From 86fd689e787778ebaf8f5b9500b5e1f4f1db50a4 Mon Sep 17 00:00:00 2001 From: "Jingwei.Zhang" Date: Thu, 18 Nov 2021 09:13:18 +0800 Subject: [PATCH] refactor: Remove useless func getUrl Remove useless func getUrl Change-Id: I12989c6efcfc4ba7fb4cd292860be9059b74497b --- src/components/Form/index.jsx | 4 ---- src/components/StepForm/index.jsx | 4 ---- src/components/TableButton/RuleButton.jsx | 4 ---- src/containers/Action/FormAction/index.jsx | 4 ---- src/containers/BaseDetail/index.jsx | 4 ---- src/containers/List/index.jsx | 4 ---- src/containers/TabDetail/index.jsx | 4 ---- src/containers/TabList/index.jsx | 4 ---- src/layouts/Base/Menu.jsx | 4 ---- src/layouts/Base/Right.jsx | 4 ---- src/layouts/Base/index.jsx | 4 ---- 11 files changed, 44 deletions(-) diff --git a/src/components/Form/index.jsx b/src/components/Form/index.jsx index c321c8d3..7c9aede7 100644 --- a/src/components/Form/index.jsx +++ b/src/components/Form/index.jsx @@ -134,10 +134,6 @@ export default class BaseForm extends React.Component { return this.props.rootStore.projectName; } - getUrl(path, adminStr) { - return this.isAdminPage ? `${path}${adminStr || '-admin'}` : path; - } - getRouteName(routeName) { return this.isAdminPage ? `${routeName}Admin` : routeName; } diff --git a/src/components/StepForm/index.jsx b/src/components/StepForm/index.jsx index 4998c20c..37b59246 100644 --- a/src/components/StepForm/index.jsx +++ b/src/components/StepForm/index.jsx @@ -209,10 +209,6 @@ export default class BaseStepForm extends React.Component { this.formRefs = this.steps.map(() => React.createRef()); } - getUrl(path, adminStr) { - return this.isAdminPage ? `${path}${adminStr || '-admin'}` : path; - } - getRouteName(routeName) { return this.isAdminPage ? `${routeName}Admin` : routeName; } diff --git a/src/components/TableButton/RuleButton.jsx b/src/components/TableButton/RuleButton.jsx index 3dbe853c..f0685fe1 100644 --- a/src/components/TableButton/RuleButton.jsx +++ b/src/components/TableButton/RuleButton.jsx @@ -18,10 +18,6 @@ import { getSelfColumns } from 'resources/security-group-rule'; import { getPath } from 'utils/route-map'; export default class RuleButton extends Component { - getUrl(path, adminStr) { - return this.isAdminPage ? `${path}${adminStr || '-admin'}` : path; - } - getDetailUrl(id) { const key = this.isAdminPage ? 'securityGroupDetailAdmin' diff --git a/src/containers/Action/FormAction/index.jsx b/src/containers/Action/FormAction/index.jsx index 378b4981..50123a57 100644 --- a/src/containers/Action/FormAction/index.jsx +++ b/src/containers/Action/FormAction/index.jsx @@ -34,10 +34,6 @@ export default class FormAction extends BaseForm { return this.props.isAdminPage || false; } - getUrl(path, adminStr) { - return this.isAdminPage ? `${path}${adminStr || '-admin'}` : path; - } - getRouteName(routeName) { return this.isAdminPage ? `${routeName}Admin` : routeName; } diff --git a/src/containers/BaseDetail/index.jsx b/src/containers/BaseDetail/index.jsx index c3a9fd60..65b1ec26 100644 --- a/src/containers/BaseDetail/index.jsx +++ b/src/containers/BaseDetail/index.jsx @@ -83,10 +83,6 @@ export default class BaseDetail extends React.Component { return false; } - getUrl(path, adminStr) { - return this.isAdminPage ? `${path}${adminStr || '-admin'}` : path; - } - getRouteName(routeName) { return this.isAdminPage ? `${routeName}Admin` : routeName; } diff --git a/src/containers/List/index.jsx b/src/containers/List/index.jsx index 519a23c0..3be6dfe1 100644 --- a/src/containers/List/index.jsx +++ b/src/containers/List/index.jsx @@ -166,10 +166,6 @@ export default class BaseList extends React.Component { return this.props.rootStore.hasAdminRole; } - getUrl(path, adminStr) { - return this.isAdminPage ? `${path}${adminStr || '-admin'}` : path; - } - getRouteName(routeName) { return this.isAdminPage ? `${routeName}Admin` : routeName; } diff --git a/src/containers/TabDetail/index.jsx b/src/containers/TabDetail/index.jsx index 06d41fdb..0ca04744 100644 --- a/src/containers/TabDetail/index.jsx +++ b/src/containers/TabDetail/index.jsx @@ -68,10 +68,6 @@ export default class DetailBase extends React.Component { return isAdminPage(pathname); } - getUrl(path, adminStr) { - return this.isAdminPage ? `${path}${adminStr || '-admin'}` : path; - } - getRouteName(routeName) { return this.isAdminPage ? `${routeName}Admin` : routeName; } diff --git a/src/containers/TabList/index.jsx b/src/containers/TabList/index.jsx index ec59b855..2ce3b123 100644 --- a/src/containers/TabList/index.jsx +++ b/src/containers/TabList/index.jsx @@ -64,10 +64,6 @@ export default class TabList extends Component { return this.checkEndpoint && !this.endpoint; } - getUrl(path, adminStr) { - return this.isAdminPage ? `${path}${adminStr || '-admin'}` : path; - } - getRouteName(routeName) { return this.isAdminPage ? `${routeName}Admin` : routeName; } diff --git a/src/layouts/Base/Menu.jsx b/src/layouts/Base/Menu.jsx index 560ebf10..ddbce42c 100644 --- a/src/layouts/Base/Menu.jsx +++ b/src/layouts/Base/Menu.jsx @@ -44,10 +44,6 @@ export class LayoutMenu extends Component { return this.props.isAdminPage || false; } - getUrl(path, adminStr) { - return this.isAdminPage ? `${path}${adminStr || '-admin'}` : path; - } - getRouteName(routeName) { return this.isAdminPage ? `${routeName}Admin` : routeName; } diff --git a/src/layouts/Base/Right.jsx b/src/layouts/Base/Right.jsx index ff419f1e..71d727e4 100644 --- a/src/layouts/Base/Right.jsx +++ b/src/layouts/Base/Right.jsx @@ -56,10 +56,6 @@ class Right extends Component { return this.props.isAdminPage || false; } - getUrl(path, adminStr) { - return this.isAdminPage ? `${path}${adminStr || '-admin'}` : path; - } - getRouteName(routeName) { return this.isAdminPage ? `${routeName}Admin` : routeName; } diff --git a/src/layouts/Base/index.jsx b/src/layouts/Base/index.jsx index 8ac914ce..4b64bded 100644 --- a/src/layouts/Base/index.jsx +++ b/src/layouts/Base/index.jsx @@ -97,10 +97,6 @@ export class BaseLayout extends Component { return this.getMenuByLicense(this.originMenu); } - getUrl(path, adminStr) { - return this.isAdminPage ? `${path}${adminStr || '-admin'}` : path; - } - getRouteName(routeName) { return this.isAdminPage ? `${routeName}Admin` : routeName; }