diff --git a/console-extensions.json b/console-extensions.json index be04878d..6a1dbeac 100644 --- a/console-extensions.json +++ b/console-extensions.json @@ -1,13 +1,3 @@ -/** - * This file declares all extensions contributed by the plugin. - * - * Depending on extension 'type', the 'properties' object may contain code references, encoded - * as object literals { $codeRef: string }. The '$codeRef' value should be formatted as either - * 'moduleName.exportName' (referring to a named export) or 'moduleName' (referring to the - * 'default' export). Only the plugin's exposed modules may be used in code references. - * - * TODO: update properties.name and properties.href - */ [ { "properties": { @@ -48,5 +38,169 @@ "exact": false, "path": "/envdynamic/:appName" } + }, + { + "type": "console.flag/hookProvider", + "properties": { + "handler": { "$codeRef": "gitopsFlags.detectOpenShiftVersion" } + } + }, + { + "type": "console.flag/model", + "properties": { + "model": { + "group": "argoproj.io", + "version": "v1alpha1", + "kind": "Rollout" + }, + "flag": "ARGO_ROLLOUT" + } + }, + { + "type": "console.topology/data/factory", + "properties": { + "id": "gitops-rollouts-topology-data-factory-dynamic-plugin", + "priority": "300", + "resources": { + "rollouts": { + "model": { + "group": "argoproj.io", + "version": "v1alpha1", + "kind": "Rollout" + }, + "opts": { "isList": true, "optional": true, "namespaced": true } + } + }, + "getDataModel": { + "$codeRef": "topology.getRolloutTopologyDataModel" + } + }, + "flags": { + "required": ["ARGO_ROLLOUT", "GITOPS_ENABLE_TOPOLOGY"] + } + }, + { + "type": "console.topology/component/factory", + "properties": { + "getFactory": { + "$codeRef": "topology.getRolloutViewComponentFactory" + } + }, + "flags": { + "required": ["ARGO_ROLLOUT", "GITOPS_ENABLE_TOPOLOGY"] + } + }, + { + "type": "console.topology/details/tab", + "properties": { + "id": "gitops-rollouts-topology-side-bar-tab-details", + "label": "Details", + "priority": "1000", + "insertBefore": "topology-side-bar-tab-resource" + }, + "flags": { + "required": ["ARGO_ROLLOUT", "GITOPS_ENABLE_TOPOLOGY"] + } + }, + { + "type": "console.topology/details/tab", + "properties": { + "id": "gitops-rollouts-topology-side-bar-tab-overview", + "label": "Overview" + }, + "flags": { + "required": ["ARGO_ROLLOUT", "GITOPS_ENABLE_TOPOLOGY"] + } + }, + { + "type": "console.topology/details/tab-section", + "properties": { + "id": "gitops-rollouts-topology-sidebar-details-tab-section", + "tab": "gitops-rollouts-topology-side-bar-tab-details", + "provider": { "$codeRef": "topology.useRolloutSideBarDetails" }, + "insertBefore": "gitops-rollouts-topology-sidebar-resource-tab-section" + }, + "flags": { + "required": ["ARGO_ROLLOUT", "GITOPS_ENABLE_TOPOLOGY"] + } + }, + { + "type": "console.topology/details/tab-section", + "properties": { + "id": "gitops-rollouts-topology-sidebar-resource-tab-section", + "tab": "topology-side-bar-tab-resource", + "provider": { "$codeRef": "topology.useOperatorBackedPanelResourceSection" } + }, + "flags": { + "required": ["ARGO_ROLLOUT", "GITOPS_ENABLE_TOPOLOGY"] + } + }, + { + "type": "console.action/provider", + "properties": { + "contextId": "topology-actions", + "provider": { "$codeRef": "topology.useGitOpsActionProviderForTopology" } + }, + "flags": { + "required": ["ARGO_ROLLOUT", "GITOPS_ENABLE_TOPOLOGY"] + } + }, + { + "type": "console.action/provider", + "properties": { + "contextId": "topology-context-actions", + "provider": { "$codeRef": "topology.useTopologyActionProvider" } + }, + "flags": { + "required": ["ARGO_ROLLOUT", "GITOPS_ENABLE_TOPOLOGY"] + } + }, + { + "type": "console.model-metadata", + "properties": { + "model": { + "group": "argoproj.io", + "version": "v1alpha1", + "kind": "Rollout" + }, + "badge": "dev", + "color": "#E9654B", + "label": "Argo Rollout", + "labelPlural": "Argo Rollouts", + "abbr": "AR" + }, + "flags": { + "required": ["ARGO_ROLLOUT", "GITOPS_ENABLE_TOPOLOGY"] + } + }, + { + "type": "console.model-metadata", + "properties": { + "model": { + "group": "argoproj.io", + "version": "v1alpha1", + "kind": "RolloutManager" + }, + "badge": "dev", + "color": "#E9654B", + "label": "Argo Rollout Manager", + "labelPlural": "Argo Rollout Managers", + "abbr": "ARM" + }, + "flags": { + "required": ["ARGO_ROLLOUT", "GITOPS_ENABLE_TOPOLOGY"] + } + }, + { + "type": "console.topology/decorator/provider", + "properties": { + "id": "argo-rollout-node-decorator", + "priority": 100, + "quadrant": "upperRight", + "decorator": { "$codeRef": "topology.getArgoRolloutNodeDecorator" } + }, + "flags": { + "required": ["ARGO_ROLLOUT", "GITOPS_ENABLE_TOPOLOGY"] + } } ] diff --git a/package.json b/package.json index 70cf118c..04871818 100644 --- a/package.json +++ b/package.json @@ -16,25 +16,24 @@ "lint": "eslint ./src --fix" }, "devDependencies": { - "@openshift-console/dynamic-plugin-sdk": "0.0.21", - "@openshift-console/dynamic-plugin-sdk-internal": "0.0.11", - "@openshift-console/dynamic-plugin-sdk-webpack": "0.0.11", - "@openshift-console/plugin-shared": "^0.0.1", - "@patternfly/quickstarts": "2.4.0", - "@patternfly/react-charts": "6.94.19", - "@patternfly/react-core": "4.276.8", - "@patternfly/react-icons": "3.15.17", - "@patternfly/react-table": "4.113.0", - "@patternfly/react-tokens": "4.94.6", - "@patternfly/react-topology": "5.0.0", - "@types/classnames": "^2.2.7", + "@openshift-console/dynamic-plugin-sdk": "^4.19.0-prerelease.2", + "@openshift-console/dynamic-plugin-sdk-internal": "^4.19.0-prerelease.2", + "@openshift-console/dynamic-plugin-sdk-webpack": "^4.19.0-prerelease.2", + "@openshift-console/plugin-shared": "^0.0.3", + "@patternfly/quickstarts": "^6.2.0", + "@patternfly/react-charts": "^8.2.0", + "@patternfly/react-core": "^6.2.0", + "@patternfly/react-icons": "^6.2.0", + "@patternfly/react-table": "^6.2.0", + "@patternfly/react-tokens": "6.2.0", + "@patternfly/react-topology": "^6.2.0", + "@types/classnames": "^2.3.1", "@types/git-url-parse": "^9.0.0", "@types/node": "^17.0.21", - "@types/react": "^17.0.37", - "@types/react-helmet": "^6.1.4", - "@types/react-redux": "7.1.24", - "@types/react-router-dom": "5.3.3", + "@types/react": "17.0.1", + "@types/react-redux": "7.1.34", "@types/webpack-dev-server": "^4.7.2", + "@types/semver": "7.7.0", "@typescript-eslint/eslint-plugin": "^5.15.0", "@typescript-eslint/parser": "^5.15.0", "copy-webpack-plugin": "12.0.2", @@ -50,54 +49,65 @@ "eslint-plugin-react": "^7.29.4", "eslint-plugin-react-hooks": "^4.3.0", "eslint-plugin-simple-import-sort": "^7.0.0", - "file-loader": "2.x", + "file-loader": "6.2.0", "i18next": "^19.8.3", "i18next-parser": "^3.3.0", "lodash-es": "^4.17.21", "prettier": "^2.6.0", - "prop-types": "^15.6.1", - "react": "^17.0.2", - "react-dom": "^17.0.2", - "react-helmet": "^6.1.0", - "react-i18next": "^11.14.3", + "prop-types": "15.7.x", + "http-server": "0.12.x", + "marked": "15.0.6", + "react": "17.0.1", + "react-dom": "17.0.1", + "react-i18next": "^11.7.3", "sass": "^1.42.1", "sass-loader": "^10.1.1", "style-loader": "^2.0.0", "ts-loader": "^9.5.1", "ts-node": "^10.7.0", - "typescript": "4.8.4", - "webpack": "^5.94.0", + "typescript": "5.8.3", + "webpack": "^5.1.0", "webpack-cli": "^4.9.2", "webpack-dev-server": "^4.9.3" }, "resolutions": { "glob-parent": "^5.1.2", "showdown": "^2.1.0", - "express": "4.21.0" + "express": "4.21.0", + "@types/jest": "21.x", + "hosted-git-info": "^3.0.8", + "jquery": "3.5.1", + "lodash-es": "^4.17.21", + "minimist": "1.2.5", + "ua-parser-js": "^0.7.24", + "jest": "21.x", + "postcss": "^8.2.13" }, "consolePlugin": { "name": "gitops-plugin", - "version": "0.0.14", + "version": "0.0.15", "displayName": "GitOps Plugin", "description": "OpenShift Console plugin for GitOps.", "exposedModules": { "environments": "./components/ApplicationListPage", "detailsPage": "./components/EnvironmentDetailsPageTabs", - "gitopsFlags": "./components/utils/flags" + "gitopsFlags": "./components/utils/flags", + "topology": "./components/topology" }, "dependencies": { "@console/pluginAPI": "*" } }, "dependencies": { - "classnames": "2.x", + "classnames": "^2.3.2", "git-url-parse": "^13.1.0", - "react": "^17.0.2", - "react-redux": "7.2.2", + "react": "17.0.1", + "react-helmet": "^6.1.0", + "react-redux": "7.2.9", "react-router": "5.3.x", "react-router-dom": "5.3.x", - "react-router-dom-v5-compat": "^6.11.2", - "react-router-hash-link": "^2.0.0", + "react-router-dom-v5-compat": "^6.22.0", + "react-router-hash-link": "2.4.3", "redux": "4.0.1" }, "//TODO": [ diff --git a/src/components/EnvironmentDetailsPageTabs.tsx b/src/components/EnvironmentDetailsPageTabs.tsx index 7fab3211..fae1d7d9 100644 --- a/src/components/EnvironmentDetailsPageTabs.tsx +++ b/src/components/EnvironmentDetailsPageTabs.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import Helmet from 'react-helmet'; +import { Helmet } from 'react-helmet'; import { useTranslation } from 'react-i18next'; import { useParams } from 'react-router-dom-v5-compat'; diff --git a/src/components/EnvironmentEmptyState.tsx b/src/components/EnvironmentEmptyState.tsx index 468bd7db..c18b7551 100644 --- a/src/components/EnvironmentEmptyState.tsx +++ b/src/components/EnvironmentEmptyState.tsx @@ -1,20 +1,15 @@ import * as React from 'react'; -import { - EmptyState, - EmptyStateBody, - EmptyStateIcon, - EmptyStateVariant, -} from '@patternfly/react-core'; +import { EmptyState, EmptyStateBody, EmptyStateVariant } from '@patternfly/react-core'; import { CubesIcon } from '@patternfly/react-icons'; interface EnvironmentEmptyStateProps { emptyStateMsg: string; } +// TODO find alternative for const EnvironmentEmptyState: React.FC = ({ emptyStateMsg }) => ( - - + {emptyStateMsg} ); diff --git a/src/components/details/EnvironmentDetails.tsx b/src/components/details/EnvironmentDetails.tsx index 63a69e13..21d8ca5d 100644 --- a/src/components/details/EnvironmentDetails.tsx +++ b/src/components/details/EnvironmentDetails.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { useTranslation } from 'react-i18next'; -import { Link } from 'react-router-dom'; +import { Link } from 'react-router-dom-v5-compat'; import * as _ from 'lodash'; import { Timestamp, useK8sWatchResource } from '@openshift-console/dynamic-plugin-sdk'; diff --git a/src/components/details/RenderStatusLabel.tsx b/src/components/details/RenderStatusLabel.tsx index 42c51795..c83f9165 100644 --- a/src/components/details/RenderStatusLabel.tsx +++ b/src/components/details/RenderStatusLabel.tsx @@ -17,23 +17,15 @@ const RenderStatusLabel: React.FC = ({ status }) => { const { t } = useTranslation('plugin__gitops-plugin'); switch (status) { case 'Synced': - return ( - - ); + return ; case 'OutOfSync': return ( -