Skip to content
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
2 changes: 1 addition & 1 deletion src/components/suivi-api/BilanEnvoisTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function hasDetailIdentifiers(envoi: BilanEnvoiItem) {
<span class="fr-sr-only">Voir le détail de cet envoi</span>
</button>
<button
v-else
v-else-if="!large"
type="button"
class="fr-btn fr-icon-information-line fr-btn--tertiary-no-outline fr-btn--sm"
aria-label="Détail indisponible"
Expand Down
20 changes: 14 additions & 6 deletions src/components/suivi-api/HistoriqueParcellaireModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ const model = defineModel<boolean>({ required: true });

const { downloadJson } = useTelechargements();

const hasPayload = computed(() => props.selectedEnvoi?.payload != null);

const hasOnlyInvalidApiRequest = computed(() => {
const erreurs = props.selectedEnvoi?.erreurs ?? [];
return erreurs.length > 0 && erreurs.every((erreur) => erreur.code === "INVALID_API_REQUEST");
Expand Down Expand Up @@ -175,13 +177,19 @@ function getRejets(envoi: HistoriqueEnvoi) {
</button>
</div>
<div class="fr-text--right">
<button
type="button"
class="fr-btn fr-icon-download-line fr-btn--icon-left fr-btn--secondary"
@click="downloadJson(selectedEnvoi?.payload, `payload-${selectedEnvoi?.jobId}.json`)"
<span
v-tooltip="{ text: hasPayload ? '' : 'Les payloads sont conservés pendant deux mois.', position: 'top' }"
:tabindex="hasPayload ? -1 : 0"
>
Télécharger l'envoi en JSON
</button>
<button
type="button"
class="fr-btn fr-icon-download-line fr-btn--icon-left fr-btn--secondary"
:disabled="!hasPayload"
@click="downloadJson(selectedEnvoi?.payload, `payload-${selectedEnvoi?.jobId}.json`)"
>
{{ hasPayload ? "Télécharger l'envoi en JSON" : "Payload indisponible" }}
</button>
</span>
</div>
</template>
</Modal>
Expand Down
Loading