From 16d0f1216b101c16322cf9624c9164cbb4dcf0a2 Mon Sep 17 00:00:00 2001 From: Richard Cox Date: Mon, 27 Nov 2023 11:33:51 +0000 Subject: [PATCH] Rename epinio to `Application Engine` when embedded in Rancher - Create a mixin to easicaly provide either `Epinio` or `Application Engine` Also - Remove app create wizard title and sub title (not needed) - Tweaked some text --- .../epinio/components/application/AppInfo.vue | 5 +++- dashboard/pkg/epinio/config/epinio.ts | 3 +- dashboard/pkg/epinio/index.ts | 3 +- dashboard/pkg/epinio/l10n/en-us.yaml | 30 ++++++++++--------- dashboard/pkg/epinio/mixins/product-name.ts | 10 +++++++ .../pkg/epinio/pages/c/_cluster/about.vue | 20 ++++++------- .../_cluster/applications/createapp/index.vue | 2 -- .../pkg/epinio/pages/c/_cluster/dashboard.vue | 13 ++++++-- dashboard/pkg/epinio/pages/index.vue | 9 ++++-- .../pkg/epinio/routing/epinio-routing.ts | 3 +- dashboard/pkg/epinio/utils/utils.ts | 23 ++++++++++++++ 11 files changed, 85 insertions(+), 36 deletions(-) create mode 100644 dashboard/pkg/epinio/mixins/product-name.ts create mode 100644 dashboard/pkg/epinio/utils/utils.ts diff --git a/dashboard/pkg/epinio/components/application/AppInfo.vue b/dashboard/pkg/epinio/components/application/AppInfo.vue index c97e08b..faa8b7a 100644 --- a/dashboard/pkg/epinio/components/application/AppInfo.vue +++ b/dashboard/pkg/epinio/components/application/AppInfo.vue @@ -14,6 +14,7 @@ import { validateKubernetesName } from '@shell/utils/validators/kubernetes-name' import { EPINIO_TYPES, EpinioNamespace } from '../../types'; import Application from '../../models/applications'; import { objValuesToString } from '../../utils/settings'; +import ProductName from '../../mixins/product-name'; export interface EpinioAppInfo { meta: { @@ -48,6 +49,8 @@ export default Vue.extend({ ChartValues, }, + mixins: [ProductName], + props: { application: { type: Object as PropType, @@ -234,7 +237,7 @@ export default Vue.extend({ v-model="values.configuration.routes" data-testid="epinio_app-info_routes" :title="t('epinio.applications.create.routes.title')" - :protip="t('epinio.applications.create.routes.tooltip')" + :protip="t('epinio.applications.create.routes.tooltip', { epinio: productName})" :mode="mode" :value-placeholder="t('epinio.applications.create.routes.placeholder')" /> diff --git a/dashboard/pkg/epinio/config/epinio.ts b/dashboard/pkg/epinio/config/epinio.ts index 18896a0..9bf1be9 100644 --- a/dashboard/pkg/epinio/config/epinio.ts +++ b/dashboard/pkg/epinio/config/epinio.ts @@ -5,6 +5,7 @@ import { createEpinioRoute, rootEpinioRoute } from '../utils/custom-routing'; import { EPINIO_PRODUCT_NAME, EPINIO_STANDALONE_CLUSTER_NAME, EPINIO_TYPES } from '../types'; import EpinioDiscovery from '../utils/epinio-discovery'; import { MULTI_CLUSTER } from '@shell/store/features'; +import { isStandalone } from '../utils/utils'; export function init($plugin: any, store: any) { const { @@ -18,7 +19,7 @@ export function init($plugin: any, store: any) { weightGroup } = $plugin.DSL(store, $plugin.name); - const isEpinioSingleProduct = process.env.rancherEnv === 'epinio'; + const isEpinioSingleProduct = isStandalone(); if (isEpinioSingleProduct) { store.dispatch('setIsSingleProduct', { diff --git a/dashboard/pkg/epinio/index.ts b/dashboard/pkg/epinio/index.ts index 4a90ed3..ce5a319 100644 --- a/dashboard/pkg/epinio/index.ts +++ b/dashboard/pkg/epinio/index.ts @@ -7,6 +7,7 @@ import epinioRoutes from './routing/epinio-routing'; import epinioMgmtStore from './store/epinio-mgmt-store'; import epinioStore from './store/epinio-store'; import { createEpinioRoute } from './utils/custom-routing'; +import { isStandalone } from './utils/utils'; const epinioObjAnnotations = [ 'epinio.io/app-container', @@ -66,7 +67,7 @@ export default function(plugin: IPlugin) { ] }, { - labelKey: 'epinio.applications.actions.goToEpinio.label', + labelKey: isStandalone() ? 'epinio.applications.actions.goToEpinio.labelStandalone' : 'epinio.applications.actions.goToEpinio.labelEmbedded', icon: 'icon-epinio', enabled(ctx: any) { const isUserNamespace = ctx.metadata.namespace !== 'epinio'; diff --git a/dashboard/pkg/epinio/l10n/en-us.yaml b/dashboard/pkg/epinio/l10n/en-us.yaml index 9ed006e..562321c 100644 --- a/dashboard/pkg/epinio/l10n/en-us.yaml +++ b/dashboard/pkg/epinio/l10n/en-us.yaml @@ -35,8 +35,8 @@ typeLabel: } typeDescription: namespaces: Namespaces group your applications, services and other resources. Deleting a namespace will delete all of it's resources. - applications: Epinio uses Applications to transition your code, through build, to being deployed. - services: Epinio can create instances of your services. Instances can be bound to your applications to provide data, for example a database service bound to an application might provide connection credentials. + applications: Applications transition your code, through build, to being deployed. + services: Instances of your services can be created and shared between Applications. Bind instances to your application to provide data, for example a database service bound to an application might provide connection credentials. configurations: Configurations are a way to provide data to applications. The data becomes available once the configuration is bound to them. appcharts: Application Charts define kube resources created by your application. Templates for active applications cannot be changed catalogservices: Catalog Services provide additional, common functionality to applications. For example an instance of a database Catalog Service can be bound to an application. @@ -65,9 +65,9 @@ epinio: getBinaries: Get binaries intro: dashboard: Dashboard - welcome: Welcome to Epinio - blurb: The Application Development Engine for Kubernetes - description: Epinio takes your application from source code to deployment and allow for Developers and Operators to work better together! + welcome: Welcome to {epinio} + blurb: The Application Development Engine for Kubernetes #TODO: RC + description: "{epinio} takes your application from source code to deployment and enables Developers and Operators to work better together" learnMoreLink: https://epinio.io/ learnMore: Learn more noNamespaces: Create a Namespace, then create your Applications @@ -93,10 +93,10 @@ epinio: tableHeaders: namespace: Namespace instances: - header: Epinio instances + header: "{epinio} Instances" none: - header: No instances of Epinio were found - description: To view an Epinio cluster be sure to import a Cluster where one is installed + header: No instances of {epinio} were found + description: To view an {epinio} instances be sure to import a Cluster where one is installed tableHeaders: api: URL version: Version @@ -149,8 +149,6 @@ epinio: latestCommit: Latest commit deployed behindCommits: Commits behind create: - title: Application - titleSubText: Epinio instances: Instances settingsVars: title: Application Variables @@ -164,7 +162,7 @@ epinio: valueLabel: Value routes: title: Routes - tooltip: Replace the default route (.) with one or more custom routes + tooltip: Replace the default route (.<{epinio} domain>) with one or more custom routes placeholder: e.g. my-custom-route.com/my-app export: label: Export App @@ -245,7 +243,7 @@ epinio: configurations: label: Bindings - subtext: Bind to Application + subtext: Bind Configurations and Services to your app configurations: select: placeholderWithOptions: Select configs to bind app to @@ -313,7 +311,8 @@ epinio: editFromCommit: label: Redeploy goToEpinio: - label: Epinio App + labelStandalone: Epinio App + labelEmbedded: Application Engine App viewDeployment: label: View In Kube Cluster wm: @@ -365,7 +364,7 @@ epinio: label: Catalog Service placeholderNoOptions: There are no services placeholderWithOptions: Select the type of Service to create - failedWaitingForServiceInstance: Service instance was created but failed to be returned by Epinio, no applications were bound + failedWaitingForServiceInstance: Service instance was created but failed to be returned, no applications were bound catalogService: tableHeaders: shortDesc: Headline @@ -385,3 +384,6 @@ model: authConfig: provider: epinio: Auth Provider +product: + # Note one other usage of this string above + epinio: Application Engine \ No newline at end of file diff --git a/dashboard/pkg/epinio/mixins/product-name.ts b/dashboard/pkg/epinio/mixins/product-name.ts new file mode 100644 index 0000000..9c63b40 --- /dev/null +++ b/dashboard/pkg/epinio/mixins/product-name.ts @@ -0,0 +1,10 @@ +import Vue from 'vue'; +import { getProductName } from '../utils/utils'; + +export default Vue.extend({ + computed: { + productName() { + return getProductName(this.t.bind(this)); + } + } +}); diff --git a/dashboard/pkg/epinio/pages/c/_cluster/about.vue b/dashboard/pkg/epinio/pages/c/_cluster/about.vue index e2df8aa..7d0e6bf 100644 --- a/dashboard/pkg/epinio/pages/c/_cluster/about.vue +++ b/dashboard/pkg/epinio/pages/c/_cluster/about.vue @@ -1,6 +1,6 @@