import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { DatasetProfileEditorComponent } from './editor/dataset-profile-editor.component';
import { DatasetProfileListingComponent } from './listing/dataset-profile-listing.component';
import { AdminAuthGuard } from '@app/core/admin-auth-guard.service';

const routes: Routes = [
	{
		path: 'new',
		component: DatasetProfileEditorComponent,
		data: {
			title: 'GENERAL.TITLES.DATASET-PROFILES-NEW'
		},
		canActivate: [AdminAuthGuard]
	},
	{
		path: ':id',
		component: DatasetProfileEditorComponent,
		data: {
			title: 'GENERAL.TITLES.DATASET-PROFILES-EDIT'
		},
		canActivate: [AdminAuthGuard]
	},
	{
		path: 'clone/:cloneid',
		component: DatasetProfileEditorComponent,
		data: {
			title: 'GENERAL.TITLES.DATASET-PROFILES-CLONE'
		},
		canActivate: [AdminAuthGuard]
	},
	{
		path: 'newversion/:newversionid',
		component: DatasetProfileEditorComponent,
		data: {
			title: 'GENERAL.TITLES.DATASET-PROFILES-NEW-VERSION'
		},
		canActivate: [AdminAuthGuard]
	},
	{
		path: 'versions/:groupId',
		component: DatasetProfileListingComponent,
		canActivate: [AdminAuthGuard]
	},
	{
		path: '',
		component: DatasetProfileListingComponent,
		canActivate: [AdminAuthGuard]
	},
];

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