Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions src/ui/app/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ import {
ROUTE_DATA_TYPE_LIST,
ROUTE_DATA_TYPE_ADD,
ROUTE_DATA_TYPE_EDIT,
ROUTE_DATA_TYPE_ATTRIBUTE_ADD,
ROUTE_DATA_TYPE_ATTRIBUTE_EDIT,
ROUTE_ATTRIBUTE_MONOLIST_ADD,
ROUTE_PROFILE_TYPE_LIST,
ROUTE_PROFILE_TYPE_ADD,
Expand Down Expand Up @@ -132,12 +130,8 @@ import ReloadConfirmPage from 'ui/reload-configuration/ReloadConfirmPage';
import ListDataTypePage from 'ui/data-types/list/ListDataTypePage';
import AddDataTypesPage from 'ui/data-types/add/AddDataTypesPage';
import EditDataTypesPage from 'ui/data-types/edit/EditDataTypesPage';
import AddDataTypeAttributePage from 'ui/data-types/attributes/AddDataTypeAttributePage';
import EditDataTypeAttributePage from 'ui/data-types/attributes/EditDataTypeAttributePage';
import MonolistPageContainer from 'ui/data-types/attributes/monolist/MonolistPageContainer';

import AddProfileTypeAttributePage from 'ui/profile-types/attributes/AddProfileTypeAttributePage';
import EditProfileTypeAttributePage from 'ui/profile-types/attributes/EditProfileTypeAttributePage';
import MonolistPageContainer from 'ui/data-types/attributes/monolist/MonolistPageContainer';
import MonolistProfilePageContainer from 'ui/profile-types/attributes/monolist/MonolistProfilePageContainer';
import CloneWidgetPage from 'ui/widgets/clone/CloneWidgetPage';

Expand Down Expand Up @@ -185,6 +179,8 @@ const UploadFileBrowserPage = React.lazy(() => import('ui/file-browser/upload/Up
const CreateFolderPage = React.lazy(() => import('ui/file-browser/add/CreateFolderPage'));
const CreateTextFilePage = React.lazy(() => import('ui/file-browser/add/CreateTextFilePage'));
const EditTextFilePage = React.lazy(() => import('ui/file-browser/edit/EditTextFilePage'));
const AddProfileTypeAttributePage = React.lazy(() => import('ui/profile-types/attributes/AddProfileTypeAttributePage'));
const EditProfileTypeAttributePage = React.lazy(() => import('ui/profile-types/attributes/EditProfileTypeAttributePage'));

// component repository
const ComponentListPage = React.lazy(() => import('ui/component-repository/components/list/ComponentListPage'));
Expand Down Expand Up @@ -400,10 +396,16 @@ const RouteComponent = () => {
path={ROUTE_PLUGIN_CONFIG_PAGE}
render={() => renderWithSuspense(<PluginConfigPageContainer />)}
/>
<Route path={ROUTE_DATA_TYPE_ATTRIBUTE_ADD} component={AddDataTypeAttributePage} />
<Route path={ROUTE_DATA_TYPE_ATTRIBUTE_EDIT} component={EditDataTypeAttributePage} />
<Route path={ROUTE_PROFILE_TYPE_ATTRIBUTE_ADD} component={AddProfileTypeAttributePage} />
<Route path={ROUTE_PROFILE_TYPE_ATTRIBUTE_EDIT} component={EditProfileTypeAttributePage} />
<Route
path={ROUTE_PROFILE_TYPE_ATTRIBUTE_ADD}
render={() =>
renderWithSuspense(<AddProfileTypeAttributePage />)}
/>
<Route
path={ROUTE_PROFILE_TYPE_ATTRIBUTE_EDIT}
render={() =>
renderWithSuspense(<EditProfileTypeAttributePage />)}
/>
<Route path={ROUTE_ATTRIBUTE_MONOLIST_ADD} component={MonolistPageContainer} />
<Route path={ROUTE_ATTRIBUTE_MONOLIST_PROFILE_ADD} component={MonolistProfilePageContainer} />
<Route exact path={ROUTE_RELOAD_CONFIG} component={ReloadConfigPage} />
Expand Down
19 changes: 19 additions & 0 deletions test/ui/app/App.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ import PageNotFoundContainer from 'ui/app/PageNotFoundContainer';
import ListDatabasePage from 'ui/database/list/ListDatabasePage';
import AddDatabasePageContainer from 'ui/database/add/AddDatabasePageContainer';
import ReportDatabasePageContainer from 'ui/database/report/ReportDatabasePageContainer';
import AddProfileTypeAttributePage from 'ui/profile-types/attributes/AddProfileTypeAttributePage';
import EditProfileTypeAttributePage from 'ui/profile-types/attributes/EditProfileTypeAttributePage';

import {
ROUTE_HOME,
Expand Down Expand Up @@ -101,6 +103,8 @@ import {
ROUTE_DATABASE_LIST,
ROUTE_DATABASE_ADD,
ROUTE_DATABASE_REPORT,
ROUTE_PROFILE_TYPE_ATTRIBUTE_ADD,
ROUTE_PROFILE_TYPE_ATTRIBUTE_EDIT,
} from 'app-init/router';
import { mountWithIntl } from 'test/legacyTestUtils';

Expand Down Expand Up @@ -405,6 +409,21 @@ describe('App', () => {
});
});


it('route to add profile type attribute page', async () => {
await waitFor(async () => {
const component = mountWithRoute(ROUTE_PROFILE_TYPE_ATTRIBUTE_ADD);
expect(component.find(AddProfileTypeAttributePage).exists()).toBe(true);
});
});

it('route to edit profile type attribute page', async () => {
await waitFor(async () => {
const component = mountWithRoute(ROUTE_PROFILE_TYPE_ATTRIBUTE_EDIT);
expect(component.find(EditProfileTypeAttributePage).exists()).toBe(true);
});
});

describe('component repository', () => {
describe('component repository disabled', () => {
it('routes to the disable page on ROUTE_ECR_COMPONENT_LIST', async () => {
Expand Down