Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-4.11-compatibility] Bug 2087078: Fix Overview tab is present under Storage section #363

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Expand Up @@ -2,3 +2,9 @@ node_modules
dist
.cache-loader
cypress/cypress-a11y-report.json
plugins/odf/package.json
plugins/odf/dist
plugins/odf/.cache-loader
plugins/mco/package.json
plugins/mco/dist
plugins/mco/.cache-loader
2 changes: 1 addition & 1 deletion Dockerfile
Expand Up @@ -10,7 +10,7 @@ RUN yarn global add http-server
RUN export PATH="$(yarn global bin):$PATH"

FROM serverpackage
COPY --from=builder /app/dist /app
COPY --from=builder /app/plugins/odf/dist /app
COPY --from=builder /app/http-server.sh .
ENTRYPOINT [ "./http-server.sh", "./app" ]

4 changes: 2 additions & 2 deletions Dockerfile.ci
Expand Up @@ -10,7 +10,7 @@ RUN yarn global add http-server
RUN export PATH="$(yarn global bin):$PATH"

FROM serverpackage
COPY --from=builder /app/dist /app
COPY --from=builder /app/dist /app/compatibility
COPY --from=builder /app/plugins/odf/dist /app
COPY --from=builder /app/plugins/odf/dist /app/compatibility
COPY --from=builder /app/http-server.sh .
ENTRYPOINT [ "./http-server.sh", "./app" ]
5 changes: 2 additions & 3 deletions Dockerfile.mco.ci
@@ -1,7 +1,6 @@
FROM node:15 AS builder
WORKDIR /app
COPY . /app
RUN sed -i "s/\"name\": \"odf-console\"/\"name\": \"odf-multicluster-console\"/" package.json
RUN yarn install
RUN yarn build-mco

Expand All @@ -11,7 +10,7 @@ RUN yarn global add http-server
RUN export PATH="$(yarn global bin):$PATH"

FROM serverpackage
COPY --from=builder /app/dist /app
COPY --from=builder /app/dist /app/compatibility
COPY --from=builder /app/plugins/mco/dist /app
COPY --from=builder /app/plugins/mco/dist /app/compatibility
COPY --from=builder /app/http-server.sh .
ENTRYPOINT [ "./http-server.sh", "./app" ]
4 changes: 2 additions & 2 deletions Dockerfile.prod
Expand Up @@ -8,12 +8,12 @@ RUN git fetch origin ${TARGET_BRANCH} && git checkout origin/${TARGET_BRANCH}

RUN yarn install --prod=false
RUN yarn build
RUN mv ./dist ../app
RUN mv ./plugins/odf/dist ../app

RUN git fetch origin ${TARGET_BRANCH}-compatibility && git checkout origin/${TARGET_BRANCH}-compatibility
RUN yarn install
RUN yarn build
RUN mv ./dist ../compatibility
RUN mv ./plugins/odf/dist ../compatibility

