From 6601458293971c9138bd26dbb463b4b5d334d592 Mon Sep 17 00:00:00 2001 From: Rotzbua Date: Tue, 27 Jun 2023 13:19:47 +0200 Subject: [PATCH] feat(webapp): use component name instead of string --- .../src/components/GenericActionHandler.vue | 2 +- www/webapp/src/views/ConfirmationPage.vue | 8 +++---- www/webapp/src/views/CrudListDomain.vue | 9 +++++--- www/webapp/src/views/CrudListRecord.vue | 15 ++++++++---- www/webapp/src/views/CrudListTOTP.vue | 8 ++++--- www/webapp/src/views/CrudListToken.vue | 23 +++++++++++-------- 6 files changed, 40 insertions(+), 25 deletions(-) diff --git a/www/webapp/src/components/GenericActionHandler.vue b/www/webapp/src/components/GenericActionHandler.vue index 4b1533b5b..f113e247b 100644 --- a/www/webapp/src/components/GenericActionHandler.vue +++ b/www/webapp/src/components/GenericActionHandler.vue @@ -20,7 +20,7 @@ auto_submit: false, }), async created() { - this.auto_submit = this.auto_submit || this.$options.name === 'GenericActionHandler' + this.auto_submit = this.auto_submit || this.$options.name === 'GenericActionHandler' /* Generic case. Name of this (root) component. */ if(this.auto_submit) { this.$emit('autosubmit') } diff --git a/www/webapp/src/views/ConfirmationPage.vue b/www/webapp/src/views/ConfirmationPage.vue index 572722394..99b25db35 100644 --- a/www/webapp/src/views/ConfirmationPage.vue +++ b/www/webapp/src/views/ConfirmationPage.vue @@ -79,9 +79,9 @@ actionHandler: null, errors: [], handler_map: { - 'activate-account': 'ActivateAccountActionHandler', - 'create-totp': 'CreateTOTPActionHandler', - 'reset-password': 'ResetPasswordActionHandler', + 'activate-account': ActivateAccountActionHandler.name, + 'create-totp': CreateTOTPActionHandler.name, + 'reset-password': ResetPasswordActionHandler.name, }, post_payload: {}, post_response: {}, @@ -90,7 +90,7 @@ working: false, }), async mounted() { - this.actionHandler = this.handler_map[this.$route.params.action] || 'GenericActionHandler' + this.actionHandler = this.handler_map[this.$route.params.action] || GenericActionHandler.name }, methods: { async confirm() { diff --git a/www/webapp/src/views/CrudListDomain.vue b/www/webapp/src/views/CrudListDomain.vue index 5e759ce86..69892e69a 100644 --- a/www/webapp/src/views/CrudListDomain.vue +++ b/www/webapp/src/views/CrudListDomain.vue @@ -3,6 +3,9 @@ import { HTTP, withWorking } from '@/utils'; import CrudList from './CrudList'; import DomainSetupDialog from '@/views/Console/DomainSetupDialog'; import {mdiDownload, mdiInformation} from "@mdi/js"; +import GenericText from "@/components/Field/GenericText.vue"; +import GenericTextarea from "@/components/Field/GenericTextarea.vue"; +import TimeAgo from "@/components/Field/TimeAgo.vue"; export default { name: 'CrudListDomain', @@ -40,7 +43,7 @@ export default { readonly: true, required: true, writeOnCreate: true, - datatype: 'GenericText', + datatype: GenericText.name, searchable: true, }, published: { @@ -50,7 +53,7 @@ export default { sortable: true, value: 'published', readonly: true, - datatype: 'TimeAgo', + datatype: TimeAgo.name, searchable: false, }, zonefile: { @@ -60,7 +63,7 @@ export default { align: 'left', value: 'zonefile', writeOnCreate: true, - datatype: 'GenericTextarea', + datatype: GenericTextarea.name, searchable: false, fieldProps: () => ({ hint: 'Note: automatically managed records will be ignored!' }), hideFromTable: true, diff --git a/www/webapp/src/views/CrudListRecord.vue b/www/webapp/src/views/CrudListRecord.vue index a31924a44..1d58ef3bd 100644 --- a/www/webapp/src/views/CrudListRecord.vue +++ b/www/webapp/src/views/CrudListRecord.vue @@ -1,6 +1,11 @@