Skip to content

Commit 7719d62

Browse files
author
Antti Huovila
committed
Added popup modal to confirm bom removal
1 parent cefc1db commit 7719d62

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/views/portfolio/projects/ProjectComponents.vue

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<b-button
3737
size="md"
3838
variant="outline-primary"
39-
@click="removeBom"
39+
@click="$refs.confirmModal.show()"
4040
v-permission="PERMISSIONS.PORTFOLIO_MANAGEMENT"
4141
style="margin-left: 0px"
4242
>
@@ -124,6 +124,16 @@
124124
:uuid="this.uuid"
125125
v-on:refreshTable="refreshTable"
126126
/>
127+
<b-modal
128+
ref="confirmModal"
129+
title="Confirm Removal"
130+
>
131+
<p>Are you sure you want to remove the BOM and all its components?</p>
132+
<div slot="modal-footer">
133+
<b-button variant="outline-primary" @click="$refs.confirmModal.hide()">Cancel</b-button>
134+
<b-button variant="outline-danger" @click="handleRemoveBom">Remove</b-button>
135+
</div>
136+
</b-modal>
127137
</div>
128138
</template>
129139

@@ -409,6 +419,10 @@ export default {
409419
}
410420
this.$refs.table.uncheckAll();
411421
},
422+
handleRemoveBom() {
423+
this.$refs.confirmModal.hide();
424+
this.removeBom();
425+
},
412426
removeBom: async function () {
413427
let getDependenciesUrl = `${this.$api.BASE_URL}/${this.$api.URL_COMPONENT}/project/${this.uuid}`;
414428
let deleteBomUrl = `${this.$api.BASE_URL}/${this.$api.URL_BOM}/project/${this.uuid}`;

0 commit comments

Comments
 (0)