Project

General

Profile

« Previous | Next » 

Revision 60538

[Monitor Dashboard | Trunk]: Remove dashboard from development. Add canActivateChild on monitor guard.

View differences:

modules/uoa-monitor-portal/trunk/monitor_dashboard/package.json
18 18
    "build": "ng build",
19 19
    "build:client-and-server-bundles": "ng build --prod --sourceMap --stats-json=true --base-href /dashboard/ && ng run ng-universal-demo:server:production",
20 20
    "build:client-and-server-bundles-beta": "ng build --configuration=beta --sourceMap --stats-json=true --base-href /dashboard/ && ng run ng-universal-demo:server:beta",
21
    "build:client-and-server-bundles-dev": "ng build --configuration=development --sourceMap --stats-json=true --base-href /dashboard/ && ng run ng-universal-demo:server:development",
21
    "build:client-and-server-bundles-dev": "ng build --configuration=development --sourceMap --stats-json=true && ng run ng-universal-demo:server:development",
22 22
    "build:prerender": "npm run build:client-and-server-bundles && npm run webpack:server && npm run generate:prerender",
23 23
    "build:ssr": "npm run build:client-and-server-bundles  && npm run webpack:server",
24 24
    "build:prerender-beta": "npm run build:client-and-server-bundles-beta && npm run webpack:server && npm run generate:prerender",
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/admin-tools/admin-tools-routing.module.ts
9 9
        loadChildren: '../openaireLibrary/dashboard/entity/entities.module#EntitiesModule',
10 10
        pathMatch: 'full'
11 11
      },
12
      {
12
     /* {
13 13
        path: 'classContents',
14 14
        loadChildren: '../openaireLibrary/dashboard/divhelpcontent/div-help-contents.module#DivHelpContentsModule'
15 15
      },
......
57 57
        path: 'pageContents/edit',
58 58
        loadChildren: '../openaireLibrary/dashboard/helpTexts/edit-page-help-content.module#EditPageHelpContentModule',
59 59
        pathMatch: 'full'
60
      }
60
      }*/
61 61
    ])
62 62
  ]
