fix(instances): s/userScript/user-script

This commit is contained in:
Sérgio Ramos 2018-05-08 18:02:01 +01:00
parent 429ad17262
commit e321c20906
3 changed files with 8 additions and 14 deletions

View File

@ -38,7 +38,7 @@ const names = {
networks: 'IC_NETWORKS',
tags: 'IC_TAGS',
metadata: 'IC_METADATA',
userScript: 'IC_USERSCRIPT',
'user-script': 'IC_USERSCRIPT',
firewall: 'IC_FIREWALL',
cns: 'IC_CNS',
affinity: 'IC_AFFINITY'
@ -98,7 +98,6 @@ class CreateInstance extends Component {
networks,
tags,
metadata,
userScript,
firewall,
cns,
affinity
@ -176,12 +175,12 @@ class CreateInstance extends Component {
</Margin>
<Margin bottom="5">
<UserScript
ref={this.setIsValid('userScript')}
ref={this.setIsValid('user-script')}
expanded={step === 'user-script'}
next="firewall"
saved={steps.userScript && steps.userScript.lines}
saved={get(steps, 'user-script.lines', false)}
onDefocus={handleDefocus('user-script')}
preview={userScript}
preview={steps['user-script']}
optional
/>
</Margin>
@ -250,7 +249,7 @@ export default compose(
networks: values[names.networks],
tags: values[names.tags],
metadata: values[names.metadata],
userScript: values[names.userScript],
'user-script': values[names['user-script']],
firewall: values[names.firewall],
cns: values[names.cns],
affinity: values[names.affinity]
@ -329,8 +328,8 @@ export default compose(
network => steps.networks[network]
);
if (steps.userScript && steps.userScript.length) {
_metadata.push({ name: 'user-script', value: steps.userScript });
if (steps['user-script'] && steps['user-script'].length) {
_metadata.push({ name: 'user-script', value: steps['user-script'] });
}
steps.tags &&

View File

@ -32,7 +32,7 @@ const UserScript = ({
handleEdit,
...props
}) => (
<Step name="userScript" getValue={handleGetValue} {...props}>
<Step name="user-script" getValue={handleGetValue} {...props}>
<StepHeader icon={<ScriptIcon />}>User script</StepHeader>
<StepDescription href="https://docs.joyent.com/private-cloud/instances/using-mdata#UsingtheMetadataAPI-ListofMetadataKeys">
Insert code to execute when the machine starts (first boot only for KVM,

View File

@ -43,11 +43,6 @@ export default ({ theme }) => css`
flex-flow: column;
}
.CodeMirror,
.ReactCodeMirror {
height: 100% !important;
}
.CodeMirror {
border: solid ${remcalc(1)} ${theme.grey};
margin: ${remcalc(8)} 0 ${remcalc(8)} 0;