diff --git a/packages/manager/apps/pci-object-storage/public/translations/containers/bucket-versioning/Messages_de_DE.json b/packages/manager/apps/pci-object-storage/public/translations/containers/bucket-versioning/Messages_de_DE.json new file mode 100644 index 000000000000..72f8f053f7e2 --- /dev/null +++ b/packages/manager/apps/pci-object-storage/public/translations/containers/bucket-versioning/Messages_de_DE.json @@ -0,0 +1,6 @@ +{ + "pci_projects_project_storages_containers_bucket_versioning_title": "Versionsverwaltung", + "pci_projects_project_storages_containers_bucket_versioning_description": "Automatisiert die Erstellung von Objektversionen, um versehentliches Löschen zu vermeiden, oder wenn ein neues Objekt hochgeladen wird.", + "pci_projects_project_storages_containers_bucket_versioning_disabled": "Deaktivieren", + "pci_projects_project_storages_containers_bucket_versioning_enabled": "Aktivieren" +} diff --git a/packages/manager/apps/pci-object-storage/public/translations/containers/bucket-versioning/Messages_en_GB.json b/packages/manager/apps/pci-object-storage/public/translations/containers/bucket-versioning/Messages_en_GB.json new file mode 100644 index 000000000000..74b9c91b02ac --- /dev/null +++ b/packages/manager/apps/pci-object-storage/public/translations/containers/bucket-versioning/Messages_en_GB.json @@ -0,0 +1,6 @@ +{ + "pci_projects_project_storages_containers_bucket_versioning_title": "Versioning", + "pci_projects_project_storages_containers_bucket_versioning_description": "Automatically saves multiple versions of objects to avoid accidental deletion, or when new objects are uploaded.", + "pci_projects_project_storages_containers_bucket_versioning_disabled": "Disable", + "pci_projects_project_storages_containers_bucket_versioning_enabled": "Activate" +} diff --git a/packages/manager/apps/pci-object-storage/public/translations/containers/bucket-versioning/Messages_es_ES.json b/packages/manager/apps/pci-object-storage/public/translations/containers/bucket-versioning/Messages_es_ES.json new file mode 100644 index 000000000000..5bc2081b0e6f --- /dev/null +++ b/packages/manager/apps/pci-object-storage/public/translations/containers/bucket-versioning/Messages_es_ES.json @@ -0,0 +1,6 @@ +{ + "pci_projects_project_storages_containers_bucket_versioning_title": "Control de versiones", + "pci_projects_project_storages_containers_bucket_versioning_description": "Automatiza la creación de versiones de un objeto para subsanar una posible eliminación accidental, o simplemente cuando se carga un nuevo objeto.", + "pci_projects_project_storages_containers_bucket_versioning_disabled": "Desactivar", + "pci_projects_project_storages_containers_bucket_versioning_enabled": "Activar" +} diff --git a/packages/manager/apps/pci-object-storage/public/translations/containers/bucket-versioning/Messages_fr_CA.json b/packages/manager/apps/pci-object-storage/public/translations/containers/bucket-versioning/Messages_fr_CA.json new file mode 100644 index 000000000000..6fc44b3b824a --- /dev/null +++ b/packages/manager/apps/pci-object-storage/public/translations/containers/bucket-versioning/Messages_fr_CA.json @@ -0,0 +1,6 @@ +{ + "pci_projects_project_storages_containers_bucket_versioning_title": "Gestion des versions", + "pci_projects_project_storages_containers_bucket_versioning_description": "Automatise la création de versions d’un objet pour pallier la suppression accidentelle de ce dernier, ou simplement quand un nouvel objet est uploadé.", + "pci_projects_project_storages_containers_bucket_versioning_disabled": "Désactiver", + "pci_projects_project_storages_containers_bucket_versioning_enabled": "Activer" +} diff --git a/packages/manager/apps/pci-object-storage/public/translations/containers/bucket-versioning/Messages_fr_FR.json b/packages/manager/apps/pci-object-storage/public/translations/containers/bucket-versioning/Messages_fr_FR.json new file mode 100644 index 000000000000..6fc44b3b824a --- /dev/null +++ b/packages/manager/apps/pci-object-storage/public/translations/containers/bucket-versioning/Messages_fr_FR.json @@ -0,0 +1,6 @@ +{ + "pci_projects_project_storages_containers_bucket_versioning_title": "Gestion des versions", + "pci_projects_project_storages_containers_bucket_versioning_description": "Automatise la création de versions d’un objet pour pallier la suppression accidentelle de ce dernier, ou simplement quand un nouvel objet est uploadé.", + "pci_projects_project_storages_containers_bucket_versioning_disabled": "Désactiver", + "pci_projects_project_storages_containers_bucket_versioning_enabled": "Activer" +} diff --git a/packages/manager/apps/pci-object-storage/public/translations/containers/bucket-versioning/Messages_it_IT.json b/packages/manager/apps/pci-object-storage/public/translations/containers/bucket-versioning/Messages_it_IT.json new file mode 100644 index 000000000000..ba489fe9eb54 --- /dev/null +++ b/packages/manager/apps/pci-object-storage/public/translations/containers/bucket-versioning/Messages_it_IT.json @@ -0,0 +1,6 @@ +{ + "pci_projects_project_storages_containers_bucket_versioning_title": "Gestione delle versioni", + "pci_projects_project_storages_containers_bucket_versioning_description": "Automatizza la creazione di versioni di un oggetto per evitarne la possibile eliminazione accidentale, o semplicemente quando viene caricato un nuovo oggetto.", + "pci_projects_project_storages_containers_bucket_versioning_disabled": "Disattivare", + "pci_projects_project_storages_containers_bucket_versioning_enabled": "Attivare" +} diff --git a/packages/manager/apps/pci-object-storage/public/translations/containers/bucket-versioning/Messages_pl_PL.json b/packages/manager/apps/pci-object-storage/public/translations/containers/bucket-versioning/Messages_pl_PL.json new file mode 100644 index 000000000000..c8b0d090b58b --- /dev/null +++ b/packages/manager/apps/pci-object-storage/public/translations/containers/bucket-versioning/Messages_pl_PL.json @@ -0,0 +1,6 @@ +{ + "pci_projects_project_storages_containers_bucket_versioning_title": "Zarządzanie wersjami", + "pci_projects_project_storages_containers_bucket_versioning_description": "Automatyzacja tworzenia wersji obiektu zabezpiecza przed przypadkowym usunięciem istniejącego obiektu, ale także uruchamia się za każdym razem, gdy dodawany jest nowy obiekt. ", + "pci_projects_project_storages_containers_bucket_versioning_disabled": "Wyłącz", + "pci_projects_project_storages_containers_bucket_versioning_enabled": "Włącz" +} diff --git a/packages/manager/apps/pci-object-storage/public/translations/containers/bucket-versioning/Messages_pt_PT.json b/packages/manager/apps/pci-object-storage/public/translations/containers/bucket-versioning/Messages_pt_PT.json new file mode 100644 index 000000000000..89ddc646e232 --- /dev/null +++ b/packages/manager/apps/pci-object-storage/public/translations/containers/bucket-versioning/Messages_pt_PT.json @@ -0,0 +1,6 @@ +{ + "pci_projects_project_storages_containers_bucket_versioning_title": "Gestão das versões", + "pci_projects_project_storages_containers_bucket_versioning_description": "Automatiza a criação de versões de um objeto para compensar a eliminação acidental deste último, ou simplesmente quando um novo objeto é alvo de upload.", + "pci_projects_project_storages_containers_bucket_versioning_disabled": "Desativar", + "pci_projects_project_storages_containers_bucket_versioning_enabled": "Ativar" +} diff --git a/packages/manager/apps/pci-object-storage/public/translations/containers/data-encryption/Messages_de_DE.json b/packages/manager/apps/pci-object-storage/public/translations/containers/data-encryption/Messages_de_DE.json new file mode 100644 index 000000000000..6b6bd1970e15 --- /dev/null +++ b/packages/manager/apps/pci-object-storage/public/translations/containers/data-encryption/Messages_de_DE.json @@ -0,0 +1,7 @@ +{ + "pci_projects_project_storages_containers_data_encryption_title": "Datenverschlüsselung", + "pci_projects_project_storages_containers_data_encryption_description": "Die in diesen Container geladenen Daten werden von OVHcloud on the fly verschlüsselt.", + "pci_projects_project_storages_containers_data_encryption_plaintext": "Keine Verschlüsselung", + "pci_projects_project_storages_containers_data_encryption_aes256": "Serverseitige Verschlüsselung mit OVHcloud Managed Keys (SSE-S3)", + "pci_projects_project_storages_containers_data_encryption_aes256_tooltip": "Die OVHcloud Managed Keys werden in Ihrem Namen von einem integrierten OVHcloud Dienst mit dem verstärkten KMS von OVHcloud verwaltet und verwendet." +} diff --git a/packages/manager/apps/pci-object-storage/public/translations/containers/data-encryption/Messages_en_GB.json b/packages/manager/apps/pci-object-storage/public/translations/containers/data-encryption/Messages_en_GB.json new file mode 100644 index 000000000000..9ab285857320 --- /dev/null +++ b/packages/manager/apps/pci-object-storage/public/translations/containers/data-encryption/Messages_en_GB.json @@ -0,0 +1,7 @@ +{ + "pci_projects_project_storages_containers_data_encryption_title": "Encrypt your data", + "pci_projects_project_storages_containers_data_encryption_description": "OVHcloud encrypts the data as it flows into the container.", + "pci_projects_project_storages_containers_data_encryption_plaintext": "No encryption", + "pci_projects_project_storages_containers_data_encryption_aes256": "Server-side encryption with OVHcloud Managed Keys (SSE-S3)", + "pci_projects_project_storages_containers_data_encryption_aes256_tooltip": "OVHcloud Managed Keys are handled and used on your behalf via OVHcloud’s secure KMS-integrated service." +} diff --git a/packages/manager/apps/pci-object-storage/public/translations/containers/data-encryption/Messages_es_ES.json b/packages/manager/apps/pci-object-storage/public/translations/containers/data-encryption/Messages_es_ES.json new file mode 100644 index 000000000000..1b9899e96bab --- /dev/null +++ b/packages/manager/apps/pci-object-storage/public/translations/containers/data-encryption/Messages_es_ES.json @@ -0,0 +1,7 @@ +{ + "pci_projects_project_storages_containers_data_encryption_title": "Cifre sus datos", + "pci_projects_project_storages_containers_data_encryption_description": "Los datos introducidos en este contenedor son cifrados de inmediato por OVHcloud.", + "pci_projects_project_storages_containers_data_encryption_plaintext": "Sin cifrado", + "pci_projects_project_storages_containers_data_encryption_aes256": "Cifrado del lado del servidor con OVHcloud Managed Keys (SSE-S3)", + "pci_projects_project_storages_containers_data_encryption_aes256_tooltip": "Las OVHcloud Managed Keys son gestionadas y utilizadas en su nombre por un servicio de OVHcloud integrado con el KMS reforzado de OVHcloud" +} diff --git a/packages/manager/apps/pci-object-storage/public/translations/containers/data-encryption/Messages_fr_CA.json b/packages/manager/apps/pci-object-storage/public/translations/containers/data-encryption/Messages_fr_CA.json new file mode 100644 index 000000000000..253395dc71a8 --- /dev/null +++ b/packages/manager/apps/pci-object-storage/public/translations/containers/data-encryption/Messages_fr_CA.json @@ -0,0 +1,7 @@ +{ + "pci_projects_project_storages_containers_data_encryption_title": "Chiffrez vos données", + "pci_projects_project_storages_containers_data_encryption_description": "Les données déversées dans ce conteneur sont chiffrées à la volée par OVHcloud.", + "pci_projects_project_storages_containers_data_encryption_plaintext": "Pas de chiffrement", + "pci_projects_project_storages_containers_data_encryption_aes256": "Chiffrement côté serveur avec des OVHcloud Managed Keys (SSE-S3)", + "pci_projects_project_storages_containers_data_encryption_aes256_tooltip": "Les OVHcloud Managed Keys sont gérées et utilisées en votre nom par un service OVHcloud intégré avec le KMS renforcé d'OVHcloud" +} diff --git a/packages/manager/apps/pci-object-storage/public/translations/containers/data-encryption/Messages_fr_FR.json b/packages/manager/apps/pci-object-storage/public/translations/containers/data-encryption/Messages_fr_FR.json new file mode 100644 index 000000000000..253395dc71a8 --- /dev/null +++ b/packages/manager/apps/pci-object-storage/public/translations/containers/data-encryption/Messages_fr_FR.json @@ -0,0 +1,7 @@ +{ + "pci_projects_project_storages_containers_data_encryption_title": "Chiffrez vos données", + "pci_projects_project_storages_containers_data_encryption_description": "Les données déversées dans ce conteneur sont chiffrées à la volée par OVHcloud.", + "pci_projects_project_storages_containers_data_encryption_plaintext": "Pas de chiffrement", + "pci_projects_project_storages_containers_data_encryption_aes256": "Chiffrement côté serveur avec des OVHcloud Managed Keys (SSE-S3)", + "pci_projects_project_storages_containers_data_encryption_aes256_tooltip": "Les OVHcloud Managed Keys sont gérées et utilisées en votre nom par un service OVHcloud intégré avec le KMS renforcé d'OVHcloud" +} diff --git a/packages/manager/apps/pci-object-storage/public/translations/containers/data-encryption/Messages_it_IT.json b/packages/manager/apps/pci-object-storage/public/translations/containers/data-encryption/Messages_it_IT.json new file mode 100644 index 000000000000..99cd5014b7e2 --- /dev/null +++ b/packages/manager/apps/pci-object-storage/public/translations/containers/data-encryption/Messages_it_IT.json @@ -0,0 +1,7 @@ +{ + "pci_projects_project_storages_containers_data_encryption_title": "Cifra i tuoi dati", + "pci_projects_project_storages_containers_data_encryption_description": "I dati inseriti in questo container sono cifrati immediatamente da OVHcloud.", + "pci_projects_project_storages_containers_data_encryption_plaintext": "Senza crittografia", + "pci_projects_project_storages_containers_data_encryption_aes256": "Crittografia lato server con OVHcloud Managed Keys (SSE-S3)", + "pci_projects_project_storages_containers_data_encryption_aes256_tooltip": "Le OVHcloud Managed Keys sono gestite e utilizzate a tuo nome da un servizio OVHcloud integrato con il KMS rafforzato di OVHcloud" +} diff --git a/packages/manager/apps/pci-object-storage/public/translations/containers/data-encryption/Messages_pl_PL.json b/packages/manager/apps/pci-object-storage/public/translations/containers/data-encryption/Messages_pl_PL.json new file mode 100644 index 000000000000..6f479b9a1be2 --- /dev/null +++ b/packages/manager/apps/pci-object-storage/public/translations/containers/data-encryption/Messages_pl_PL.json @@ -0,0 +1,7 @@ +{ + "pci_projects_project_storages_containers_data_encryption_title": "Szyfruj dane", + "pci_projects_project_storages_containers_data_encryption_description": "Dane przesyłane do tego kontenera są szyfrowane w locie przez OVHcloud.", + "pci_projects_project_storages_containers_data_encryption_plaintext": "Bez szyfrowania", + "pci_projects_project_storages_containers_data_encryption_aes256": "Szyfrowanie po stronie serwera za pomocą OVHcloud Managed Keys (SSE-S3)", + "pci_projects_project_storages_containers_data_encryption_aes256_tooltip": "Klucze OVHcloud Managed Keys są zarządzane i używane w Twoim imieniu przez usługę OVHcloud zintegrowaną z ulepszonym KMS od OVHcloud." +} diff --git a/packages/manager/apps/pci-object-storage/public/translations/containers/data-encryption/Messages_pt_PT.json b/packages/manager/apps/pci-object-storage/public/translations/containers/data-encryption/Messages_pt_PT.json new file mode 100644 index 000000000000..e18cdbcdd958 --- /dev/null +++ b/packages/manager/apps/pci-object-storage/public/translations/containers/data-encryption/Messages_pt_PT.json @@ -0,0 +1,7 @@ +{ + "pci_projects_project_storages_containers_data_encryption_title": "Encripte os seus dados", + "pci_projects_project_storages_containers_data_encryption_description": "Os dados introduzidos neste container são encriptados \"on demand\" pela OVHcloud.", + "pci_projects_project_storages_containers_data_encryption_plaintext": "Sem encriptação", + "pci_projects_project_storages_containers_data_encryption_aes256": "Encriptação do servidor com os OVHcloud Managed Keys (SSE-S3)", + "pci_projects_project_storages_containers_data_encryption_aes256_tooltip": "Os OVHcloud Managed Keys são geridos e utilizados em seu nome por um serviço OVHcloud integrado com o KMS reforçado da OVHcloud" +} diff --git a/packages/manager/apps/pci-object-storage/public/translations/containers/translations/Messages_de_DE.json b/packages/manager/apps/pci-object-storage/public/translations/containers/translations/Messages_de_DE.json new file mode 100644 index 000000000000..72f8f053f7e2 --- /dev/null +++ b/packages/manager/apps/pci-object-storage/public/translations/containers/translations/Messages_de_DE.json @@ -0,0 +1,6 @@ +{ + "pci_projects_project_storages_containers_bucket_versioning_title": "Versionsverwaltung", + "pci_projects_project_storages_containers_bucket_versioning_description": "Automatisiert die Erstellung von Objektversionen, um versehentliches Löschen zu vermeiden, oder wenn ein neues Objekt hochgeladen wird.", + "pci_projects_project_storages_containers_bucket_versioning_disabled": "Deaktivieren", + "pci_projects_project_storages_containers_bucket_versioning_enabled": "Aktivieren" +} diff --git a/packages/manager/apps/pci-object-storage/public/translations/containers/translations/Messages_en_GB.json b/packages/manager/apps/pci-object-storage/public/translations/containers/translations/Messages_en_GB.json new file mode 100644 index 000000000000..74b9c91b02ac --- /dev/null +++ b/packages/manager/apps/pci-object-storage/public/translations/containers/translations/Messages_en_GB.json @@ -0,0 +1,6 @@ +{ + "pci_projects_project_storages_containers_bucket_versioning_title": "Versioning", + "pci_projects_project_storages_containers_bucket_versioning_description": "Automatically saves multiple versions of objects to avoid accidental deletion, or when new objects are uploaded.", + "pci_projects_project_storages_containers_bucket_versioning_disabled": "Disable", + "pci_projects_project_storages_containers_bucket_versioning_enabled": "Activate" +} diff --git a/packages/manager/apps/pci-object-storage/public/translations/containers/translations/Messages_es_ES.json b/packages/manager/apps/pci-object-storage/public/translations/containers/translations/Messages_es_ES.json new file mode 100644 index 000000000000..5bc2081b0e6f --- /dev/null +++ b/packages/manager/apps/pci-object-storage/public/translations/containers/translations/Messages_es_ES.json @@ -0,0 +1,6 @@ +{ + "pci_projects_project_storages_containers_bucket_versioning_title": "Control de versiones", + "pci_projects_project_storages_containers_bucket_versioning_description": "Automatiza la creación de versiones de un objeto para subsanar una posible eliminación accidental, o simplemente cuando se carga un nuevo objeto.", + "pci_projects_project_storages_containers_bucket_versioning_disabled": "Desactivar", + "pci_projects_project_storages_containers_bucket_versioning_enabled": "Activar" +} diff --git a/packages/manager/apps/pci-object-storage/public/translations/containers/translations/Messages_fr_CA.json b/packages/manager/apps/pci-object-storage/public/translations/containers/translations/Messages_fr_CA.json new file mode 100644 index 000000000000..6fc44b3b824a --- /dev/null +++ b/packages/manager/apps/pci-object-storage/public/translations/containers/translations/Messages_fr_CA.json @@ -0,0 +1,6 @@ +{ + "pci_projects_project_storages_containers_bucket_versioning_title": "Gestion des versions", + "pci_projects_project_storages_containers_bucket_versioning_description": "Automatise la création de versions d’un objet pour pallier la suppression accidentelle de ce dernier, ou simplement quand un nouvel objet est uploadé.", + "pci_projects_project_storages_containers_bucket_versioning_disabled": "Désactiver", + "pci_projects_project_storages_containers_bucket_versioning_enabled": "Activer" +} diff --git a/packages/manager/apps/pci-object-storage/public/translations/containers/translations/Messages_fr_FR.json b/packages/manager/apps/pci-object-storage/public/translations/containers/translations/Messages_fr_FR.json new file mode 100644 index 000000000000..6fc44b3b824a --- /dev/null +++ b/packages/manager/apps/pci-object-storage/public/translations/containers/translations/Messages_fr_FR.json @@ -0,0 +1,6 @@ +{ + "pci_projects_project_storages_containers_bucket_versioning_title": "Gestion des versions", + "pci_projects_project_storages_containers_bucket_versioning_description": "Automatise la création de versions d’un objet pour pallier la suppression accidentelle de ce dernier, ou simplement quand un nouvel objet est uploadé.", + "pci_projects_project_storages_containers_bucket_versioning_disabled": "Désactiver", + "pci_projects_project_storages_containers_bucket_versioning_enabled": "Activer" +} diff --git a/packages/manager/apps/pci-object-storage/public/translations/containers/translations/Messages_it_IT.json b/packages/manager/apps/pci-object-storage/public/translations/containers/translations/Messages_it_IT.json new file mode 100644 index 000000000000..ba489fe9eb54 --- /dev/null +++ b/packages/manager/apps/pci-object-storage/public/translations/containers/translations/Messages_it_IT.json @@ -0,0 +1,6 @@ +{ + "pci_projects_project_storages_containers_bucket_versioning_title": "Gestione delle versioni", + "pci_projects_project_storages_containers_bucket_versioning_description": "Automatizza la creazione di versioni di un oggetto per evitarne la possibile eliminazione accidentale, o semplicemente quando viene caricato un nuovo oggetto.", + "pci_projects_project_storages_containers_bucket_versioning_disabled": "Disattivare", + "pci_projects_project_storages_containers_bucket_versioning_enabled": "Attivare" +} diff --git a/packages/manager/apps/pci-object-storage/public/translations/containers/translations/Messages_pl_PL.json b/packages/manager/apps/pci-object-storage/public/translations/containers/translations/Messages_pl_PL.json new file mode 100644 index 000000000000..c8b0d090b58b --- /dev/null +++ b/packages/manager/apps/pci-object-storage/public/translations/containers/translations/Messages_pl_PL.json @@ -0,0 +1,6 @@ +{ + "pci_projects_project_storages_containers_bucket_versioning_title": "Zarządzanie wersjami", + "pci_projects_project_storages_containers_bucket_versioning_description": "Automatyzacja tworzenia wersji obiektu zabezpiecza przed przypadkowym usunięciem istniejącego obiektu, ale także uruchamia się za każdym razem, gdy dodawany jest nowy obiekt. ", + "pci_projects_project_storages_containers_bucket_versioning_disabled": "Wyłącz", + "pci_projects_project_storages_containers_bucket_versioning_enabled": "Włącz" +} diff --git a/packages/manager/apps/pci-object-storage/public/translations/containers/translations/Messages_pt_PT.json b/packages/manager/apps/pci-object-storage/public/translations/containers/translations/Messages_pt_PT.json new file mode 100644 index 000000000000..89ddc646e232 --- /dev/null +++ b/packages/manager/apps/pci-object-storage/public/translations/containers/translations/Messages_pt_PT.json @@ -0,0 +1,6 @@ +{ + "pci_projects_project_storages_containers_bucket_versioning_title": "Gestão das versões", + "pci_projects_project_storages_containers_bucket_versioning_description": "Automatiza a criação de versões de um objeto para compensar a eliminação acidental deste último, ou simplesmente quando um novo objeto é alvo de upload.", + "pci_projects_project_storages_containers_bucket_versioning_disabled": "Desativar", + "pci_projects_project_storages_containers_bucket_versioning_enabled": "Ativar" +} diff --git a/packages/manager/apps/pci-object-storage/public/translations/regions/Messages_de_DE.json b/packages/manager/apps/pci-object-storage/public/translations/regions/Messages_de_DE.json new file mode 100644 index 000000000000..36d6844179b8 --- /dev/null +++ b/packages/manager/apps/pci-object-storage/public/translations/regions/Messages_de_DE.json @@ -0,0 +1,7 @@ +{ + "pci_project_regions_list_continent_all": "Alle Standorte", + "pci_project_regions_list_empty": "Kein Standort verfügbar", + "pci_project_regions_list_add": "Bitte aktivieren Sie die letzten Standorte jeder Zone im Bereich Standorte.", + "pci_project_regions_list_region": "Standort", + "pci_project_regions_list_quota": "Mein Quota erhöhen" +} diff --git a/packages/manager/apps/pci-object-storage/public/translations/regions/Messages_en_GB.json b/packages/manager/apps/pci-object-storage/public/translations/regions/Messages_en_GB.json new file mode 100644 index 000000000000..cdbd9524a4b3 --- /dev/null +++ b/packages/manager/apps/pci-object-storage/public/translations/regions/Messages_en_GB.json @@ -0,0 +1,7 @@ +{ + "pci_project_regions_list_continent_all": "All locations", + "pci_project_regions_list_empty": "No locations are available", + "pci_project_regions_list_add": "Please activate the latest locations in each zone in the Locations section", + "pci_project_regions_list_region": "Location", + "pci_project_regions_list_quota": "Increase your quota" +} diff --git a/packages/manager/apps/pci-object-storage/public/translations/regions/Messages_es_ES.json b/packages/manager/apps/pci-object-storage/public/translations/regions/Messages_es_ES.json new file mode 100644 index 000000000000..148495c3a517 --- /dev/null +++ b/packages/manager/apps/pci-object-storage/public/translations/regions/Messages_es_ES.json @@ -0,0 +1,7 @@ +{ + "pci_project_regions_list_continent_all": "Todas las localizaciones", + "pci_project_regions_list_empty": "No hay localizaciones disponibles.", + "pci_project_regions_list_add": "Por favor, active las últimas localizaciones de cada zona en la sección Localizaciones.", + "pci_project_regions_list_region": "Localización", + "pci_project_regions_list_quota": "Aumentar los límites de mi cuota" +} diff --git a/packages/manager/apps/pci-object-storage/public/translations/regions/Messages_fr_CA.json b/packages/manager/apps/pci-object-storage/public/translations/regions/Messages_fr_CA.json new file mode 100644 index 000000000000..917f9a4f479f --- /dev/null +++ b/packages/manager/apps/pci-object-storage/public/translations/regions/Messages_fr_CA.json @@ -0,0 +1,7 @@ +{ + "pci_project_regions_list_continent_all": "Toutes les localisations", + "pci_project_regions_list_empty": "Aucune localisation n'est disponible", + "pci_project_regions_list_add": "Nous vous invitons à activer les dernières localisations de chaque zone dans la partie Localisations", + "pci_project_regions_list_region": "Localisation", + "pci_project_regions_list_quota": "Augmenter mon quota" +} diff --git a/packages/manager/apps/pci-object-storage/public/translations/regions/Messages_fr_FR.json b/packages/manager/apps/pci-object-storage/public/translations/regions/Messages_fr_FR.json new file mode 100644 index 000000000000..917f9a4f479f --- /dev/null +++ b/packages/manager/apps/pci-object-storage/public/translations/regions/Messages_fr_FR.json @@ -0,0 +1,7 @@ +{ + "pci_project_regions_list_continent_all": "Toutes les localisations", + "pci_project_regions_list_empty": "Aucune localisation n'est disponible", + "pci_project_regions_list_add": "Nous vous invitons à activer les dernières localisations de chaque zone dans la partie Localisations", + "pci_project_regions_list_region": "Localisation", + "pci_project_regions_list_quota": "Augmenter mon quota" +} diff --git a/packages/manager/apps/pci-object-storage/public/translations/regions/Messages_it_IT.json b/packages/manager/apps/pci-object-storage/public/translations/regions/Messages_it_IT.json new file mode 100644 index 000000000000..07888b4a7268 --- /dev/null +++ b/packages/manager/apps/pci-object-storage/public/translations/regions/Messages_it_IT.json @@ -0,0 +1,7 @@ +{ + "pci_project_regions_list_continent_all": "Tutte le Region", + "pci_project_regions_list_empty": "Nessuna Region disponibile", + "pci_project_regions_list_add": "Per attivare le ultime localizzazioni disponibili in ogni zona, accedi alla sezione Localizzazioni", + "pci_project_regions_list_region": "Localizzazione", + "pci_project_regions_list_quota": "Aumenta la tua quota" +} diff --git a/packages/manager/apps/pci-object-storage/public/translations/regions/Messages_pl_PL.json b/packages/manager/apps/pci-object-storage/public/translations/regions/Messages_pl_PL.json new file mode 100644 index 000000000000..c97352642e0d --- /dev/null +++ b/packages/manager/apps/pci-object-storage/public/translations/regions/Messages_pl_PL.json @@ -0,0 +1,7 @@ +{ + "pci_project_regions_list_continent_all": "Wszystkie lokalizacje", + "pci_project_regions_list_empty": "Żadna z lokalizacji nie jest dostępna", + "pci_project_regions_list_add": "Włącz najnowsze lokalizacje każdej strefy w sekcji Lokalizacje", + "pci_project_regions_list_region": "Lokalizacja", + "pci_project_regions_list_quota": "Zwiększ limit" +} diff --git a/packages/manager/apps/pci-object-storage/public/translations/regions/Messages_pt_PT.json b/packages/manager/apps/pci-object-storage/public/translations/regions/Messages_pt_PT.json new file mode 100644 index 000000000000..ede04f6e2975 --- /dev/null +++ b/packages/manager/apps/pci-object-storage/public/translations/regions/Messages_pt_PT.json @@ -0,0 +1,7 @@ +{ + "pci_project_regions_list_continent_all": "Todas as localizações", + "pci_project_regions_list_empty": "Nenhuma localização disponível", + "pci_project_regions_list_add": "Pode ativar as últimas localizações de cada zona na secção Localizações", + "pci_project_regions_list_region": "Localização", + "pci_project_regions_list_quota": "Aumentar o meu limite" +} diff --git a/packages/manager/apps/pci-object-storage/src/constants.ts b/packages/manager/apps/pci-object-storage/src/constants.ts index 271149c31fb7..026803f21305 100644 --- a/packages/manager/apps/pci-object-storage/src/constants.ts +++ b/packages/manager/apps/pci-object-storage/src/constants.ts @@ -195,6 +195,7 @@ export const PLAN_CODES = { }; export const STORAGE_STANDARD_PLANCODE = 'storage-standard.consumption'; +export const STORAGE_STANDARD_REGION_PLANCODE = 'storage-standard'; export const OBJECT_CONTAINER_OFFERS = [ OBJECT_CONTAINER_OFFER_STORAGE_STANDARD, diff --git a/packages/manager/apps/pci-object-storage/src/pages/objects/container/new/New.page.tsx b/packages/manager/apps/pci-object-storage/src/pages/objects/container/new/New.page.tsx index 363289f6f8fa..82cf5dff0211 100644 --- a/packages/manager/apps/pci-object-storage/src/pages/objects/container/new/New.page.tsx +++ b/packages/manager/apps/pci-object-storage/src/pages/objects/container/new/New.page.tsx @@ -18,12 +18,20 @@ import { useTranslation } from 'react-i18next'; import { useContext } from 'react'; import { ShellContext } from '@ovh-ux/manager-react-shell-client'; import { + OBJECT_CONTAINER_MODE_LOCAL_ZONE, OBJECT_CONTAINER_OFFER_STORAGE_STANDARD, + OBJECT_CONTAINER_OFFER_SWIFT, STORAGE_PRICES_LINK, } from '@/constants'; import { SolutionStepComponent } from './step/SolutionStep.component'; import { DeploymentModeStep } from './step/DeploymentModeStep.component'; import { useContainerCreationStore } from './useContainerCreationStore'; +import { RegionStep } from './step/RegionStep.component'; +import { ContainerType } from './step/ContainerTypeStep.component'; +import { ContainerNameStep } from './step/ContainerNameStep.component'; +import { LinkUserStep } from './step/LinkUserStep.component'; +import { VersioningStep } from './step/VersioningStep.component'; +import { EncryptionStep } from './step/EncryptionStep.component'; export default function ContainerNewPage() { const { t } = useTranslation('containers/add'); @@ -89,6 +97,17 @@ export default function ContainerNewPage() { {form.offer === OBJECT_CONTAINER_OFFER_STORAGE_STANDARD && ( )} + + {form.offer === OBJECT_CONTAINER_OFFER_SWIFT && } + {form.offer === OBJECT_CONTAINER_OFFER_STORAGE_STANDARD && + form.deploymentMode !== OBJECT_CONTAINER_MODE_LOCAL_ZONE && ( + <> + + + + + )} + ); diff --git a/packages/manager/apps/pci-object-storage/src/pages/objects/container/new/step/ContainerNameStep.component.tsx b/packages/manager/apps/pci-object-storage/src/pages/objects/container/new/step/ContainerNameStep.component.tsx new file mode 100644 index 000000000000..dac55e61ce7d --- /dev/null +++ b/packages/manager/apps/pci-object-storage/src/pages/objects/container/new/step/ContainerNameStep.component.tsx @@ -0,0 +1,44 @@ +import { useTranslation } from 'react-i18next'; +import { StepComponent } from '@ovh-ux/manager-react-components'; +import { useContainerCreationStore } from '../useContainerCreationStore'; +import { + OBJECT_CONTAINER_MODE_LOCAL_ZONE, + OBJECT_CONTAINER_OFFER_STORAGE_STANDARD, + OBJECT_CONTAINER_OFFER_SWIFT, +} from '@/constants'; + +export function ContainerNameStep() { + const { t } = useTranslation(['containers/add', 'pci-common']); + const { + form, + stepper, + submitContainerName, + editContainerName, + } = useContainerCreationStore(); + return ( + + TODO container name + + ); +} diff --git a/packages/manager/apps/pci-object-storage/src/pages/objects/container/new/step/ContainerRegionSelector.component.tsx b/packages/manager/apps/pci-object-storage/src/pages/objects/container/new/step/ContainerRegionSelector.component.tsx new file mode 100644 index 000000000000..e35f977cfa2a --- /dev/null +++ b/packages/manager/apps/pci-object-storage/src/pages/objects/container/new/step/ContainerRegionSelector.component.tsx @@ -0,0 +1,155 @@ +import { useMemo } from 'react'; +import { useParams } from 'react-router-dom'; +import { useTranslatedMicroRegions } from '@ovh-ux/manager-react-components'; +import { useTranslation } from 'react-i18next'; +import { + ShapesInputComponent, + TRegion, + TRegionAvailability, + TileChoice, + useProductAvailability, +} from '@ovh-ux/manager-pci-common'; +import { + OsdsMessage, + OsdsSpinner, + OsdsText, +} from '@ovhcloud/ods-components/react'; +import { + ODS_MESSAGE_TYPE, + ODS_TEXT_LEVEL, + ODS_TEXT_SIZE, +} from '@ovhcloud/ods-components'; +import { ODS_THEME_COLOR_INTENT } from '@ovhcloud/ods-common-theming'; + +import { STORAGE_STANDARD_REGION_PLANCODE } from '@/constants'; +import { RegionLabel } from './RegionLabel.component'; + +interface RegionSelectorProps { + deploymentMode: string; + region: TRegionAvailability; + onSelectRegion: (region: TRegionAvailability) => void; + isSubmitted: boolean; +} + +export function ContainerRegionSelector({ + deploymentMode, + region, + onSelectRegion, + isSubmitted, +}: Readonly) { + const { t } = useTranslation(['containers/add', 'pci-common', 'regions']); + const { projectId } = useParams(); + + const { data: availability, isPending } = useProductAvailability(projectId); + const { + translateContinentRegion, + translateMacroRegion, + translateMicroRegion, + } = useTranslatedMicroRegions(); + + const allowedRegions = useMemo(() => { + const allRegions = availability?.plans + ?.filter(({ code }) => code.startsWith(STORAGE_STANDARD_REGION_PLANCODE)) + .reduce((acc, { regions }) => [...acc, ...regions], []); + + const uniqueRegions = [ + ...new Set(allRegions?.map(({ name }) => name)), + ].map((regionName) => allRegions?.find(({ name }) => name === regionName)); + + return uniqueRegions + .filter(({ type }) => type === deploymentMode) + .map((reg) => ({ + ...reg, + microName: translateMicroRegion(reg.name), + macroName: translateMacroRegion(reg.name), + continentName: translateContinentRegion(reg.name), + })); + }, [availability, deploymentMode]); + + return ( + <> + {isPending && } + {!isPending && !isSubmitted && ( + + items={allowedRegions} + onInput={(reg) => + onSelectRegion( + allowedRegions.find(({ name }) => name === reg?.name), + ) + } + value={allowedRegions.find(({ name }) => name === region?.name)} + columnsCount={3} + item={{ + getId: (item) => item.name, + LabelComponent: ({ item, isItemSelected }) => ( + + ), + }} + stack={{ + by: (item) => item?.macroName || '', + LabelComponent: ({ stackKey, isStackSelected }) => ( + + ), + }} + group={{ + by: (item) => item.continentName, + LabelComponent: ({ groupName, isMobile, isGroupSelected }) => ( +
+ + {groupName || + t('regions:pci_project_regions_list_continent_all')} + +
+ ), + }} + isMobile={false} + /> + )} + {region && !region.enabled && ( + + {t( + 'pci_projects_project_storages_containers_add_add_region_activate', + )} + + )} + {!isPending && isSubmitted && ( +
    +
  • + + name === region?.name) + ?.microName + } + /> + +
  • +
+ )} + + ); +} diff --git a/packages/manager/apps/pci-object-storage/src/pages/objects/container/new/step/ContainerTypeStep.component.tsx b/packages/manager/apps/pci-object-storage/src/pages/objects/container/new/step/ContainerTypeStep.component.tsx new file mode 100644 index 000000000000..4b4e08f86005 --- /dev/null +++ b/packages/manager/apps/pci-object-storage/src/pages/objects/container/new/step/ContainerTypeStep.component.tsx @@ -0,0 +1,32 @@ +import { useTranslation } from 'react-i18next'; +import { StepComponent } from '@ovh-ux/manager-react-components'; +import { useContainerCreationStore } from '../useContainerCreationStore'; + +export function ContainerType() { + const { t } = useTranslation(['containers/add', 'pci-common']); + const { + stepper, + submitContainerType, + editContainerType, + } = useContainerCreationStore(); + return ( + + TODO container type + + ); +} diff --git a/packages/manager/apps/pci-object-storage/src/pages/objects/container/new/step/EncryptionStep.component.tsx b/packages/manager/apps/pci-object-storage/src/pages/objects/container/new/step/EncryptionStep.component.tsx new file mode 100644 index 000000000000..63b80b9db2a1 --- /dev/null +++ b/packages/manager/apps/pci-object-storage/src/pages/objects/container/new/step/EncryptionStep.component.tsx @@ -0,0 +1,34 @@ +import { useTranslation } from 'react-i18next'; +import { StepComponent } from '@ovh-ux/manager-react-components'; +import { useContainerCreationStore } from '../useContainerCreationStore'; + +export function EncryptionStep() { + const { t } = useTranslation(['containers/data-encryption', 'pci-common']); + const { + stepper, + submitEncryption, + editEncryption, + } = useContainerCreationStore(); + return ( + + TODO encryption + + ); +} diff --git a/packages/manager/apps/pci-object-storage/src/pages/objects/container/new/step/LinkUserStep.component.tsx b/packages/manager/apps/pci-object-storage/src/pages/objects/container/new/step/LinkUserStep.component.tsx new file mode 100644 index 000000000000..54c43a3d2592 --- /dev/null +++ b/packages/manager/apps/pci-object-storage/src/pages/objects/container/new/step/LinkUserStep.component.tsx @@ -0,0 +1,30 @@ +import { useTranslation } from 'react-i18next'; +import { StepComponent } from '@ovh-ux/manager-react-components'; +import { useContainerCreationStore } from '../useContainerCreationStore'; + +export function LinkUserStep() { + const { t } = useTranslation(['containers/add', 'pci-common']); + const { stepper, editUser, submitUser } = useContainerCreationStore(); + return ( + + TODO container name + + ); +} diff --git a/packages/manager/apps/pci-object-storage/src/pages/objects/container/new/step/RegionLabel.component.tsx b/packages/manager/apps/pci-object-storage/src/pages/objects/container/new/step/RegionLabel.component.tsx new file mode 100644 index 000000000000..0843166c6c2e --- /dev/null +++ b/packages/manager/apps/pci-object-storage/src/pages/objects/container/new/step/RegionLabel.component.tsx @@ -0,0 +1,22 @@ +import { ODS_TEXT_LEVEL, ODS_TEXT_SIZE } from '@ovhcloud/ods-components'; +import { OsdsText } from '@ovhcloud/ods-components/react'; +import { ODS_THEME_COLOR_INTENT } from '@ovhcloud/ods-common-theming'; + +interface RegionLabelProps { + label: string; + isSelected?: boolean; +} + +export function RegionLabel({ label, isSelected }: Readonly) { + return ( +
+ + {label} + +
+ ); +} diff --git a/packages/manager/apps/pci-object-storage/src/pages/objects/container/new/step/RegionStep.component.tsx b/packages/manager/apps/pci-object-storage/src/pages/objects/container/new/step/RegionStep.component.tsx new file mode 100644 index 000000000000..d6188a4244fe --- /dev/null +++ b/packages/manager/apps/pci-object-storage/src/pages/objects/container/new/step/RegionStep.component.tsx @@ -0,0 +1,124 @@ +import { useContext, useEffect, useState } from 'react'; +import { usePrevious } from 'react-use'; +import { ShellContext } from '@ovh-ux/manager-react-shell-client'; +import { + NotificationType, + StepComponent, +} from '@ovh-ux/manager-react-components'; +import { useTranslation } from 'react-i18next'; +import { OsdsMessage, OsdsSpinner } from '@ovhcloud/ods-components/react'; +import { + useAddProjectRegion, + useRefreshProductAvailability, +} from '@ovh-ux/manager-pci-common'; +import { useParams } from 'react-router-dom'; +import { ODS_MESSAGE_TYPE } from '@ovhcloud/ods-components'; +import { ODS_THEME_COLOR_INTENT } from '@ovhcloud/ods-common-theming'; +import { ApiError } from '@ovh-ux/manager-core-api'; + +import { useContainerCreationStore } from '../useContainerCreationStore'; +import { OBJECT_CONTAINER_OFFER_SWIFT } from '@/constants'; +import { ContainerRegionSelector } from './ContainerRegionSelector.component'; + +export function RegionStep() { + const { t } = useTranslation(['containers/add', 'pci-common', 'regions']); + const context = useContext(ShellContext); + const { ovhSubsidiary } = context.environment.getUser(); + const { + form, + stepper, + setRegion, + editRegion, + submitRegion, + } = useContainerCreationStore(); + const [addRegionMessage, setAddRegionMessage] = useState(); + const { projectId } = useParams(); + const { refresh } = useRefreshProductAvailability(projectId, ovhSubsidiary); + const { addRegion, isPending } = useAddProjectRegion({ + projectId, + onSuccess: () => { + refresh(); + setRegion({ + ...form.region, + enabled: true, + }); + submitRegion(); + setAddRegionMessage( + + {t( + 'pci_projects_project_storages_containers_add_add_region_success', + { + code: form.region.name, + }, + )} + , + ); + }, + onError: (error: ApiError) => { + setAddRegionMessage( + + {t('pci_projects_project_storages_containers_add_add_region_error', { + message: error?.response?.data?.message || error?.message || null, + requestId: error?.config?.headers['X-OVH-MANAGER-REQUEST-ID'], + })} + , + ); + }, + }); + + const submitRegionHandler = () => { + if (!form.region.enabled) { + addRegion(form.region.name); + } else { + submitRegion(); + } + }; + + const wasLocked = usePrevious(stepper.region.isLocked); + useEffect(() => { + const { isLocked } = stepper.region; + if (wasLocked === true && isLocked === false) { + setAddRegionMessage(undefined); + } + }, [stepper.region.isLocked]); + + return ( + + <> + {isPending && } + {!isPending && ( + + )} + {addRegionMessage} + + + ); +} diff --git a/packages/manager/apps/pci-object-storage/src/pages/objects/container/new/step/VersioningStep.component.tsx b/packages/manager/apps/pci-object-storage/src/pages/objects/container/new/step/VersioningStep.component.tsx new file mode 100644 index 000000000000..ea92aa292275 --- /dev/null +++ b/packages/manager/apps/pci-object-storage/src/pages/objects/container/new/step/VersioningStep.component.tsx @@ -0,0 +1,34 @@ +import { useTranslation } from 'react-i18next'; +import { StepComponent } from '@ovh-ux/manager-react-components'; +import { useContainerCreationStore } from '../useContainerCreationStore'; + +export function VersioningStep() { + const { t } = useTranslation(['containers/bucket-versioning', 'pci-common']); + const { + stepper, + submitVersioning, + editVersioning, + } = useContainerCreationStore(); + return ( + + TODO versioning + + ); +} diff --git a/packages/manager/apps/pci-object-storage/src/pages/objects/container/new/useContainerCreationStore.ts b/packages/manager/apps/pci-object-storage/src/pages/objects/container/new/useContainerCreationStore.ts index 6f019acdbe63..3df6772ec40a 100644 --- a/packages/manager/apps/pci-object-storage/src/pages/objects/container/new/useContainerCreationStore.ts +++ b/packages/manager/apps/pci-object-storage/src/pages/objects/container/new/useContainerCreationStore.ts @@ -1,9 +1,20 @@ import { create } from 'zustand'; -import { OBJECT_CONTAINER_OFFER_STORAGE_STANDARD } from '@/constants'; +import { TRegionAvailability } from '@ovh-ux/manager-pci-common'; +import { + OBJECT_CONTAINER_MODE_LOCAL_ZONE, + OBJECT_CONTAINER_OFFER_STORAGE_STANDARD, + OBJECT_CONTAINER_OFFER_SWIFT, +} from '@/constants'; export interface ContainerCreationForn { offer: string; deploymentMode: string; + region: TRegionAvailability; + user: string; + versioning: boolean; + encryption: boolean; + containerName: string; + containerType: string; } export interface StepState { @@ -17,99 +28,277 @@ export interface ContainerStore { stepper: { offer: StepState; deployment: StepState; + region: StepState; + user: StepState; + versioning: StepState; + encryption: StepState; + containerName: StepState; + containerType: StepState; }; + setOffer: (offer: string) => void; - setDeploymentMode: (mode: string) => void; editOffer: () => void; submitOffer: () => void; + + setDeploymentMode: (mode: string) => void; editDeploymentMode: () => void; submitDeploymentMode: () => void; -} -export const useContainerCreationStore = create()((set) => { - /** Unlock and open the 'toEdit' step, closes the other 'toClose' steps and reset their form values */ - const editStep = (toEdit: string, toClose: string[]) => { - set((state) => ({ - stepper: { - ...state.stepper, - [toEdit]: { - isOpen: true, - isLocked: false, - isChecked: false, - }, - ...toClose.reduce( - (acc, key) => ({ - ...acc, - [key]: { - isOpen: false, - isLocked: false, - isChecked: false, - }, - }), - {}, - ), - }, - form: { - ...state.form, - ...toClose.reduce( - (acc, key) => ({ - ...acc, - [key]: undefined, - }), - {}, - ), - }, - })); - }; + setRegion: (region: TRegionAvailability) => void; + editRegion: () => void; + submitRegion: () => void; - /** Submit and close the 'toSubmit' step, open and unlock to next step */ - const submitStep = (toSubmit: string, nextState: string) => { - set((state) => ({ - stepper: { - ...state.stepper, - [toSubmit]: { - isOpen: false, - isChecked: true, - isLocked: true, - }, - [nextState]: { - isOpen: true, - isChecked: false, - isLocked: false, - }, - }, - })); - }; + setUser: (user: string) => void; + editUser: () => void; + submitUser: () => void; + + setVersioning: (versioning: boolean) => void; + editVersioning: () => void; + submitVersioning: () => void; + + setEncryption: (encryption: boolean) => void; + editEncryption: () => void; + submitEncryption: () => void; + + setContainerName: (name: string) => void; + editContainerName: () => void; + submitContainerName: () => void; + + setContainerType: (type: string) => void; + editContainerType: () => void; + submitContainerType: () => void; +} - return { - // initial form state - form: { - offer: OBJECT_CONTAINER_OFFER_STORAGE_STANDARD, - deploymentMode: undefined, - }, - // initial stepper state - stepper: { - offer: { isOpen: true }, - deployment: {}, - }, - setOffer: (offer: string) => +export const useContainerCreationStore = create()( + (set, get) => { + /** Unlock and open the 'toEdit' step, closes the other 'toClose' steps and reset their form values */ + const editStep = (toEdit: string, toClose: string[]) => { set((state) => ({ + stepper: { + ...state.stepper, + [toEdit]: { + isOpen: true, + isLocked: false, + isChecked: false, + }, + ...toClose.reduce( + (acc, key) => ({ + ...acc, + [key]: { + isOpen: false, + isLocked: false, + isChecked: false, + }, + }), + {}, + ), + }, form: { ...state.form, - offer, - deploymentMode: undefined, + ...toClose.reduce( + (acc, key) => ({ + ...acc, + [key]: undefined, + }), + {}, + ), }, - })), - submitOffer: () => submitStep('offer', 'deployment'), - editOffer: () => editStep('offer', ['deployment']), - setDeploymentMode: (deploymentMode: string) => + })); + }; + + /** Submit and close the 'toSubmit' step, open and unlock to next step */ + const submitStep = (toSubmit: string, nextState: string) => { set((state) => ({ - form: { - ...state.form, - deploymentMode, + stepper: { + ...state.stepper, + [toSubmit]: { + isOpen: false, + isChecked: true, + isLocked: true, + }, + [nextState]: { + isOpen: true, + isChecked: false, + isLocked: false, + }, }, - })), - submitDeploymentMode: () => submitStep('deployment', 'region'), - editDeploymentMode: () => editStep('deployment', []), - }; -}); + })); + }; + + return { + // initial form state + form: { + offer: OBJECT_CONTAINER_OFFER_STORAGE_STANDARD, + deploymentMode: undefined, + region: undefined, + user: undefined, + versioning: false, + encryption: false, + containerName: '', + containerType: undefined, + }, + + // initial stepper state + stepper: { + offer: { isOpen: true }, + deployment: {}, + region: {}, + user: {}, + versioning: {}, + encryption: {}, + containerName: {}, + containerType: {}, + }, + + setOffer: (offer: string) => + set((state) => ({ + form: { + ...state.form, + offer, + deploymentMode: undefined, + region: undefined, + user: undefined, + versioning: false, + encryption: false, + containerName: '', + containerType: undefined, + }, + })), + submitOffer: () => + submitStep( + 'offer', + get().form.offer === OBJECT_CONTAINER_OFFER_SWIFT + ? 'region' + : 'deployment', + ), + editOffer: () => + editStep('offer', [ + 'deployment', + 'region', + 'user', + 'versioning', + 'encryption', + 'containerName', + ]), + + setDeploymentMode: (deploymentMode: string) => + set((state) => ({ + form: { + ...state.form, + deploymentMode, + region: undefined, + user: undefined, + versioning: false, + encryption: false, + containerName: '', + containerType: undefined, + }, + })), + submitDeploymentMode: () => submitStep('deployment', 'region'), + editDeploymentMode: () => + editStep('deployment', [ + 'region', + 'user', + 'versioning', + 'encryption', + 'containerName', + ]), + + setRegion: (region: TRegionAvailability) => + set((state) => ({ + form: { + ...state.form, + region, + user: undefined, + versioning: false, + encryption: false, + containerName: '', + containerType: undefined, + }, + })), + submitRegion: () => { + const { form } = get(); + if (form.offer === OBJECT_CONTAINER_OFFER_SWIFT) { + submitStep('region', 'containerType'); + } else if (form.deploymentMode === OBJECT_CONTAINER_MODE_LOCAL_ZONE) { + submitStep('region', 'containerName'); + } else { + submitStep('region', 'user'); + } + }, + editRegion: () => + editStep('region', [ + 'user', + 'versioning', + 'encryption', + 'containerName', + 'containerType', + ]), + + setUser: (user: string) => + set((state) => ({ + form: { + ...state.form, + user, + versioning: false, + encryption: false, + containerName: '', + containerType: undefined, + }, + })), + editUser: () => + editStep('user', ['versioning', 'encryption', 'containerName']), + submitUser: () => submitStep('user', 'versioning'), + + setVersioning: (versioning: boolean) => + set((state) => ({ + form: { + ...state.form, + versioning, + encryption: false, + containerName: '', + containerType: undefined, + }, + })), + editVersioning: () => + editStep('versioning', ['encryption', 'containerName']), + submitVersioning: () => submitStep('versioning', 'encryption'), + + setEncryption: (encryption: boolean) => + set((state) => ({ + form: { + ...state.form, + encryption, + containerName: '', + containerType: undefined, + }, + })), + editEncryption: () => editStep('encryption', ['containerName']), + submitEncryption: () => submitStep('encryption', 'containerName'), + + setContainerName: (containerName: string) => + set((state) => ({ + form: { + ...state.form, + containerName, + containerType: undefined, + }, + })), + editContainerName: () => editStep('containerName', []), + submitContainerName: () => { + // @TODO create container + }, + + setContainerType: (containerType: string) => + set((state) => ({ + form: { + ...state.form, + containerName: '', + containerType, + }, + })), + editContainerType: () => editStep('containerType', ['containerName']), + submitContainerType: () => submitStep('containerType', 'containerName'), + }; + }, +); diff --git a/packages/manager/modules/manager-pci-common/src/api/data/availability.ts b/packages/manager/modules/manager-pci-common/src/api/data/availability.ts index 8f4abf8bd7c6..a4393923aaf1 100644 --- a/packages/manager/modules/manager-pci-common/src/api/data/availability.ts +++ b/packages/manager/modules/manager-pci-common/src/api/data/availability.ts @@ -1,6 +1,6 @@ import { v6 } from '@ovh-ux/manager-core-api'; -type TRegion = { +export type TRegionAvailability = { continentCode: 'ASIA' | 'EU' | 'NA' | 'US'; datacenter: string; enabled: boolean; @@ -11,11 +11,11 @@ type TRegion = { export type TProductAvailability = { plans: { code: string; - regions: TRegion[]; + regions: TRegionAvailability[]; }[]; products: { name: string; - regions: TRegion[]; + regions: TRegionAvailability[]; }[]; }; diff --git a/packages/manager/modules/manager-pci-common/src/api/data/regions.ts b/packages/manager/modules/manager-pci-common/src/api/data/regions.ts index cb9f3fa65fcb..d2972b060edb 100644 --- a/packages/manager/modules/manager-pci-common/src/api/data/regions.ts +++ b/packages/manager/modules/manager-pci-common/src/api/data/regions.ts @@ -1,4 +1,4 @@ -import { fetchIcebergV6 } from '@ovh-ux/manager-core-api'; +import { fetchIcebergV6, v6 } from '@ovh-ux/manager-core-api'; export type TRegion = { name: string; @@ -21,3 +21,13 @@ export const getProjectRegions = async ( }); return data; }; + +export const addProjectRegion = async ( + projectId: string, + region: string, +): Promise => { + const { data } = await v6.post(`/cloud/project/${projectId}/region`, { + region, + }); + return data; +}; diff --git a/packages/manager/modules/manager-pci-common/src/api/hook/useAvailability.ts b/packages/manager/modules/manager-pci-common/src/api/hook/useAvailability.ts index 57ac5c298d61..09ba93337b30 100644 --- a/packages/manager/modules/manager-pci-common/src/api/hook/useAvailability.ts +++ b/packages/manager/modules/manager-pci-common/src/api/hook/useAvailability.ts @@ -1,4 +1,4 @@ -import { useQuery } from '@tanstack/react-query'; +import { useQuery, useQueryClient } from '@tanstack/react-query'; import { useMe } from '@ovh-ux/manager-react-components'; import { getProductAvailability, @@ -28,3 +28,17 @@ export const useProductAvailability = ( enabled: !!me, }); }; + +export const useRefreshProductAvailability = ( + projectId: string, + ovhSubsidiary: string, + filter?: ProductAvailabilityFilter, +) => { + const queryClient = useQueryClient(); + return { + refresh: () => + queryClient.invalidateQueries({ + queryKey: ['product-availability', projectId, ovhSubsidiary, filter], + }), + }; +}; diff --git a/packages/manager/modules/manager-pci-common/src/api/hook/useRegions.ts b/packages/manager/modules/manager-pci-common/src/api/hook/useRegions.ts index 1a7c87c83d95..9b5ad22c697d 100644 --- a/packages/manager/modules/manager-pci-common/src/api/hook/useRegions.ts +++ b/packages/manager/modules/manager-pci-common/src/api/hook/useRegions.ts @@ -1,5 +1,5 @@ -import { useQuery } from '@tanstack/react-query'; -import { getProjectRegions } from '../data/regions'; +import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; +import { addProjectRegion, getProjectRegions } from '../data/regions'; export const useGetProjectRegionsQuery = (projectId: string) => ({ queryKey: ['project', projectId, 'regions'], @@ -10,3 +10,31 @@ export const useGetProjectRegions = (projectId: string) => useQuery({ ...useGetProjectRegionsQuery(projectId), }); + +export interface AddProjectRegionProps { + projectId: string; + onError: (cause: Error) => void; + onSuccess: () => void; +} + +export const useAddProjectRegion = ({ + projectId, + onError, + onSuccess, +}: AddProjectRegionProps) => { + const queryClient = useQueryClient(); + const mutation = useMutation({ + mutationFn: (region: string) => addProjectRegion(projectId, region), + onError, + onSuccess: async () => { + await queryClient.invalidateQueries({ + queryKey: ['project', projectId, 'regions'], + }); + onSuccess(); + }, + }); + return { + addRegion: (region: string) => mutation.mutate(region), + ...mutation, + }; +};