From 999c032d42f812ba46997549a0ae590260445d86 Mon Sep 17 00:00:00 2001 From: yingfeng Date: Sat, 13 Apr 2024 11:43:28 -0400 Subject: [PATCH] AMP-3131 --- src/components/entity/EntityList.vue | 17 +++--- src/components/entity/ItemSearch.vue | 2 - src/components/shared/Search.vue | 57 +++----------------- src/components/supplement/SupplementFile.vue | 14 +++-- src/service/config-properties-service.js | 2 +- 5 files changed, 26 insertions(+), 66 deletions(-) diff --git a/src/components/entity/EntityList.vue b/src/components/entity/EntityList.vue index 2335e60d..7ac399c6 100644 --- a/src/components/entity/EntityList.vue +++ b/src/components/entity/EntityList.vue @@ -1331,7 +1331,6 @@ export default { self.showLoader = true; const configPropertiesResponse = await self.configPropertiesService.getConfigProperties(); self.configProperties = configPropertiesResponse.data; - self.showLoader = false; } catch (error) { self.showLoader = false; @@ -1350,12 +1349,10 @@ export default { this.getCollectionItems(); else { self.selectedCollection = self.entity = {}; - self.showLoader = false; self.showEdit = false; } } else if (self.baseUrl === "item") { self.entity = self.selectedItem; - self.showLoader = false; if (self.isCreatePage) { self.selectedItem = self.entity = {}; self.showEdit = false; @@ -1487,14 +1484,14 @@ export default { }, mounted() { const self = this; - self.showLoader = true; - if (!self.configProperties) { + + // retrieve configProperties if not yet populated + if (!self.configProperties || Object.keys(self.configProperties).length === 0) { self.getConfigs(); } - // For unit details page + // retrieve units list and currentUnit info from storage if available, otherwise initialize them const uEntity = JSON.parse(sessionStorage.getItem("unitEntity")); - if (!uEntity) { self.unitEntity = { unitList: [], currentUnit: "" }; } @@ -1502,23 +1499,23 @@ export default { self.unitEntity = uEntity; } + // retrieve units list if not yet populated if (!self.unitEntity.unitList || !self.unitEntity.unitList.length) { self.getAllUnits(); } + // if currentUnit set, gegetEntityData for the page if (self.unitEntity.currentUnit) { self.getEntityData(); } + // adjust size of PFile fields for PFile page let formHTML = document.getElementsByClassName("form")[0]; if (formHTML && this.baseUrl === "file") { formHTML.style.width = "50%"; } else if (formHTML) { formHTML.style.width = "100%"; } - - // console.log("end of mounted: mediaSource = " + self.entity.mediaSource); - // console.log("end of mounted: mediaType = " + self.entity.mediaType); }, }; diff --git a/src/components/entity/ItemSearch.vue b/src/components/entity/ItemSearch.vue index 87b5b98a..fb52b65c 100644 --- a/src/components/entity/ItemSearch.vue +++ b/src/components/entity/ItemSearch.vue @@ -40,7 +40,6 @@