Explorar el Código

fix(webapp): replace deprecated filter

* Add filter rule to prevent future ones
* Preparation for vue3 migration

Reference:
https://v3-migration.vuejs.org/breaking-changes/filters.html
https://eslint.vuejs.org/rules/no-deprecated-filter.html
Rotzbua hace 2 años
padre
commit
f954cd1cac
Se han modificado 2 ficheros con 8 adiciones y 1 borrados
  1. 1 0
      www/webapp/.eslintrc.js
  2. 7 1
      www/webapp/src/views/ConfirmationPage.vue

+ 1 - 0
www/webapp/.eslintrc.js

@@ -19,6 +19,7 @@ module.exports = {
     'vue/v-slot-style': 'warn',
     'vue/v-slot-style': 'warn',
     'vue/mustache-interpolation-spacing': ['warn', 'always'],
     'vue/mustache-interpolation-spacing': ['warn', 'always'],
     'vue/no-multi-spaces': 'warn',
     'vue/no-multi-spaces': 'warn',
+    'vue/no-deprecated-filter': 'warn', // Preparation for vue3
   },
   },
   ignorePatterns: ['**/src/modules/**/*'],
   ignorePatterns: ['**/src/modules/**/*'],
   parserOptions: {
   parserOptions: {

+ 7 - 1
www/webapp/src/views/ConfirmationPage.vue

@@ -18,7 +18,7 @@
                   dark
                   dark
                   flat
                   flat
           >
           >
-            <v-toolbar-title class="capitalize">{{ this.$route.params.action | replace(/-/g, ' ') }} Confirmation</v-toolbar-title>
+            <v-toolbar-title class="capitalize">{{ actionName }} Confirmation</v-toolbar-title>
           </v-toolbar>
           </v-toolbar>
           <v-card-text>
           <v-card-text>
             <error-alert :errors="errors"></error-alert>
             <error-alert :errors="errors"></error-alert>
@@ -89,6 +89,12 @@
       valid: true,
       valid: true,
       working: false,
       working: false,
     }),
     }),
+    computed: {
+      actionName() {
+        const text = this.$route.params.action ?? '';
+        return text.replace(/-/g, ' ');
+      },
+    },
     async mounted() {
     async mounted() {
       this.actionHandler = this.handler_map[this.$route.params.action] || GenericActionHandler.name
       this.actionHandler = this.handler_map[this.$route.params.action] || GenericActionHandler.name
     },
     },