fix #295 include both save and cancel cases of popup modal; however, for cases when conformance page acting as starting point, bugs are still there
This commit is contained in:
@@ -199,6 +199,7 @@ export default {
|
||||
if(this.$route.name === 'NotFound404') {
|
||||
return;
|
||||
}
|
||||
|
||||
this.navViewName = this.$route.matched[1].name.toUpperCase();
|
||||
this.store.filesTag = 'ALL';
|
||||
switch (this.navViewName) {
|
||||
@@ -230,6 +231,8 @@ export default {
|
||||
break;
|
||||
}
|
||||
|
||||
// Frontend is not sure which button will the user press on the modal,
|
||||
// so here we need to save to a pending state
|
||||
this.setPendingActivePage(valueToSet);
|
||||
|
||||
return valueToSet;
|
||||
@@ -240,7 +243,6 @@ export default {
|
||||
async saveModal() {
|
||||
// 協助判斷 MAP, CONFORMANCE 儲存有「送出」或「取消」。
|
||||
let isSaved;
|
||||
|
||||
// 傳給 Map,通知 Sidebar 要關閉。
|
||||
this.$emitter.emit('saveModal', false);
|
||||
// 判斷在哪個子頁面
|
||||
@@ -257,6 +259,7 @@ export default {
|
||||
isSaved = await saveFilter(this.allMapDataStore.addFilterId);
|
||||
// 存檔後為 filterID,換網址不跳頁,使用 push 記錄歷史路由
|
||||
if(isSaved) {
|
||||
this.setActivePage('MAP');
|
||||
await this.$router.push(`/discover/filter/${this.createFilterId}/map`);
|
||||
}
|
||||
};
|
||||
@@ -266,8 +269,9 @@ export default {
|
||||
isSaved = await saveFilter(this.allMapDataStore.addFilterId);
|
||||
// 存檔後為 filterID,換網址不跳頁,使用 push 記錄歷史路由
|
||||
if(isSaved) {
|
||||
this.setActivePage('MAP');
|
||||
await this.$router.push(`/discover/filter/${this.createFilterId}/map`);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'Conformance':
|
||||
case 'CheckConformance':
|
||||
@@ -283,9 +287,11 @@ export default {
|
||||
// 存檔後為 checkID,換網址不跳頁,使用 push 記錄歷史路由
|
||||
if(isSaved) {
|
||||
if(this.conformanceLogId) {
|
||||
this.setActivePage('CONFORMANCE');
|
||||
await this.$router.push(`/discover/conformance/log/${this.conformanceLogCreateCheckId}/conformance`);
|
||||
}
|
||||
else if(this.conformanceFilterId) {
|
||||
this.setActivePage('CONFORMANCE');
|
||||
await this.$router.push(`/discover/conformance/filter/${this.conformanceFilterCreateCheckId}/conformance`);
|
||||
}
|
||||
}
|
||||
@@ -293,7 +299,11 @@ export default {
|
||||
break;
|
||||
}
|
||||
},
|
||||
...mapActions(PageAdminStore, ['setPendingActivePage', 'setPrevioiusPage'],),
|
||||
...mapActions(PageAdminStore, [
|
||||
'setPendingActivePage',
|
||||
'setPrevioiusPage',
|
||||
'setActivePage'
|
||||
],),
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user