fix: redirection when clone and styles
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Alex Moreno 2024-05-13 09:30:03 +02:00
parent daf1d4de2d
commit a28d18f1e1
2 changed files with 26 additions and 38 deletions

View File

@ -182,7 +182,3 @@ input::-webkit-inner-spin-button {
.q-scrollarea__content { .q-scrollarea__content {
max-width: 100%; max-width: 100%;
} }
.mt-15 {
margin-top: 15px;
}

View File

@ -106,13 +106,9 @@ const exprBuilder = (param, value) => {
}; };
async function clone(id) { async function clone(id) {
try { const { data } = await axios.post(`Zones/${id}/clone`);
await axios.post(`Zones/${id}/clone`);
notify(t('globals.dataSaved'), 'positive'); notify(t('globals.dataSaved'), 'positive');
router.push({ name: 'ZoneBasicData', params: { id } }); router.push({ name: 'ZoneBasicData', params: { id: data.id } });
} catch (error) {
console.error('Error cloning zone: ', error);
}
} }
const handleClone = (id) => { const handleClone = (id) => {
openConfirmationModal( openConfirmationModal(
@ -154,6 +150,7 @@ onMounted(async () => {
:filter="{ :filter="{
include: { relation: 'agencyMode', scope: { fields: ['name'] } }, include: { relation: 'agencyMode', scope: { fields: ['name'] } },
}" }"
:limit="20"
auto-load auto-load
> >
<template #body="{ rows }"> <template #body="{ rows }">
@ -184,24 +181,20 @@ onMounted(async () => {
<QTd :props="props"> <QTd :props="props">
<QTr :props="props" class="cursor-pointer"> <QTr :props="props" class="cursor-pointer">
{{ props.value }} {{ props.value }}
</QTr></QTd </QTr>
></template </QTd>
> </template>
<template #body-cell-actions="props"> <template #body-cell-actions="props">
<QTd :props="props"> <QTd :props="props" class="q-gutter-x-sm">
<div class="table-actions">
<QIcon <QIcon
class="mt-15"
name="vn:clone" name="vn:clone"
size="sm" size="sm"
color="primary" color="primary"
@click.stop="handleClone(props.row.id)" @click.stop="handleClone(props.row.id)"
> >
<QTooltip>{{ <QTooltip>{{ t('globals.clone') }}</QTooltip>
t('globals.clone') </QIcon>
}}</QTooltip> </QIcon <QIcon
><QIcon
class="mt-15"
name="preview" name="preview"
size="sm" size="sm"
color="primary" color="primary"
@ -211,7 +204,6 @@ onMounted(async () => {
> >
<QTooltip>{{ t('Preview') }}</QTooltip> <QTooltip>{{ t('Preview') }}</QTooltip>
</QIcon> </QIcon>
</div>
</QTd> </QTd>
</template> </template>
</QTable> </QTable>