Skip to content

Commit

Permalink
Fix Overview tab is present under Storage section
Browse files Browse the repository at this point in the history
Signed-off-by: Gowtham Shanmugasundaram <gshanmug@redhat.com>
  • Loading branch information
GowthamShanmugam committed Jul 28, 2022
1 parent c055ca2 commit de3c310
Show file tree
Hide file tree
Showing 7 changed files with 108 additions and 134 deletions.
2 changes: 1 addition & 1 deletion Dockerfile.mco.ci
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM node:15 AS builder
WORKDIR /app
COPY . /app
RUN sed -i "s/\"name\": \"odf-console\"/\"name\": \"odf-multicluster-console\"/" package.json
RUN node scripts/generatePluginPackage.js mco
RUN yarn install
RUN yarn build-mco

Expand Down
126 changes: 5 additions & 121 deletions console-extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@
}
}
},
{
"type": "console.flag",
"properties": {
"handler": {
"$codeRef": "features.setMCOFlag"
}
}
},
{
"type": "console.flag",
"properties": {
Expand Down Expand Up @@ -55,17 +47,6 @@
}
}
},
{
"type": "console.flag/model",
"properties": {
"model": {
"group": "ramendr.openshift.io",
"version": "v1alpha1",
"kind": "DRPolicy"
},
"flag": "ODR_MODEL"
}
},
{
"type": "console.navigation/resource-cluster",
"properties": {
Expand All @@ -83,7 +64,6 @@
"required": ["MCG"]
}
},
/* Activates when RGW is present without MCG */
{
"type": "console.navigation/resource-cluster",
"properties": {
Expand Down Expand Up @@ -119,7 +99,6 @@
"required": ["MCG"]
}
},
/* Activates when RGW is present without MCG */
{
"type": "console.navigation/resource-ns",
"properties": {
Expand Down Expand Up @@ -148,8 +127,7 @@
"href": "/odf/cluster"
},
"flags": {
"required": ["ODF_MODEL", "OCS"],
"disallowed": ["MCO"]
"required": ["ODF_MODEL", "OCS"]
}
},
{
Expand All @@ -160,8 +138,7 @@
"component": { "$codeRef": "dashboard.default" }
},
"flags": {
"required": ["ODF_MODEL"],
"disallowed": ["MCO"]
"required": ["ODF_MODEL"]
}
},
{
Expand All @@ -172,8 +149,7 @@
"component": { "$codeRef": "dashboard.Reroute" }
},
"flags": {
"required": ["ODF_MODEL"],
"disallowed": ["MCO"]
"required": ["ODF_MODEL"]
}
},
{
Expand All @@ -184,8 +160,7 @@
"component": { "$codeRef": "dashboard.RerouteResource" }
},
"flags": {
"required": ["ODF_MODEL"],
"disallowed": ["MCO"]
"required": ["ODF_MODEL"]
}
},
{
Expand All @@ -199,78 +174,6 @@
"component": { "$codeRef": "wizard.default" }
}
},
{
"type": "console.navigation/section",
"properties": {
"id": "mco-data-services",
"perspective": "acm",
"name": "%plugin__odf-plugin~Data Services%",
"insertBefore": "acm-applications"
},
"flags": {
"required": ["MCO"]
}
},
{
"type": "console.navigation/href",
"properties": {
"id": "mco-data-policies",
"perspective": "acm",
"section": "mco-data-services",
"name": "%plugin__odf-plugin~Data policies%",
"href": "/multicloud/data-services/data-policies"
},
"flags": {
"required": ["MCO", "ODR_MODEL"]
}
},
{
"type": "console.page/route",
"properties": {
"path": "/multicloud/data-services/data-policies",
"exact": true,
"component": { "$codeRef": "dataPolicies.DataPoliciesList" }
},
"flags": {
"required": ["MCO"]
}
},
{
"type": "console.page/route",
"properties": {
"path": "/multicloud/data-services/data-policies/ramendr.openshift.io~v1alpha1~DRPolicy/~new",
"exact": true,
"component": { "$codeRef": "createDataPolicy.CreateDRPolicy" }
},
"flags": {
"required": ["MCO"]
}
},
{
"type": "console.navigation/href",
"properties": {
"id": "mcodashboard",
"perspective": "acm",
"insertAfter": "mco-data-policies",
"section": "mco-data-services",
"name": "%plugin__odf-plugin~Storage System%",
"href": "/multicloud/data-services/storagesystem"
},
"flags": {
"required": ["MCO"]
}
},
{
"type": "console.page/route",
"properties": {
"path": "/multicloud/data-services/storagesystem",
"exact": false,
"component": { "$codeRef": "mcoDashboard.default" }
},
"flags": {
"required": ["MCO"]
}
},
{
"type": "console.page/resource/list",
"properties": {
Expand All @@ -280,9 +183,6 @@
"version": "v1alpha1"
},
"component": { "$codeRef": "obc.OBCListPage" }
},
"flags": {
"disallowed": ["MCO"]
}
},
{
Expand All @@ -294,9 +194,6 @@
"version": "v1alpha1"
},
"component": { "$codeRef": "obc.OBCDetailsPage" }
},
"flags": {
"disallowed": ["MCO"]
}
},
{
Expand All @@ -309,8 +206,7 @@
}
},
"flags": {
"required": ["OCS"],
"disallowed": ["MCO"]
"required": ["OCS"]
}
},
{
Expand All @@ -322,9 +218,6 @@
"version": "v1alpha1"
},
"component": { "$codeRef": "ob.OBDetailsPage" }
},
"flags": {
"disallowed": ["MCO"]
}
},
{
Expand All @@ -336,9 +229,6 @@
"version": "v1alpha1"
},
"component": { "$codeRef": "ob.ObjectBucketListPage" }
},
"flags": {
"disallowed": ["MCO"]
}
},
{
Expand All @@ -359,9 +249,6 @@
"component": {
"$codeRef": "blockPoolDetailsPage.default"
}
},
"flags": {
"disallowed": ["MCO"]
}
},
{
Expand Down Expand Up @@ -432,9 +319,6 @@
"component": {
"$codeRef": "ocs.default"
}
},
"flags": {
"disallowed": ["MCO"]
}
},
{
Expand Down
7 changes: 2 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "odf-console",
"name": "odf-plugin",
"version": "0.0.0",
"description": "ODF console",
"description": "ODF plugin",
"license": "MIT",
"private": true,
"workspaces": [
Expand Down Expand Up @@ -126,16 +126,13 @@
"dashboard": "@odf/core/components/odf-dashboard/dashboard",
"features": "@odf/core/features",
"wizard": "@odf/core/components/create-storage-system/create-storage-system",
"dataPolicies": "@odf/mco/components/data-policies/data-policies-list",
"createDataPolicy": "@odf/mco/components/data-policies/create-dr-policy/create-dr-policy",
"obc": "@odf/core/components/mcg/ObjectBucketClaim",
"createOBC": "@odf/core/components/mcg/CreateObjectBucketClaim",
"ob": "@odf/core/components/mcg/ObjectBucket",
"ocs": "@odf/ocs/dashboards/odf-system-dashboard",
"blockPoolDetailsPage": "@odf/ocs/block-pool/BlockPoolDetailsPage",
"createBlockPools": "@odf/ocs/block-pool/CreateBlockPool",
"bsCreate": "@odf/core/components/create-bs/create-bs-page",
"mcoDashboard": "@odf/mco/components/mco-dashboard/dashboard",
"nsCreate": "@odf/core/components/namespace-store/create-namespace-store",
"bcCreate": "@odf/core/components/bucket-class/create-bc",
"bsDetails": "@odf/core/components/resource-pages/BackingStoreDetailsPage",
Expand Down
7 changes: 0 additions & 7 deletions packages/odf/features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ export const CEPH_FLAG = 'CEPH';
// Based on the existence of StorageCluster
export const OCS_FLAG = 'OCS';

export const MCO_MODE_FLAG = 'MCO';

export const isMCO = process.env.MODE === 'MCO';

export enum FEATURES {
// Flag names to be prefixed with "OCS_" so as to seperate from console flags
OCS_MULTUS = 'OCS_MULTUS',
Expand Down Expand Up @@ -106,9 +102,6 @@ const setOCSFlagsFalse = (setFlag: SetFeatureFlag) => {
export const setODFFlag = (setFlag: SetFeatureFlag) =>
setFlag(ODF_MODEL_FLAG, true);

export const setMCOFlag = (setFlag: SetFeatureFlag) =>
setFlag(MCO_MODE_FLAG, isMCO);

export const setOCSFlags = async (setFlag: SetFeatureFlag) => {
let ocsIntervalId = null;
// to prevent unnecessary re-render every 15 sec
Expand Down
70 changes: 70 additions & 0 deletions plugins/mco/console-extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
[
{
"type": "console.flag/model",
"properties": {
"model": {
"group": "ramendr.openshift.io",
"version": "v1alpha1",
"kind": "DRPolicy"
},
"flag": "ODR_MODEL"
}
},
{
"type": "console.navigation/section",
"properties": {
"id": "mco-data-services",
"perspective": "acm",
"name": "%plugin__odf-plugin~Data Services%",
"insertBefore": "acm-applications"
}
},
{
"type": "console.navigation/href",
"properties": {
"id": "mco-data-policies",
"perspective": "acm",
"section": "mco-data-services",
"name": "%plugin__odf-plugin~Data policies%",
"href": "/multicloud/data-services/data-policies"
},
"flags": {
"required": ["ODR_MODEL"]
}
},
{
"type": "console.page/route",
"properties": {
"path": "/multicloud/data-services/data-policies",
"exact": true,
"component": { "$codeRef": "dataPolicies.DataPoliciesList" }
}
},
{
"type": "console.page/route",
"properties": {
"path": "/multicloud/data-services/data-policies/ramendr.openshift.io~v1alpha1~DRPolicy/~new",
"exact": true,
"component": { "$codeRef": "createDataPolicy.CreateDRPolicy" }
}
},
{
"type": "console.navigation/href",
"properties": {
"id": "mcodashboard",
"perspective": "acm",
"insertAfter": "mco-data-policies",
"section": "mco-data-services",
"name": "%plugin__odf-plugin~Storage System%",
"href": "/multicloud/data-services/storagesystem"
}
},
{
"type": "console.page/route",
"properties": {
"path": "/multicloud/data-services/storagesystem",
"exact": false,
"component": { "$codeRef": "mcoDashboard.default" }
}
}
]
14 changes: 14 additions & 0 deletions plugins/mco/console-plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "odf-multicluster-console",
"version": "0.0.0",
"displayName": "ODF MCO(ODF Multicluster Orchestrator) Plugin",
"description": "Console plugin for ODF MCO",
"dependencies": {
"@console/pluginAPI": "*"
},
"exposedModules": {
"dataPolicies": "@odf/mco/components/data-policies/data-policies-list",
"createDataPolicy": "@odf/mco/components/data-policies/create-dr-policy/create-dr-policy",
"mcoDashboard": "@odf/mco/components/mco-dashboard/dashboard"
}
}
16 changes: 16 additions & 0 deletions scripts/generatePluginPackage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const fs = require('fs');

const plugin = process.argv[2];
const frontendPackage = JSON.parse(fs.readFileSync('./package.json'));
frontendPackage.consolePlugin = JSON.parse(
fs.readFileSync(`./plugins/${plugin}/console-plugin.json`)
);
fs.writeFileSync('./package.json', JSON.stringify(frontendPackage));

const consoleExtensions = JSON.parse(
fs.readFileSync(`./plugins/${plugin}/console-extensions.json`)
);
fs.writeFileSync(
'./console-extensions.json',
JSON.stringify(consoleExtensions)
);

0 comments on commit de3c310

Please sign in to comment.