Removes /grants, /grants/new, /grants/edit/:id
This commit is contained in:
parent
1b36ad6c1a
commit
4e9a35605d
|
@ -52,14 +52,15 @@ const appRoutes: Routes = [
|
|||
title: 'GENERAL.TITLES.ABOUT'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'grants',
|
||||
loadChildren: () => import('./ui/grant/grant.module').then(m => m.GrantModule),
|
||||
data: {
|
||||
breadcrumb: true,
|
||||
title: 'GENERAL.TITLES.GRANTS'
|
||||
}
|
||||
},
|
||||
// ----------- UNCOMMENT TO ADD AGAIN GRANTS --------
|
||||
// {
|
||||
// path: 'grants',
|
||||
// loadChildren: () => import('./ui/grant/grant.module').then(m => m.GrantModule),
|
||||
// data: {
|
||||
// breadcrumb: true,
|
||||
// title: 'GENERAL.TITLES.GRANTS'
|
||||
// }
|
||||
// },
|
||||
{
|
||||
path: 'plans',
|
||||
loadChildren: () => import('./ui/dmp/dmp.module').then(m => m.DmpModule),
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
import {of as observableOf, Observable } from 'rxjs';
|
||||
|
||||
import {switchMap, filter, map } from 'rxjs/operators';
|
||||
|
||||
import {of as observableOf, Observable } from 'rxjs';
|
||||
|
||||
import {switchMap, filter, map } from 'rxjs/operators';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute, NavigationEnd, Router } from '@angular/router';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
|
@ -101,9 +101,10 @@ export class AppComponent implements OnInit {
|
|||
this.router.navigate(['/plans'], { queryParams: { /*refresh : Math.random() ,returnUrl: this.state.url*/ } });
|
||||
}
|
||||
|
||||
goToGrants() {
|
||||
this.router.navigate(['/grants'], { queryParams: { /*refresh : Math.random() ,returnUrl: this.state.url*/ } });
|
||||
}
|
||||
// ----------- UNCOMMENT TO ADD AGAIN GRANTS --------
|
||||
// goToGrants() {
|
||||
// this.router.navigate(['/grants'], { queryParams: { /*refresh : Math.random() ,returnUrl: this.state.url*/ } });
|
||||
// }
|
||||
|
||||
initializeServices() {
|
||||
this.translate.setDefaultLang('en');
|
||||
|
|
|
@ -25,7 +25,8 @@
|
|||
<app-info-counter [title]="'DASHBOARD.MY-DATASETS'" [subtitle]="dashboardStatisticsData?.totalDataSetCount" routerLink='/datasets' buttonRedirectLink="/datasets/new" icon="library_books"></app-info-counter>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-6 col-sm-6">
|
||||
<app-info-counter [title]="'DASHBOARD.MY-GRANTS'" [subtitle]="dashboardStatisticsData?.totalGrantCount" routerLink='/grants' buttonRedirectLink="/grants/new" icon="work_outline"></app-info-counter>
|
||||
<!-- <app-info-counter [title]="'DASHBOARD.MY-GRANTS'" [subtitle]="dashboardStatisticsData?.totalGrantCount" routerLink='/grants' buttonRedirectLink="/grants/new" icon="work_outline"></app-info-counter> -->
|
||||
<app-info-counter [title]="'DASHBOARD.MY-GRANTS'" [subtitle]="dashboardStatisticsData?.totalGrantCount" icon="work_outline"></app-info-counter>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-6 col-sm-6">
|
||||
<app-info-counter [title]="'DASHBOARD.ORGANIZATIONS'" [subtitle]="dashboardStatisticsData?.totalOrganisationCount" icon="scatter_plot">
|
||||
|
@ -52,7 +53,8 @@
|
|||
<app-info-counter [title]="'DASHBOARD.DATASETS'" [subtitle]="dashboardStatisticsData?.totalDataSetCount" routerLink='/explore' buttonRedirectLink="/datasets/new" icon="library_books"></app-info-counter>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-6 col-sm-6">
|
||||
<app-info-counter [title]="'DASHBOARD.GRANTS'" [subtitle]="dashboardStatisticsData?.totalGrantCount" buttonRedirectLink="/grants/new" icon="work_outline"></app-info-counter>
|
||||
<!-- <app-info-counter [title]="'DASHBOARD.GRANTS'" [subtitle]="dashboardStatisticsData?.totalGrantCount" buttonRedirectLink="/grants/new" icon="work_outline"></app-info-counter> -->
|
||||
<app-info-counter [title]="'DASHBOARD.GRANTS'" [subtitle]="dashboardStatisticsData?.totalGrantCount" icon="work_outline"></app-info-counter>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-6 col-sm-6">
|
||||
<app-info-counter title="Related Organizations" [subtitle]="dashboardStatisticsData?.totalOrganisationCount" icon="scatter_plot"></app-info-counter>
|
||||
|
|
|
@ -163,11 +163,11 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr
|
|||
label: this.language.instant('NAV-BAR.MY-DATASET-DESCRIPTIONS'),
|
||||
url: '/datasets',
|
||||
notFoundResolver: [
|
||||
{
|
||||
parentComponentName: null,
|
||||
label: this.datasetWizardModel.dmp.grant.label,
|
||||
url: '/grants/edit/' + this.datasetWizardModel.dmp.grant.id
|
||||
},
|
||||
// {
|
||||
// parentComponentName: null,
|
||||
// label: this.datasetWizardModel.dmp.grant.label,
|
||||
// url: '/grants/edit/' + this.datasetWizardModel.dmp.grant.id
|
||||
// },
|
||||
{
|
||||
parentComponentName: null,
|
||||
label: this.datasetWizardModel.dmp.label,
|
||||
|
@ -199,11 +199,11 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr
|
|||
label: this.language.instant('NAV-BAR.MY-DATASET-DESCRIPTIONS'),
|
||||
url: '/datasets',
|
||||
notFoundResolver: [
|
||||
{
|
||||
parentComponentName: null,
|
||||
label: this.datasetWizardModel.dmp.grant.label,
|
||||
url: '/grants/edit/' + this.datasetWizardModel.dmp.grant.id
|
||||
},
|
||||
// {
|
||||
// parentComponentName: null,
|
||||
// label: this.datasetWizardModel.dmp.grant.label,
|
||||
// url: '/grants/edit/' + this.datasetWizardModel.dmp.grant.id
|
||||
// },
|
||||
{
|
||||
parentComponentName: null,
|
||||
label: this.datasetWizardModel.dmp.label,
|
||||
|
@ -261,11 +261,11 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr
|
|||
label: this.language.instant('NAV-BAR.MY-DATASET-DESCRIPTIONS'),
|
||||
url: '/datasets',
|
||||
notFoundResolver: [
|
||||
{
|
||||
parentComponentName: null,
|
||||
label: this.datasetWizardModel.dmp.grant.label,
|
||||
url: '/grants/edit/' + this.datasetWizardModel.dmp.grant.id
|
||||
},
|
||||
// {
|
||||
// parentComponentName: null,
|
||||
// label: this.datasetWizardModel.dmp.grant.label,
|
||||
// url: '/grants/edit/' + this.datasetWizardModel.dmp.grant.id
|
||||
// },
|
||||
{
|
||||
parentComponentName: null,
|
||||
label: this.datasetWizardModel.dmp.label,
|
||||
|
|
|
@ -27,9 +27,10 @@ export class DatasetListingItemComponent implements OnInit {
|
|||
this.onClick.emit(this.dataset);
|
||||
}
|
||||
|
||||
grantClicked(dataset: DatasetListingModel) {
|
||||
this.router.navigate(['/grants/edit/' + dataset.grantId]);
|
||||
}
|
||||
// ----------- UNCOMMENT TO ADD AGAIN GRANTS --------
|
||||
// grantClicked(dataset: DatasetListingModel) {
|
||||
// this.router.navigate(['/grants/edit/' + dataset.grantId]);
|
||||
// }
|
||||
|
||||
datasetClicked(dataset: DatasetListingModel) {
|
||||
this.router.navigate(['/plans/edit/' + dataset.dmpId])
|
||||
|
|
|
@ -53,13 +53,14 @@ const routes: Routes = [
|
|||
title: 'GENERAL.TITLES.DMP-OVERVIEW'
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'new/grant/:grantId',
|
||||
component: DmpEditorComponent,
|
||||
data: {
|
||||
breadcrumbs: 'new'
|
||||
}
|
||||
},
|
||||
// ----------- UNCOMMENT TO ADD AGAIN GRANTS --------
|
||||
// {
|
||||
// path: 'new/grant/:grantId',
|
||||
// component: DmpEditorComponent,
|
||||
// data: {
|
||||
// breadcrumbs: 'new'
|
||||
// }
|
||||
// },
|
||||
{
|
||||
path: 'new',
|
||||
component: DmpEditorComponent,
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
<!-- <p class="card-category">{{'DMP-LISTING.SUBTITLE' | translate}}</p> -->
|
||||
</div>
|
||||
<div class="row ml-auto p-2">
|
||||
<button mat-raised-button color="primary" class="text-uppercase lightblue-btn m-1" [routerLink]="grantId ? ['/plans/new/grant/', grantId] : ['./new']">
|
||||
<!-- <button mat-raised-button color="primary" class="text-uppercase lightblue-btn m-1" [routerLink]="grantId ? ['/plans/new/grant/', grantId] : ['./new']"> -->
|
||||
<button mat-raised-button color="primary" class="text-uppercase lightblue-btn m-1" [routerLink]="['./new']">
|
||||
<mat-icon>add</mat-icon> {{'DMP-LISTING.ACTIONS.NEW' | translate}}
|
||||
</button>
|
||||
<button mat-raised-button color="primary" class="text-uppercase lightblue-btn m-1" [routerLink]="['/quick-wizard']">
|
||||
|
|
|
@ -85,9 +85,10 @@ export class DmpListingItemComponent implements OnInit {
|
|||
this.onClick.emit(this.dmp);
|
||||
}
|
||||
|
||||
grantClicked(grantId: String) {
|
||||
this.router.navigate(['/grants/edit/' + grantId]);
|
||||
}
|
||||
// ----------- UNCOMMENT TO ADD AGAIN GRANTS --------
|
||||
// grantClicked(grantId: String) {
|
||||
// this.router.navigate(['/grants/edit/' + grantId]);
|
||||
// }
|
||||
|
||||
datasetClicked(dmpId: string) {
|
||||
this.router.navigate(['/plans/edit/' + dmpId], { queryParams: { tab: "datasetDescriptions" } });
|
||||
|
|
|
@ -93,9 +93,10 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
|
|||
this.router.navigate(['/plans/clone/' + dmp.id]);
|
||||
}
|
||||
|
||||
grantClicked(grantId: String) {
|
||||
this.router.navigate(['/grants/edit/' + grantId]);
|
||||
}
|
||||
// ----------- UNCOMMENT TO ADD AGAIN GRANTS --------
|
||||
// grantClicked(grantId: String) {
|
||||
// this.router.navigate(['/grants/edit/' + grantId]);
|
||||
// }
|
||||
|
||||
datasetClicked(datasetId: String) {
|
||||
if (this.isPublicView) {
|
||||
|
|
|
@ -1,36 +1,36 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
import { GrantEditorComponent } from './editor/grant-editor.component';
|
||||
import { GrantListingComponent } from './listing/grant-listing.component';
|
||||
// import { NgModule } from '@angular/core';
|
||||
// import { RouterModule, Routes } from '@angular/router';
|
||||
// import { GrantEditorComponent } from './editor/grant-editor.component';
|
||||
// import { GrantListingComponent } from './listing/grant-listing.component';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: GrantListingComponent,
|
||||
data: {
|
||||
breadcrumb: true
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'edit/:id',
|
||||
component: GrantEditorComponent,
|
||||
data: {
|
||||
breadcrumb: true,
|
||||
title: 'GENERAL.TITLES.GRANT-EDIT'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'new',
|
||||
component: GrantEditorComponent,
|
||||
data: {
|
||||
breadcrumb: true,
|
||||
title: 'GENERAL.TITLES.GRANT-NEW'
|
||||
},
|
||||
}
|
||||
];
|
||||
// const routes: Routes = [
|
||||
// {
|
||||
// path: '',
|
||||
// component: GrantListingComponent,
|
||||
// data: {
|
||||
// breadcrumb: true
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// path: 'edit/:id',
|
||||
// component: GrantEditorComponent,
|
||||
// data: {
|
||||
// breadcrumb: true,
|
||||
// title: 'GENERAL.TITLES.GRANT-EDIT'
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// path: 'new',
|
||||
// component: GrantEditorComponent,
|
||||
// data: {
|
||||
// breadcrumb: true,
|
||||
// title: 'GENERAL.TITLES.GRANT-NEW'
|
||||
// },
|
||||
// }
|
||||
// ];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule]
|
||||
})
|
||||
export class GrantRoutingModule { }
|
||||
// @NgModule({
|
||||
// imports: [RouterModule.forChild(routes)],
|
||||
// exports: [RouterModule]
|
||||
// })
|
||||
// export class GrantRoutingModule { }
|
||||
|
|
|
@ -6,7 +6,8 @@
|
|||
<a mat-button class="buttonNav navbar-button" routerLink="/explore">{{'NAV-BAR.PUBLIC-DATASETS' | translate}}</a>
|
||||
</div>
|
||||
<div *ngIf="isAuthenticated()" class="col-auto">
|
||||
<a mat-button class="buttonNav navbar-button" routerLink="/grants">{{'NAV-BAR.GRANTS' | translate}}</a>
|
||||
<!-- ----------- UNCOMMENT TO ADD AGAIN GRANTS -------- -->
|
||||
<!-- <a mat-button class="buttonNav navbar-button" routerLink="/grants">{{'NAV-BAR.GRANTS' | translate}}</a> -->
|
||||
<a mat-button class="buttonNav navbar-button" routerLink="/plans">{{'NAV-BAR.DMPS' | translate}}</a>
|
||||
<a mat-button class="buttonNav navbar-button" routerLink="/datasets">{{'NAV-BAR.DATASETS' | translate}}</a>
|
||||
<a *ngIf="isAdmin()" mat-button class="buttonNav navbar-button" routerLink="/users">{{'NAV-BAR.USERS' | translate}}</a>
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { NavbarComponent } from './navbar.component';
|
||||
|
||||
describe('NavbarComponent', () => {
|
||||
let component: NavbarComponent;
|
||||
let fixture: ComponentFixture<NavbarComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ NavbarComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(NavbarComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
|
@ -43,13 +43,10 @@ export const PUBLIC_ROUTES: RouteInfo[] = [
|
|||
{ path: '/explore', title: 'SIDE-BAR.PUBLIC-DESC', icon: 'public' }
|
||||
];
|
||||
|
||||
export const GRANTS_ROUTES: RouteInfo[] = [
|
||||
{ path: '/grants', title: 'SIDE-BAR.MY-GRANTS', icon: 'work_outline' }
|
||||
];
|
||||
|
||||
// export const GRANTS_ROUTES: RouteInfo[] = [
|
||||
// { path: '/grants', title: 'SIDE-BAR.MY-GRANTS', icon: 'work_outline' }
|
||||
// ];
|
||||
|
||||
export const ADMIN_ROUTES: RouteInfo[] = [
|
||||
{ path: '/dmp-profiles', title: 'SIDE-BAR.DMP-TEMPLATES', icon: 'library_books' },
|
||||
{ path: '/dataset-profiles', title: 'SIDE-BAR.DATASET-TEMPLATES', icon: 'library_books' },
|
||||
|
@ -113,14 +110,15 @@ export class SidebarComponent implements OnInit {
|
|||
}
|
||||
this.groupMenuItems.push(this.datasetItems);
|
||||
|
||||
this.grantItems = {
|
||||
title: 'SIDE-BAR.GRANTS',
|
||||
routes: GRANTS_ROUTES,
|
||||
requiresAuthentication: true,
|
||||
requiresAdmin: false,
|
||||
isGeneral: false
|
||||
}
|
||||
this.groupMenuItems.push(this.grantItems);
|
||||
// ----------- UNCOMMENT TO ADD AGAIN GRANTS --------
|
||||
// this.grantItems = {
|
||||
// title: 'SIDE-BAR.GRANTS',
|
||||
// routes: GRANTS_ROUTES,
|
||||
// requiresAuthentication: true,
|
||||
// requiresAdmin: false,
|
||||
// isGeneral: false
|
||||
// }
|
||||
// this.groupMenuItems.push(this.grantItems);
|
||||
|
||||
this.adminItems = {
|
||||
title: 'SIDE-BAR.ADMIN',
|
||||
|
|
Loading…
Reference in New Issue