Skip to content

Commit

Permalink
Use v-b-modal.modal-lg directive to open search modal
Browse files Browse the repository at this point in the history
  • Loading branch information
Dananji committed Dec 11, 2024
1 parent 0ee6964 commit 5a0ce98
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 26 deletions.
2 changes: 0 additions & 2 deletions src/components/dashboard/Dashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1187,8 +1187,6 @@ export default {
);
break;
}
this.$bvModal?.show("modal-lg");
},
getDateString() {
const date = new Date();
Expand Down
3 changes: 2 additions & 1 deletion src/components/entity/EntityList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,7 @@
<button
class="btn btn-primary btn-lg btn-edit"
type="button"
v-b-modal.modal-lg
@click="onSearch('listing-collection')"
>
Search Collections
Expand All @@ -746,6 +747,7 @@
<button
class="btn btn-primary btn-lg btn-edit"
type="button"
v-b-modal.modal-lg
@click="onSearch('listing-item')"
>
Search Items
Expand Down Expand Up @@ -1445,7 +1447,6 @@ export default {
},
onSearch(type) {
this.searchType = type;
this.$bvModal?.show("modal-lg");
},
onSearchDone(records) {
this.records = records && records.length ? records : this.masterRecords;
Expand Down
15 changes: 1 addition & 14 deletions src/components/entity/ItemSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<button
class="btn btn-primary btn-lg btn-edit float-right"
type="button"
@click="onSearch()"
v-b-modal.modal-lg
>
Search Item
</button>
Expand Down Expand Up @@ -68,11 +68,6 @@ export default {
searchItems(searchWord) {
this.refreshData(searchWord);
},
// pop up child component (the Search pop-up ialog)
onSearch() {
this.$bvModal?.show("modal-lg");
},
// call item search API
async refreshData(searchWord = "") {
Expand Down Expand Up @@ -101,14 +96,6 @@ export default {
}
},
},
updated() {
this.onSearch();
},
mounted() {
this.onSearch();
},
};
</script>

Expand Down
9 changes: 7 additions & 2 deletions src/components/shared/Search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
size="lg"
id="modal-lg"
centered
ref="searchModal"
@show="processModalData()"
:no-close-on-backdrop="type === 'item-search'"
>
<template #modal-header>
<template #header>
<!-- Emulate built in modal header close button action -->

<h5 class="text-capitalize" v-if="!isEntityList">
Expand Down Expand Up @@ -579,7 +580,7 @@
</template>
</template>

<template #modal-footer="{ ok, hide }">
<template #footer="{ ok, hide }">
<!-- Emulate built in modal footer ok and cancel button actions -->
<button
v-if="type !== 'statuses' && type !== 'workflow-search'"
Expand Down Expand Up @@ -757,6 +758,10 @@ export default {
mounted() {
const self = this;
self.fields = self.allSearchFields;
// Display search modal on page load for item-search page
if(this.searchType === 'item-search') {
this.$refs.searchModal.show();
}
},
methods: {
async searchWfKeyUp(e) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/supplement/SupplementList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<button
class="btn btn-primary btn-lg btn-edit"
type="button"
v-b-modal.modal-lg
@click="onSearch('listing-supplement')"
>
Search Files
Expand Down Expand Up @@ -164,7 +165,6 @@ export default {
},
onSearch(type) {
this.searchType = type;
this.$bvModal?.show("modal-lg");
},
onSearchDone(records) {
this.records = records && records.length ? records : this.masterRecords;
Expand Down
7 changes: 1 addition & 6 deletions src/components/workflow/WorkflowList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
<button
id="btn-search"
class="ml-1 btn btn-primary btn-lg marg-b-4 float-right"
data-toggle="modal"
data-target=".bd-example-modal-lg-2"
@click="handleWorkflowSearch()"
v-b-modal.modal-lg
>
Search Workflows
</button>
Expand Down Expand Up @@ -316,9 +314,6 @@ export default {
self.listOfWorkflows[workflowIndex]
);
},
handleWorkflowSearch() {
this.$bvModal?.show("modal-lg");
},
async handleWorkflowCreation() {
const self = this;
await self.workflowService
Expand Down

0 comments on commit 5a0ce98

Please sign in to comment.