Commit c421f54e authored by Oleksii Savran's avatar Oleksii Savran

Merge branch '241-login-redirects' into 'master'

Login redirects

Closes #241

See merge request genesys-pgr/genesys-ui!247
parents 8c2204de bc3ae23e
......@@ -2,7 +2,7 @@ import Loadable from 'utilities/CustomReactLoadable';
import steps from 'datasets/ui/dashboard/dataset-stepper/steps';
import { ROLE_ADMINISTRATOR, ROLE_USER } from 'constants/userRoles';
import {ROLE_ADMINISTRATOR, ROLE_VETTEDUSER} from 'constants/userRoles';
const publicRoutes = [
{
......@@ -48,7 +48,7 @@ const dashboardRoutes = [
loader: () => import(/* webpackMode:"lazy", webpackChunkName: "datasets" */'datasets/ui/dashboard/DashboardPage'),
}),
exact: true,
auth: [ROLE_USER, ROLE_ADMINISTRATOR],
auth: [ROLE_VETTEDUSER, ROLE_ADMINISTRATOR],
extraProps: {
title: 'My Dashboard',
},
......@@ -58,7 +58,7 @@ const dashboardRoutes = [
component: Loadable({
loader: () => import(/* webpackMode:"lazy", webpackChunkName: "datasets" */'datasets/ui/dashboard/StepperPage'),
}),
auth: [ROLE_USER, ROLE_ADMINISTRATOR],
auth: [ROLE_VETTEDUSER, ROLE_ADMINISTRATOR],
extraProps: {
title: 'datasets.dashboard.p.stepper.publisher',
},
......@@ -77,7 +77,7 @@ const dashboardRoutes = [
component: Loadable({
loader: () => import(/* webpackMode:"lazy", webpackChunkName: "datasets" */'datasets/ui/dashboard/StepperPage'),
}),
auth: [ROLE_USER, ROLE_ADMINISTRATOR],
auth: [ROLE_VETTEDUSER, ROLE_ADMINISTRATOR],
extraProps: {
title: 'datasets.dashboard.p.stepper.publisher',
},
......
......@@ -2,7 +2,7 @@ import Loadable from 'utilities/CustomReactLoadable';
import steps from 'descriptorlists/ui/dashboard/descriptorlist-stepper/steps';
import { ROLE_ADMINISTRATOR, ROLE_USER } from 'constants/userRoles';
import {ROLE_ADMINISTRATOR, ROLE_VETTEDUSER} from 'constants/userRoles';
const publicRoutes = [
......@@ -37,7 +37,7 @@ const dashboardRoutes = [
component: Loadable({
loader: () => import(/* webpackMode:"lazy", webpackChunkName: "descriptorlists" */'descriptorlists/ui/dashboard/DashboardPage'),
}),
auth: [ROLE_USER, ROLE_ADMINISTRATOR],
auth: [ROLE_VETTEDUSER, ROLE_ADMINISTRATOR],
extraProps: {
title: 'My Dashboard',
},
......@@ -48,7 +48,7 @@ const dashboardRoutes = [
loader: () => import(/* webpackMode:"lazy", webpackChunkName: "descriptorlists" */'descriptorlists/ui/dashboard/descriptorlist-stepper/StepperPage'),
}),
exact: true,
auth: [ROLE_USER, ROLE_ADMINISTRATOR],
auth: [ROLE_VETTEDUSER, ROLE_ADMINISTRATOR],
extraProps: {
title: 'Descriptor list publisher',
},
......@@ -67,7 +67,7 @@ const dashboardRoutes = [
component: Loadable({
loader: () => import(/* webpackMode:"lazy", webpackChunkName: "descriptorlists" */'descriptorlists/ui/dashboard/descriptorlist-stepper/StepperPage'),
}),
auth: [ROLE_USER, ROLE_ADMINISTRATOR],
auth: [ROLE_VETTEDUSER, ROLE_ADMINISTRATOR],
extraProps: {
title: 'Descriptor list publisher',
},
......
import Loadable from 'utilities/CustomReactLoadable';
import { ROLE_ADMINISTRATOR, ROLE_USER } from 'constants/userRoles';
import {ROLE_ADMINISTRATOR, ROLE_VETTEDUSER} from 'constants/userRoles';
const publicRoutes = [
......@@ -35,7 +35,7 @@ const dashboardRoutes = [
loader: () => import(/* webpackMode:"lazy", webpackChunkName: "descriptors" */'descriptors/ui/dashboard/DashboardPage'),
}),
exact: true,
auth: [ROLE_USER, ROLE_ADMINISTRATOR],
auth: [ROLE_VETTEDUSER, ROLE_ADMINISTRATOR],
extraProps: {
title: 'My Dashboard',
},
......@@ -45,7 +45,7 @@ const dashboardRoutes = [
component: Loadable({
loader: () => import(/* webpackMode:"lazy", webpackChunkName: "descriptors" */'descriptors/ui/dashboard/EditPage'),
}),
auth: [ROLE_USER, ROLE_ADMINISTRATOR],
auth: [ROLE_VETTEDUSER, ROLE_ADMINISTRATOR],
exact: true,
},
{
......@@ -53,7 +53,7 @@ const dashboardRoutes = [
component: Loadable({
loader: () => import(/* webpackMode:"lazy", webpackChunkName: "descriptors" */'descriptors/ui/dashboard/EditPage'),
}),
auth: [ROLE_USER, ROLE_ADMINISTRATOR],
auth: [ROLE_VETTEDUSER, ROLE_ADMINISTRATOR],
exact: true,
},
];
......
......@@ -2,7 +2,7 @@ import Loadable from 'utilities/CustomReactLoadable';
import steps from 'subsets/ui/dashboard/subset-stepper/steps';
import { ROLE_ADMINISTRATOR, ROLE_USER } from 'constants/userRoles';
import {ROLE_ADMINISTRATOR, ROLE_VETTEDUSER} from 'constants/userRoles';
const publicRoutes = [
{
......@@ -35,7 +35,7 @@ const dashboardRoutes = [
component: Loadable({
loader: () => import(/* webpackMode:"lazy", webpackChunkName: "subsets" */'subsets/ui/dashboard/StepperPage'),
}),
auth: [ROLE_USER, ROLE_ADMINISTRATOR],
auth: [ROLE_VETTEDUSER, ROLE_ADMINISTRATOR],
extraProps: {
title: 'Subset create',
},
......@@ -54,7 +54,7 @@ const dashboardRoutes = [
component: Loadable({
loader: () => import(/* webpackMode:"lazy", webpackChunkName: "subsets" */'subsets/ui/dashboard/DashboardPage'),
}),
auth: [ROLE_USER, ROLE_ADMINISTRATOR],
auth: [ROLE_VETTEDUSER, ROLE_ADMINISTRATOR],
exact: true,
extraProps: {
title: 'subsets.dashboard.p.stepper.publisher',
......@@ -65,7 +65,7 @@ const dashboardRoutes = [
component: Loadable({
loader: () => import(/* webpackMode:"lazy", webpackChunkName: "subsets" */'subsets/ui/dashboard/StepperPage'),
}),
auth: [ROLE_USER, ROLE_ADMINISTRATOR],
auth: [ROLE_VETTEDUSER, ROLE_ADMINISTRATOR],
extraProps: {
title: 'subsets.dashboard.p.stepper.publisher',
},
......
......@@ -3,6 +3,7 @@ import { translate } from 'react-i18next';
import renderRoutes from 'ui/renderRoutes';
import TopNavigation from './headers/v1/NavigationBar';
import {ROLE_ADMINISTRATOR, ROLE_VETTEDUSER} from 'constants/userRoles';
const DASHBOARD_MENUS = [
{
......@@ -32,6 +33,7 @@ const DASHBOARD_MENUS = [
{
to: '/dashboard/datasets/',
label: 'common.menu.catalog',
auth: [ROLE_VETTEDUSER, ROLE_ADMINISTRATOR],
subMenus: [
{
to: '/dashboard/datasets/',
......@@ -50,6 +52,7 @@ const DASHBOARD_MENUS = [
{
to: '/dashboard/subsets',
label: 'subsets.dashboard.menu.subsets',
auth: [ROLE_VETTEDUSER, ROLE_ADMINISTRATOR],
},
];
......
......@@ -38,7 +38,7 @@ class LoginContainer extends React.Component<ILoginContainerProps, void> {
return checkTokenRequest(access_token);
})
.then((data) => {
history.push('/dashboard');
history.push('/');
return false;
}).catch((e) => {
const data = _.get(e, 'response.data');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment