From 9bd8ff85bfb7f1edd482ca7870a7b3e09adf33bc Mon Sep 17 00:00:00 2001 From: Yoann Fievez Date: Tue, 26 Nov 2024 10:26:58 +0100 Subject: [PATCH] feat(pci-object-storage): add datagrid for user s3 ref: DTCORE-2876 Signed-off-by: Yoann Fievez --- .../objects/users/Messages_de_DE.json | 20 ++ .../objects/users/Messages_en_GB.json | 20 ++ .../objects/users/Messages_es_ES.json | 20 ++ .../objects/users/Messages_fr_CA.json | 20 ++ .../objects/users/Messages_fr_FR.json | 20 ++ .../objects/users/Messages_it_IT.json | 20 ++ .../objects/users/Messages_pl_PL.json | 20 ++ .../objects/users/Messages_pt_PT.json | 20 ++ .../pci-object-storage/src/api/data/user.ts | 33 +++ .../src/api/hooks/useUser.ts | 68 +++++ .../src/components/Actions.component.tsx | 45 ++++ .../apps/pci-object-storage/src/constants.ts | 2 + .../src/pages/objects/Objects.page.tsx | 6 +- .../container/users/Listing.page.spec.tsx | 42 +++ .../objects/container/users/Listing.page.tsx | 253 +++++++++++++++++- .../container/users/useDatagridColumn.tsx | 47 ++++ .../tabs-panel}/TabsPanel.component.tsx | 2 +- .../manager-pci-common/src/helpers/index.ts | 39 +++ .../modules/manager-pci-common/src/index.ts | 3 + .../storages/containers/Messages_de_DE.json | 35 +++ .../storages/containers/Messages_en_GB.json | 35 +++ .../storages/containers/Messages_es_ES.json | 35 +++ .../storages/containers/Messages_fr_CA.json | 40 +++ .../storages/containers/Messages_fr_FR.json | 40 +++ .../storages/containers/Messages_it_IT.json | 35 +++ .../storages/containers/Messages_pl_PL.json | 35 +++ .../storages/containers/Messages_pt_PT.json | 35 +++ .../translations/storages/containers/index.ts | 27 ++ 28 files changed, 1011 insertions(+), 6 deletions(-) create mode 100644 packages/manager/apps/pci-object-storage/public/translations/objects/users/Messages_de_DE.json create mode 100644 packages/manager/apps/pci-object-storage/public/translations/objects/users/Messages_en_GB.json create mode 100644 packages/manager/apps/pci-object-storage/public/translations/objects/users/Messages_es_ES.json create mode 100644 packages/manager/apps/pci-object-storage/public/translations/objects/users/Messages_fr_CA.json create mode 100644 packages/manager/apps/pci-object-storage/public/translations/objects/users/Messages_fr_FR.json create mode 100644 packages/manager/apps/pci-object-storage/public/translations/objects/users/Messages_it_IT.json create mode 100644 packages/manager/apps/pci-object-storage/public/translations/objects/users/Messages_pl_PL.json create mode 100644 packages/manager/apps/pci-object-storage/public/translations/objects/users/Messages_pt_PT.json create mode 100644 packages/manager/apps/pci-object-storage/src/api/data/user.ts create mode 100644 packages/manager/apps/pci-object-storage/src/api/hooks/useUser.ts create mode 100644 packages/manager/apps/pci-object-storage/src/components/Actions.component.tsx create mode 100644 packages/manager/apps/pci-object-storage/src/constants.ts create mode 100644 packages/manager/apps/pci-object-storage/src/pages/objects/container/users/Listing.page.spec.tsx create mode 100644 packages/manager/apps/pci-object-storage/src/pages/objects/container/users/useDatagridColumn.tsx rename packages/manager/{apps/pci-object-storage/src/components => modules/manager-pci-common/src/components/tabs-panel}/TabsPanel.component.tsx (96%) create mode 100644 packages/manager/modules/manager-pci-common/src/helpers/index.ts create mode 100644 packages/manager/modules/manager-pci-common/src/translations/storages/containers/Messages_de_DE.json create mode 100644 packages/manager/modules/manager-pci-common/src/translations/storages/containers/Messages_en_GB.json create mode 100644 packages/manager/modules/manager-pci-common/src/translations/storages/containers/Messages_es_ES.json create mode 100644 packages/manager/modules/manager-pci-common/src/translations/storages/containers/Messages_fr_CA.json create mode 100644 packages/manager/modules/manager-pci-common/src/translations/storages/containers/Messages_fr_FR.json create mode 100644 packages/manager/modules/manager-pci-common/src/translations/storages/containers/Messages_it_IT.json create mode 100644 packages/manager/modules/manager-pci-common/src/translations/storages/containers/Messages_pl_PL.json create mode 100644 packages/manager/modules/manager-pci-common/src/translations/storages/containers/Messages_pt_PT.json create mode 100644 packages/manager/modules/manager-pci-common/src/translations/storages/containers/index.ts diff --git a/packages/manager/apps/pci-object-storage/public/translations/objects/users/Messages_de_DE.json b/packages/manager/apps/pci-object-storage/public/translations/objects/users/Messages_de_DE.json new file mode 100644 index 000000000000..26f649a95f6a --- /dev/null +++ b/packages/manager/apps/pci-object-storage/public/translations/objects/users/Messages_de_DE.json @@ -0,0 +1,20 @@ +{ + "pci_projects_project_storages_containers_users_title": "Verwaltung der S3-Zugangsdaten", + "pci_projects_project_storages_containers_users_username": "Nutzername", + "pci_projects_project_storages_containers_users_description": "Beschreibung", + "pci_projects_project_storages_containers_users_import_json": "S3 Policy (JSON) importieren", + "pci_projects_project_storages_containers_users_download_json": "S3 Policy (JSON) herunterladen", + "pci_projects_project_storages_containers_users_user_management": "Nutzerverwaltung", + "pci_projects_project_storages_containers_users_user_description": "In dieser Rubrik können Sie einen neuen S3-Nutzer hinzufügen, Ihren Zugangsschlüssel und geheimen Schlüssel erhalten sowie die S3-Richtlinien verwalten.", + "pci_projects_project_storages_containers_users_user_description_warning": "Wenn ein Nutzerprofil erstellt ist, müssen die S3-Zugangsdaten dafür im Bereich „Nutzer & Rollen“ generiert werden.", + "pci_projects_project_storages_containers_users_add_user": "Nutzer hinzufügen", + "pci_projects_project_storages_containers_users_import_success_message": "Die JSON-Datei für den Nutzer {{user}} wurde komplett heruntergeladen.", + "pci_projects_project_storages_containers_users_import_error_message": "Beim Herunterladen der JSON-Datei für den Nutzer ist ein Fehler aufgetreten: {{ message }}.", + "pci_projects_project_storages_containers_users_accesskey": "Zugriffsschlüssel", + "pci_projects_project_storages_containers_users_download_rclone_file": "Rclone-Datei herunterladen", + "pci_projects_project_storages_containers_users_see_secret_key": "Den geheimen Schlüssel anzeigen", + "pci_projects_project_storages_containers_users_show_secret_key_success": "Der geheime Schlüssel des Nutzers {{user}} ist {{secret}}.", + "pci_projects_project_storages_containers_users_add_success_field_secret_key": "Ihr geheimer S3-Schlüssel:", + "pci_projects_project_storages_containers_users_show_secret_key_error": "Beim Abrufen des geheimen Schlüssels des Nutzers {{ user }} ist ein Fehler aufgetreten: {{ message }}", + "pci_projects_project_storages_containers_users_user_info_banner": "Neue User haben automatisch Zugriff auf alle Container in den Local Zones." +} diff --git a/packages/manager/apps/pci-object-storage/public/translations/objects/users/Messages_en_GB.json b/packages/manager/apps/pci-object-storage/public/translations/objects/users/Messages_en_GB.json new file mode 100644 index 000000000000..ca6cc55dbb5d --- /dev/null +++ b/packages/manager/apps/pci-object-storage/public/translations/objects/users/Messages_en_GB.json @@ -0,0 +1,20 @@ +{ + "pci_projects_project_storages_containers_users_title": "Manage your S3 credentials", + "pci_projects_project_storages_containers_users_username": "Username", + "pci_projects_project_storages_containers_users_description": "Description", + "pci_projects_project_storages_containers_users_import_json": "Import S3 Policy (JSON)", + "pci_projects_project_storages_containers_users_download_json": "Download S3 Policy (JSON)", + "pci_projects_project_storages_containers_users_user_management": "User management", + "pci_projects_project_storages_containers_users_user_description": "In this section you can add a new S3 user, get your access key and secret key, and manage S3 Policies.", + "pci_projects_project_storages_containers_users_user_description_warning": "Once your user has been created, you will need to generate the S3 credentials for them in the ‘Users & Roles’ section.", + "pci_projects_project_storages_containers_users_add_user": "Add user", + "pci_projects_project_storages_containers_users_import_success_message": "The JSON file linked to the {{user}} user has been downloaded.", + "pci_projects_project_storages_containers_users_import_error_message": "An error has occurred downloading the JSON file linked to the user: {{message}}", + "pci_projects_project_storages_containers_users_accesskey": "Access key", + "pci_projects_project_storages_containers_users_download_rclone_file": "Download rclone file", + "pci_projects_project_storages_containers_users_see_secret_key": "View the secret key", + "pci_projects_project_storages_containers_users_show_secret_key_success": "Your {{user}} user's secret key is {{secret}}.", + "pci_projects_project_storages_containers_users_add_success_field_secret_key": "Your S3 secret key:", + "pci_projects_project_storages_containers_users_show_secret_key_error": "An error has occurred retrieving the secret key for the user {{ user }} : {{ message }}", + "pci_projects_project_storages_containers_users_user_info_banner": "New users will automatically have access to all containers in Local Zones." +} diff --git a/packages/manager/apps/pci-object-storage/public/translations/objects/users/Messages_es_ES.json b/packages/manager/apps/pci-object-storage/public/translations/objects/users/Messages_es_ES.json new file mode 100644 index 000000000000..b7599a0d77d9 --- /dev/null +++ b/packages/manager/apps/pci-object-storage/public/translations/objects/users/Messages_es_ES.json @@ -0,0 +1,20 @@ +{ + "pci_projects_project_storages_containers_users_title": "Gestión de claves S3", + "pci_projects_project_storages_containers_users_username": "Nombre de usuario", + "pci_projects_project_storages_containers_users_description": "Descripción", + "pci_projects_project_storages_containers_users_import_json": "Importar S3 Policy (JSON)", + "pci_projects_project_storages_containers_users_download_json": "Descargar S3 Policy (JSON)", + "pci_projects_project_storages_containers_users_user_management": "Gestión de los usuarios", + "pci_projects_project_storages_containers_users_user_description": "Desde esta sección podrá añadir un nuevo usuario S3, obtener su clave de acceso y su clave secreta, y gestionar las S3 Policies.", + "pci_projects_project_storages_containers_users_user_description_warning": "Una vez creado el usuario, deberá generar las claves S3 para él en la sección «Users & Roles».", + "pci_projects_project_storages_containers_users_add_user": "Añadir un usuario", + "pci_projects_project_storages_containers_users_import_success_message": "El archivo JSON asociado al usuario {{user}} se ha descargado correctamente.", + "pci_projects_project_storages_containers_users_import_error_message": "Se ha producido un error al descargar el archivo JSON asociado al usuario: {{ message }}.", + "pci_projects_project_storages_containers_users_accesskey": "Clave de acceso", + "pci_projects_project_storages_containers_users_download_rclone_file": "Descargar el archivo Rclone", + "pci_projects_project_storages_containers_users_see_secret_key": "Ver la clave secreta", + "pci_projects_project_storages_containers_users_show_secret_key_success": "La clave secreta de su usuario {{user}} es {{secret}}.", + "pci_projects_project_storages_containers_users_add_success_field_secret_key": "Su llave secreta S3:", + "pci_projects_project_storages_containers_users_show_secret_key_error": "Se ha producido un error al cargar la clave secreta del usuario {{ user }}: {{ message }}", + "pci_projects_project_storages_containers_users_user_info_banner": "Los nuevos usuarios tendrán acceso automáticamente a todos los contenedores en las Local Zones." +} diff --git a/packages/manager/apps/pci-object-storage/public/translations/objects/users/Messages_fr_CA.json b/packages/manager/apps/pci-object-storage/public/translations/objects/users/Messages_fr_CA.json new file mode 100644 index 000000000000..d80dfd6d9256 --- /dev/null +++ b/packages/manager/apps/pci-object-storage/public/translations/objects/users/Messages_fr_CA.json @@ -0,0 +1,20 @@ +{ + "pci_projects_project_storages_containers_users_title": "Gestion des credentials S3", + "pci_projects_project_storages_containers_users_username": "Nom d'utilisateur", + "pci_projects_project_storages_containers_users_description": "Description", + "pci_projects_project_storages_containers_users_accesskey": "Clé d'accès", + "pci_projects_project_storages_containers_users_import_json": "Importer S3 Policy (JSON)", + "pci_projects_project_storages_containers_users_download_json": "Télécharger S3 Policy (JSON)", + "pci_projects_project_storages_containers_users_download_rclone_file": "Télécharger le fichier rclone", + "pci_projects_project_storages_containers_users_see_secret_key": "Voir la clé secrète", + "pci_projects_project_storages_containers_users_user_management": "Gestion des utilisateurs", + "pci_projects_project_storages_containers_users_user_description": "Cette section vous permet d'ajouter un nouvel utilisateur S3, d'obtenir votre clé d'accès et votre clé secrète, et de gérer les S3 Policies.", + "pci_projects_project_storages_containers_users_user_description_warning": "Une fois votre utilisateur créé il sera nécessaire de générer les credentials S3 pour celui-ci dans la section «Users & Roles».", + "pci_projects_project_storages_containers_users_add_user": "Ajouter un utilisateur", + "pci_projects_project_storages_containers_users_import_success_message": "Le téléchargment du fichier JSON lié à l’utilisateur {{user}} a été effectué avec succès.", + "pci_projects_project_storages_containers_users_import_error_message": "Une erreur est survenue lors du téléchargement du fichier JSON lié à l’utilisateur : {{ message }}.", + "pci_projects_project_storages_containers_users_show_secret_key_success": "La clé secrète de votre utilisateur {{user}} est {{secret}}.", + "pci_projects_project_storages_containers_users_show_secret_key_error": "Une erreur est survenue lors de la récupération de la clé secrète de l'utilisateur {{ user }} : {{ message }}", + "pci_projects_project_storages_containers_users_add_success_field_secret_key": "Votre clé secrète S3 :", + "pci_projects_project_storages_containers_users_user_info_banner": "Les nouveaux utilisateurs auront automatiquement accès à tous les conteneurs dans les Local Zones." +} diff --git a/packages/manager/apps/pci-object-storage/public/translations/objects/users/Messages_fr_FR.json b/packages/manager/apps/pci-object-storage/public/translations/objects/users/Messages_fr_FR.json new file mode 100644 index 000000000000..d80dfd6d9256 --- /dev/null +++ b/packages/manager/apps/pci-object-storage/public/translations/objects/users/Messages_fr_FR.json @@ -0,0 +1,20 @@ +{ + "pci_projects_project_storages_containers_users_title": "Gestion des credentials S3", + "pci_projects_project_storages_containers_users_username": "Nom d'utilisateur", + "pci_projects_project_storages_containers_users_description": "Description", + "pci_projects_project_storages_containers_users_accesskey": "Clé d'accès", + "pci_projects_project_storages_containers_users_import_json": "Importer S3 Policy (JSON)", + "pci_projects_project_storages_containers_users_download_json": "Télécharger S3 Policy (JSON)", + "pci_projects_project_storages_containers_users_download_rclone_file": "Télécharger le fichier rclone", + "pci_projects_project_storages_containers_users_see_secret_key": "Voir la clé secrète", + "pci_projects_project_storages_containers_users_user_management": "Gestion des utilisateurs", + "pci_projects_project_storages_containers_users_user_description": "Cette section vous permet d'ajouter un nouvel utilisateur S3, d'obtenir votre clé d'accès et votre clé secrète, et de gérer les S3 Policies.", + "pci_projects_project_storages_containers_users_user_description_warning": "Une fois votre utilisateur créé il sera nécessaire de générer les credentials S3 pour celui-ci dans la section «Users & Roles».", + "pci_projects_project_storages_containers_users_add_user": "Ajouter un utilisateur", + "pci_projects_project_storages_containers_users_import_success_message": "Le téléchargment du fichier JSON lié à l’utilisateur {{user}} a été effectué avec succès.", + "pci_projects_project_storages_containers_users_import_error_message": "Une erreur est survenue lors du téléchargement du fichier JSON lié à l’utilisateur : {{ message }}.", + "pci_projects_project_storages_containers_users_show_secret_key_success": "La clé secrète de votre utilisateur {{user}} est {{secret}}.", + "pci_projects_project_storages_containers_users_show_secret_key_error": "Une erreur est survenue lors de la récupération de la clé secrète de l'utilisateur {{ user }} : {{ message }}", + "pci_projects_project_storages_containers_users_add_success_field_secret_key": "Votre clé secrète S3 :", + "pci_projects_project_storages_containers_users_user_info_banner": "Les nouveaux utilisateurs auront automatiquement accès à tous les conteneurs dans les Local Zones." +} diff --git a/packages/manager/apps/pci-object-storage/public/translations/objects/users/Messages_it_IT.json b/packages/manager/apps/pci-object-storage/public/translations/objects/users/Messages_it_IT.json new file mode 100644 index 000000000000..b9587ea76a2a --- /dev/null +++ b/packages/manager/apps/pci-object-storage/public/translations/objects/users/Messages_it_IT.json @@ -0,0 +1,20 @@ +{ + "pci_projects_project_storages_containers_users_title": "Gestione delle credenziali S3", + "pci_projects_project_storages_containers_users_username": "Nome utente", + "pci_projects_project_storages_containers_users_description": "Descrizione", + "pci_projects_project_storages_containers_users_import_json": "Importa S3 Policy (JSON)", + "pci_projects_project_storages_containers_users_download_json": "Scarica S3 Policy (JSON)", + "pci_projects_project_storages_containers_users_user_management": "Gestione degli utenti", + "pci_projects_project_storages_containers_users_user_description": "Questa sezione permette di aggiungere un nuovo utente S3, ottenere la chiave di accesso e la chiave segreta e gestire le policy S3.", + "pci_projects_project_storages_containers_users_user_description_warning": "Una volta creato l'utente, sarà necessario generare le credenziali S3 nella sezione \"Users & Roles\".", + "pci_projects_project_storages_containers_users_add_user": "Aggiungere un utente", + "pci_projects_project_storages_containers_users_import_success_message": "Il download del file JSON associato all'utente {{user}} è stato effettuato correttamente.", + "pci_projects_project_storages_containers_users_import_error_message": "Si è verificato un errore durante il download del file JSON associato all'utente: {{ message }}.", + "pci_projects_project_storages_containers_users_accesskey": "Chiave di accesso", + "pci_projects_project_storages_containers_users_download_rclone_file": "Scarica il file Rclone", + "pci_projects_project_storages_containers_users_see_secret_key": "Mostra la chiave segreta", + "pci_projects_project_storages_containers_users_show_secret_key_success": "La chiave segreta dell’utente {{user}} è {{secret}}.", + "pci_projects_project_storages_containers_users_add_success_field_secret_key": "La tua chiave segreta S3:", + "pci_projects_project_storages_containers_users_show_secret_key_error": "Si è verificato un errore durante il recupero della chiave segreta dell'utente {{ user }}: {{ message }}", + "pci_projects_project_storages_containers_users_user_info_banner": "I nuovi utenti avranno automaticamente accesso a tutti i container nelle Local Zone." +} diff --git a/packages/manager/apps/pci-object-storage/public/translations/objects/users/Messages_pl_PL.json b/packages/manager/apps/pci-object-storage/public/translations/objects/users/Messages_pl_PL.json new file mode 100644 index 000000000000..3cd1230ab83c --- /dev/null +++ b/packages/manager/apps/pci-object-storage/public/translations/objects/users/Messages_pl_PL.json @@ -0,0 +1,20 @@ +{ + "pci_projects_project_storages_containers_users_title": "Zarządzanie poświadczeniami S3", + "pci_projects_project_storages_containers_users_username": "Nazwa użytkownika", + "pci_projects_project_storages_containers_users_description": "Opis", + "pci_projects_project_storages_containers_users_import_json": "Importuj S3 Policy (JSON)", + "pci_projects_project_storages_containers_users_download_json": "Pobierz S3 Policy (JSON)", + "pci_projects_project_storages_containers_users_user_management": "Zarządzanie użytkownikami", + "pci_projects_project_storages_containers_users_user_description": "W tej sekcji możesz dodać nowego użytkownika S3, uzyskać klucz dostępowy oraz klucz tajny i zarządzać polityką S3.", + "pci_projects_project_storages_containers_users_user_description_warning": "Po utworzeniu użytkownika konieczne jest wygenerowanie dla niego certyfikatu S3 w sekcji „Users & Roles”.", + "pci_projects_project_storages_containers_users_add_user": "Dodaj użytkownika", + "pci_projects_project_storages_containers_users_import_success_message": "Pobranie pliku JSON powiązanego z użytkownikiem {{user}} zostało wykonane.", + "pci_projects_project_storages_containers_users_import_error_message": "Wystąpił błąd podczas pobierania pliku JSON powiązanego z użytkownikiem: {{message}}", + "pci_projects_project_storages_containers_users_accesskey": "Klucz dostępu", + "pci_projects_project_storages_containers_users_download_rclone_file": "Pobierz plik rclone", + "pci_projects_project_storages_containers_users_see_secret_key": "Wyświetl tajny klucz", + "pci_projects_project_storages_containers_users_show_secret_key_success": "Tajny klucz dla Twojego użytkownika {{user}} to {{secret}}.", + "pci_projects_project_storages_containers_users_add_success_field_secret_key": "Twój tajny klucz S3:", + "pci_projects_project_storages_containers_users_show_secret_key_error": "Wystąpił błąd podczas pobierania tajnego klucza użytkownika {{user}}: {{message}}", + "pci_projects_project_storages_containers_users_user_info_banner": "Nowi użytkownicy będą mieli automatycznie dostęp do wszystkich kontenerów w Local Zones." +} diff --git a/packages/manager/apps/pci-object-storage/public/translations/objects/users/Messages_pt_PT.json b/packages/manager/apps/pci-object-storage/public/translations/objects/users/Messages_pt_PT.json new file mode 100644 index 000000000000..7703eadf982c --- /dev/null +++ b/packages/manager/apps/pci-object-storage/public/translations/objects/users/Messages_pt_PT.json @@ -0,0 +1,20 @@ +{ + "pci_projects_project_storages_containers_users_title": "Gestão das credenciais S3", + "pci_projects_project_storages_containers_users_username": "Nome de utilizador", + "pci_projects_project_storages_containers_users_description": "Descrição", + "pci_projects_project_storages_containers_users_import_json": "Importar S3 Policy (JSON)", + "pci_projects_project_storages_containers_users_download_json": "Download da S3 Policy (JSON)", + "pci_projects_project_storages_containers_users_user_management": "Gestão de utilizadores", + "pci_projects_project_storages_containers_users_user_description": "Esta secção permite-lhe adicionar um novo utilizador S3, obter a sua chave de acesso e a sua chave secreta e gerir as S3 Policies.", + "pci_projects_project_storages_containers_users_user_description_warning": "Depois de criar o utilizador, será necessário gerar as credenciais S3 na secção \"Utilizadores e funções\".", + "pci_projects_project_storages_containers_users_add_user": "Adicionar um utilizador", + "pci_projects_project_storages_containers_users_import_success_message": "O download do ficheiro JSON associado ao utilizador {{user}} foi efetuado com êxito.", + "pci_projects_project_storages_containers_users_import_error_message": "Ocorreu um erro aquando do download do ficheiro JSON associado ao utilizador: {{ message }}.", + "pci_projects_project_storages_containers_users_accesskey": "Chave de acesso", + "pci_projects_project_storages_containers_users_download_rclone_file": "Descarregar o ficheiro rclone", + "pci_projects_project_storages_containers_users_see_secret_key": "Ver a chave secreta", + "pci_projects_project_storages_containers_users_show_secret_key_success": "A chave secreta do seu utilizador {{user}} é {{secret}}.", + "pci_projects_project_storages_containers_users_add_success_field_secret_key": "A sua chave secreta S3:", + "pci_projects_project_storages_containers_users_show_secret_key_error": "Ocorreu um erro durante a recuperação da chave secreta do utilizador {{ user }}: {{ message }}", + "pci_projects_project_storages_containers_users_user_info_banner": "Os novos utilizadores terão automaticamente acesso a todos os containers nas Local Zones." +} diff --git a/packages/manager/apps/pci-object-storage/src/api/data/user.ts b/packages/manager/apps/pci-object-storage/src/api/data/user.ts new file mode 100644 index 000000000000..feeb64c3ade6 --- /dev/null +++ b/packages/manager/apps/pci-object-storage/src/api/data/user.ts @@ -0,0 +1,33 @@ +import { v6 } from '@ovh-ux/manager-core-api'; + +export type TS3Credentials = { + userId: string; + tenantId: string; + access: string; +}; + +export type TUser = { + id: number; + username: string; + creationDate: string; + description: string; + openstackId: string; + status: string; + access?: string; + search?: string; +}; + +export const getAllUsers = async (projectId: string): Promise => { + const { data } = await v6.get(`/cloud/project/${projectId}/user`); + return data; +}; + +export const getS3Credentials = async ( + projectId: string, + userId: number, +): Promise => { + const { data } = await v6.get( + `/cloud/project/${projectId}/user/${userId}/s3Credentials`, + ); + return data; +}; diff --git a/packages/manager/apps/pci-object-storage/src/api/hooks/useUser.ts b/packages/manager/apps/pci-object-storage/src/api/hooks/useUser.ts new file mode 100644 index 000000000000..9bdbed8e6bb5 --- /dev/null +++ b/packages/manager/apps/pci-object-storage/src/api/hooks/useUser.ts @@ -0,0 +1,68 @@ +import { useQueries, useQuery } from '@tanstack/react-query'; +import { ColumnSort, PaginationState } from '@ovh-ux/manager-react-components'; +import { applyFilters, Filter } from '@ovh-ux/manager-core-api'; +import { useMemo } from 'react'; +import { paginateResults, sortResults } from '@ovh-ux/manager-pci-common'; +import { log } from 'console'; +import { getAllUsers, getS3Credentials, TUser } from '@/api/data/user'; + +export const useAllUsers = (projectId: string) => + useQuery({ + queryKey: ['project', projectId, 'users'], + queryFn: () => getAllUsers(projectId), + }); + +export const useUsers = (projectId: string) => { + const { data: users, isPending } = useAllUsers(projectId); + return useQueries({ + queries: (users || [])?.map((user) => ({ + queryKey: ['user', user.id, 's3Credentials'], + queryFn: () => getS3Credentials(projectId, user.id), + enabled: !isPending, + select: (s3Credentials) => s3Credentials[0], + })), + combine: (results) => ({ + isPending: results.some((result) => result.isPending), + isLoading: results.some((result) => result.isLoading), + error: results.find((result) => result.error), + data: users?.reduce((all, user) => { + const s3Credentials = results.find( + (result) => result.data?.userId === user.openstackId, + )?.data; + + if (s3Credentials) { + all.push({ + ...user, + access: s3Credentials.access, + search: `${user.username} ${user.description} ${s3Credentials.access}`, + }); + } + + return all; + }, []), + }), + }); +}; + +export const usePaginatedUsers = ( + projectId: string, + pagination: PaginationState, + sorting: ColumnSort, + filters: Filter[], +) => { + const { data: users, error, isLoading, isPending } = useUsers(projectId); + + return useMemo( + () => ({ + isLoading, + isPending, + paginatedUsers: paginateResults( + sortResults(applyFilters(users || [], filters), sorting), + pagination, + ), + allUsers: users, + error, + }), + [users, error, isLoading, isPending, pagination, sorting, filters], + ); +}; diff --git a/packages/manager/apps/pci-object-storage/src/components/Actions.component.tsx b/packages/manager/apps/pci-object-storage/src/components/Actions.component.tsx new file mode 100644 index 000000000000..02a486ae87e0 --- /dev/null +++ b/packages/manager/apps/pci-object-storage/src/components/Actions.component.tsx @@ -0,0 +1,45 @@ +import { useHref } from 'react-router-dom'; +import { useTranslation } from 'react-i18next'; +import { ActionMenu } from '@ovh-ux/manager-react-components'; +import { TUser } from '@/api/data/user'; + +type ActionsComponentProps = { + user: TUser; +}; + +export default function ActionsComponent({ + user, +}: Readonly) { + const { t } = useTranslation('objects/users'); + const { t: tPciStoragesContainers } = useTranslation( + 'pci-storages-containers', + ); + const items = [ + { + id: 0, + label: t('pci_projects_project_storages_containers_users_import_json'), + }, + { + id: 1, + label: t('pci_projects_project_storages_containers_users_download_json'), + }, + { + id: 2, + label: t( + 'pci_projects_project_storages_containers_users_download_rclone_file', + ), + }, + { + id: 3, + label: t('pci_projects_project_storages_containers_users_see_secret_key'), + }, + { + id: 4, + label: tPciStoragesContainers( + 'pci_projects_project_storages_containers_delete_label', + ), + }, + ]; + + return ; +} diff --git a/packages/manager/apps/pci-object-storage/src/constants.ts b/packages/manager/apps/pci-object-storage/src/constants.ts new file mode 100644 index 000000000000..f35153b650f9 --- /dev/null +++ b/packages/manager/apps/pci-object-storage/src/constants.ts @@ -0,0 +1,2 @@ +export const PCI_FEATURES_FREE_LOCAL_ZONES_BANNER = + 'public-cloud:object-storage:localzone'; diff --git a/packages/manager/apps/pci-object-storage/src/pages/objects/Objects.page.tsx b/packages/manager/apps/pci-object-storage/src/pages/objects/Objects.page.tsx index eb236be258a1..4e57dbf3c1db 100644 --- a/packages/manager/apps/pci-object-storage/src/pages/objects/Objects.page.tsx +++ b/packages/manager/apps/pci-object-storage/src/pages/objects/Objects.page.tsx @@ -1,4 +1,4 @@ -import { useProject } from '@ovh-ux/manager-pci-common'; +import { TabsPanel, useProject } from '@ovh-ux/manager-pci-common'; import { Headers, Notifications, @@ -11,9 +11,8 @@ import { Suspense, useEffect, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { Outlet, useLocation, useResolvedPath } from 'react-router-dom'; import { ROUTE_PATHS } from '@/routes'; -import TabsPanel from '@/components/TabsPanel.component'; -export default function BillingPage() { +export default function ObjectsPage() { const { t } = useTranslation('objects'); const location = useLocation(); const hrefProject = useProjectUrl('public-cloud'); @@ -62,7 +61,6 @@ export default function BillingPage() { 'pci_projects_project_storages_containers_object_description', )} /> -
diff --git a/packages/manager/apps/pci-object-storage/src/pages/objects/container/users/Listing.page.spec.tsx b/packages/manager/apps/pci-object-storage/src/pages/objects/container/users/Listing.page.spec.tsx new file mode 100644 index 000000000000..8b6064b0cfff --- /dev/null +++ b/packages/manager/apps/pci-object-storage/src/pages/objects/container/users/Listing.page.spec.tsx @@ -0,0 +1,42 @@ +import { render } from '@testing-library/react'; +import { describe, expect, it, vi } from 'vitest'; +import { TLoadBalancer } from '@/api/data/load-balancer'; +import * as useLoadBalancerModule from '@/api/hook/useLoadBalancer'; +import { mockLoadBalancers } from '@/mocks'; +import ListingPage from '@/pages/listing/Listing.page'; +import { wrapper } from '@/wrapperRenders'; + +describe('ListingPage', () => { + it('renders spinner when data is pending', () => { + vi.spyOn(useLoadBalancerModule, 'useLoadBalancers').mockReturnValue({ + paginatedLoadBalancer: { + rows: [] as TLoadBalancer[], + totalRows: 0, + pageCount: 0, + }, + allLoadBalancer: [], + isPending: true, + isLoading: true, + error: null, + }); + const { getByTestId } = render(, { wrapper }); + + expect(getByTestId('redirectionGuard_spinner')).toBeInTheDocument(); + }); + + it('renders datagrid with load balancers when data is available', () => { + vi.spyOn(useLoadBalancerModule, 'useLoadBalancers').mockReturnValue({ + paginatedLoadBalancer: { + rows: mockLoadBalancers, + totalRows: 1, + pageCount: 1, + }, + allLoadBalancer: mockLoadBalancers, + isPending: false, + isLoading: false, + error: null, + }); + const { getByText } = render(, { wrapper }); + expect(getByText(mockLoadBalancers[0].name)).toBeInTheDocument(); + }); +}); diff --git a/packages/manager/apps/pci-object-storage/src/pages/objects/container/users/Listing.page.tsx b/packages/manager/apps/pci-object-storage/src/pages/objects/container/users/Listing.page.tsx index e8f96c39aa4b..cf31767b5558 100644 --- a/packages/manager/apps/pci-object-storage/src/pages/objects/container/users/Listing.page.tsx +++ b/packages/manager/apps/pci-object-storage/src/pages/objects/container/users/Listing.page.tsx @@ -1,3 +1,254 @@ +import { + Datagrid, + FilterAdd, + FilterList, + Notifications, + RedirectionGuard, + useColumnFilters, + useDataGrid, + useFeatureAvailability, + useNotifications, +} from '@ovh-ux/manager-react-components'; +import { Suspense, useRef, useState } from 'react'; +import { + OsdsButton, + OsdsIcon, + OsdsMessage, + OsdsPopover, + OsdsPopoverContent, + OsdsSearchBar, + OsdsSpinner, + OsdsText, +} from '@ovhcloud/ods-components/react'; +import { + ODS_BUTTON_SIZE, + ODS_BUTTON_VARIANT, + ODS_ICON_NAME, + ODS_ICON_SIZE, + ODS_MESSAGE_TYPE, + ODS_SPINNER_SIZE, +} from '@ovhcloud/ods-components'; +import { + ODS_THEME_COLOR_INTENT, + ODS_THEME_TYPOGRAPHY_LEVEL, + ODS_THEME_TYPOGRAPHY_SIZE, +} from '@ovhcloud/ods-common-theming'; +import { FilterCategories } from '@ovh-ux/manager-core-api'; +import { useTranslation } from 'react-i18next'; +import { Outlet, useNavigate, useParams } from 'react-router-dom'; +import { usePaginatedUsers } from '@/api/hooks/useUser'; +import { useDatagridColumn } from './useDatagridColumn'; +import { PCI_FEATURES_FREE_LOCAL_ZONES_BANNER } from '@/constants'; +import queryClient from '@/queryClient'; + export default function Listing() { - return
User listing
; + const { t } = useTranslation('objects/users'); + const { t: tFilter } = useTranslation('filters'); + + const { projectId } = useParams(); + const { pagination, setPagination, sorting, setSorting } = useDataGrid(); + + const navigate = useNavigate(); + const { clearNotifications } = useNotifications(); + const { filters, addFilter, removeFilter } = useColumnFilters(); + const [searchField, setSearchField] = useState(''); + const [searchQueries, setSearchQueries] = useState([]); + const filterPopoverRef = useRef(undefined); + + const { allUsers, paginatedUsers, isPending } = usePaginatedUsers( + projectId, + pagination, + sorting, + filters, + ); + + const columns = useDatagridColumn(); + + const { data: availability } = useFeatureAvailability([ + PCI_FEATURES_FREE_LOCAL_ZONES_BANNER, + ]); + + const refresh = async () => { + queryClient.invalidateQueries({ + queryKey: ['project', projectId, 'users'], + }); + queryClient.invalidateQueries({ + queryKey: ['user'], + }); + }; + + return ( + +
+ +
+ + {t('pci_projects_project_storages_containers_users_title')} + + + {t('pci_projects_project_storages_containers_users_user_description')} + + {availability && availability[PCI_FEATURES_FREE_LOCAL_ZONES_BANNER] && ( + + {t('pci_projects_project_storages_containers_users_user_info_banner')} + + )} + +
+ { + clearNotifications(); + navigate('../create'); + }} + > + + {t('pci_projects_project_storages_containers_users_add_user')} + + +
+ { + refresh(); + }} + > + + + { + const { inputValue } = detail; + if (inputValue) { + setSearchField(''); + if (searchQueries.indexOf(inputValue) < 0) { + setSearchQueries([...searchQueries, inputValue]); + setPagination({ + ...pagination, + pageIndex: 0, + }); + } else { + setSearchQueries([...searchQueries]); + } + } + }} + /> + + + + {tFilter('common_criteria_adder_filter_label')} + + + { + setPagination({ + pageIndex: 0, + pageSize: pagination.pageSize, + }); + addFilter({ + ...addedFilter, + label: column.label, + }); + filterPopoverRef.current?.closeSurface(); + }} + /> + + +
+
+ +
+ +
+ + {isPending ? ( + + ) : ( + + )} + + + +
+ ); } diff --git a/packages/manager/apps/pci-object-storage/src/pages/objects/container/users/useDatagridColumn.tsx b/packages/manager/apps/pci-object-storage/src/pages/objects/container/users/useDatagridColumn.tsx new file mode 100644 index 000000000000..286ec40f5451 --- /dev/null +++ b/packages/manager/apps/pci-object-storage/src/pages/objects/container/users/useDatagridColumn.tsx @@ -0,0 +1,47 @@ +import { + DatagridColumn, + DataGridTextCell, +} from '@ovh-ux/manager-react-components'; +import { useTranslation } from 'react-i18next'; +import { TUser } from '@/api/data/user'; +import ActionsComponent from '@/components/Actions.component'; + +export const useDatagridColumn = () => { + const { t } = useTranslation('objects/users'); + + const columns: DatagridColumn[] = [ + { + id: 'username', + cell: (props: TUser) => ( + {props.username} + ), + label: t('pci_projects_project_storages_containers_users_username'), + }, + { + id: 'description', + cell: (props: TUser) => ( + {props.description} + ), + label: t('pci_projects_project_storages_containers_users_description'), + }, + { + id: 'access', + cell: (props: TUser) => ( + {props.access} + ), + label: t('pci_projects_project_storages_containers_users_accesskey'), + }, + { + id: 'actions', + cell: (props: TUser) => ( +
+ +
+ ), + label: '', + isSortable: false, + }, + ]; + + return columns; +}; diff --git a/packages/manager/apps/pci-object-storage/src/components/TabsPanel.component.tsx b/packages/manager/modules/manager-pci-common/src/components/tabs-panel/TabsPanel.component.tsx similarity index 96% rename from packages/manager/apps/pci-object-storage/src/components/TabsPanel.component.tsx rename to packages/manager/modules/manager-pci-common/src/components/tabs-panel/TabsPanel.component.tsx index 8b5daee77b28..037663bd80a8 100644 --- a/packages/manager/apps/pci-object-storage/src/components/TabsPanel.component.tsx +++ b/packages/manager/modules/manager-pci-common/src/components/tabs-panel/TabsPanel.component.tsx @@ -20,7 +20,7 @@ export type TabsProps = { tabs: TabItemProps[]; }; -export default function TabsPanel({ tabs }: Readonly) { +export function TabsPanel({ tabs }: Readonly) { const [activePanel, setActivePanel] = useState(''); const location = useLocation(); const { clearNotifications } = useNotifications(); diff --git a/packages/manager/modules/manager-pci-common/src/helpers/index.ts b/packages/manager/modules/manager-pci-common/src/helpers/index.ts new file mode 100644 index 000000000000..8ad3c2d3c4c1 --- /dev/null +++ b/packages/manager/modules/manager-pci-common/src/helpers/index.ts @@ -0,0 +1,39 @@ +import { PaginationState } from '@ovh-ux/manager-react-components'; +import { ColumnSort } from '@tanstack/react-table'; + +export const paginateResults = ( + items: T[], + pagination: PaginationState, +) => ({ + rows: items.slice( + pagination.pageIndex * pagination.pageSize, + (pagination.pageIndex + 1) * pagination.pageSize, + ), + pageCount: Math.ceil(items.length / pagination.pageSize), + totalRows: items.length, +}); + +export const compareFunction = (key: keyof T) => (a: T, b: T) => { + const aValue = a[key] || ''; + const bValue = b[key] || ''; + + if (typeof aValue === 'number' && typeof bValue === 'number') { + return aValue - bValue; + } + return aValue.toString().localeCompare(bValue.toString()); +}; + +export const sortResults = (items: T[], sorting: ColumnSort): T[] => { + const data = [...items]; + + if (sorting) { + const { id: sortKey, desc } = sorting; + data.sort(compareFunction(sortKey as keyof T)); + + if (desc) { + data.reverse(); + } + } + + return data; +}; diff --git a/packages/manager/modules/manager-pci-common/src/index.ts b/packages/manager/modules/manager-pci-common/src/index.ts index eb660b04e2e7..55075a88f39a 100644 --- a/packages/manager/modules/manager-pci-common/src/index.ts +++ b/packages/manager/modules/manager-pci-common/src/index.ts @@ -10,8 +10,11 @@ export * from './components/flavor-selector'; export * from './components/region-selector/RegionSelector.component'; export * from './components/region-selector/RegionSummary.component'; export * from './components/region-selector/useRegions'; +export * from './components/tabs-panel/TabsPanel.component'; export * from './hooks'; +export * from './helpers'; export * from './constants'; export * from './components/quantity-selector'; export * from './components/Pricing'; export * from './components/shape-input/ShapeInput.component'; +export * from './translations/storages/containers'; diff --git a/packages/manager/modules/manager-pci-common/src/translations/storages/containers/Messages_de_DE.json b/packages/manager/modules/manager-pci-common/src/translations/storages/containers/Messages_de_DE.json new file mode 100644 index 000000000000..0cde0c05b411 --- /dev/null +++ b/packages/manager/modules/manager-pci-common/src/translations/storages/containers/Messages_de_DE.json @@ -0,0 +1,35 @@ +{ + "pci_projects_project_storages_containers_archive_title": "Cloud Archive", + "pci_projects_project_storages_containers_object_title": "Container", + "pci_projects_project_storages_containers_object_description": "Hosten Sie Ihren Datenkatalog mit unserer Object-Storage-Lösung. Verwalten Sie diese Daten mit Ihrer Anwendung und nutzen Sie dafür S3-APIs.", + "pci_projects_project_storages_containers_name_label": "Name", + "pci_projects_project_storages_containers_region_label": "Standort", + "pci_projects_project_storages_containers_id_label": "ID", + "pci_projects_project_storages_containers_offer_label": "Angebot", + "pci_projects_project_storages_containers_public_label": "Öffentlich", + "pci_projects_project_storages_containers_toggle_public_succeed": "Ihr Container {{name}} wurde in den Status „Public“ versetzt.", + "pci_projects_project_storages_containers_toggle_private_succeed": "Der Status „Public“ wurde für den Container {{name}} deaktiviert.", + "pci_projects_project_storages_containers_toggle_fail": "Ein Fehler ist aufgetreten: {{message}}", + "pci_projects_project_storages_containers_containerType_label": "Typ", + "pci_projects_project_storages_containers_containerType_public": "Öffentlich", + "pci_projects_project_storages_containers_containerType_private": "Privat", + "pci_projects_project_storages_containers_containerType_static": "Statisch", + "pci_projects_project_storages_containers_storedObjects_label": "Objektanzahl", + "pci_projects_project_storages_containers_storedBytes_label": "Speichernutzung", + "pci_projects_project_storages_containers_view_archive_label": "Archive ansehen", + "pci_projects_project_storages_containers_view_object_label": "Objekte ansehen", + "pci_projects_project_storages_containers_view_add_user_label": "Einen Nutzer zu einem Container hinzufügen", + "pci_projects_project_storages_containers_delete_label": "Löschen", + "pci_projects_project_storages_blocks_add_archive_label": "Archivcontainer erstellen", + "pci_projects_project_storages_blocks_add_object_label": "Objektcontainer erstellen", + "pci_projects_project_storages_containers_offer_s3": "S3", + "pci_projects_project_storages_containers_offer_swift": "Swift", + "pci_projects_project_storages_containers_switch_to_private_label": "Zu „Private“ wechseln", + "pci_projects_project_storages_containers_switch_to_public_label": "Zu „Public“ wechseln", + "pci_projects_project_storages_containers_swift_containers_load_error": "Bei einem oder mehreren Ihrer Swift-Container ist ein Fehler aufgetreten. Bitte versuchen Sie es später noch einmal.", + "pci_projects_project_storages_containers_s3_containers_load_error": "Bei einem oder mehreren Ihrer S3-Container in der Region {{ regions }} ist ein Fehler aufgetreten. Bitte versuchen Sie es später noch einmal.", + "pci_projects_project_storages_containers_deployment_mode_label": "Bereitstellungsmodus", + "pci_projects_project_storages_containers_deployment_mode_region": "1-AZ Region", + "pci_projects_project_storages_containers_deployment_mode_region-3-az": "3-AZ Region", + "pci_projects_project_storages_containers_deployment_mode_localzone": "Local Zone" +} diff --git a/packages/manager/modules/manager-pci-common/src/translations/storages/containers/Messages_en_GB.json b/packages/manager/modules/manager-pci-common/src/translations/storages/containers/Messages_en_GB.json new file mode 100644 index 000000000000..9261b022c1f8 --- /dev/null +++ b/packages/manager/modules/manager-pci-common/src/translations/storages/containers/Messages_en_GB.json @@ -0,0 +1,35 @@ +{ + "pci_projects_project_storages_containers_archive_title": "Cloud Archive", + "pci_projects_project_storages_containers_object_title": "Containers", + "pci_projects_project_storages_containers_object_description": "Host your data catalogue in our Object Storage solution. You can manage this data from your application using the S3 APIs.", + "pci_projects_project_storages_containers_name_label": "Name", + "pci_projects_project_storages_containers_region_label": "Region", + "pci_projects_project_storages_containers_id_label": "ID", + "pci_projects_project_storages_containers_offer_label": "Solution ", + "pci_projects_project_storages_containers_public_label": "Public", + "pci_projects_project_storages_containers_toggle_public_succeed": "Your {{name}} container has been switched to Public status.", + "pci_projects_project_storages_containers_toggle_private_succeed": "Public status has been disabled on the {{name}} container.", + "pci_projects_project_storages_containers_toggle_fail": "An error has occurred: {{message}}", + "pci_projects_project_storages_containers_containerType_label": "Type", + "pci_projects_project_storages_containers_containerType_public": "Public", + "pci_projects_project_storages_containers_containerType_private": "Private", + "pci_projects_project_storages_containers_containerType_static": "Static", + "pci_projects_project_storages_containers_storedObjects_label": "Number of objects", + "pci_projects_project_storages_containers_storedBytes_label": "Used space", + "pci_projects_project_storages_containers_view_archive_label": "View archives", + "pci_projects_project_storages_containers_view_object_label": "Display objects", + "pci_projects_project_storages_containers_view_add_user_label": "Add a user to a container", + "pci_projects_project_storages_containers_delete_label": "Delete", + "pci_projects_project_storages_blocks_add_archive_label": "Create an archive container", + "pci_projects_project_storages_blocks_add_object_label": "Create an object container ", + "pci_projects_project_storages_containers_offer_s3": "S3", + "pci_projects_project_storages_containers_offer_swift": "Swift", + "pci_projects_project_storages_containers_switch_to_private_label": "Switch to Private", + "pci_projects_project_storages_containers_switch_to_public_label": "Switch to Public", + "pci_projects_project_storages_containers_swift_containers_load_error": "An error has occurred on one or more of your Swift containers. Please try again later.", + "pci_projects_project_storages_containers_s3_containers_load_error": "An error has occurred on one or more of your S3 containers in the {{regions}} region. Please try again later.", + "pci_projects_project_storages_containers_deployment_mode_label": "Deployment mode", + "pci_projects_project_storages_containers_deployment_mode_region": "1-AZ Region", + "pci_projects_project_storages_containers_deployment_mode_region-3-az": "3-AZ Region", + "pci_projects_project_storages_containers_deployment_mode_localzone": "Local Zone" +} diff --git a/packages/manager/modules/manager-pci-common/src/translations/storages/containers/Messages_es_ES.json b/packages/manager/modules/manager-pci-common/src/translations/storages/containers/Messages_es_ES.json new file mode 100644 index 000000000000..149c1a67151d --- /dev/null +++ b/packages/manager/modules/manager-pci-common/src/translations/storages/containers/Messages_es_ES.json @@ -0,0 +1,35 @@ +{ + "pci_projects_project_storages_containers_archive_title": "Cloud Archive", + "pci_projects_project_storages_containers_object_title": "Contenedores", + "pci_projects_project_storages_containers_object_description": "Aloje su catálogo de datos en nuestra solución Object Storage. Puede administrar estos datos desde su aplicación gracias a las API S3.", + "pci_projects_project_storages_containers_name_label": "Nombre", + "pci_projects_project_storages_containers_region_label": "Localización", + "pci_projects_project_storages_containers_id_label": "ID", + "pci_projects_project_storages_containers_offer_label": "Solución", + "pci_projects_project_storages_containers_public_label": "Público", + "pci_projects_project_storages_containers_toggle_public_succeed": "Su contenedor {{name}} ha cambiado al estado «Público».", + "pci_projects_project_storages_containers_toggle_private_succeed": "Se ha desactivado el estado «Público» del contenedor {{name}}.", + "pci_projects_project_storages_containers_toggle_fail": "Se ha producido un error: {{message}}", + "pci_projects_project_storages_containers_containerType_label": "Tipo", + "pci_projects_project_storages_containers_containerType_public": "Público", + "pci_projects_project_storages_containers_containerType_private": "Privado", + "pci_projects_project_storages_containers_containerType_static": "Estático", + "pci_projects_project_storages_containers_storedObjects_label": "Número de objetos", + "pci_projects_project_storages_containers_storedBytes_label": "Espacio utilizado", + "pci_projects_project_storages_containers_view_archive_label": "Ver los archivos", + "pci_projects_project_storages_containers_view_object_label": "Ver los objetos", + "pci_projects_project_storages_containers_view_add_user_label": "Añadir un usuario a un contenedor", + "pci_projects_project_storages_containers_delete_label": "Eliminar", + "pci_projects_project_storages_blocks_add_archive_label": "Crear un contenedor de archivos", + "pci_projects_project_storages_blocks_add_object_label": "Crear un contenedor de objetos", + "pci_projects_project_storages_containers_offer_s3": "S3", + "pci_projects_project_storages_containers_offer_swift": "Swift", + "pci_projects_project_storages_containers_switch_to_private_label": "Pasar a Privado", + "pci_projects_project_storages_containers_switch_to_public_label": "Pasar a Público", + "pci_projects_project_storages_containers_swift_containers_load_error": "Se ha producido un error en uno o más de sus contenedores Swift. Por favor, vuelva a intentarlo más adelante.", + "pci_projects_project_storages_containers_s3_containers_load_error": "Se ha producido un error en uno o o más de sus contenedores S3 en la región {{ regions }}. Por favor, vuelva a intentarlo más adelante.", + "pci_projects_project_storages_containers_deployment_mode_label": "Modo de implementación", + "pci_projects_project_storages_containers_deployment_mode_region": "Región 1-AZ", + "pci_projects_project_storages_containers_deployment_mode_region-3-az": "Región 3-AZ", + "pci_projects_project_storages_containers_deployment_mode_localzone": "Local Zone" +} diff --git a/packages/manager/modules/manager-pci-common/src/translations/storages/containers/Messages_fr_CA.json b/packages/manager/modules/manager-pci-common/src/translations/storages/containers/Messages_fr_CA.json new file mode 100644 index 000000000000..0f659e8c3f93 --- /dev/null +++ b/packages/manager/modules/manager-pci-common/src/translations/storages/containers/Messages_fr_CA.json @@ -0,0 +1,40 @@ +{ + "pci_projects_project_storages_containers_archive_title": "Cloud Archive", + "pci_projects_project_storages_containers_object_title": "Containers", + "pci_projects_project_storages_containers_object_description": "Hébergez votre catalogue de données dans notre solution Object Storage. Vous pouvez administrer ces données depuis votre application grâce aux API S3.", + "pci_projects_project_storages_containers_name_label": "Nom", + "pci_projects_project_storages_containers_region_label": "Localisation", + "pci_projects_project_storages_containers_id_label": "ID", + + "pci_projects_project_storages_containers_offer_label": "Offre", + "pci_projects_project_storages_containers_public_label": "Public", + "pci_projects_project_storages_containers_toggle_public_succeed": "Votre container {{name}} est passé en statut Public.", + "pci_projects_project_storages_containers_toggle_private_succeed": "Le statut Public a été désactivé sur le container {{name}}.", + "pci_projects_project_storages_containers_toggle_fail": "Une erreur est survenue : {{message}}", + + "pci_projects_project_storages_containers_containerType_label": "Type", + "pci_projects_project_storages_containers_containerType_public": "Public", + "pci_projects_project_storages_containers_containerType_private": "Privé", + "pci_projects_project_storages_containers_containerType_static": "Statique", + + "pci_projects_project_storages_containers_storedObjects_label": "Nombre d'objets", + "pci_projects_project_storages_containers_storedBytes_label": "Espace utilisé", + + "pci_projects_project_storages_containers_view_archive_label": "Voir les archives", + "pci_projects_project_storages_containers_view_object_label": "Voir les objets", + "pci_projects_project_storages_containers_view_add_user_label": "Ajouter un utilisateur à un conteneur", + "pci_projects_project_storages_containers_delete_label": "Supprimer", + + "pci_projects_project_storages_blocks_add_archive_label": "Créer un conteneur d'archive", + "pci_projects_project_storages_blocks_add_object_label": "Créer un conteneur d'objets", + "pci_projects_project_storages_containers_offer_s3": "S3", + "pci_projects_project_storages_containers_offer_swift": "Swift", + "pci_projects_project_storages_containers_switch_to_private_label": "Passer en Privé", + "pci_projects_project_storages_containers_switch_to_public_label": "Passer en Public", + "pci_projects_project_storages_containers_swift_containers_load_error": "Une erreur est survenue sur un ou plusieurs de vos conteneurs Swift. Veuillez réessayer ultérieurement.", + "pci_projects_project_storages_containers_s3_containers_load_error": "Une erreur est survenue sur un ou plusieurs de vos conteneurs S3 dans la région {{ regions }}. Veuillez réessayer ultérieurement.", + "pci_projects_project_storages_containers_deployment_mode_label": "Mode de déploiment", + "pci_projects_project_storages_containers_deployment_mode_region": "Région 1-AZ", + "pci_projects_project_storages_containers_deployment_mode_region-3-az": "Région 3-AZ", + "pci_projects_project_storages_containers_deployment_mode_localzone": "Local Zone" +} diff --git a/packages/manager/modules/manager-pci-common/src/translations/storages/containers/Messages_fr_FR.json b/packages/manager/modules/manager-pci-common/src/translations/storages/containers/Messages_fr_FR.json new file mode 100644 index 000000000000..0f659e8c3f93 --- /dev/null +++ b/packages/manager/modules/manager-pci-common/src/translations/storages/containers/Messages_fr_FR.json @@ -0,0 +1,40 @@ +{ + "pci_projects_project_storages_containers_archive_title": "Cloud Archive", + "pci_projects_project_storages_containers_object_title": "Containers", + "pci_projects_project_storages_containers_object_description": "Hébergez votre catalogue de données dans notre solution Object Storage. Vous pouvez administrer ces données depuis votre application grâce aux API S3.", + "pci_projects_project_storages_containers_name_label": "Nom", + "pci_projects_project_storages_containers_region_label": "Localisation", + "pci_projects_project_storages_containers_id_label": "ID", + + "pci_projects_project_storages_containers_offer_label": "Offre", + "pci_projects_project_storages_containers_public_label": "Public", + "pci_projects_project_storages_containers_toggle_public_succeed": "Votre container {{name}} est passé en statut Public.", + "pci_projects_project_storages_containers_toggle_private_succeed": "Le statut Public a été désactivé sur le container {{name}}.", + "pci_projects_project_storages_containers_toggle_fail": "Une erreur est survenue : {{message}}", + + "pci_projects_project_storages_containers_containerType_label": "Type", + "pci_projects_project_storages_containers_containerType_public": "Public", + "pci_projects_project_storages_containers_containerType_private": "Privé", + "pci_projects_project_storages_containers_containerType_static": "Statique", + + "pci_projects_project_storages_containers_storedObjects_label": "Nombre d'objets", + "pci_projects_project_storages_containers_storedBytes_label": "Espace utilisé", + + "pci_projects_project_storages_containers_view_archive_label": "Voir les archives", + "pci_projects_project_storages_containers_view_object_label": "Voir les objets", + "pci_projects_project_storages_containers_view_add_user_label": "Ajouter un utilisateur à un conteneur", + "pci_projects_project_storages_containers_delete_label": "Supprimer", + + "pci_projects_project_storages_blocks_add_archive_label": "Créer un conteneur d'archive", + "pci_projects_project_storages_blocks_add_object_label": "Créer un conteneur d'objets", + "pci_projects_project_storages_containers_offer_s3": "S3", + "pci_projects_project_storages_containers_offer_swift": "Swift", + "pci_projects_project_storages_containers_switch_to_private_label": "Passer en Privé", + "pci_projects_project_storages_containers_switch_to_public_label": "Passer en Public", + "pci_projects_project_storages_containers_swift_containers_load_error": "Une erreur est survenue sur un ou plusieurs de vos conteneurs Swift. Veuillez réessayer ultérieurement.", + "pci_projects_project_storages_containers_s3_containers_load_error": "Une erreur est survenue sur un ou plusieurs de vos conteneurs S3 dans la région {{ regions }}. Veuillez réessayer ultérieurement.", + "pci_projects_project_storages_containers_deployment_mode_label": "Mode de déploiment", + "pci_projects_project_storages_containers_deployment_mode_region": "Région 1-AZ", + "pci_projects_project_storages_containers_deployment_mode_region-3-az": "Région 3-AZ", + "pci_projects_project_storages_containers_deployment_mode_localzone": "Local Zone" +} diff --git a/packages/manager/modules/manager-pci-common/src/translations/storages/containers/Messages_it_IT.json b/packages/manager/modules/manager-pci-common/src/translations/storages/containers/Messages_it_IT.json new file mode 100644 index 000000000000..ad4dd5d3a6d2 --- /dev/null +++ b/packages/manager/modules/manager-pci-common/src/translations/storages/containers/Messages_it_IT.json @@ -0,0 +1,35 @@ +{ + "pci_projects_project_storages_containers_archive_title": "Cloud Archive", + "pci_projects_project_storages_containers_object_title": "Container", + "pci_projects_project_storages_containers_object_description": "Ospita il tuo catalogo di dati nella nostra soluzione Object Storage. Puoi gestire questi dati dalla tua applicazione con le API S3.", + "pci_projects_project_storages_containers_name_label": "Nome", + "pci_projects_project_storages_containers_region_label": "Localizzazione", + "pci_projects_project_storages_containers_id_label": "ID", + "pci_projects_project_storages_containers_offer_label": "Servizio", + "pci_projects_project_storages_containers_public_label": "Pubblica", + "pci_projects_project_storages_containers_toggle_public_succeed": "Il tuo container {{name}} è passato allo status “Pubblico”.", + "pci_projects_project_storages_containers_toggle_private_succeed": "Lo status “Pubblico” è stato disattivato sul container {{name}}.", + "pci_projects_project_storages_containers_toggle_fail": "Si è verificato un errore: {{message}}", + "pci_projects_project_storages_containers_containerType_label": "Tipo", + "pci_projects_project_storages_containers_containerType_public": "Pubblico", + "pci_projects_project_storages_containers_containerType_private": "Privato", + "pci_projects_project_storages_containers_containerType_static": "Statico", + "pci_projects_project_storages_containers_storedObjects_label": "Numero di oggetti", + "pci_projects_project_storages_containers_storedBytes_label": "Spazio utilizzato", + "pci_projects_project_storages_containers_view_archive_label": "Visualizza gli archivi", + "pci_projects_project_storages_containers_view_object_label": "Visualizza gli oggetti", + "pci_projects_project_storages_containers_view_add_user_label": "Aggiungere un utente a un container", + "pci_projects_project_storages_containers_delete_label": "Elimina", + "pci_projects_project_storages_blocks_add_archive_label": "Crea un container di archivi", + "pci_projects_project_storages_blocks_add_object_label": "Crea un container di oggetti", + "pci_projects_project_storages_containers_offer_s3": "S3", + "pci_projects_project_storages_containers_offer_swift": "Swift", + "pci_projects_project_storages_containers_switch_to_private_label": "Passa a Privato", + "pci_projects_project_storages_containers_switch_to_public_label": "Passa a Public", + "pci_projects_project_storages_containers_swift_containers_load_error": "Si è verificato un errore su uno o più dei tuoi container Swift. Ti preghiamo di riprovare più tardi.", + "pci_projects_project_storages_containers_s3_containers_load_error": "Si è verificato un errore su uno o più dei tuoi container S3 nella Region {{ regions }}. Ti preghiamo di riprovare più tardi.", + "pci_projects_project_storages_containers_deployment_mode_label": "Modalità di deploy", + "pci_projects_project_storages_containers_deployment_mode_region": "Region 1-AZ", + "pci_projects_project_storages_containers_deployment_mode_region-3-az": "Region 3-AZ", + "pci_projects_project_storages_containers_deployment_mode_localzone": "Local Zone" +} diff --git a/packages/manager/modules/manager-pci-common/src/translations/storages/containers/Messages_pl_PL.json b/packages/manager/modules/manager-pci-common/src/translations/storages/containers/Messages_pl_PL.json new file mode 100644 index 000000000000..2edaf35274e5 --- /dev/null +++ b/packages/manager/modules/manager-pci-common/src/translations/storages/containers/Messages_pl_PL.json @@ -0,0 +1,35 @@ +{ + "pci_projects_project_storages_containers_archive_title": "Cloud Archive", + "pci_projects_project_storages_containers_object_title": "Kontenery", + "pci_projects_project_storages_containers_object_description": "Hostuj katalog danych w naszym rozwiązaniu Object Storage. Danymi możesz zarządzać z poziomu swojej aplikacji za pomocą API S3.", + "pci_projects_project_storages_containers_name_label": "Nazwa", + "pci_projects_project_storages_containers_region_label": "Lokalizacja", + "pci_projects_project_storages_containers_id_label": "ID", + "pci_projects_project_storages_containers_offer_label": "Usługa", + "pci_projects_project_storages_containers_public_label": "Publiczny", + "pci_projects_project_storages_containers_toggle_public_succeed": "Status Twojego kontenera {{name}} został zmieniony na Public.", + "pci_projects_project_storages_containers_toggle_private_succeed": "Status Public został wyłączony dla kontenera {{name}}.", + "pci_projects_project_storages_containers_toggle_fail": "Wystąpił błąd: {{message}}", + "pci_projects_project_storages_containers_containerType_label": "Typ", + "pci_projects_project_storages_containers_containerType_public": "Publiczny", + "pci_projects_project_storages_containers_containerType_private": "Prywatny", + "pci_projects_project_storages_containers_containerType_static": "Statyczny", + "pci_projects_project_storages_containers_storedObjects_label": "Liczba obiektów", + "pci_projects_project_storages_containers_storedBytes_label": "Wykorzystana przestrzeń", + "pci_projects_project_storages_containers_view_archive_label": "Wyświetl archiwa", + "pci_projects_project_storages_containers_view_object_label": "Wyświetl obiekty", + "pci_projects_project_storages_containers_view_add_user_label": "Dodaj użytkownika do kontenera", + "pci_projects_project_storages_containers_delete_label": "Usuń", + "pci_projects_project_storages_blocks_add_archive_label": "Utwórz kontener archiwów", + "pci_projects_project_storages_blocks_add_object_label": "Utwórz kontener obiektów", + "pci_projects_project_storages_containers_offer_s3": "S3", + "pci_projects_project_storages_containers_offer_swift": "Swift", + "pci_projects_project_storages_containers_switch_to_private_label": "Przejdź do trybu prywatnego", + "pci_projects_project_storages_containers_switch_to_public_label": "Przejdź do trybu publicznego", + "pci_projects_project_storages_containers_swift_containers_load_error": "Wystąpił błąd na jednym lub kilku kontenerach Swift. Spróbuj ponownie później.", + "pci_projects_project_storages_containers_s3_containers_load_error": "Wystąpił błąd na jednym lub kilku kontenerach S3 w regionie {{regions}}. Spróbuj ponownie później.", + "pci_projects_project_storages_containers_deployment_mode_label": "Tryb wdrażania", + "pci_projects_project_storages_containers_deployment_mode_region": "Region 1-AZ", + "pci_projects_project_storages_containers_deployment_mode_region-3-az": "Region 3-AZ", + "pci_projects_project_storages_containers_deployment_mode_localzone": "Local Zone" +} diff --git a/packages/manager/modules/manager-pci-common/src/translations/storages/containers/Messages_pt_PT.json b/packages/manager/modules/manager-pci-common/src/translations/storages/containers/Messages_pt_PT.json new file mode 100644 index 000000000000..4560e5608c97 --- /dev/null +++ b/packages/manager/modules/manager-pci-common/src/translations/storages/containers/Messages_pt_PT.json @@ -0,0 +1,35 @@ +{ + "pci_projects_project_storages_containers_archive_title": "Cloud Archive", + "pci_projects_project_storages_containers_object_title": "Containers", + "pci_projects_project_storages_containers_object_description": "Aloje o seu catálogo de dados na nossa solução Object Storage. Pode administrar estes dados a partir da sua aplicação graças às API S3.", + "pci_projects_project_storages_containers_name_label": "Nome", + "pci_projects_project_storages_containers_region_label": "Localização", + "pci_projects_project_storages_containers_id_label": "ID", + "pci_projects_project_storages_containers_offer_label": "Oferta", + "pci_projects_project_storages_containers_public_label": "Público", + "pci_projects_project_storages_containers_toggle_public_succeed": "O seu container {{name}} passou para o estado “Público”.", + "pci_projects_project_storages_containers_toggle_private_succeed": "O estado “Público” foi desativado no container {{name}}.", + "pci_projects_project_storages_containers_toggle_fail": "Ocorreu um erro: {{ message }}", + "pci_projects_project_storages_containers_containerType_label": "Tipo", + "pci_projects_project_storages_containers_containerType_public": "Público", + "pci_projects_project_storages_containers_containerType_private": "Privado", + "pci_projects_project_storages_containers_containerType_static": "Estático", + "pci_projects_project_storages_containers_storedObjects_label": "Número de objetos", + "pci_projects_project_storages_containers_storedBytes_label": "Espaço utilizado", + "pci_projects_project_storages_containers_view_archive_label": "Ver os arquivos", + "pci_projects_project_storages_containers_view_object_label": "Ver os objetos", + "pci_projects_project_storages_containers_view_add_user_label": "Adicionar um utilizador a um container", + "pci_projects_project_storages_containers_delete_label": "Eliminar", + "pci_projects_project_storages_blocks_add_archive_label": "Criar um container de arquivos", + "pci_projects_project_storages_blocks_add_object_label": "Criar um container de objetos", + "pci_projects_project_storages_containers_offer_s3": "S3", + "pci_projects_project_storages_containers_offer_swift": "Swift", + "pci_projects_project_storages_containers_switch_to_private_label": "Passar para Privado", + "pci_projects_project_storages_containers_switch_to_public_label": "Passar para Público", + "pci_projects_project_storages_containers_swift_containers_load_error": "Ocorreu um erro num ou vários dos seus containers Swift. Tente novamente mais tarde.", + "pci_projects_project_storages_containers_s3_containers_load_error": "Ocorreu um erro num ou vários dos seus containers S3 na região {{ regions }}. Tente novamente mais tarde.", + "pci_projects_project_storages_containers_deployment_mode_label": "Modo de implementação", + "pci_projects_project_storages_containers_deployment_mode_region": "Região 1-AZ", + "pci_projects_project_storages_containers_deployment_mode_region-3-az": "Região 3-AZ", + "pci_projects_project_storages_containers_deployment_mode_localzone": "Local Zone" +} diff --git a/packages/manager/modules/manager-pci-common/src/translations/storages/containers/index.ts b/packages/manager/modules/manager-pci-common/src/translations/storages/containers/index.ts new file mode 100644 index 000000000000..29227c3d89f3 --- /dev/null +++ b/packages/manager/modules/manager-pci-common/src/translations/storages/containers/index.ts @@ -0,0 +1,27 @@ +import i18next from 'i18next'; + +import de_DE from './Messages_de_DE.json'; +import en_GB from './Messages_en_GB.json'; +import es_ES from './Messages_es_ES.json'; +import fr_CA from './Messages_fr_CA.json'; +import fr_FR from './Messages_fr_FR.json'; +import it_IT from './Messages_it_IT.json'; +import pl_PL from './Messages_pl_PL.json'; +import pt_PT from './Messages_pt_PT.json'; + +function addTranslations() { + i18next.addResources('de_DE', 'pci-storages-containers', de_DE); + i18next.addResources('en_GB', 'pci-storages-containers', en_GB); + i18next.addResources('es_ES', 'pci-storages-containers', es_ES); + i18next.addResources('fr_CA', 'pci-storages-containers', fr_CA); + i18next.addResources('fr_FR', 'pci-storages-containers', fr_FR); + i18next.addResources('it_IT', 'pci-storages-containers', it_IT); + i18next.addResources('pl_PL', 'pci-storages-containers', pl_PL); + i18next.addResources('pt_PT', 'pci-storages-containers', pt_PT); +} + +if (i18next.isInitialized) { + addTranslations(); +} else { + i18next.on('initialized', addTranslations); +}