Skip to content

Commit

Permalink
Fix button still clickable after deleting a sample
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminCharmes committed Sep 9, 2024
1 parent a33d2d8 commit 8c540d0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 8 additions & 1 deletion webapp/src/components/ButtonPrimeTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<button
v-if="dataType === 'startingMaterials' && editableInventory"
class="btn btn-default"
:disabled="itemsSelected.length === 0"
@click="$emit('open-create-item-modal')"
>
Add a starting material
Expand All @@ -38,7 +39,12 @@
</button>
</div>
<div class="button-right d-flex">
<button v-if="itemsSelected.length > 0" class="btn btn-default ml-2" @click="confirmDeletion">
<button
v-if="itemsSelected.length > 0"
class="btn btn-default ml-2"
:disabled="itemsSelected.length === 0"
@click="confirmDeletion"
>
Delete selected
</button>
<IconField>
Expand Down Expand Up @@ -120,6 +126,7 @@ export default {
} else if (this.dataType === "equipments") {
this.deleteEquipments();
}
this.$emit("delete-selected-items");
},
deleteSamples() {
const idsSelected = this.itemsSelected.map((x) => x.item_id);
Expand Down
3 changes: 3 additions & 0 deletions webapp/src/components/PrimeTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,9 @@ export default {
return props;
},
deleteSelectedItems() {
this.itemsSelected = [];
},
},
};
</script>
Expand Down

0 comments on commit 8c540d0

Please sign in to comment.