Revision 60012
Added by Konstantinos Triantafyllou over 3 years ago
modules/uoa-connect-portal/trunk/src/app/searchPages/communities/searchCommunities-routing.module.ts | ||
---|---|---|
2 | 2 |
import { RouterModule } from '@angular/router'; |
3 | 3 |
import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; |
4 | 4 |
import {SearchCommunitiesComponent} from "./searchCommunities.component"; |
5 |
import {IsRouteEnabled} from "../../openaireLibrary/error/isRouteEnabled.guard"; |
|
5 | 6 |
|
6 | 7 |
@NgModule({ |
7 | 8 |
imports: [ |
8 | 9 |
RouterModule.forChild([ |
9 |
{ path: '', component: SearchCommunitiesComponent, canDeactivate: [PreviousRouteRecorder] } |
|
10 |
|
|
10 |
{ path: '', component: SearchCommunitiesComponent, canActivate: [IsRouteEnabled],canDeactivate: [PreviousRouteRecorder] } |
|
11 | 11 |
]) |
12 | 12 |
] |
13 | 13 |
}) |
modules/uoa-connect-portal/trunk/src/app/searchPages/communities/searchCommunities.module.ts | ||
---|---|---|
6 | 6 |
import {SearchCommunitiesRoutingModule} from "./searchCommunities-routing.module"; |
7 | 7 |
import {PreviousRouteRecorder} from "../../openaireLibrary/utils/piwik/previousRouteRecorder.guard"; |
8 | 8 |
import {NewSearchPageModule} from "../../openaireLibrary/searchPages/searchUtils/newSearchPage.module"; |
9 |
import {IsRouteEnabled} from "../../openaireLibrary/error/isRouteEnabled.guard"; |
|
9 | 10 |
|
10 | 11 |
@NgModule({ |
11 | 12 |
imports: [ |
... | ... | |
15 | 16 |
declarations: [ |
16 | 17 |
SearchCommunitiesComponent |
17 | 18 |
], |
18 |
providers:[ PreviousRouteRecorder], |
|
19 |
providers: [ |
|
20 |
PreviousRouteRecorder, |
|
21 |
IsRouteEnabled |
|
22 |
], |
|
19 | 23 |
exports: [ |
20 | 24 |
SearchCommunitiesComponent |
21 | 25 |
] |
22 | 26 |
}) |
23 |
export class SearchCommunitiesModule { } |
|
27 |
export class SearchCommunitiesModule { |
|
28 |
} |
modules/uoa-connect-portal/trunk/src/app/communities/communities.module.ts | ||
---|---|---|
17 | 17 |
import {GifSliderModule} from "../openaireLibrary/utils/gif-slider/gif-slider.module"; |
18 | 18 |
import {OtherPortalsModule} from "../openaireLibrary/sharedComponents/other-portals/other-portals.module"; |
19 | 19 |
import {SEOServiceModule} from "../openaireLibrary/sharedComponents/SEO/SEOService.module"; |
20 |
import {IsRouteEnabled} from "../openaireLibrary/error/isRouteEnabled.guard"; |
|
20 | 21 |
|
21 | 22 |
@NgModule({ |
22 | 23 |
imports: [ |
... | ... | |
30 | 31 |
], |
31 | 32 |
providers:[ |
32 | 33 |
PreviousRouteRecorder, |
33 |
PiwikService |
|
34 |
PiwikService, |
|
35 |
IsRouteEnabled |
|
34 | 36 |
], |
35 | 37 |
exports: [ |
36 | 38 |
CommunitiesComponent |
modules/uoa-connect-portal/trunk/src/app/communities/communities-routing.module.ts | ||
---|---|---|
4 | 4 |
import{CommunitiesComponent} from './communities.component'; |
5 | 5 |
|
6 | 6 |
import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; |
7 |
import {IsRouteEnabled} from "../openaireLibrary/error/isRouteEnabled.guard"; |
|
7 | 8 |
|
8 | 9 |
@NgModule({ |
9 | 10 |
imports: [ |
10 | 11 |
RouterModule.forChild([ |
11 |
{ path: '', component: CommunitiesComponent, canDeactivate: [PreviousRouteRecorder] } |
|
12 |
|
|
12 |
{ path: '', component: CommunitiesComponent, canActivate: [IsRouteEnabled], canDeactivate: [PreviousRouteRecorder] } |
|
13 | 13 |
]) |
14 | 14 |
] |
15 | 15 |
}) |
modules/uoa-connect-portal/trunk/src/app/app.component.ts | ||
---|---|---|
144 | 144 |
if(communityId) { |
145 | 145 |
this.properties.adminToolsPortalType = "community"; |
146 | 146 |
} |
147 |
this.configurationService.initCommunityInformation(this.properties, communityId);
|
|
147 |
this.configurationService.initCommunityInformation(this.properties, (communityId)?communityId:this.properties.adminToolsPortalType);
|
|
148 | 148 |
this.buildMenu(communityId); |
149 | 149 |
})); |
150 | 150 |
} else { |
... | ... | |
153 | 153 |
if(communityId) { |
154 | 154 |
this.properties.adminToolsPortalType = "community"; |
155 | 155 |
} |
156 |
this.configurationService.initCommunityInformation(this.properties, communityId);
|
|
156 |
this.configurationService.initCommunityInformation(this.properties, (communityId)?communityId:this.properties.adminToolsPortalType);
|
|
157 | 157 |
this.buildMenu(communityId); |
158 | 158 |
} |
159 | 159 |
this.communityId = communityId; |
... | ... | |
263 | 263 |
}; |
264 | 264 |
this.menuItems = []; |
265 | 265 |
this.menuItems.push({ |
266 |
rootItem: new MenuItem("about", "About", "", "/about/learn-how", false, [], null, {}),
|
|
266 |
rootItem: new MenuItem("about", "About", "", "/about/learn-how", false, [], ["/about/learn-how"], {}),
|
|
267 | 267 |
items: [ |
268 |
new MenuItem("", "Learn the process", "", "/about/learn-how", false, [], [], {}), |
|
268 |
new MenuItem("", "Learn the process", "", "/about/learn-how", false, [], ["/about/learn-in-depth"], {}),
|
|
269 | 269 |
new MenuItem("", "Publications", "", "/publications", false, [], ["/publications"], {}), |
270 | 270 |
new MenuItem("", "Roadmap", "https://trello.com/b/yfzUz0kp/openaire-connect-dashboard", "", false, [], [], {}), |
271 | 271 |
new MenuItem("", "FAQs", "", "/about/faq", false, [], ["/about/faq"], {}) |
... | ... | |
273 | 273 |
|
274 | 274 |
}); |
275 | 275 |
this.menuItems.push({ |
276 |
rootItem: new MenuItem("communities", "Communities", "", "/search/find/communities", false, [], null, {}),
|
|
276 |
rootItem: new MenuItem("communities", "Communities", "", "/search/find/communities", false, [], ['/search/find/communities'], {}),
|
|
277 | 277 |
items: [] |
278 | 278 |
}); |
279 | 279 |
this.menuItems.push({ |
280 |
rootItem: new MenuItem("contact-us", "Contact us", "", "/contact-us", false, [], null, {}),
|
|
280 |
rootItem: new MenuItem("contact-us", "Contact us", "", "/contact-us", false, [], ['/contact-us'], {}),
|
|
281 | 281 |
items: [] |
282 | 282 |
}); |
283 | 283 |
this.bottomMenuItems = [ |
Also available in: Unified diff
[Connect | Trunk]: Fix Route enabled bug