This is an automated email from the ASF dual-hosted git repository. machristie pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git
commit f2f65b3faf1901783b455adbf07de00e4192fff8 Author: Marcus Christie <[email protected]> AuthorDate: Wed Sep 5 12:52:35 2018 -0400 AIRAVATA-2876 Bug fix: only update modules if they are loaded --- .../applications/ApplicationEditorContainer.vue | 33 +++++++++++++--------- .../src/store/applications/app_modules.js | 20 +++++++------ 2 files changed, 32 insertions(+), 21 deletions(-) diff --git a/django_airavata/apps/admin/static/django_airavata_admin/src/components/applications/ApplicationEditorContainer.vue b/django_airavata/apps/admin/static/django_airavata_admin/src/components/applications/ApplicationEditorContainer.vue index b6213c6..9b8e21b 100644 --- a/django_airavata/apps/admin/static/django_airavata_admin/src/components/applications/ApplicationEditorContainer.vue +++ b/django_airavata/apps/admin/static/django_airavata_admin/src/components/applications/ApplicationEditorContainer.vue @@ -15,7 +15,8 @@ <b-nav-item active-class="active" :to="{name: 'application_deployments', params: {id: id}}" :disabled="!id">Deployments</b-nav-item> </b-nav> <router-view name="module" v-if="module" v-model="module" @save="saveModule" @cancel="cancelModule" /> - <router-view name="interface" v-if="appInterface" v-model="appInterface" @save="saveInterface" @cancel="cancelInterface" /> + <router-view name="interface" v-if="appInterface" v-model="appInterface" @save="saveInterface" @cancel="cancelInterface" + /> <router-view name="deployments" /> <router-view name="deployment" /> </div> @@ -103,18 +104,24 @@ export default { this.appInterface.applicationName = this.module.appModuleName; this.appInterface.applicationDescription = this.module.appModuleDescription; - this.updateApplicationModule(this.module).then(appModule => { - if (this.appInterface.applicationInterfaceId) { - return this.updateApplicationInterface(this.appInterface).then(() => { - this.$router.push({ path: "/applications" }); - }); - } else { - this.appInterface.applicationModules = [this.id]; - return this.createApplicationInterface(this.appInterface).then(() => { - this.$router.push({ path: "/applications" }); - }); - } - }); + this.updateApplicationModule(this.module) + .then(appModule => { + if (this.appInterface.applicationInterfaceId) { + return this.updateApplicationInterface(this.appInterface).then( + () => { + this.$router.push({ path: "/applications" }); + } + ); + } else { + this.appInterface.applicationModules = [this.id]; + return this.createApplicationInterface(this.appInterface).then( + () => { + this.$router.push({ path: "/applications" }); + } + ); + } + }) + .catch(error => notifications.NotificationList.addError(error)); }, cancelModule() { this.$router.push({ path: "/applications" }); diff --git a/django_airavata/apps/admin/static/django_airavata_admin/src/store/applications/app_modules.js b/django_airavata/apps/admin/static/django_airavata_admin/src/store/applications/app_modules.js index 2ad6131..7678c81 100644 --- a/django_airavata/apps/admin/static/django_airavata_admin/src/store/applications/app_modules.js +++ b/django_airavata/apps/admin/static/django_airavata_admin/src/store/applications/app_modules.js @@ -41,20 +41,24 @@ export default { return services.ApplicationModuleService.create({ data: appModule }) .then(appModule => { commit('setModule', appModule); - const appModulesCopy = state.modules.slice(); - appModulesCopy.push(appModule); - commit('setModules', appModulesCopy); - return appModule; + if (state.modules) { + const appModulesCopy = state.modules.slice(); + appModulesCopy.push(appModule); + commit('setModules', appModulesCopy); + return appModule; + } }); }, updateApplicationModule({ commit, state }, appModule) { return services.ApplicationModuleService.update({ lookup: appModule.appModuleId, data: appModule }) .then(appModule => { commit('setModule', appModule); - const appModules = state.modules.filter(mod => mod.appModuleId !== appModule.appModuleId) - appModules.push(appModule); - commit('setModules', appModules); - return appModule; + if (state.modules) { + const appModules = state.modules.filter(mod => mod.appModuleId !== appModule.appModuleId) + appModules.push(appModule); + commit('setModules', appModules); + return appModule; + } }) } }
