refactor: refs #4074 use fn
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Jorge Penadés 2024-09-10 09:18:57 +02:00
parent f7975069d1
commit 3fafb15eb8
2 changed files with 9 additions and 11 deletions

View File

@ -20,6 +20,7 @@ const route = useRoute();
const { t } = useI18n(); const { t } = useI18n();
const entityId = computed(() => $props.id || route.params.id); const entityId = computed(() => $props.id || route.params.id);
const getUrl = (id, param) => `#/Item/${id}/${param}`;
</script> </script>
<template> <template>
<CardSummary <CardSummary
@ -53,7 +54,7 @@ const entityId = computed(() => $props.id || route.params.id);
</QCard> </QCard>
<QCard class="vn-one"> <QCard class="vn-one">
<VnTitle <VnTitle
:url="`#/item/${entityId}/basic-data`" :url="getUrl(entityId, 'basic-data')"
:text="t('item.summary.basicData')" :text="t('item.summary.basicData')"
/> />
<VnLv :label="t('item.summary.name')" :value="item.name" /> <VnLv :label="t('item.summary.name')" :value="item.name" />
@ -87,7 +88,7 @@ const entityId = computed(() => $props.id || route.params.id);
</QCard> </QCard>
<QCard class="vn-one"> <QCard class="vn-one">
<VnTitle <VnTitle
:url="`#/item/${entityId}/basic-data`" :url="getUrl(entityId, 'basic-data')"
:text="t('item.summary.otherData')" :text="t('item.summary.otherData')"
/> />
<VnLv <VnLv
@ -114,10 +115,7 @@ const entityId = computed(() => $props.id || route.params.id);
/> />
</QCard> </QCard>
<QCard class="vn-one"> <QCard class="vn-one">
<VnTitle <VnTitle :url="getUrl(entityId, 'tags')" :text="t('item.summary.tags')" />
:url="`#/item/${entityId}/tags`"
:text="t('item.summary.tags')"
/>
<VnLv <VnLv
v-for="(tag, index) in tags" v-for="(tag, index) in tags"
:key="index" :key="index"
@ -127,13 +125,13 @@ const entityId = computed(() => $props.id || route.params.id);
</QCard> </QCard>
<QCard class="vn-one" v-if="item.description"> <QCard class="vn-one" v-if="item.description">
<VnTitle <VnTitle
:url="`#/item/${entityId}/basic-data`" :url="getUrl(entityId, 'basic-data')"
:text="t('item.summary.description')" :text="t('item.summary.description')"
/> />
<p v-text="item.description" /> <p v-text="item.description" />
</QCard> </QCard>
<QCard class="vn-one"> <QCard class="vn-one">
<VnTitle :url="`#/item/${entityId}/tax`" :text="t('item.summary.tax')" /> <VnTitle :url="getUrl(entityId, 'tax')" :text="t('item.summary.tax')" />
<VnLv <VnLv
v-for="(tax, index) in item.taxes" v-for="(tax, index) in item.taxes"
:key="index" :key="index"
@ -143,7 +141,7 @@ const entityId = computed(() => $props.id || route.params.id);
</QCard> </QCard>
<QCard class="vn-one"> <QCard class="vn-one">
<VnTitle <VnTitle
:url="`#/item/${entityId}/botanical`" :url="getUrl(entityId, 'botanical')"
:text="t('item.summary.botanical')" :text="t('item.summary.botanical')"
/> />
<VnLv :label="t('item.summary.genus')" :value="botanical?.genus?.name" /> <VnLv :label="t('item.summary.genus')" :value="botanical?.genus?.name" />
@ -154,7 +152,7 @@ const entityId = computed(() => $props.id || route.params.id);
</QCard> </QCard>
<QCard class="vn-one"> <QCard class="vn-one">
<VnTitle <VnTitle
:url="`#/item/${entityId}/barcode`" :url="getUrl(entityId, 'barcode')"
:text="t('item.summary.barcode')" :text="t('item.summary.barcode')"
/> />
<p <p

View File

@ -52,7 +52,7 @@ describe('Login', () => {
cy.url().should('contain', '/login'); cy.url().should('contain', '/login');
}); });
it(`should get redirected to dashboard since employee can't create tickets`, () => { it(`should be redirected to dashboard since the employee is not enabled to see ldap`, () => {
cy.visit('/#/account/ldap', { failOnStatusCode: false }); cy.visit('/#/account/ldap', { failOnStatusCode: false });
cy.url().should('contain', '/#/login?redirect=/account/ldap'); cy.url().should('contain', '/#/login?redirect=/account/ldap');
cy.get('input[aria-label="Username"]').type('employee'); cy.get('input[aria-label="Username"]').type('employee');