Skip to content

Commit ba16d60

Browse files
author
Antti Huovila
committed
Added toast for showing that ur trying to delete a bom that doesn't exist
1 parent 7719d62 commit ba16d60

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/i18n/locales/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,7 @@
784784
"remove_bom": "Remove BOM",
785785
"removing_dependencies": "Removing dependencies, {n} left",
786786
"bom_deleted": "BOM successfully deleted",
787+
"no_bom_available": "No BOM exists for project",
787788
"reported_by": "Reported By",
788789
"required_component_identifier": "A component identifier is required",
789790
"required_component_name": "The component name is required",

src/views/portfolio/projects/ProjectComponents.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,7 @@ export default {
441441
//Step 2: Delete dependencies in batches
442442
let batchSize = 50;
443443
let lengthAllDependencies = allDependencies.length;
444+
if (lengthAllDependencies !== 0) {
444445
for (let i = 0; i < allDependencies.length; i += batchSize) {
445446
let batch = allDependencies.slice(i, i + batchSize);
446447
this.$toastr.s(this.$t("message.removing_dependencies", { n: lengthAllDependencies }));
@@ -455,6 +456,10 @@ export default {
455456
this.$toastr.s(this.$t("message.bom_deleted"));
456457
//Step 4: Refresh the table
457458
this.$refs.table.removeAll();
459+
}
460+
else {
461+
this.$toastr.w(this.$t("message.no_bom_available"));
462+
}
458463
} catch (error) {
459464
this.$toastr.w(this.$t("condition.unsuccessful_action"));
460465
}

0 commit comments

Comments
 (0)