Skip to content

Commit

Permalink
Use page route instead of resource for vmtemplates
Browse files Browse the repository at this point in the history
  • Loading branch information
yaacov committed Jun 11, 2019
1 parent 3cd29c6 commit b7d1a51
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
3 changes: 2 additions & 1 deletion frontend/packages/console-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"dependencies": {
"@console/internal": "0.0.0-fixed",
"@console/plugin-sdk": "0.0.0-fixed",
"@console/shared": "0.0.0-fixed"
"@console/shared": "0.0.0-fixed",
"@console/kubevirt-plugin": "0.0.0-fixed"
},
"consolePlugin": {
"entry": "src/plugin.tsx"
Expand Down
5 changes: 2 additions & 3 deletions frontend/packages/kubevirt-plugin/src/models.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { K8sKind } from '@console/internal/module/k8s';
import { TEMPLATE_TYPE_LABEL } from 'kubevirt-web-ui-components';

export const VirtualMachineModel: K8sKind = {
label: 'Virtual Machine',
Expand Down Expand Up @@ -52,7 +53,6 @@ export const VirtualMachineInstanceReplicaSetModel: K8sKind = {
id: 'virtualmachineinstancereplicaset',
};

/* TODO(mlibra): migrate templates
export const VmTemplateModel: K8sKind = {
label: 'Template',
labelPlural: 'Templates',
Expand All @@ -65,10 +65,9 @@ export const VmTemplateModel: K8sKind = {
kind: 'Template',
id: 'vmtemplate',
selector: {
matchLabels: {[TEMPLATE_TYPE_LABEL]: 'vm'},
matchLabels: { [TEMPLATE_TYPE_LABEL]: 'vm' },
},
};
*/

export const NetworkAttachmentDefinitionModel: K8sKind = {
label: 'Network Attachment Definition',
Expand Down
14 changes: 13 additions & 1 deletion frontend/packages/kubevirt-plugin/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
ModelFeatureFlag,
YAMLTemplate,
ModelDefinition,
RoutePage,
} from '@console/plugin-sdk';

import * as models from './models';
Expand All @@ -18,7 +19,8 @@ type ConsumedExtensions =
| ResourceDetailsPage
| ModelFeatureFlag
| YAMLTemplate
| ModelDefinition;
| ModelDefinition
| RoutePage;

const FLAG_KUBEVIRT = 'KUBEVIRT';

Expand Down Expand Up @@ -65,6 +67,16 @@ const plugin: Plugin<ConsumedExtensions> = [
template: yamlTemplates.getIn([models.VirtualMachineModel, 'default']),
},
},
{
type: 'Page/Route',
properties: {
path: `/k8s/ns/:ns/${models.VmTemplateModel.plural}`,
loader: () =>
import('./components/vm-template' /* webpackChunkName: "kubevirt-vm-template" */).then(
(m) => m.VirtualMachineTemplatesPage,
),
},
},
// {
// type: 'Page/Resource/Details',
// properties: {
Expand Down

0 comments on commit b7d1a51

Please sign in to comment.