From 54c347eb11233d4f5674558af76af9f7bb4b8bb2 Mon Sep 17 00:00:00 2001 From: Joseph Garrone Date: Mon, 9 Oct 2023 01:56:46 +0200 Subject: [PATCH] Update the context dialog of the command bar so that it can be shared betwen the laucher and myServices --- web/src/ui/i18n/resources/de.tsx | 3 +- web/src/ui/i18n/resources/en.tsx | 73 +++------------------- web/src/ui/i18n/resources/fi.tsx | 3 +- web/src/ui/i18n/resources/fr.tsx | 3 +- web/src/ui/i18n/resources/it.tsx | 3 +- web/src/ui/i18n/resources/nl.tsx | 3 +- web/src/ui/i18n/resources/no.tsx | 3 +- web/src/ui/i18n/resources/zh-CN.tsx | 3 +- web/src/ui/pages/myServices/MyServices.tsx | 12 +--- 9 files changed, 17 insertions(+), 89 deletions(-) diff --git a/web/src/ui/i18n/resources/de.tsx b/web/src/ui/i18n/resources/de.tsx index c6a2cb687..8cdc3f3ca 100644 --- a/web/src/ui/i18n/resources/de.tsx +++ b/web/src/ui/i18n/resources/de.tsx @@ -479,8 +479,7 @@ Fühlen Sie sich frei, Ihre Kubernetes-Bereitstellungen zu erkunden und die Kont "confirm delete body shared services": "Achtung, einige Ihrer Dienste sind für andere Projektmitglieder freigegeben.", "cancel": "Abbrechen", - "confirm": "Ja, löschen", - "api logs help body": undefined + "confirm": "Ja, löschen" }, "MyServicesButtonBar": { "refresh": "Aktualisieren", diff --git a/web/src/ui/i18n/resources/en.tsx b/web/src/ui/i18n/resources/en.tsx index 57efedc09..00b1b3078 100644 --- a/web/src/ui/i18n/resources/en.tsx +++ b/web/src/ui/i18n/resources/en.tsx @@ -394,27 +394,25 @@ export const translations: Translations<"en"> = { return false; } }} - >{`Welcome to our Helm Command Explanation Dialog! -We've designed this interface to empower you to take control over your Kubernetes deployments. + >{`We've designed the command bar to empower you to take control over your Kubernetes deployments. Here's what you need to know: -#### What is this Helm Command? +#### What are those Helm Commands? -The command displayed on the screen is the exact Helm command that our application will execute on your behalf in your Kubernetes namespace. -This enables you to know what's happening behind the scenes when you click the 'launch' button. +Theses commands are the exact Helm command that Onyxia API will execute on your behalf in your Kubernetes namespace. +This enables you to know what's happening behind the scenes when you interact with the UI. #### Real-time Updates -As you modify options in the UI, the Helm command will automatically update to reflect those changes. -This way, you can see how your choices impact the underlying system. +As you interact with the UI, the Helm commands will automatically update to reflect what you are doing. #### Why Should I Care? - **Transparency:** We believe you have the right to know what actions are being performed in your environment. - **Learning:** Understanding these commands can provide insight into Kubernetes and Helm, deepening your knowledge. -- **Manual Execution:** You can copy and paste this command into a terminal with write-access to Kubernetes, allowing you to launch the service manually. +- **Manual Execution:** You can copy and paste those commands into a terminal with write-access to Kubernetes, allowing you to launch the service manually. -#### How Can I Run this Command Manually? +#### How Can I Run Those Commands Manually? There are two ways to run theses commands: @@ -472,62 +470,7 @@ Feel free to explore and take charge of your Kubernetes deployments! "confirm delete body": "Don't forget to push your code on GitHub or GitLab before terminating your services", "cancel": "cancel", - "confirm": "Yes, delete", - "api logs help body": ({ - k8CredentialsHref, - myServicesHref, - interfacePreferenceHref - }) => ( - { - switch (href) { - case k8CredentialsHref: - return true; - case myServicesHref: - return true; - case interfacePreferenceHref: - return false; - default: - return false; - } - }} - >{`Welcome to our Helm Command Explanation Dialog! -We've designed this interface to empower you to take control over your Kubernetes deployments. -Here's what you need to know: - -#### What is this Helm Command? - -The command displayed on the screen is the exact Helm command that our application will execute on your behalf in your Kubernetes namespace. -This enables you to know what's happening behind the scenes when you click the 'launch' button. - -#### Real-time Updates - -As you modify options in the UI, the Helm command will automatically update to reflect those changes. -This way, you can see how your choices impact the underlying system. - -#### Why Should I Care? - -- **Transparency:** We believe you have the right to know what actions are being performed in your environment. -- **Learning:** Understanding these commands can provide insight into Kubernetes and Helm, deepening your knowledge. -- **Manual Execution:** You can copy and paste this command into a terminal with write-access to Kubernetes, allowing you to launch the service manually. - -#### How Can I Run this Command Manually? - -There are two ways to run theses commands: - -- **Local Terminal:** Go to [\`My Account -> Kubernetes tab\`](${k8CredentialsHref}). - Here, you will find the credentials that allow you to run commands in your Kubernetes namespace from your local terminal. - -- **VSCode-Python Terminal:** You can also launch a VSCode-Python instance with the Kubernetes role set to \`write\`. - Open a terminal within VSCode, and you'll be able to execute the command. - -By executing the command manually, you will still be able to see the service in the [\`MyServices\`](${myServicesHref}) page as if it was launched via the UI. - -You can disable the command bar in the [\`My Account -> Interface preference tab\`](${interfacePreferenceHref}). - -Feel free to explore and take charge of your Kubernetes deployments! - `} - ) + "confirm": "Yes, delete" }, "MyServicesButtonBar": { "refresh": "Refresh", diff --git a/web/src/ui/i18n/resources/fi.tsx b/web/src/ui/i18n/resources/fi.tsx index ef14603ea..4807a6edb 100644 --- a/web/src/ui/i18n/resources/fi.tsx +++ b/web/src/ui/i18n/resources/fi.tsx @@ -469,8 +469,7 @@ Tutustu vapaasti ja ota hallintaan Kubernetes-julkaisusi! "confirm delete body": "Muista tallentaa koodisi GitHubiin tai GitLabiin ennen palveluiden lopettamista", "cancel": "Peruuta", - "confirm": "Kyllä, poista", - "api logs help body": undefined + "confirm": "Kyllä, poista" }, "MyServicesButtonBar": { "refresh": "Päivitä", diff --git a/web/src/ui/i18n/resources/fr.tsx b/web/src/ui/i18n/resources/fr.tsx index c9d256a0d..c55abf9b8 100644 --- a/web/src/ui/i18n/resources/fr.tsx +++ b/web/src/ui/i18n/resources/fr.tsx @@ -483,8 +483,7 @@ N'hésitez pas à explorer et à prendre en main vos déploiements Kubernetes ! "confirm delete body shared services": "Attention, certains de vos services sont partagés aux autres membres du projet.", "cancel": "Annuler", - "confirm": "Oui, supprimer", - "api logs help body": undefined + "confirm": "Oui, supprimer" }, "MyServicesButtonBar": { "refresh": "Rafraîchir", diff --git a/web/src/ui/i18n/resources/it.tsx b/web/src/ui/i18n/resources/it.tsx index c7b2e822c..4f2f79062 100644 --- a/web/src/ui/i18n/resources/it.tsx +++ b/web/src/ui/i18n/resources/it.tsx @@ -475,8 +475,7 @@ Sentiti libero di esplorare e prendere il controllo dei tuoi deployment Kubernet "confirm delete body shared services": "Attenzione, alcuni dei tuoi servizi sono condivisi con gli altri membri del progetto.", "cancel": "Annullare", - "confirm": "Sì, eliminare", - "api logs help body": undefined + "confirm": "Sì, eliminare" }, "MyServicesButtonBar": { "refresh": "Aggiornare", diff --git a/web/src/ui/i18n/resources/nl.tsx b/web/src/ui/i18n/resources/nl.tsx index f00b9a191..8753ae186 100644 --- a/web/src/ui/i18n/resources/nl.tsx +++ b/web/src/ui/i18n/resources/nl.tsx @@ -476,8 +476,7 @@ Voel je vrij om te verkennen en controle te nemen over je Kubernetes-implementat "confirm delete body shared services": "Opgelet, sommige van uw diensten worden gedeeld met andere projectleden.", "cancel": "Annuleren", - "confirm": "Ja, verwijderen", - "api logs help body": undefined + "confirm": "Ja, verwijderen" }, "MyServicesButtonBar": { "refresh": "Vernieuwen", diff --git a/web/src/ui/i18n/resources/no.tsx b/web/src/ui/i18n/resources/no.tsx index 0882c5760..1fbbd0a50 100644 --- a/web/src/ui/i18n/resources/no.tsx +++ b/web/src/ui/i18n/resources/no.tsx @@ -473,8 +473,7 @@ Føl deg fri til å utforske og ta kontroll over dine Kubernetes-implementeringe "confirm delete body": "Ikke glem å laste opp koden din på GitHub eller GitLab før du avslutter tjenestene dine", "cancel": "Avbryt", - "confirm": "Ja, slett", - "api logs help body": undefined + "confirm": "Ja, slett" }, "MyServicesButtonBar": { "refresh": "Oppdater", diff --git a/web/src/ui/i18n/resources/zh-CN.tsx b/web/src/ui/i18n/resources/zh-CN.tsx index aeabf9780..ae73592ab 100644 --- a/web/src/ui/i18n/resources/zh-CN.tsx +++ b/web/src/ui/i18n/resources/zh-CN.tsx @@ -409,8 +409,7 @@ export const translations: Translations<"zh-CN"> = { "confirm delete body shared services": "请注意,您的某些服务正在与项目的其他成员共享.", "cancel": "取消", - "confirm": "是的, 删除", - "api logs help body": undefined + "confirm": "是的, 删除" }, "MyServicesButtonBar": { "refresh": "刷新", diff --git a/web/src/ui/pages/myServices/MyServices.tsx b/web/src/ui/pages/myServices/MyServices.tsx index 7e95da7e6..ff5b5869a 100644 --- a/web/src/ui/pages/myServices/MyServices.tsx +++ b/web/src/ui/pages/myServices/MyServices.tsx @@ -31,6 +31,7 @@ export default function MyServices(props: Props) { const { className, route } = props; const { t } = useTranslation({ MyServices }); + const { t: tCatalogLauncher } = useTranslation("CatalogLauncher"); /* prettier-ignore */ const { serviceManager, restorablePackageConfig, projectConfigs } = useCoreFunctions(); @@ -308,7 +309,7 @@ export default function MyServices(props: Props) { helpDialog={{ "body": (
- {t("api logs help body", { + {tCatalogLauncher("api logs help body", { "k8CredentialsHref": routes.account({ "tabId": "k8sCredentials" }).href, @@ -418,15 +419,6 @@ export const { i18n } = declareComponentKeys< | "confirm delete body shared services" | "cancel" | "confirm" - | { - K: "api logs help body"; - P: { - k8CredentialsHref: string; - myServicesHref: string; - interfacePreferenceHref: string; - }; - R: JSX.Element; - } >()({ MyServices }); const useStyles = tss