import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { AuthGuard } from '../../core/auth-guard.service';
import { DatasetWizardComponent } from './dataset-wizard/dataset-wizard.component';
import { DatasetListingComponent } from './listing/dataset-listing.component';

const routes: Routes = [
	{
		path: 'new/:dmpId',
		component: DatasetWizardComponent,
		canActivate: [AuthGuard],
		data: {
			breadcrumb: true,
			title: 'GENERAL.TITLES.DATASET-NEW'
		},
	},
	{
		path: 'edit/:id',
		component: DatasetWizardComponent,
		canActivate: [AuthGuard],
		data: {
			breadcrumb: true,
			public: false,
			title: 'GENERAL.TITLES.DATASET-EDIT'
		},
	},
	{
		path: 'publicEdit/:publicId',
		component: DatasetWizardComponent,
		//canActivate: [AuthGuard],
		data: {
			public: true,
			title: 'GENERAL.TITLES.DATASET-PUBLIC-EDIT'
		}
	},
	{
		path: 'new',
		component: DatasetWizardComponent,
		canActivate: [AuthGuard],
		data: {
			breadcrumb: true,
			title: 'GENERAL.TITLES.DATASET-NEW'
		},
	},
	{
		path: '',
		component: DatasetListingComponent,
		canActivate: [AuthGuard],
		data: {
			breadcrumb: true
		},
	},
	{
		path: 'dmp/:dmpId',
		component: DatasetListingComponent,
		canActivate: [AuthGuard],
		data: {
			breadcrumb: true
		},
	},
	{
		path: 'copy/:id',
		component: DatasetWizardComponent,
		canActivate: [AuthGuard],
		data: {
			breadcrumb: true,
			title: 'GENERAL.TITLES.DATASET-COPY'
		},
	},
	{
		path: 'profileupdate/:updateId',
		component: DatasetWizardComponent,
		canActivate: [AuthGuard],
		data: {
			breadcrumb: true,
			title: 'GENERAL.TITLES.DATASET-UPDATE'
		},
	}
];

@NgModule({
	imports: [RouterModule.forChild(routes)],
	exports: [RouterModule]
})
export class DatasetRoutingModule { }
