Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
150 changes: 0 additions & 150 deletions shell/config/product/apps.js

This file was deleted.

106 changes: 106 additions & 0 deletions shell/config/product/apps.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
import { IExtension } from '@shell/core/types';
import {
ProductChildCustomPage,
ProductChildResourcePage,
ProductChildGroup
} from '@shell/core/plugin-types';

import {
AGE,
STATE,
CHART,
CHART_UPGRADE,
NAMESPACE,
NAME as NAME_COL,
APP_SUMMARY,
APPS_REPO_TYPE,
APPS_REPO_URL,
APPS_REPO_BRANCH,
APPS_OP_ACTION,
APPS_OP_RELEASE_NS,
APPS_OP_RELEASE_NAME
} from '@shell/config/table-headers';

import { CATALOG } from '@shell/config/types';
import { STEVE_AGE_COL, STEVE_NAMESPACE_COL, STEVE_NAME_COL, STEVE_STATE_COL } from '@shell/config/pagination-table-headers';

export const NAME = 'apps';

export function $init(prodReg: IExtension) {
const appsChartsPage: ProductChildCustomPage = {
labelKey: 'catalog.charts.header',
name: 'charts',
component: () => import('@shell/pages/c/_cluster/apps/charts/index.vue'),
config: { namespaced: false },
};

const appsInstalledAppsPage: ProductChildResourcePage = {
type: CATALOG.APP,
config: { isCreatable: false, isEditable: false },
headers: [STATE, NAME_COL, NAMESPACE, CHART, CHART_UPGRADE, APP_SUMMARY, AGE],
sspHeaders: [STEVE_STATE_COL, STEVE_NAME_COL, STEVE_NAMESPACE_COL, {
...CHART,
sort: ['spec.chart.metadata.name'],
search: ['spec.chart.metadata.name'],
}, {
...CHART_UPGRADE,
sort: false,
search: false,
},
APP_SUMMARY,
STEVE_AGE_COL]
};

const appsReposPage: ProductChildResourcePage = {
type: CATALOG.CLUSTER_REPO,
config: { listCreateButtonLabelKey: 'catalog.repo.add' },
headers: [STATE, NAME_COL, APPS_REPO_TYPE, APPS_REPO_URL, APPS_REPO_BRANCH, AGE],
sspHeaders: [STEVE_STATE_COL, STEVE_NAME_COL, {
...APPS_REPO_TYPE,
sort: false,
search: false,
}, {
...APPS_REPO_URL,
sort: false,
search: false,
},
APPS_REPO_BRANCH]
};

const appsOperationsPage: ProductChildResourcePage = {
type: CATALOG.OPERATION,
config: { isCreatable: false, isEditable: false },
headers: [
STATE,
NAME_COL,
NAMESPACE,
APPS_OP_ACTION,
APPS_OP_RELEASE_NS,
APPS_OP_RELEASE_NAME,
AGE
],
sspHeaders: [
STEVE_STATE_COL,
STEVE_NAME_COL,
STEVE_NAMESPACE_COL,
APPS_OP_ACTION,
APPS_OP_RELEASE_NS,
APPS_OP_RELEASE_NAME,
STEVE_AGE_COL
]
};

const resourcesGroup: ProductChildGroup = {
name: 'apps',
labelKey: 'product.apps',
weight: 97,
children: [
appsChartsPage,
appsInstalledAppsPage,
appsReposPage,
appsOperationsPage
],
};

prodReg.extendProduct('explorer', [resourcesGroup]);
}
45 changes: 45 additions & 0 deletions shell/config/table-headers.js
Original file line number Diff line number Diff line change
Expand Up @@ -1207,3 +1207,48 @@ export const MGMT_CLUSTER_KUBE_VERSION = {
search: 'statusInfo.kubernetesVersion',
formatter: 'ClusterKubeVersion',
};

// Apps & Marketplace
export const APPS_REPO_TYPE = {
name: 'type',
labelKey: 'tableHeaders.type',
sort: 'typeDisplay',
value: 'typeDisplay'
};

export const APPS_REPO_URL = {
name: 'url',
labelKey: 'tableHeaders.url',
sort: 'urlDisplay',
value: 'urlDisplay'
};

export const APPS_REPO_BRANCH = {
name: 'branch',
labelKey: 'tableHeaders.branch',
sort: 'spec.gitBranch',
value: 'spec.gitBranch',
dashIfEmpty: true,
};

export const APPS_OP_ACTION = {
name: 'action',
label: 'Action',
sort: 'status.action',
value: 'status.action',
labelKey: 'catalog.operation.tableHeaders.action',
};
export const APPS_OP_RELEASE_NS = {
name: 'releaseNamespace',
label: 'Tgt Namespace',
sort: 'status.namespace',
value: 'status.namespace',
labelKey: 'catalog.operation.tableHeaders.releaseNamespace',
};
export const APPS_OP_RELEASE_NAME = {
name: 'releaseName',
label: 'Tgt Release',
sort: 'status.releaseName',
value: 'status.releaseName',
labelKey: 'catalog.operation.tableHeaders.releaseName',
};
2 changes: 1 addition & 1 deletion shell/core/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ export interface HeaderOptions {
* A string which represents the path to access the value from the row object which we'll use to search i.e. `row.meta.value`.
* It can be false to disable searching on this field
*/
search?: string | boolean;
search?: string | boolean | string[];

/**
* Number of pixels the column should be in the table
Expand Down
Loading