fix(instances): send user-script when creating instance

This commit is contained in:
Sérgio Ramos 2018-05-09 11:11:03 +01:00
parent f9c89cbccc
commit de356e1fbe
4 changed files with 494 additions and 515 deletions

View File

@ -305,15 +305,15 @@ export default compose(
};
return {
handleDefocus: name => value =>
dispatch(set({ name: names[name], value })),
handleDefocus: name => value => {
return dispatch(set({ name: names[name], value }))
},
handleSubmit: async () => {
const _affinity = steps.affinity ? parseAffRule(steps.affinity) : null;
const _name = steps.name && steps.name.name.toLowerCase();
const _metadata =
steps.metadata && steps.metadata.map(a => omit(a, 'open'));
const _metadata = (steps.metadata && steps.metadata.map(a => omit(a, 'open'))) || [];
const _tags =
steps.tags &&
@ -325,19 +325,19 @@ export default compose(
steps.networks &&
steps.networks.map(({ id }) => id);
if (steps['user-script'] && steps['user-script'].length) {
_metadata.push({ name: 'user-script', value: steps['user-script'] });
if (steps['user-script'] && steps['user-script'].lines) {
_metadata.push({ name: 'user-script', value: steps['user-script'].script });
}
steps.tags &&
steps.cns &&
steps.tags.push({
if (steps.cns) {
_tags.push({
name: 'triton.cns.disable',
value: !steps.cns.cnsEnabled
});
}
if (steps.cns && (steps.cns.cnsServices && steps.cns.cnsEnabled)) {
steps.tags.push({
_tags.push({
name: 'triton.cns.services',
value: steps.cns.cnsServices.join(',')
});

View File

@ -77,7 +77,7 @@ export default compose(
return {
script,
lines,
handleGetValue: () => ({ lines }),
handleGetValue: () => ({ script, lines }),
create: !script.value,
edit: script.value,
formOpen

View File

@ -124,11 +124,6 @@ exports[`renders <KeyValue /> without throwing 1`] = `
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
width: 100%;
height: 100%;
-webkit-flex-basis: 100%;
-ms-flex-preferred-size: 100%;
flex-basis: 100%;
}
.c13 {
@ -1037,11 +1032,6 @@ exports[`renders <KeyValue expanded={false} /> without throwing 1`] = `
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
width: 100%;
height: 100%;
-webkit-flex-basis: 100%;
-ms-flex-preferred-size: 100%;
flex-basis: 100%;
}
.c9 {
@ -1334,11 +1324,6 @@ exports[`renders <KeyValue input="input" /> without throwing 1`] = `
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
width: 100%;
height: 100%;
-webkit-flex-basis: 100%;
-ms-flex-preferred-size: 100%;
flex-basis: 100%;
}
.c13 {
@ -2334,11 +2319,6 @@ exports[`renders <KeyValue input="textarea" /> without throwing 1`] = `
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
width: 100%;
height: 100%;
-webkit-flex-basis: 100%;
-ms-flex-preferred-size: 100%;
flex-basis: 100%;
}
.c30 {
@ -3399,11 +3379,6 @@ exports[`renders <KeyValue method="add" /> without throwing 1`] = `
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
width: 100%;
height: 100%;
-webkit-flex-basis: 100%;
-ms-flex-preferred-size: 100%;
flex-basis: 100%;
}
.c13 {
@ -4404,11 +4379,6 @@ exports[`renders <KeyValue method="edit" /> without throwing 1`] = `
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
width: 100%;
height: 100%;
-webkit-flex-basis: 100%;
-ms-flex-preferred-size: 100%;
flex-basis: 100%;
}
.c13 {
@ -5407,11 +5377,6 @@ exports[`renders <KeyValue removing /> without throwing 1`] = `
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
width: 100%;
height: 100%;
-webkit-flex-basis: 100%;
-ms-flex-preferred-size: 100%;
flex-basis: 100%;
}
.c13 {
@ -6486,11 +6451,6 @@ exports[`renders <KeyValue submitting /> without throwing 1`] = `
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
width: 100%;
height: 100%;
-webkit-flex-basis: 100%;
-ms-flex-preferred-size: 100%;
flex-basis: 100%;
}
.c13 {
@ -7622,11 +7582,6 @@ exports[`renders <KeyValue type="tag" /> without throwing 1`] = `
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
width: 100%;
height: 100%;
-webkit-flex-basis: 100%;
-ms-flex-preferred-size: 100%;
flex-basis: 100%;
}
.c13 {