Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(History-Teleicare): le badge Historique TeleIcare ne s'affiche pas toujours car il n'y a pas toujours de teleicareId #1595

Merged
merged 2 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions api/serializers/declaration.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@ class Meta:
fields = (
"id",
"teleicare_id",
"siccrf_id",
"article",
"status",
"author",
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/DeclarationSummary/index.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div>
<HistoryBadge v-if="!!payload.teleicareId" class="mb-2" />
<HistoryBadge v-if="!!payload.siccrfId" class="mb-2" />
<ArticleInfoRow
v-model="payload"
:hideArticle15Subtypes="!allowArticleChange"
Expand Down Expand Up @@ -28,7 +28,7 @@
<SummaryInfoSegment label="Durabilité minimale / DLUO (en mois)" :value="payload.minimumDuration" />
<SummaryInfoSegment label="Objectifs / effets" :value="effectsNames" />
</div>
<div v-if="!payload.teleicareId">
<div v-if="!payload.siccrfId">
<h3 class="fr-h6 !mt-8">
Composition
<SummaryModificationButton class="ml-4" v-if="!readonly" @click="router.push(editLink(1))" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ const headers = ["ID", "Nom du produit", "Entreprise", "Auteur", "État", "Date
const rows = computed(() =>
props.data?.results?.map((x) => ({
rowData: [
x.teleicareId ? x.teleicareId : x.id,
x.siccrfId ? (x.teleicareId ? x.teleicareId : "") : x.id,
{
component: DeclarationName,
withHistoryBadge: !!x.teleicareId,
withHistoryBadge: !!x.siccrfId,
text: x.name,
to: { name: "DeclarationPage", params: { id: x.id } }, // TODO Change to a more enteprisey view
},
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/views/DeclarationsHomePage/DeclarationsTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ const rows = computed(() => {

return props.data.results.map((d) => ({
rowData: [
d.teleicareId ? d.teleicareId : d.id,
d.siccrfId ? (d.teleicareId ? d.teleicareId : "") : d.id,
{
component: DeclarationName,
withHistoryBadge: !!d.teleicareId,
withHistoryBadge: !!d.siccrfId,
text: d.name,
class: "font-medium",
to: { name: "DeclarationPage", params: { id: d.id } },
Expand All @@ -55,7 +55,7 @@ const rows = computed(() => {
d.author ? `${d.author.firstName} ${d.author.lastName}` : "",
getStatusTagForCell(d.status, true),
timeAgo(d.creationDate),
d.teleicareId
d.siccrfId
? ""
: {
component: "router-link",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ const rows = computed(() =>
component: CircleIndicators,
declaration: x,
},
x.teleicareId ? x.teleicareId : x.id,
x.siccrfId ? (x.teleicareId ? x.teleicareId : "") : x.id,
{
component: DeclarationName,
withHistoryBadge: !!x.teleicareId,
withHistoryBadge: !!x.siccrfId,
text: x.name,
to: { name: "InstructionPage", params: { declarationId: x.id } },
},
Expand Down
12 changes: 6 additions & 6 deletions frontend/src/views/InstructionPage/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@
</DsfrAlert>
<DeclarationAlert
class="mb-6"
v-else-if="!canInstruct && !declaration.teleicareId"
v-else-if="!canInstruct && !declaration.siccrfId"
role="instructor"
:declaration="declaration"
:snapshots="snapshots"
/>
<DeclarationFromTeleicareAlert v-else-if="declaration.teleicareId" />
<DeclarationFromTeleicareAlert v-else-if="declaration.siccrfId" />
<div v-if="declaration">
<DeclarationSummary
:allowArticleChange="!declaration.teleicareId"
:allowArticleChange="!declaration.siccrfId"
:useAccordions="true"
:showElementAuthorization="true"
:readonly="true"
Expand All @@ -62,7 +62,7 @@
:company="company"
:snapshots="snapshots"
@decision-done="onDecisionDone"
:allowArticleChange="!declaration.teleicareId"
:allowArticleChange="!declaration.siccrfId"
></component>
</DsfrTabContent>
</DsfrTabs>
Expand All @@ -74,7 +74,7 @@
@forward="selectedTabIndex += 1"
:removeSaveLabel="true"
>
<template v-slot:content v-if="!declaration.teleicareId">
<template v-slot:content v-if="!declaration.siccrfId">
<h6 class="text-left">
<v-icon name="ri-pencil-fill"></v-icon>
Notes à destination de l'administration
Expand Down Expand Up @@ -208,7 +208,7 @@ onMounted(async () => {
// Tab management
const components = computed(() => {
const baseComponents = [IdentityTab, DeclarationSummary]
if (!declaration.value.teleicareId) baseComponents.push(HistoryTab)
if (!declaration.value.siccrfId) baseComponents.push(HistoryTab)
if (canInstruct.value) baseComponents.push(DecisionTab)
return baseComponents
})
Expand Down
10 changes: 5 additions & 5 deletions frontend/src/views/ProducerFormPage/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</div>

<div v-else class="mb-4">
<DeclarationFromTeleicareAlert v-if="payload.teleicareId" />
<DeclarationFromTeleicareAlert v-if="payload.siccrfId" />
<DeclarationAlert
v-else-if="payload"
role="declarant"
Expand All @@ -26,7 +26,7 @@

<DsfrAlert
class="mb-4"
v-if="payload.id && !payload.author && !payload.teleicareId"
v-if="payload.id && !payload.author && !payload.siccrfId"
type="info"
title="Cette déclaration n'est gérée par personne"
>
Expand All @@ -35,7 +35,7 @@
</DsfrAlert>
<DsfrAlert
class="mb-4"
v-else-if="payload.author && payload.author !== loggedUser.id && !payload.teleicareId"
v-else-if="payload.author && payload.author !== loggedUser.id && !payload.siccrfId"
type="info"
title="Cette déclaration est gérée par une autre personne"
>
Expand Down Expand Up @@ -209,9 +209,9 @@ const readonly = computed(
)

const showHistory = computed(
() => !payload.value.teleicareId && (readonly.value || (!isNewDeclaration.value && payload.value.status !== "DRAFT"))
() => !payload.value.siccrfId && (readonly.value || (!isNewDeclaration.value && payload.value.status !== "DRAFT"))
)
const showWithdrawal = computed(() => !payload.value.teleicareId && payload.value.status === "AUTHORIZED")
const showWithdrawal = computed(() => !payload.value.siccrfId && payload.value.status === "AUTHORIZED")

const components = computed(() => {
const baseComponents = readonly.value ? [SummaryTab] : [ProductTab, CompositionTab, AttachmentTab, SummaryTab]
Expand Down
10 changes: 5 additions & 5 deletions frontend/src/views/VisaPage/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
<DeclarationAlert
role="visor"
class="mb-4"
v-else-if="!declaration.teleicareId"
v-else-if="!declaration.siccrfId"
:declaration="declaration"
:snapshots="snapshots"
/>
<div v-if="declaration">
<DeclarationSummary
:allowArticleChange="!declaration.teleicareId"
:allowArticleChange="!declaration.siccrfId"
:useAccordions="true"
:showElementAuthorization="true"
:readonly="true"
Expand All @@ -47,7 +47,7 @@
>
<component
:is="component"
:allowArticleChange="!declaration.teleicareId"
:allowArticleChange="!declaration.siccrfId"
v-model="declaration"
:externalResults="$externalResults"
:readonly="true"
Expand All @@ -69,7 +69,7 @@
@forward="selectedTabIndex += 1"
:removeSaveLabel="true"
>
<template v-slot:content v-if="!declaration.teleicareId">
<template v-slot:content v-if="!declaration.siccrfId">
<h6 class="text-left">
<v-icon name="ri-pencil-fill"></v-icon>
Notes à destination de l'administration
Expand Down Expand Up @@ -201,7 +201,7 @@ const saveComment = useDebounceFn(async () => {
// Tab management
const components = computed(() => {
const baseComponents = [IdentityTab, DeclarationSummary]
if (!declaration.value.teleicareId) baseComponents.push(HistoryTab)
if (!declaration.value.siccrfId) baseComponents.push(HistoryTab)
if (canInstruct.value) baseComponents.push(VisaValidationTab)
return baseComponents
})
Expand Down
Loading