Skip to content

Commit

Permalink
Add ability to disable top buttons in dynamic table, and disable them…
Browse files Browse the repository at this point in the history
… for collection edit page
  • Loading branch information
ml-evs committed Sep 27, 2024
1 parent d18b9aa commit 41bc175
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions webapp/src/components/CollectionInformation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
:columns="collectionTableColumns"
:data-type="'samples'"
:global-filter-fields="['item_id', 'type', 'name', 'chemform', 'creatorsList', 'nblocks']"
:show-buttons="false"
/>
</div>
</template>
Expand Down
8 changes: 7 additions & 1 deletion webapp/src/components/DynamicButtonDataTable.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="button-group d-flex justify-content-between align-items-center">
<div v-if="showButtons" class="button-group d-flex justify-content-between align-items-center">
<div class="button-left">
<button
v-if="dataType === 'samples'"
Expand Down Expand Up @@ -115,6 +115,12 @@ export default {
required: false,
default: false,
},
// Global toggle for all buttons and search bar
showButtons: {
type: Boolean,
required: false,
default: true,
},
},
emits: [
"open-create-item-modal",
Expand Down
6 changes: 6 additions & 0 deletions webapp/src/components/DynamicDataTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
:items-selected="itemsSelected"
:filters="filters"
:editable-inventory="editable_inventory"
:show-buttons="showButtons"
@open-create-item-modal="createItemModalIsOpen = true"
@open-batch-create-item-modal="batchCreateItemModalIsOpen = true"
@open-qr-scanner-modal="qrScannerModalIsOpen = true"
Expand Down Expand Up @@ -160,6 +161,11 @@ export default {
type: Array,
required: true,
},
showButtons: {
type: Boolean,
required: false,
default: true,
},
},
data() {
return {
Expand Down

0 comments on commit 41bc175

Please sign in to comment.