Skip to content

Commit 354feb4

Browse files
committed
feat(pci-file-storage): add custom error page for share not found
ref: #TAPC-6299 Signed-off-by: aTurmo <adrien.turmo.ext@ovhcloud.com>
1 parent 4b2dea6 commit 354feb4

File tree

15 files changed

+308
-4
lines changed

15 files changed

+308
-4
lines changed
58.8 KB
Loading

packages/manager/apps/pci-file-storage/public/translations/dashboard/Messages_de_DE.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,11 @@
1414
"rename": {
1515
"success": "Share wird aktualisiert. Das kann einige Sekunden dauern",
1616
"error": "Beim Aktualisieren des Share ist ein Fehler aufgetreten"
17+
},
18+
"not_found": {
19+
"title": "Share nicht gefunden",
20+
"description": "Der Share \"{{shareId}}\" wurde nicht gefunden. Er wurde möglicherweise gelöscht oder die ID ist falsch.",
21+
"go_back": "Zurück zum File Storage",
22+
"reload": "Seite neu laden"
1723
}
1824
}

packages/manager/apps/pci-file-storage/public/translations/dashboard/Messages_en_GB.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,11 @@
1414
"rename": {
1515
"success": "Updating share... This may take a few seconds",
1616
"error": "An error occurred while updating the share"
17+
},
18+
"not_found": {
19+
"title": "Share not found",
20+
"description": "The share \"{{shareId}}\" could not be found. It may have been deleted or the ID is incorrect.",
21+
"go_back": "Back to file storage",
22+
"reload": "Reload the page"
1723
}
1824
}

packages/manager/apps/pci-file-storage/public/translations/dashboard/Messages_es_ES.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,11 @@
1414
"rename": {
1515
"success": "La actualización del share está en curso, esto puede tardar unos segundos",
1616
"error": "Se ha producido un error al actualizar el share"
17+
},
18+
"not_found": {
19+
"title": "Share no encontrado",
20+
"description": "No se ha encontrado el share \"{{shareId}}\". Es posible que se haya eliminado o que el identificador sea incorrecto.",
21+
"go_back": "Volver al file storage",
22+
"reload": "Recargar la página"
1723
}
1824
}

packages/manager/apps/pci-file-storage/public/translations/dashboard/Messages_fr_CA.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,11 @@
1414
"rename": {
1515
"success": "La mise à jour du share est en cours, cela peut prendre quelques secondes",
1616
"error": "Une erreur s'est produite lors de la mise à jour du share"
17+
},
18+
"not_found": {
19+
"title": "Share introuvable",
20+
"description": "Le share \"{{shareId}}\" est introuvable. Il a peut-être été supprimé ou l'identifiant est incorrect.",
21+
"go_back": "Retour au file storage",
22+
"reload": "Recharger la page"
1723
}
1824
}

packages/manager/apps/pci-file-storage/public/translations/dashboard/Messages_fr_FR.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,11 @@
1414
"rename": {
1515
"success": "La mise à jour du share est en cours, cela peut prendre quelques secondes",
1616
"error": "Une erreur s'est produite lors de la mise à jour du share"
17+
},
18+
"not_found": {
19+
"title": "Share introuvable",
20+
"description": "Le share \"{{shareId}}\" est introuvable. Il a peut-être été supprimé ou l'identifiant est incorrect.",
21+
"go_back": "Retour au file storage",
22+
"reload": "Recharger la page"
1723
}
1824
}

packages/manager/apps/pci-file-storage/public/translations/dashboard/Messages_it_IT.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,13 @@
1212
"coming_soon": "In arrivo"
1313
},
1414
"rename": {
15-
"success": "Laggiornamento dello share è in corso, loperazione potrebbe richiedere alcuni secondi",
15+
"success": "L'aggiornamento dello share è in corso, l'operazione potrebbe richiedere alcuni secondi",
1616
"error": "Si è verificato un errore durante l'aggiornamento dello share"
17+
},
18+
"not_found": {
19+
"title": "Share non trovato",
20+
"description": "Lo share \"{{shareId}}\" non è stato trovato. Potrebbe essere stato eliminato o l'identificativo è errato.",
21+
"go_back": "Torna al file storage",
22+
"reload": "Ricarica la pagina"
1723
}
1824
}

packages/manager/apps/pci-file-storage/public/translations/dashboard/Messages_pl_PL.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,11 @@
1414
"rename": {
1515
"success": "Trwa aktualizacja „share”. Może to zająć kilka sekund.",
1616
"error": "Wystąpił błąd podczas aktualizacji „share”."
17+
},
18+
"not_found": {
19+
"title": "Nie znaleziono share",
20+
"description": "Nie znaleziono share \"{{shareId}}\". Mógł zostać usunięty lub identyfikator jest nieprawidłowy.",
21+
"go_back": "Wróć do file storage",
22+
"reload": "Odśwież stronę"
1723
}
1824
}

packages/manager/apps/pci-file-storage/public/translations/dashboard/Messages_pt_PT.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,11 @@
1414
"rename": {
1515
"success": "A atualização do share está em curso, o que pode demorar alguns segundos",
1616
"error": "Ocorreu um erro aquando da atualização do share"
17+
},
18+
"not_found": {
19+
"title": "Share não encontrado",
20+
"description": "O share \"{{shareId}}\" não foi encontrado. Ele pode ter sido excluído ou o identificador está incorreto.",
21+
"go_back": "Voltar ao file storage",
22+
"reload": "Recarregar a página"
1723
}
1824
}

packages/manager/apps/pci-file-storage/src/data/hooks/shares/useShare.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { useQuery } from '@tanstack/react-query';
2+
import { isAxiosError } from 'axios';
23

34
import { shareDetailsQueryKey } from '@/adapters/shares/queryKeys';
45
import { getShare } from '@/data/api/shares.api';
@@ -21,6 +22,11 @@ export const useShare = <TData>(
2122
select: options?.select,
2223
...getForceReloadUseQueryOptions(),
2324
retry: 1,
24-
throwOnError: true,
25+
throwOnError: (error) => {
26+
if (isAxiosError(error) && error.response?.status === 404) {
27+
return false;
28+
}
29+
return true;
30+
},
2531
});
2632
};

0 commit comments

Comments
 (0)