63 63
})
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/app.module.ts
14 14
import {NavigationBarModule} from './openaireLibrary/sharedComponents/navigationBar.module';
15 15

  
16 16
import {EnvironmentSpecificResolver} from './openaireLibrary/utils/properties/environmentSpecificResolver';
17
import {UserMiniModule} from "./openaireLibrary/login/userMiniModule.module";
18 17
import {SideBarModule} from "./openaireLibrary/dashboard/sharedComponents/sidebar/sideBar.module";
19 18
import {SharedModule} from "./openaireLibrary/shared/shared.module";
20 19
import {Schema2jsonldModule} from "./openaireLibrary/sharedComponents/schema2jsonld/schema2jsonld.module";
......
25 24
import {ErrorInterceptorService} from "./openaireLibrary/error-interceptor.service";
26 25
import {AdminLoginGuard} from "./openaireLibrary/login/adminLoginGuard.guard";
27 26
import {AdminDashboardGuard} from "./utils/adminDashboard.guard";
27
import {LoginGuard} from "./openaireLibrary/login/loginGuard.guard";
28 28

  
29 29
@NgModule({
30 30
  
......
46 46
  declarations: [AppComponent, OpenaireErrorPageComponent],
47 47
  exports: [AppComponent],
48 48
  providers: [
49
    EnvironmentSpecificResolver, AdminLoginGuard, AdminDashboardGuard,
49
    EnvironmentSpecificResolver, AdminLoginGuard, AdminDashboardGuard, LoginGuard,
50 50
    {
51 51
      provide: HTTP_INTERCEPTORS,
52 52
      useClass: HttpInterceptorService,
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/admin-stakeholder/admin-stakeholder-routing.module.ts
1 1
import {NgModule} from "@angular/core";
2 2
import {RouterModule} from "@angular/router";
3
import {ConnectRIGuard} from "../openaireLibrary/connect/communityGuard/connectRIGuard.guard";
4
import {EnvironmentSpecificResolver} from "../openaireLibrary/utils/properties/environmentSpecificResolver";
5 3

  
6 4
@NgModule({
7 5
  imports: [RouterModule.forChild([
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/utils/adminDashboard.guard.ts
1 1
import {Injectable} from '@angular/core';
2
import {ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot} from '@angular/router';
2
import {
3
  ActivatedRouteSnapshot,
4
  CanActivate,
5
  CanActivateChild,
6
  Router,
7
  RouterStateSnapshot,
8
  UrlTree
9
} from '@angular/router';
3 10
import {Observable} from 'rxjs/Observable';
4 11

  
5 12
import {map, take, tap} from "rxjs/operators";
......
11 18

  
12 19

  
13 20
@Injectable()
14
export class AdminDashboardGuard implements CanActivate {
21
export class AdminDashboardGuard implements CanActivate, CanActivateChild {
15 22

  
16 23
  constructor(private router: Router,
17 24
              private stakeholderService: StakeholderService,
......
41 48
  canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> | boolean {
42 49
    return this.check(state.url, route.params.stakeholder);
43 50
  }
51
  
52
  canActivateChild(childRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
53
    return this.check(state.url, childRoute.params.stakeholder);
54
  }
44 55
}
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/manageStakeholders/manageStakeholders-routing.module.ts
2 2
import {RouterModule} from '@angular/router';
3 3
import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
4 4
import {ManageStakeholdersComponent} from "./manageStakeholders.component";
5
import {LoginGuard} from "../openaireLibrary/login/loginGuard.guard";
6 5

  
7 6
@NgModule({
8 7
  imports: [
......
10 9
      {
11 10
        path: '',
12 11
        component: ManageStakeholdersComponent,
13
        canActivate: [LoginGuard],
14 12
        canDeactivate: [PreviousRouteRecorder],
15 13
        data: {hasSidebar: true}
16 14
      }
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/manageStakeholders/manageStakeholders.module.ts
12 12
import {IconsModule} from "../openaireLibrary/utils/icons/icons.module";
13 13
import {IconsService} from "../openaireLibrary/utils/icons/icons.service";
14 14
import {add, bullet, earth, group, lock, search} from "../openaireLibrary/utils/icons/icons";
15
import {LoginGuard} from "../openaireLibrary/login/loginGuard.guard";
16 15
import {PageContentModule} from "../openaireLibrary/dashboard/sharedComponents/page-content/page-content.module";
17 16

  
18 17
@NgModule({
......
30 29
    PageContentModule
31 30
  ],
32 31
  providers: [
33
    LoginGuard, PreviousRouteRecorder,
32
    PreviousRouteRecorder,
34 33
  ],
35 34
  exports: [ManageStakeholdersComponent]
36 35
})
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/users/users-routing.module.ts
1 1
import {NgModule} from '@angular/core';
2 2
import {RouterModule} from '@angular/router';
3 3
import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
4
import {AdminDashboardGuard} from "../utils/adminDashboard.guard";
5 4
import {UsersComponent} from "./users.component";
6 5

  
7 6
@NgModule({
......
10 9
      {
11 10
        path: '',
12 11
        component: UsersComponent,
13
        canActivate: [AdminDashboardGuard],
14 12
        canDeactivate: [PreviousRouteRecorder]
15 13
      }
16 14
    ])
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/users/users.module.ts
2 2
import {UsersComponent} from "./users.component";
3 3
import {CommonModule} from "@angular/common";
4 4
import {UsersRoutingModule} from "./users-routing.module";
5
import {AdminDashboardGuard} from "../utils/adminDashboard.guard";
6 5
import {LoadingModule} from "../openaireLibrary/utils/loading/loading.module";
7 6
import {PageContentModule} from "../openaireLibrary/dashboard/sharedComponents/page-content/page-content.module";
8 7
import {RoleUsersModule} from "../openaireLibrary/dashboard/users/role-users/role-users.module";
......
11 10
@NgModule({
12 11
  imports: [CommonModule, UsersRoutingModule, LoadingModule, PageContentModule, RoleUsersModule, RouterModule],
13 12
  declarations: [UsersComponent],
14
  exports: [UsersComponent],
15
  providers: [AdminDashboardGuard]
13
  exports: [UsersComponent]
16 14
})
17
export class UsersModule {}
15
export class UsersModule {
16
}
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/general/general.module.ts
8 8
import {LoadingModule} from "../openaireLibrary/utils/loading/loading.module";
9 9
import {AlertModalModule} from "../openaireLibrary/utils/modal/alertModal.module";
10 10
import {ReactiveFormsModule} from "@angular/forms";
11
import {AdminDashboardGuard} from "../utils/adminDashboard.guard";
12 11
import {EditStakeholderModule} from "./edit-stakeholder/edit-stakeholder.module";
13 12
import {PageContentModule} from "../openaireLibrary/dashboard/sharedComponents/page-content/page-content.module";
14 13

  
......
26 25
    PageContentModule
27 26
  ],
28 27
  providers: [
29
    AdminDashboardGuard, PreviousRouteRecorder,
28
    PreviousRouteRecorder,
30 29
  ],
31 30
  exports: [GeneralComponent]
32 31
})
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/general/general-routing.module.ts
2 2
import {RouterModule} from '@angular/router';
3 3
import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
4 4
import {GeneralComponent} from "./general.component";
5
import {AdminDashboardGuard} from "../utils/adminDashboard.guard";
6 5

  
7 6
@NgModule({
8 7
  imports: [
......
10 9
      {
11 10
        path: '',
12 11
        component: GeneralComponent,
13
        canActivate: [AdminDashboardGuard],
14 12
        canDeactivate: [PreviousRouteRecorder],
15 13
        data: {hasSidebar: true}
16 14
      }
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/topic/topic.module.ts
12 12
import {AlertModalModule} from "../openaireLibrary/utils/modal/alertModal.module";
13 13
import {InputModule} from "../openaireLibrary/sharedComponents/input/input.module";
14 14
import {ClickModule} from "../openaireLibrary/utils/click/click.module";
15
import {AdminDashboardGuard} from "../utils/adminDashboard.guard";
16 15
import {IconsService} from "../openaireLibrary/utils/icons/icons.service";
17 16
import {
18 17
  preview,
......
28 27
import {IconsModule} from "../openaireLibrary/utils/icons/icons.module";
29 28
import {PageContentModule} from "../openaireLibrary/dashboard/sharedComponents/page-content/page-content.module";
30 29
import {LoadingModule} from "../openaireLibrary/utils/loading/loading.module";
30
import {NotifyFormModule} from "../openaireLibrary/notifications/notify-form/notify-form.module";
31 31

  
32 32
@NgModule({
33 33
  imports: [
34 34
    CommonModule, TopicRoutingModule, ClickModule, RouterModule, FormsModule, AlertModalModule,
35
    ReactiveFormsModule, InputModule, IconsModule, PageContentModule, LoadingModule
35
    ReactiveFormsModule, InputModule, IconsModule, PageContentModule, LoadingModule, NotifyFormModule
36 36
  ],
37 37
  declarations: [
38 38
    TopicComponent, IndicatorsComponent
39 39
  ],
40 40
  providers: [
41
    AdminDashboardGuard, PreviousRouteRecorder,
41
    PreviousRouteRecorder,
42 42
    PiwikService
43 43
  ],
44 44
  exports: [
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/topic/topic-routing.module.ts
3 3
import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
4 4
import {TopicComponent} from "./topic.component";
5 5
import {CanExitGuard} from "../openaireLibrary/utils/can-exit.guard";
6
import {AdminDashboardGuard} from "../utils/adminDashboard.guard";
7 6

  
8 7
@NgModule({
9 8
  imports: [
......
11 10
      {
12 11
        path: '',
13 12
        component: TopicComponent,
14
        canActivate: [AdminDashboardGuard],
15 13
        canDeactivate: [PreviousRouteRecorder, CanExitGuard]
16 14
      }
17 15
    ])
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/app/app-routing.module.ts
6 6

  
7 7
import {OpenaireErrorPageComponent} from './error/errorPage.component';
8 8
import {AdminLoginGuard} from "./openaireLibrary/login/adminLoginGuard.guard";
9
import {AdminDashboardGuard} from "./utils/adminDashboard.guard";
10
import {LoginGuard} from "./openaireLibrary/login/loginGuard.guard";
9 11

  
10 12
const routes: Routes = [
11 13
  {
......
26 28
  {
27 29
    path: 'admin',
28 30
    loadChildren: './manageStakeholders/manageStakeholders.module#ManageStakeholdersModule',
29
    data: {hasAdminMenu: true}
31
    data: {hasAdminMenu: true},
32
    canActivateChild: [LoginGuard]
30 33
  },
31 34
  {
32 35
    path: 'admin/admin-tools',
33 36
    loadChildren: './admin-tools/portal-admin-tools-routing.module#PortalAdminToolsRoutingModule',
34
    canActivate: [AdminLoginGuard],
37
    canActivateChild: [AdminLoginGuard],
35 38
    data: {hasAdminMenu: true}
36 39
  },
37 40
  {
38 41
    path: 'admin/monitor/admin-tools',
39 42
    loadChildren: './admin-tools/admin-tools-routing.module#AdminToolsRoutingModule',
40
    canActivate: [AdminLoginGuard],
43
    canActivateChild: [AdminLoginGuard],
41 44
    data: {hasAdminMenu: true, portal: 'monitor'}
42 45
  },
43 46
  {
44 47
    path: 'admin/:stakeholder',
45 48
    loadChildren: './admin-stakeholder/admin-stakeholder-routing.module#AdminStakeholderRoutingModule',
49
    canActivateChild: [AdminDashboardGuard]
46 50
  },
47 51
  {path: 'theme', loadChildren: './openaireLibrary/utils/theme/theme.module#ThemeModule'},
48 52
  {
modules/uoa-monitor-portal/trunk/monitor_dashboard/src/environments/environment.ts
73 73
  csvLimit: 2000,
74 74
  pagingLimit: 20,
75 75
  resultsPerPage: 10,
76
  baseLink: "/dashboard",
76
  baseLink: "/",
77 77
  domain: "http://mpagasas.di.uoa.gr:4600",
78 78
  searchLinkToResult: "/search/result?id=",
79 79
  searchLinkToPublication: "/search/publication?articleId=",

Also available in: Unified diff