Skip to content

Commit

Permalink
AMP-3402/AMP-3399
Browse files Browse the repository at this point in the history
- SelectWorkflow: fix b-form-group v-slot issue
- SupplementList and other components: fix window.location.hash issue
  • Loading branch information
yingfeng-iu committed Oct 16, 2024
1 parent 5e7750d commit 28d6100
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
16 changes: 8 additions & 8 deletions src/components/entity/EntityList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -972,30 +972,30 @@ export default {
configProperties: sync("configProperties"),
baseUrl() {
const self = this;
if (window.location.hash.toLowerCase().indexOf("unit") > -1) {
if (window.location.href.toLowerCase().indexOf("unit") > -1) {
return "unit";
} else if (window.location.hash.toLowerCase().indexOf("file") > -1) {
} else if (window.location.href.toLowerCase().indexOf("file") > -1) {
return "file";
} else if (
window.location.hash.toLowerCase().indexOf("collection") > -1 &&
window.location.hash.toLowerCase().indexOf("item") === -1
window.location.href.toLowerCase().indexOf("collection") > -1 &&
window.location.href.toLowerCase().indexOf("item") === -1
) {
this.getItemsConfig();
return "collection";
} else if (window.location.hash.toLowerCase().indexOf("item") > -1) {
} else if (window.location.href.toLowerCase().indexOf("item") > -1) {
return "item";
}
return "";
},
purpose() {
return window.location.hash.toLowerCase().indexOf("details") > -1
return window.location.href.toLowerCase().indexOf("details") > -1
? "details"
: "";
},
isCreatePage() {
return (
window.location.hash.toLowerCase().indexOf("create") > -1 ||
window.location.hash.toLowerCase().indexOf("add-item") > -1
window.location.href.toLowerCase().indexOf("create") > -1 ||
window.location.href.toLowerCase().indexOf("add-item") > -1
);
},
listOfTaskManager() {
Expand Down
2 changes: 1 addition & 1 deletion src/components/entity/ItemFiles.vue
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export default {
selectedFile: sync("selectedFile"),
accessControl: sync("accessControl"),
isCreatePage() {
return window.location.hash.toLowerCase().indexOf("add-item") > -1;
return window.location.href.toLowerCase().indexOf("add-item") > -1;
},
},
methods: {
Expand Down
11 changes: 9 additions & 2 deletions src/components/supplement/SupplementList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,19 @@ export default {
acActions: sync("acActions"),
baseUrl() {
const self = this;
console.log("url:" + window.location);
if (
window.location.hash.toLowerCase().indexOf("supplemental-files/") > -1
window.location.href.toLowerCase().indexOf("supplemental-files/") > -1
) {
console.log("supplement file");
return "supplement";
} else if (
window.location.hash.toLowerCase().indexOf("supplemental-files") > -1
window.location.href.toLowerCase().indexOf("supplemental-files") > -1
) {
console.log("supplement list");
return "list-supplement";
}
console.log("invalid path");
return "";
},
},
Expand Down Expand Up @@ -188,6 +192,7 @@ export default {
async getSupplementData() {
const self = this;
self.showLoader = true;
console.log("getSupplementData ...");
const supplementalFilesResponse = await self.getSupplementalFiles(self);
if (supplementalFilesResponse) {
Expand Down Expand Up @@ -241,6 +246,7 @@ export default {
async getData() {
const self = this;
if (self.baseUrl === "list-supplement") {
console.log("getSupplementData...");
self.getSupplementData();
}
},
Expand All @@ -267,6 +273,7 @@ export default {
},
},
mounted() {
console.log("SupplementList.mounted");
this.getData();
},
};
Expand Down
7 changes: 2 additions & 5 deletions src/components/workflow/SelectWorkflow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -288,17 +288,14 @@
</h5>
</template>
<template #default>
<b-form-group v-slot="{ ariaDescribedby }">
<b-form-radio-group v-model="selectedSupplement">
<b-form-radio
v-for="(supplement, index) in supplementList"
v-bind:key="index"
v-model="selectedSupplement"
:aria-describedby="ariaDescribedby"
name="some-radios"
:value="supplement"
>{{ supplement.name }}</b-form-radio
>
</b-form-group>
</b-form-radio-group>
<div class="row pad-all-2">
<div class="float-left">
<label class="switch">
Expand Down

0 comments on commit 28d6100

Please sign in to comment.