Merge pull request #206 from dod-ccpo/multiple-environments

Allow a user to add multiple environments when creating a project
This commit is contained in:
richard-dds
2018-08-23 16:15:00 -04:00
committed by GitHub
10 changed files with 89 additions and 21 deletions

View File

@@ -1,5 +1,7 @@
import textinput from '../text_input'
const createEnvironment = (name) => ({ name })
export default {
name: 'new-project',
@@ -16,14 +18,16 @@ export default {
data: function () {
const {
name,
description,
environments = ['']
environment_names,
} = this.initialData
const environments = (
environment_names.length > 0
? environment_names
: [""]
).map(createEnvironment)
return {
name,
description,
environments,
}
},
@@ -34,7 +38,7 @@ export default {
methods: {
addEnvironment: function (event) {
this.environments.push('')
this.environments.push(createEnvironment(""))
},
removeEnvironment: function (index) {