fix(AccountAlias): fix and optimization
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Alex Moreno 2024-06-07 12:51:38 +02:00
parent 5551077c92
commit dce95824be
4 changed files with 8 additions and 27 deletions

View File

@ -58,7 +58,6 @@ const openCreateModal = () => aliasCreateDialogRef.value.show();
ref="paginateRef" ref="paginateRef"
data-key="AccountAliasList" data-key="AccountAliasList"
url="MailAliases" url="MailAliases"
auto-load
:expr-builder="exprBuilder" :expr-builder="exprBuilder"
> >
<template #body="{ rows }"> <template #body="{ rows }">

View File

@ -3,7 +3,6 @@ import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import FormModel from 'components/FormModel.vue'; import FormModel from 'components/FormModel.vue';
import VnRow from 'components/ui/VnRow.vue';
import VnInput from 'src/components/common/VnInput.vue'; import VnInput from 'src/components/common/VnInput.vue';
const route = useRoute(); const route = useRoute();
@ -11,26 +10,13 @@ const { t } = useI18n();
</script> </script>
<template> <template>
<FormModel :url="`MailAliases/${route.params.id}`" model="Alias" auto-load> <FormModel model="Alias">
<template #form="{ data }"> <template #form="{ data }">
<VnRow class="row q-gutter-md q-mb-md"> <div class="column q-gutter-y-md">
<div class="col">
<VnInput v-model="data.alias" :label="t('mailAlias.name')" /> <VnInput v-model="data.alias" :label="t('mailAlias.name')" />
</div> <VnInput v-model="data.description" :label="t('mailAlias.description')" />
</VnRow>
<VnRow class="row q-gutter-md q-mb-md">
<div class="col">
<VnInput
v-model="data.description"
:label="t('mailAlias.description')"
/>
</div>
</VnRow>
<VnRow class="row q-gutter-md q-mb-md">
<div class="col">
<QCheckbox :label="t('mailAlias.isPublic')" v-model="data.isPublic" /> <QCheckbox :label="t('mailAlias.isPublic')" v-model="data.isPublic" />
</div> </div>
</VnRow>
</template> </template>
</FormModel> </FormModel>
</template> </template>

View File

@ -22,6 +22,7 @@ const searchBarDataKeys = {
<template> <template>
<VnCard <VnCard
data-key="Alias" data-key="Alias"
base-url="MailAliases"
:descriptor="AliasDescriptor" :descriptor="AliasDescriptor"
:search-data-key="searchBarDataKeys[routeName]" :search-data-key="searchBarDataKeys[routeName]"
:search-custom-route-redirect="customRouteRedirectName" :search-custom-route-redirect="customRouteRedirectName"

View File

@ -32,10 +32,6 @@ const entityId = computed(() => {
const data = ref(useCardDescription()); const data = ref(useCardDescription());
const setData = (entity) => (data.value = useCardDescription(entity.alias, entity.id)); const setData = (entity) => (data.value = useCardDescription(entity.alias, entity.id));
const filter = {
where: { id: entityId },
};
const removeAlias = () => { const removeAlias = () => {
quasar quasar
.dialog({ .dialog({
@ -62,8 +58,7 @@ const removeAlias = () => {
<template> <template>
<CardDescriptor <CardDescriptor
ref="descriptor" ref="descriptor"
url="MailAliases" :url="`MailAliases/${entityId}`"
:filter="filter"
module="Alias" module="Alias"
@on-fetch="setData" @on-fetch="setData"
data-key="aliasData" data-key="aliasData"