Skip to content

Commit

Permalink
promgen.vue.js: Fix silence form's delete label
Browse files Browse the repository at this point in the history
Before creating the silence, the silence form appears and we have the
possibility to remove any labels that were added by default. When doing
so, an error like this one happens:

  TypeError: this.$delete is not a function

The error occurs because the "$delete" instance method [1] has been
removed in Vue 3 [2], but we forgot to adapt this part of the code when
we did the migration.

1: https://v2.vuejs.org/v2/api/#vm-delete
2: https://v3-migration.vuejs.org/breaking-changes/#removed-apis
  • Loading branch information
vincent-olivert-riera committed Dec 27, 2023
1 parent d0e5148 commit f9a88fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion promgen/static/js/promgen.vue.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ app.component('silence-form', {
}),
methods: {
removeLabel(label) {
this.$delete(this.state.labels, label);
delete this.state.labels[label];
},
submit() {
const body = JSON.stringify({
Expand Down

0 comments on commit f9a88fd

Please sign in to comment.