Skip to content

Commit

Permalink
Rename epinio to Application Engine when embedded in Rancher
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
richard-cox committed Nov 27, 2023
1 parent 59c89a8 commit 16d0f12
Show file tree
Hide file tree
Showing 11 changed files with 85 additions and 36 deletions.
5 changes: 4 additions & 1 deletion dashboard/pkg/epinio/components/application/AppInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -48,6 +49,8 @@ export default Vue.extend<Data, any, any, any>({
ChartValues,
},
mixins: [ProductName],
props: {
application: {
type: Object as PropType<Application>,
Expand Down Expand Up @@ -234,7 +237,7 @@ export default Vue.extend<Data, any, any, any>({
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')"
/>
Expand Down
3 changes: 2 additions & 1 deletion dashboard/pkg/epinio/config/epinio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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', {
Expand Down
3 changes: 2 additions & 1 deletion dashboard/pkg/epinio/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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';
Expand Down
30 changes: 16 additions & 14 deletions dashboard/pkg/epinio/l10n/en-us.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -149,8 +149,6 @@ epinio:
latestCommit: Latest commit deployed
behindCommits: Commits behind
create:
title: Application
titleSubText: Epinio
instances: Instances
settingsVars:
title: Application Variables
Expand All @@ -164,7 +162,7 @@ epinio:
valueLabel: Value
routes:
title: Routes
tooltip: Replace the default route (<app name>.<epinio domain>) with one or more custom routes
tooltip: Replace the default route (<app name>.<{epinio} domain>) with one or more custom routes
placeholder: e.g. my-custom-route.com/my-app
export:
label: Export App
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -385,3 +384,6 @@ model:
authConfig:
provider:
epinio: Auth Provider
product:
# Note one other usage of this string above
epinio: Application Engine
10 changes: 10 additions & 0 deletions dashboard/pkg/epinio/mixins/product-name.ts
Original file line number Diff line number Diff line change
@@ -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));
}
}
});
20 changes: 9 additions & 11 deletions dashboard/pkg/epinio/pages/c/_cluster/about.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script>
import { MANAGEMENT } from '@shell/config/types';
import { getVendor } from '@shell/config/private-label';
import ProductName from '../../../mixins/product-name';
export default {
async fetch() {
Expand All @@ -9,24 +9,22 @@ export default {
this.version = await this.$store.dispatch('epinio/version');
},
mixins: [ProductName],
data() {
return { version: null };
},
computed: {
appName() {
const isSingleProduct = !!this.$store.getters['isSingleProduct'];
return isSingleProduct ? getVendor() : this.t('epinio.label');
},
computed: {
downloads() {
// TODO: Not sure if we can get the URL from the settings here.
const gitUrl = `https://github.com/epinio/epinio/releases/download`;
return [
this.createOSOption('about.os.mac', 'icon-apple', `${ gitUrl }/${ this.version?.displayVersion }/${ this.appName.toLowerCase() }-darwin-x86_64`, null),
this.createOSOption('about.os.linux', 'icon-linux', `${ gitUrl }/${ this.version?.displayVersion }/${ this.appName.toLowerCase() }-linux-x86_64`, this.downloadLinuxImages),
this.createOSOption('about.os.windows', 'icon-windows', `${ gitUrl }/${ this.version?.displayVersion }/${ this.appName.toLowerCase() }-windows-x86_64.zip`)
this.createOSOption('about.os.mac', 'icon-apple', `${ gitUrl }/${ this.version?.displayVersion }/epinio-darwin-x86_64`, null),
this.createOSOption('about.os.linux', 'icon-linux', `${ gitUrl }/${ this.version?.displayVersion }/epinio-linux-x86_64`, this.downloadLinuxImages),
this.createOSOption('about.os.windows', 'icon-windows', `${ gitUrl }/${ this.version?.displayVersion }/epinio-windows-x86_64.zip`)
];
},
Expand Down Expand Up @@ -58,7 +56,7 @@ export default {
<div class="about">
<template>
<h1 v-t="'about.title'">
{{ appName }}
{{ productName }}
</h1>
<table>
<thead>
Expand All @@ -74,7 +72,7 @@ export default {
target="_blank"
rel="nofollow noopener noreferrer"
>
{{ appName }}
{{ productName }}
</a>
</td><td>{{ versionString }}</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,6 @@ export default Vue.extend<Data, any, any, any>({
>
<Wizard
:steps="steps"
:banner-title="t('epinio.applications.create.title')"
:banner-title-subtext="t('epinio.applications.create.titleSubText')"
header-mode="create"
finish-mode="done"
:edit-first-step="true"
Expand Down
13 changes: 11 additions & 2 deletions dashboard/pkg/epinio/pages/c/_cluster/dashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { Location } from 'vue-router';
import Banner from '@components/Banner/Banner.vue';
import { METRIC } from '@shell/config/types';
import { allHash } from '@shell/utils/promise';
import ProductName from '../../../mixins/product-name';
type ComponentService = {
name: string,
Expand All @@ -26,6 +27,9 @@ export default Vue.extend<any, any, any, any>({
DashboardCard,
ConsumptionGauge
},
mixins: [ProductName],
async fetch() {
const hash: { [key:string]: any } = await allHash({
ns: this.$store.dispatch(`epinio/findAll`, { type: EPINIO_TYPES.NAMESPACE }),
Expand All @@ -37,6 +41,7 @@ export default Vue.extend<any, any, any, any>({
this.version = hash.version;
},
data() {
return {
sectionContent: [
Expand Down Expand Up @@ -80,9 +85,11 @@ export default Vue.extend<any, any, any, any>({
showMetricsInfo: false
};
},
created() {
this.redoCards();
},
watch: {
namespaces(old, neu) {
if (isEqual(old, neu)) {
Expand All @@ -106,6 +113,7 @@ export default Vue.extend<any, any, any, any>({
this.redoCards();
}
},
methods: {
async calcAvailableResources() {
if (this.$store.getters['isSingleProduct']) {
Expand Down Expand Up @@ -156,6 +164,7 @@ export default Vue.extend<any, any, any, any>({
}
}
},
computed: {
services() {
const fetchServicesInstances: EpinioServiceModel[] = this.$store.getters['epinio/all'](EPINIO_TYPES.SERVICE_INSTANCE);
Expand Down Expand Up @@ -214,7 +223,7 @@ export default Vue.extend<any, any, any, any>({
<div class="dashboard">
<div class="head">
<div class="head-title">
<h1>{{ t('epinio.intro.welcome') }}</h1>
<h1>{{ t('epinio.intro.welcome', {epinio: productName}) }}</h1>
<span v-if="version">{{ version.displayVersion }}</span>
</div>

Expand All @@ -223,7 +232,7 @@ export default Vue.extend<any, any, any, any>({
</p>

<p>
{{ t('epinio.intro.description') }}
{{ t('epinio.intro.description', {epinio: productName}) }}
</p>

<div class="head-links">
Expand Down
9 changes: 6 additions & 3 deletions dashboard/pkg/epinio/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import epinioAuth, { EpinioAuthTypes } from '../utils/auth';
import EpinioCluster, { EpinioInfoPath } from '../models/cluster';
import LoginDialog from '../components/LoginDialog.vue';
import Dialog from '@shell/components/Dialog.vue';
import ProductName from '../mixins/product-name';
interface Data {
clustersSchema: any;
Expand All @@ -23,6 +24,8 @@ export default Vue.extend<Data, any, any, any>({
AsyncButton, Loading, Link, ResourceTable, LoginDialog, Dialog
},
mixins: [ProductName],
layout: 'plain',
async fetch() {
Expand Down Expand Up @@ -149,15 +152,15 @@ export default Vue.extend<Data, any, any, any>({
v-else-if="clusters.length === 0"
class="root"
>
<h2>{{ t('epinio.instances.none.header') }}</h2>
<p>{{ t('epinio.instances.none.description') }}</p>
<h2>{{ t('epinio.instances.none.header', {epinio: productName}) }}</h2>
<p>{{ t('epinio.instances.none.description', {epinio: productName}) }}</p>
</div>
<div
v-else
class="root"
>
<div class="epinios-table">
<h2>{{ t('epinio.instances.header') }}</h2>
<h2>{{ t('epinio.instances.header', {epinio: productName}) }}</h2>
<ResourceTable
:rows="clusters"
:schema="clustersSchema"
Expand Down
3 changes: 2 additions & 1 deletion dashboard/pkg/epinio/routing/epinio-routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import CreateEpinioResource from '../pages/c/_cluster/_resource/create.vue';
import ViewEpinioResource from '../pages/c/_cluster/_resource/_id.vue';
import ViewEpinioNsResource from '../pages/c/_cluster/_resource/_namespace/_id.vue';
import AuthVerify from '../pages/auth/verify.vue';
import { isStandalone } from '../utils/utils';

const meta = {
product: EPINIO_PRODUCT_NAME,
Expand Down Expand Up @@ -66,7 +67,7 @@ const routes: RouteConfig[] = [{
meta
}];

const isEpinioSingleProduct = process.env.rancherEnv === 'epinio';
const isEpinioSingleProduct = isStandalone();

if (!isEpinioSingleProduct) {
routes.unshift({
Expand Down
23 changes: 23 additions & 0 deletions dashboard/pkg/epinio/utils/utils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
export const STANDALONE_RANCHER_ENV = 'epinio';

export const isStandalone = (): boolean => {
return process.env.rancherEnv === STANDALONE_RANCHER_ENV;
};

/**
* In standalone world it's Epinio, in embedded world Application Engine
*/
export function getProductNameLabel(): string {
if (isStandalone()) {
return 'epinio.label';
}

return 'product.epinio';
}

/**
* In standalone world it's Epinio, in embedded world Application Engine
*/
export function getProductName(t: (label: string) => string): string {
return t(getProductNameLabel());
}

0 comments on commit 16d0f12

Please sign in to comment.