FROM registry.access.redhat.com/ubi8/nginx-118
ADD default.conf "${NGINX_CONFIGURATION_PATH}"
Expand Down
50 changes: 12 additions & 38 deletions package.json
@@ -1,25 +1,29 @@
{
"name": "odf-console",
"name": "odf-plugin",
"version": "0.0.0",
"description": "ODF console",
"description": "ODF plugin",
"license": "MIT",
"private": true,
"workspaces": [
"packages/*"
],
"repository": "git@github.com:red-hat-storage/odf-console.git",
"scripts": {
"clean": "rm -rf ./dist",
"clean": "yarn clean-mco && yarn clean-odf",
"clean-mco": "cd plugins/mco && rm -rf ./dist",
"clean-odf": "cd plugins/odf && rm -rf ./dist",
"cypress-merge": "mochawesome-merge ./gui-test-screenshots/cypress_report*.json > ./gui-test-screenshots/cypress.json",
"cypress-generate": "marge -o ./gui-test-screenshots/ -f cypress-report -t 'OpenShift Console Cypress Test Results' -p 'OpenShift Cypress Test Results' --showPassed false --assetsDir ./gui-test-screenshots/cypress/assets ./gui-test-screenshots/cypress.json",
"cypress-postreport": "yarn cypress-merge && yarn cypress-generate",
"test-cypress": "node_modules/.bin/cypress open --config-file ./cypress/cypress.json --env openshift=true",
"test-cypress-headless": "node --max-old-space-size=4096 node_modules/.bin/cypress run --config-file ./cypress/cypress.json --env openshift=true --browser ${BRIDGE_E2E_BROWSER_NAME:=chrome} --headless",
"build": "yarn clean && NODE_ENV=production I8N_NS=plugin__odf-console yarn ts-node ./node_modules/.bin/webpack",
"build-mco": "yarn clean && NODE_ENV=production MODE=MCO I8N_NS=plugin__odf-multicluster-console yarn ts-node ./node_modules/.bin/webpack",
"build-dev": "yarn clean && yarn ts-node ./node_modules/.bin/webpack",
"dev": "yarn clean && I8N_NS=plugin__odf-console yarn ts-node ./node_modules/.bin/webpack serve --progress",
"dev-mco": "yarn clean && MODE=MCO I8N_NS=plugin__odf-multicluster-console yarn ts-node ./node_modules/.bin/webpack serve",
"build:plugin": "yarn clean-${PLUGIN} && cd plugins/${PLUGIN} && ts-node ../../scripts/generatePluginPackage.ts && NODE_ENV=${NODE_ENV} I8N_NS=${I8N_NS} yarn ts-node ../../node_modules/.bin/webpack -c ../../webpack.config.ts",
"build": "NODE_ENV=production PLUGIN=odf I8N_NS=plugin__odf-console yarn build:plugin",
"build-mco": "NODE_ENV=production PLUGIN=mco I8N_NS=plugin__odf-multicluster-console yarn build:plugin",
"build-dev": "NODE_ENV=development PLUGIN=odf I8N_NS=plugin__odf-console yarn build:plugin",
"server:plugin": "yarn clean-${PLUGIN} && cd plugins/${PLUGIN} && ts-node ../../scripts/generatePluginPackage.ts && NODE_ENV=development I8N_NS=${I8N_NS} yarn ts-node ../../node_modules/.bin/webpack serve -c ../../webpack.config.ts --progress",
"dev": "PLUGIN=odf I8N_NS=plugin__odf-console yarn server:plugin",
"dev-mco": "PLUGIN=mco I8N_NS=plugin__odf-multicluster-console yarn server:plugin",
"http-server": "./http-server.sh ./dist",
"ts-node": "ts-node -O '{\"module\":\"commonjs\"}' -I '/node_modules/(?!(@odf)/)/'",
"lint-css": "yarn stylelint packages/**/**/*.scss",
Expand Down Expand Up @@ -112,35 +116,5 @@
"webpack": "5.64.4",
"webpack-cli": "4.5.x",
"webpack-dev-server": "^4.9.2"
},
"consolePlugin": {
"name": "odf-console",
"version": "0.0.0",
"displayName": "ODF(OpenShift Data Foundation) Plugin",
"description": "Console plugin for ODF",
"dependencies": {
"@console/pluginAPI": "*"
},
"exposedModules": {
"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",
"bcDetails": "@odf/core/components/resource-pages/BucketClassDetailsPage",
"nsDetails": "@odf/core/components/resource-pages/NamespaceStoreDetailsPage",
"editPage": "@odf/core/components/ResourceEditor/GenericResourceEditor"
}
}
}
7 changes: 0 additions & 7 deletions packages/odf/features.ts
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
83 changes: 83 additions & 0 deletions plugins/mco/console-extensions.json
@@ -0,0 +1,83 @@
[
{
"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-multicluster-console~Data Services%",
"insertBefore": "acm-applications"
}
},
{
"type": "console.navigation/href",
"properties": {
"id": "mco-data-policies",
"perspective": "acm",
"section": "mco-data-services",
"name": "%plugin__odf-multicluster-console~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" }
}
},
{
"type": "console.page/route",
"properties": {
"path": [
"/odf/edit/:cluster/ns/:namespace/:kind/:name/yaml",
"/odf/edit/:cluster/cluster/:kind/:name/yaml"
],
"exact": true,
"component": {
"$codeRef": "editPage.default"
}
}
}
]
15 changes: 15 additions & 0 deletions plugins/mco/console-plugin.json
@@ -0,0 +1,15 @@
{
"name": "odf-multicluster-console",
"version": "0.0.0",
"displayName": "ODF MCO(ODF Multicluster Orchestartor) Plugin",
"description": "Console plugin for ODF and DR",
"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",
"editPage": "@odf/core/components/ResourceEditor/GenericResourceEditor"
}
}