forked from hazza/dspace-angular
[DURACOM-191] fix routing modules
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
import { Routes } from '@angular/router';
|
||||
import { LdnServicesOverviewComponent } from './ldn-services-directory/ldn-services-directory.component';
|
||||
import { NavigationBreadcrumbResolver } from '../../core/breadcrumbs/navigation-breadcrumb.resolver';
|
||||
import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver';
|
||||
@@ -28,10 +27,7 @@ const moduleRoutes: Routes = [
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
RouterModule.forChild(moduleRoutes.map(route => {
|
||||
export const ROUTES = moduleRoutes.map(route => {
|
||||
return {...route, data: {
|
||||
...route.data,
|
||||
relatedRoutes: moduleRoutes.filter(relatedRoute => relatedRoute.path !== route.path)
|
||||
@@ -39,9 +35,4 @@ const moduleRoutes: Routes = [
|
||||
return {path: relatedRoute.path, data: relatedRoute.data};
|
||||
})
|
||||
}};
|
||||
}))
|
||||
]
|
||||
})
|
||||
export class AdminLdnServicesRoutingModule {
|
||||
|
||||
}
|
||||
});
|
@@ -1,8 +1,5 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { AdminLdnServicesRoutingModule } from './admin-ldn-services-routing.module';
|
||||
import { LdnServicesOverviewComponent } from './ldn-services-directory/ldn-services-directory.component';
|
||||
import { LdnServiceFormComponent } from './ldn-service-form/ldn-service-form.component';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { LdnItemfiltersService } from './ldn-services-data/ldn-itemfilters-data.service';
|
||||
|
||||
@@ -10,13 +7,8 @@ import { LdnItemfiltersService } from './ldn-services-data/ldn-itemfilters-data.
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
AdminLdnServicesRoutingModule,
|
||||
FormsModule
|
||||
],
|
||||
declarations: [
|
||||
LdnServicesOverviewComponent,
|
||||
LdnServiceFormComponent,
|
||||
],
|
||||
providers: [LdnItemfiltersService]
|
||||
})
|
||||
export class AdminLdnServicesModule {
|
||||
|
@@ -6,15 +6,15 @@ import {
|
||||
TemplateRef,
|
||||
ViewChild
|
||||
} from '@angular/core';
|
||||
import {FormArray, FormBuilder, FormGroup, Validators} from '@angular/forms';
|
||||
import { FormArray, FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
|
||||
import {LDN_SERVICE} from '../ldn-services-model/ldn-service.resource-type';
|
||||
import {ActivatedRoute, Router} from '@angular/router';
|
||||
import {LdnServicesService} from '../ldn-services-data/ldn-services-data.service';
|
||||
import {notifyPatterns} from '../ldn-services-patterns/ldn-service-coar-patterns';
|
||||
import {animate, state, style, transition, trigger} from '@angular/animations';
|
||||
import {NgbModal} from '@ng-bootstrap/ng-bootstrap';
|
||||
import { NgbDropdownModule, NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import {NotificationsService} from '../../../shared/notifications/notifications.service';
|
||||
import {TranslateService} from '@ngx-translate/core';
|
||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
||||
import {LdnService} from '../ldn-services-model/ldn-services.model';
|
||||
import {RemoteData} from 'src/app/core/data/remote-data';
|
||||
import {Operation} from 'fast-json-patch';
|
||||
@@ -27,6 +27,7 @@ import {PaginationService} from '../../../core/pagination/pagination.service';
|
||||
import {FindListOptions} from '../../../core/data/find-list-options.model';
|
||||
import {NotifyServicePattern} from '../ldn-services-model/ldn-service-patterns.model';
|
||||
import { IpV4Validator } from '../../../shared/utils/ipV4.validator';
|
||||
import { AsyncPipe, NgForOf, NgIf } from '@angular/common';
|
||||
|
||||
|
||||
/**
|
||||
@@ -36,6 +37,7 @@ import { IpV4Validator } from '../../../shared/utils/ipV4.validator';
|
||||
selector: 'ds-ldn-service-form',
|
||||
templateUrl: './ldn-service-form.component.html',
|
||||
styleUrls: ['./ldn-service-form.component.scss'],
|
||||
standalone: true,
|
||||
animations: [
|
||||
trigger('toggleAnimation', [
|
||||
state('true', style({})),
|
||||
@@ -43,6 +45,14 @@ import { IpV4Validator } from '../../../shared/utils/ipV4.validator';
|
||||
transition('true <=> false', animate('300ms ease-in')),
|
||||
]),
|
||||
],
|
||||
imports: [
|
||||
ReactiveFormsModule,
|
||||
TranslateModule,
|
||||
NgIf,
|
||||
NgbDropdownModule,
|
||||
NgForOf,
|
||||
AsyncPipe
|
||||
]
|
||||
})
|
||||
export class LdnServiceFormComponent implements OnInit, OnDestroy {
|
||||
formModel: FormGroup;
|
||||
|
@@ -21,7 +21,12 @@ import {hasValue} from '../../../shared/empty.util';
|
||||
import {Operation} from 'fast-json-patch';
|
||||
import {getFirstCompletedRemoteData} from '../../../core/shared/operators';
|
||||
import {NotificationsService} from '../../../shared/notifications/notifications.service';
|
||||
import {TranslateService} from '@ngx-translate/core';
|
||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
||||
import { AsyncPipe, NgClass, NgIf } from '@angular/common';
|
||||
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
||||
import { TruncatableComponent } from '../../../shared/truncatable/truncatable.component';
|
||||
import { TruncatablePartComponent } from '../../../shared/truncatable/truncatable-part/truncatable-part.component';
|
||||
import { RouterLink } from '@angular/router';
|
||||
|
||||
|
||||
/**
|
||||
@@ -33,7 +38,18 @@ import {TranslateService} from '@ngx-translate/core';
|
||||
selector: 'ds-ldn-services-directory',
|
||||
templateUrl: './ldn-services-directory.component.html',
|
||||
styleUrls: ['./ldn-services-directory.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.Default
|
||||
changeDetection: ChangeDetectionStrategy.Default,
|
||||
imports: [
|
||||
NgIf,
|
||||
TranslateModule,
|
||||
AsyncPipe,
|
||||
PaginationComponent,
|
||||
TruncatableComponent,
|
||||
TruncatablePartComponent,
|
||||
NgClass,
|
||||
RouterLink
|
||||
],
|
||||
standalone: true
|
||||
})
|
||||
export class LdnServicesOverviewComponent implements OnInit, OnDestroy {
|
||||
|
||||
|
28
src/app/admin/admin-reports/admin-reports-routes.ts
Normal file
28
src/app/admin/admin-reports/admin-reports-routes.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { FilteredCollectionsComponent } from './filtered-collections/filtered-collections.component';
|
||||
import { FilteredItemsComponent } from './filtered-items/filtered-items.component';
|
||||
import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver';
|
||||
|
||||
export const ROUTES = [
|
||||
{
|
||||
path: 'collections',
|
||||
resolve: {breadcrumb: I18nBreadcrumbResolver},
|
||||
data: {title: 'admin.reports.collections.title', breadcrumbKey: 'admin.reports.collections'},
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: FilteredCollectionsComponent
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: 'queries',
|
||||
resolve: {breadcrumb: I18nBreadcrumbResolver},
|
||||
data: {title: 'admin.reports.items.title', breadcrumbKey: 'admin.reports.items'},
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: FilteredItemsComponent
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
@@ -1,37 +0,0 @@
|
||||
import { FilteredCollectionsComponent } from './filtered-collections/filtered-collections.component';
|
||||
import { FilteredItemsComponent } from './filtered-items/filtered-items.component';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
RouterModule.forChild([
|
||||
{
|
||||
path: 'collections',
|
||||
resolve: { breadcrumb: I18nBreadcrumbResolver },
|
||||
data: {title: 'admin.reports.collections.title', breadcrumbKey: 'admin.reports.collections'},
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: FilteredCollectionsComponent
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: 'queries',
|
||||
resolve: { breadcrumb: I18nBreadcrumbResolver },
|
||||
data: {title: 'admin.reports.items.title', breadcrumbKey: 'admin.reports.items'},
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: FilteredItemsComponent
|
||||
}
|
||||
]
|
||||
}
|
||||
])
|
||||
]
|
||||
})
|
||||
export class AdminReportsRoutingModule {
|
||||
|
||||
}
|
@@ -1,26 +1,16 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FilteredCollectionsComponent } from './filtered-collections/filtered-collections.component';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { FormModule } from '../../shared/form/form.module';
|
||||
import { FilteredItemsComponent } from './filtered-items/filtered-items.component';
|
||||
import { AdminReportsRoutingModule } from './admin-reports-routing.module';
|
||||
import { NgbAccordionModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { FiltersComponent } from './filters-section/filters-section.component';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
RouterModule,
|
||||
FormModule,
|
||||
AdminReportsRoutingModule,
|
||||
NgbAccordionModule
|
||||
],
|
||||
declarations: [
|
||||
FilteredCollectionsComponent,
|
||||
FilteredItemsComponent,
|
||||
FiltersComponent
|
||||
]
|
||||
})
|
||||
export class AdminReportsModule {
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { Component, ViewChild } from '@angular/core';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { NgbAccordion } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { NgbAccordion, NgbAccordionModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { Observable } from 'rxjs';
|
||||
import { RestRequestMethod } from 'src/app/core/data/rest-request-method';
|
||||
import { DspaceRestService } from 'src/app/core/dspace-rest/dspace-rest.service';
|
||||
@@ -8,6 +8,8 @@ import { RawRestResponse } from 'src/app/core/dspace-rest/raw-rest-response.mode
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { FiltersComponent } from '../filters-section/filters-section.component';
|
||||
import { FilteredCollections } from './filtered-collections.model';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { KeyValuePipe, NgForOf } from '@angular/common';
|
||||
|
||||
/**
|
||||
* Component representing the Filtered Collections content report
|
||||
@@ -15,7 +17,15 @@ import { FilteredCollections } from './filtered-collections.model';
|
||||
@Component({
|
||||
selector: 'ds-report-filtered-collections',
|
||||
templateUrl: './filtered-collections.component.html',
|
||||
styleUrls: ['./filtered-collections.component.scss']
|
||||
styleUrls: ['./filtered-collections.component.scss'],
|
||||
imports: [
|
||||
TranslateModule,
|
||||
NgbAccordionModule,
|
||||
FiltersComponent,
|
||||
KeyValuePipe,
|
||||
NgForOf
|
||||
],
|
||||
standalone: true
|
||||
})
|
||||
export class FilteredCollectionsComponent {
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import { Component, ViewChild } from '@angular/core';
|
||||
import { FormArray, FormBuilder, FormControl, FormGroup } from '@angular/forms';
|
||||
import { NgbAccordion } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { FormArray, FormBuilder, FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
||||
import { NgbAccordion, NgbAccordionModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
||||
import { map, Observable } from 'rxjs';
|
||||
import { CollectionDataService } from 'src/app/core/data/collection-data.service';
|
||||
import { CommunityDataService } from 'src/app/core/data/community-data.service';
|
||||
@@ -23,6 +23,7 @@ import { FilteredItems } from './filtered-items-model';
|
||||
import { OptionVO } from './option-vo.model';
|
||||
import { PresetQuery } from './preset-query.model';
|
||||
import { QueryPredicate } from './query-predicate.model';
|
||||
import { AsyncPipe, NgForOf } from '@angular/common';
|
||||
|
||||
/**
|
||||
* Component representing the Filtered Items content report.
|
||||
@@ -30,7 +31,16 @@ import { QueryPredicate } from './query-predicate.model';
|
||||
@Component({
|
||||
selector: 'ds-report-filtered-items',
|
||||
templateUrl: './filtered-items.component.html',
|
||||
styleUrls: ['./filtered-items.component.scss']
|
||||
styleUrls: ['./filtered-items.component.scss'],
|
||||
imports: [
|
||||
ReactiveFormsModule,
|
||||
NgbAccordionModule,
|
||||
TranslateModule,
|
||||
AsyncPipe,
|
||||
NgForOf,
|
||||
FiltersComponent
|
||||
],
|
||||
standalone: true
|
||||
})
|
||||
export class FilteredItemsComponent {
|
||||
|
||||
|
@@ -1,7 +1,9 @@
|
||||
import { Component, Input } from '@angular/core';
|
||||
import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
|
||||
import { FormBuilder, FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
||||
import { FilterGroup } from './filter-group.model';
|
||||
import { Filter } from './filter.model';
|
||||
import { NgForOf } from '@angular/common';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
/**
|
||||
* Component representing the Query Filters section used in both
|
||||
@@ -10,7 +12,13 @@ import { Filter } from './filter.model';
|
||||
@Component({
|
||||
selector: 'ds-filters',
|
||||
templateUrl: './filters-section.component.html',
|
||||
styleUrls: ['./filters-section.component.scss']
|
||||
styleUrls: ['./filters-section.component.scss'],
|
||||
imports: [
|
||||
NgForOf,
|
||||
ReactiveFormsModule,
|
||||
TranslateModule
|
||||
],
|
||||
standalone: true
|
||||
})
|
||||
export class FiltersComponent {
|
||||
|
||||
|
@@ -5,7 +5,12 @@ import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.reso
|
||||
import { AdminWorkflowPageComponent } from './admin-workflow-page/admin-workflow-page.component';
|
||||
import { I18nBreadcrumbsService } from '../core/breadcrumbs/i18n-breadcrumbs.service';
|
||||
import { AdminCurationTasksComponent } from './admin-curation-tasks/admin-curation-tasks.component';
|
||||
import { NOTIFICATIONS_MODULE_PATH, REGISTRIES_MODULE_PATH } from './admin-routing-paths';
|
||||
import {
|
||||
LDN_PATH,
|
||||
NOTIFICATIONS_MODULE_PATH,
|
||||
REGISTRIES_MODULE_PATH,
|
||||
REPORTS_MODULE_PATH
|
||||
} from './admin-routing-paths';
|
||||
import { BatchImportPageComponent } from './admin-import-batch-page/batch-import-page.component';
|
||||
|
||||
const providers = [
|
||||
@@ -68,4 +73,20 @@ export const ROUTES: Route[] = [
|
||||
loadChildren: () => import('../system-wide-alert/system-wide-alert-routes').then((m) => m.ROUTES),
|
||||
data: {title: 'admin.system-wide-alert.title', breadcrumbKey: 'admin.system-wide-alert'}
|
||||
},
|
||||
{
|
||||
path: LDN_PATH,
|
||||
children: [
|
||||
{ path: '', pathMatch: 'full', redirectTo: 'services' },
|
||||
{
|
||||
path: 'services',
|
||||
loadChildren: () => import('./admin-ldn-services/admin-ldn-services-routes')
|
||||
.then((m) => m.ROUTES),
|
||||
}
|
||||
],
|
||||
},
|
||||
{
|
||||
path: REPORTS_MODULE_PATH,
|
||||
loadChildren: () => import('./admin-reports/admin-reports-routes')
|
||||
.then((m) => m.ROUTES),
|
||||
},
|
||||
];
|
||||
|
@@ -18,6 +18,12 @@ import { ThemedCollectionPageComponent } from './themed-collection-page.componen
|
||||
import { MenuItemType } from '../shared/menu/menu-item-type.model';
|
||||
import { DSOEditMenuResolver } from '../shared/dso-page/dso-edit-menu.resolver';
|
||||
import { Route } from '@angular/router';
|
||||
import {
|
||||
ComcolSearchSectionComponent
|
||||
} from '../shared/comcol/sections/comcol-search-section/comcol-search-section.component';
|
||||
import { ComcolBrowseByComponent } from '../shared/comcol/sections/comcol-browse-by/comcol-browse-by.component';
|
||||
import { BrowseByGuard } from '../browse-by/browse-by-guard';
|
||||
import { BrowseByI18nBreadcrumbResolver } from '../browse-by/browse-by-i18n-breadcrumb.resolver';
|
||||
|
||||
|
||||
export const ROUTES: Route[] = [
|
||||
@@ -78,7 +84,23 @@ export const ROUTES: Route[] = [
|
||||
{
|
||||
path: '',
|
||||
component: ThemedCollectionPageComponent,
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
pathMatch: 'full',
|
||||
component: ComcolSearchSectionComponent,
|
||||
},
|
||||
{
|
||||
path: 'browse/:id',
|
||||
pathMatch: 'full',
|
||||
component: ComcolBrowseByComponent,
|
||||
canActivate: [BrowseByGuard],
|
||||
resolve: {
|
||||
breadcrumb: BrowseByI18nBreadcrumbResolver,
|
||||
},
|
||||
data: { breadcrumbKey: 'browse.metadata' },
|
||||
},
|
||||
],
|
||||
}
|
||||
],
|
||||
data: {
|
||||
|
@@ -14,6 +14,14 @@ import { LinkMenuItemModel } from '../shared/menu/menu-item/models/link.model';
|
||||
import { ThemedCommunityPageComponent } from './themed-community-page.component';
|
||||
import { MenuItemType } from '../shared/menu/menu-item-type.model';
|
||||
import { DSOEditMenuResolver } from '../shared/dso-page/dso-edit-menu.resolver';
|
||||
import {
|
||||
ComcolSearchSectionComponent
|
||||
} from '../shared/comcol/sections/comcol-search-section/comcol-search-section.component';
|
||||
import { SubComColSectionComponent } from './sections/sub-com-col-section/sub-com-col-section.component';
|
||||
import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver';
|
||||
import { ComcolBrowseByComponent } from '../shared/comcol/sections/comcol-browse-by/comcol-browse-by.component';
|
||||
import { BrowseByGuard } from '../browse-by/browse-by-guard';
|
||||
import { BrowseByI18nBreadcrumbResolver } from '../browse-by/browse-by-i18n-breadcrumb.resolver';
|
||||
|
||||
export const ROUTES: Route[] = [
|
||||
{
|
||||
@@ -61,7 +69,32 @@ export const ROUTES: Route[] = [
|
||||
{
|
||||
path: '',
|
||||
component: ThemedCommunityPageComponent,
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
pathMatch: 'full',
|
||||
component: ComcolSearchSectionComponent,
|
||||
},
|
||||
{
|
||||
path: 'subcoms-cols',
|
||||
pathMatch: 'full',
|
||||
component: SubComColSectionComponent,
|
||||
resolve: {
|
||||
breadcrumb: I18nBreadcrumbResolver,
|
||||
},
|
||||
data: { breadcrumbKey: 'community.subcoms-cols' },
|
||||
},
|
||||
{
|
||||
path: 'browse/:id',
|
||||
pathMatch: 'full',
|
||||
component: ComcolBrowseByComponent,
|
||||
canActivate: [BrowseByGuard],
|
||||
resolve: {
|
||||
breadcrumb: BrowseByI18nBreadcrumbResolver,
|
||||
},
|
||||
data: { breadcrumbKey: 'browse.metadata' },
|
||||
},
|
||||
],
|
||||
}
|
||||
],
|
||||
data: {
|
||||
|
Reference in New Issue
Block a user