@choerodon/master
Version:
A package of Master for Choerodon platform.
75 lines (72 loc) • 2.77 kB
JavaScript
import React, { Suspense } from 'react';
import { Route, Switch, withRouter, Redirect } from 'react-router-dom';
import { observer } from 'mobx-react-lite';
import { ModalContainer } from 'choerodon-ui/pro/lib';
import { inject } from 'mobx-react';
import { mount } from '@choerodon/inject';
import { Loading } from '@choerodon/components';
import PermissionRoute from "../../../../components/permission-route";
var Unauthorized = /*#__PURE__*/React.lazy(function () {
return import("../routes/unauthorized");
});
var WorkBench = /*#__PURE__*/React.lazy(function () {
return import("../routes/workBench/list/view");
});
var WorkBenchEdit = /*#__PURE__*/React.lazy(function () {
return import("../routes/workBench/list/edit");
});
var ProjectsPro = /*#__PURE__*/React.lazy(function () {
return import("../routes/projectsPro");
});
var ProjectOverview = /*#__PURE__*/React.lazy(function () {
return import("../routes/projectOverview");
});
var InnerIndex = function InnerIndex(_ref) {
var match = _ref.match,
AutoRouter = _ref.AutoRouter,
AppState = _ref.AppState;
return /*#__PURE__*/React.createElement("div", {
style: {
background: 'white',
height: '100%'
}
}, /*#__PURE__*/React.createElement(Suspense, {
fallback: /*#__PURE__*/React.createElement(Loading, {
type: "c7n"
})
}, /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(Route, {
exact: true,
path: "".concat(match.url, "projects"),
component: ProjectsPro
}), /*#__PURE__*/React.createElement(Route, {
exact: true,
path: "".concat(match.url, "unauthorized"),
component: Unauthorized
}), /*#__PURE__*/React.createElement(PermissionRoute, {
exact: true,
path: "".concat(match.url, "workbench"),
component: function component() {
if (AppState.currentMenuType.organizationId) {
return /*#__PURE__*/React.createElement(WorkBench, null);
}
return '';
}
}), /*#__PURE__*/React.createElement(PermissionRoute, {
service: ['choerodon.code.project.project.overview.ps.default'],
exact: true,
path: "".concat(match.url, "agile/project-overview"),
component: ProjectOverview
}), /*#__PURE__*/React.createElement(Route, {
exact: true,
path: "/"
}, /*#__PURE__*/React.createElement(Redirect, {
to: "".concat(match.url, "workbench")
})), /*#__PURE__*/React.createElement(Route, {
path: "".concat(match.url, "workbench/edit"),
component: WorkBenchEdit
}), /*#__PURE__*/React.createElement(Route, {
path: match.url,
component: AutoRouter
}))), mount('base-pro:newUserGuideStep'), /*#__PURE__*/React.createElement(ModalContainer, null));
};
export default withRouter(inject('AppState')(observer(InnerIndex)));