mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
[DURACOM-191] run optimize imports and lint fix
This commit is contained in:
@@ -1,29 +1,29 @@
|
|||||||
import { EPeopleRegistryComponent } from './epeople-registry/epeople-registry.component';
|
import { Route } from '@angular/router';
|
||||||
import { GroupFormComponent } from './group-registry/group-form/group-form.component';
|
|
||||||
import { GroupsRegistryComponent } from './group-registry/groups-registry.component';
|
|
||||||
import { EPERSON_PATH, GROUP_PATH } from './access-control-routing-paths';
|
|
||||||
import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver';
|
import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver';
|
||||||
import { GroupPageGuard } from './group-registry/group-page.guard';
|
import { GroupAdministratorGuard } from '../core/data/feature-authorization/feature-authorization-guard/group-administrator.guard';
|
||||||
|
import { SiteAdministratorGuard } from '../core/data/feature-authorization/feature-authorization-guard/site-administrator.guard';
|
||||||
import {
|
import {
|
||||||
GroupAdministratorGuard
|
EPERSON_PATH,
|
||||||
} from '../core/data/feature-authorization/feature-authorization-guard/group-administrator.guard';
|
GROUP_PATH,
|
||||||
import {
|
} from './access-control-routing-paths';
|
||||||
SiteAdministratorGuard
|
|
||||||
} from '../core/data/feature-authorization/feature-authorization-guard/site-administrator.guard';
|
|
||||||
import { BulkAccessComponent } from './bulk-access/bulk-access.component';
|
import { BulkAccessComponent } from './bulk-access/bulk-access.component';
|
||||||
|
import { EPeopleRegistryComponent } from './epeople-registry/epeople-registry.component';
|
||||||
import { EPersonFormComponent } from './epeople-registry/eperson-form/eperson-form.component';
|
import { EPersonFormComponent } from './epeople-registry/eperson-form/eperson-form.component';
|
||||||
import { EPersonResolver } from './epeople-registry/eperson-resolver.service';
|
import { EPersonResolver } from './epeople-registry/eperson-resolver.service';
|
||||||
import { Route } from '@angular/router';
|
import { GroupFormComponent } from './group-registry/group-form/group-form.component';
|
||||||
|
import { GroupPageGuard } from './group-registry/group-page.guard';
|
||||||
|
import { GroupsRegistryComponent } from './group-registry/groups-registry.component';
|
||||||
|
|
||||||
export const ROUTES: Route[] = [
|
export const ROUTES: Route[] = [
|
||||||
{
|
{
|
||||||
path: EPERSON_PATH,
|
path: EPERSON_PATH,
|
||||||
component: EPeopleRegistryComponent,
|
component: EPeopleRegistryComponent,
|
||||||
resolve: {
|
resolve: {
|
||||||
breadcrumb: I18nBreadcrumbResolver
|
breadcrumb: I18nBreadcrumbResolver,
|
||||||
},
|
},
|
||||||
data: {title: 'admin.access-control.epeople.title', breadcrumbKey: 'admin.access-control.epeople'},
|
data: { title: 'admin.access-control.epeople.title', breadcrumbKey: 'admin.access-control.epeople' },
|
||||||
canActivate: [SiteAdministratorGuard]
|
canActivate: [SiteAdministratorGuard],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: `${EPERSON_PATH}/create`,
|
path: `${EPERSON_PATH}/create`,
|
||||||
@@ -31,7 +31,7 @@ export const ROUTES: Route[] = [
|
|||||||
resolve: {
|
resolve: {
|
||||||
breadcrumb: I18nBreadcrumbResolver,
|
breadcrumb: I18nBreadcrumbResolver,
|
||||||
},
|
},
|
||||||
data: {title: 'admin.access-control.epeople.add.title', breadcrumbKey: 'admin.access-control.epeople.add'},
|
data: { title: 'admin.access-control.epeople.add.title', breadcrumbKey: 'admin.access-control.epeople.add' },
|
||||||
canActivate: [SiteAdministratorGuard],
|
canActivate: [SiteAdministratorGuard],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -41,46 +41,46 @@ export const ROUTES: Route[] = [
|
|||||||
breadcrumb: I18nBreadcrumbResolver,
|
breadcrumb: I18nBreadcrumbResolver,
|
||||||
ePerson: EPersonResolver,
|
ePerson: EPersonResolver,
|
||||||
},
|
},
|
||||||
data: {title: 'admin.access-control.epeople.edit.title', breadcrumbKey: 'admin.access-control.epeople.edit'},
|
data: { title: 'admin.access-control.epeople.edit.title', breadcrumbKey: 'admin.access-control.epeople.edit' },
|
||||||
canActivate: [SiteAdministratorGuard],
|
canActivate: [SiteAdministratorGuard],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: GROUP_PATH,
|
path: GROUP_PATH,
|
||||||
component: GroupsRegistryComponent,
|
component: GroupsRegistryComponent,
|
||||||
resolve: {
|
resolve: {
|
||||||
breadcrumb: I18nBreadcrumbResolver
|
breadcrumb: I18nBreadcrumbResolver,
|
||||||
},
|
},
|
||||||
data: {title: 'admin.access-control.groups.title', breadcrumbKey: 'admin.access-control.groups'},
|
data: { title: 'admin.access-control.groups.title', breadcrumbKey: 'admin.access-control.groups' },
|
||||||
canActivate: [GroupAdministratorGuard]
|
canActivate: [GroupAdministratorGuard],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: `${GROUP_PATH}/create`,
|
path: `${GROUP_PATH}/create`,
|
||||||
component: GroupFormComponent,
|
component: GroupFormComponent,
|
||||||
resolve: {
|
resolve: {
|
||||||
breadcrumb: I18nBreadcrumbResolver
|
breadcrumb: I18nBreadcrumbResolver,
|
||||||
},
|
},
|
||||||
data: {title: 'admin.access-control.groups.title.addGroup', breadcrumbKey: 'admin.access-control.groups.addGroup'},
|
data: { title: 'admin.access-control.groups.title.addGroup', breadcrumbKey: 'admin.access-control.groups.addGroup' },
|
||||||
canActivate: [GroupAdministratorGuard]
|
canActivate: [GroupAdministratorGuard],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: `${GROUP_PATH}/:groupId/edit`,
|
path: `${GROUP_PATH}/:groupId/edit`,
|
||||||
component: GroupFormComponent,
|
component: GroupFormComponent,
|
||||||
resolve: {
|
resolve: {
|
||||||
breadcrumb: I18nBreadcrumbResolver
|
breadcrumb: I18nBreadcrumbResolver,
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
title: 'admin.access-control.groups.title.singleGroup',
|
title: 'admin.access-control.groups.title.singleGroup',
|
||||||
breadcrumbKey: 'admin.access-control.groups.singleGroup'
|
breadcrumbKey: 'admin.access-control.groups.singleGroup',
|
||||||
},
|
},
|
||||||
canActivate: [GroupPageGuard]
|
canActivate: [GroupPageGuard],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'bulk-access',
|
path: 'bulk-access',
|
||||||
component: BulkAccessComponent,
|
component: BulkAccessComponent,
|
||||||
resolve: {
|
resolve: {
|
||||||
breadcrumb: I18nBreadcrumbResolver
|
breadcrumb: I18nBreadcrumbResolver,
|
||||||
},
|
},
|
||||||
data: {title: 'admin.access-control.bulk-access.title', breadcrumbKey: 'admin.access-control.bulk-access'},
|
data: { title: 'admin.access-control.bulk-access.title', breadcrumbKey: 'admin.access-control.bulk-access' },
|
||||||
canActivate: [SiteAdministratorGuard]
|
canActivate: [SiteAdministratorGuard],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
@@ -1,21 +1,27 @@
|
|||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { AbstractControl } from '@angular/forms';
|
import {
|
||||||
|
AbstractControl,
|
||||||
|
AbstractControl,
|
||||||
|
} from '@angular/forms';
|
||||||
import { RouterModule } from '@angular/router';
|
import { RouterModule } from '@angular/router';
|
||||||
|
import { NgbAccordionModule } from '@ng-bootstrap/ng-bootstrap';
|
||||||
|
import {
|
||||||
|
DYNAMIC_ERROR_MESSAGES_MATCHER,
|
||||||
|
DynamicErrorMessagesMatcher,
|
||||||
|
} from '@ng-dynamic-forms/core';
|
||||||
|
|
||||||
|
import { FormModule } from '../shared/form/form.module';
|
||||||
|
import { SearchModule } from '../shared/search/search.module';
|
||||||
|
import { BulkAccessBrowseComponent } from './bulk-access/browse/bulk-access-browse.component';
|
||||||
|
import { BulkAccessComponent } from './bulk-access/bulk-access.component';
|
||||||
|
import { BulkAccessSettingsComponent } from './bulk-access/settings/bulk-access-settings.component';
|
||||||
import { EPeopleRegistryComponent } from './epeople-registry/epeople-registry.component';
|
import { EPeopleRegistryComponent } from './epeople-registry/epeople-registry.component';
|
||||||
import { EPersonFormComponent } from './epeople-registry/eperson-form/eperson-form.component';
|
import { EPersonFormComponent } from './epeople-registry/eperson-form/eperson-form.component';
|
||||||
import { GroupFormComponent } from './group-registry/group-form/group-form.component';
|
import { GroupFormComponent } from './group-registry/group-form/group-form.component';
|
||||||
import { MembersListComponent } from './group-registry/group-form/members-list/members-list.component';
|
import { MembersListComponent } from './group-registry/group-form/members-list/members-list.component';
|
||||||
import { SubgroupsListComponent } from './group-registry/group-form/subgroup-list/subgroups-list.component';
|
import { SubgroupsListComponent } from './group-registry/group-form/subgroup-list/subgroups-list.component';
|
||||||
import { GroupsRegistryComponent } from './group-registry/groups-registry.component';
|
import { GroupsRegistryComponent } from './group-registry/groups-registry.component';
|
||||||
import { FormModule } from '../shared/form/form.module';
|
|
||||||
import { DYNAMIC_ERROR_MESSAGES_MATCHER, DynamicErrorMessagesMatcher } from '@ng-dynamic-forms/core';
|
|
||||||
import { AbstractControl } from '@angular/forms';
|
|
||||||
import { BulkAccessComponent } from './bulk-access/bulk-access.component';
|
|
||||||
import { NgbAccordionModule } from '@ng-bootstrap/ng-bootstrap';
|
|
||||||
import { BulkAccessBrowseComponent } from './bulk-access/browse/bulk-access-browse.component';
|
|
||||||
import { BulkAccessSettingsComponent } from './bulk-access/settings/bulk-access-settings.component';
|
|
||||||
import { SearchModule } from '../shared/search/search.module';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Condition for displaying error messages on email form field
|
* Condition for displaying error messages on email form field
|
||||||
@@ -26,30 +32,30 @@ export const ValidateEmailErrorStateMatcher: DynamicErrorMessagesMatcher =
|
|||||||
};
|
};
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
RouterModule,
|
RouterModule,
|
||||||
FormModule,
|
FormModule,
|
||||||
NgbAccordionModule,
|
NgbAccordionModule,
|
||||||
SearchModule,
|
SearchModule,
|
||||||
EPeopleRegistryComponent,
|
EPeopleRegistryComponent,
|
||||||
EPersonFormComponent,
|
EPersonFormComponent,
|
||||||
GroupsRegistryComponent,
|
GroupsRegistryComponent,
|
||||||
GroupFormComponent,
|
GroupFormComponent,
|
||||||
SubgroupsListComponent,
|
SubgroupsListComponent,
|
||||||
MembersListComponent,
|
MembersListComponent,
|
||||||
BulkAccessComponent,
|
BulkAccessComponent,
|
||||||
BulkAccessBrowseComponent,
|
BulkAccessBrowseComponent,
|
||||||
BulkAccessSettingsComponent
|
BulkAccessSettingsComponent,
|
||||||
],
|
],
|
||||||
exports: [
|
exports: [
|
||||||
MembersListComponent,
|
MembersListComponent,
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
{
|
{
|
||||||
provide: DYNAMIC_ERROR_MESSAGES_MATCHER,
|
provide: DYNAMIC_ERROR_MESSAGES_MATCHER,
|
||||||
useValue: ValidateEmailErrorStateMatcher,
|
useValue: ValidateEmailErrorStateMatcher,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
/**
|
/**
|
||||||
|
@@ -13,20 +13,16 @@ import { of } from 'rxjs';
|
|||||||
|
|
||||||
import { buildPaginatedList } from '../../../core/data/paginated-list.model';
|
import { buildPaginatedList } from '../../../core/data/paginated-list.model';
|
||||||
import { PageInfo } from '../../../core/shared/page-info.model';
|
import { PageInfo } from '../../../core/shared/page-info.model';
|
||||||
|
import { getMockThemeService } from '../../../shared/mocks/theme-service.mock';
|
||||||
|
import { ListableObjectComponentLoaderComponent } from '../../../shared/object-collection/shared/listable-object/listable-object-component-loader.component';
|
||||||
|
import { SelectableListItemControlComponent } from '../../../shared/object-collection/shared/selectable-list-item-control/selectable-list-item-control.component';
|
||||||
import { SelectableListService } from '../../../shared/object-list/selectable-list/selectable-list.service';
|
import { SelectableListService } from '../../../shared/object-list/selectable-list/selectable-list.service';
|
||||||
import { SelectableObject } from '../../../shared/object-list/selectable-list/selectable-list.service.spec';
|
import { SelectableObject } from '../../../shared/object-list/selectable-list/selectable-list.service.spec';
|
||||||
import { createSuccessfulRemoteDataObject } from '../../../shared/remote-data.utils';
|
|
||||||
import { BulkAccessBrowseComponent } from './bulk-access-browse.component';
|
|
||||||
import { ThemeService } from '../../../shared/theme-support/theme.service';
|
|
||||||
import { getMockThemeService } from '../../../shared/mocks/theme-service.mock';
|
|
||||||
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
||||||
|
import { createSuccessfulRemoteDataObject } from '../../../shared/remote-data.utils';
|
||||||
import { ThemedSearchComponent } from '../../../shared/search/themed-search.component';
|
import { ThemedSearchComponent } from '../../../shared/search/themed-search.component';
|
||||||
import {
|
import { ThemeService } from '../../../shared/theme-support/theme.service';
|
||||||
SelectableListItemControlComponent
|
import { BulkAccessBrowseComponent } from './bulk-access-browse.component';
|
||||||
} from '../../../shared/object-collection/shared/selectable-list-item-control/selectable-list-item-control.component';
|
|
||||||
import {
|
|
||||||
ListableObjectComponentLoaderComponent
|
|
||||||
} from '../../../shared/object-collection/shared/listable-object/listable-object-component-loader.component';
|
|
||||||
|
|
||||||
describe('BulkAccessBrowseComponent', () => {
|
describe('BulkAccessBrowseComponent', () => {
|
||||||
let component: BulkAccessBrowseComponent;
|
let component: BulkAccessBrowseComponent;
|
||||||
@@ -48,7 +44,7 @@ describe('BulkAccessBrowseComponent', () => {
|
|||||||
NgbAccordionModule,
|
NgbAccordionModule,
|
||||||
NgbNavModule,
|
NgbNavModule,
|
||||||
TranslateModule.forRoot(),
|
TranslateModule.forRoot(),
|
||||||
BulkAccessBrowseComponent
|
BulkAccessBrowseComponent,
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: SelectableListService, useValue: selectableListService },
|
{ provide: SelectableListService, useValue: selectableListService },
|
||||||
@@ -64,9 +60,9 @@ describe('BulkAccessBrowseComponent', () => {
|
|||||||
PaginationComponent,
|
PaginationComponent,
|
||||||
ThemedSearchComponent,
|
ThemedSearchComponent,
|
||||||
SelectableListItemControlComponent,
|
SelectableListItemControlComponent,
|
||||||
ListableObjectComponentLoaderComponent
|
ListableObjectComponentLoaderComponent,
|
||||||
]
|
],
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
}));
|
}));
|
||||||
|
@@ -1,52 +1,62 @@
|
|||||||
|
import {
|
||||||
|
AsyncPipe,
|
||||||
|
NgForOf,
|
||||||
|
NgIf,
|
||||||
|
} from '@angular/common';
|
||||||
import {
|
import {
|
||||||
Component,
|
Component,
|
||||||
Input,
|
Input,
|
||||||
OnDestroy,
|
OnDestroy,
|
||||||
OnInit,
|
OnInit,
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
import {
|
||||||
|
NgbAccordionModule,
|
||||||
|
NgbNavModule,
|
||||||
|
} from '@ng-bootstrap/ng-bootstrap';
|
||||||
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
|
import { NgxPaginationModule } from 'ngx-pagination';
|
||||||
import {
|
import {
|
||||||
BehaviorSubject,
|
BehaviorSubject,
|
||||||
|
BehaviorSubject,
|
||||||
|
Subscription,
|
||||||
Subscription,
|
Subscription,
|
||||||
} from 'rxjs';
|
} from 'rxjs';
|
||||||
import {
|
import {
|
||||||
distinctUntilChanged,
|
distinctUntilChanged,
|
||||||
|
distinctUntilChanged,
|
||||||
|
map,
|
||||||
map,
|
map,
|
||||||
} from 'rxjs/operators';
|
} from 'rxjs/operators';
|
||||||
|
|
||||||
import { BehaviorSubject, Subscription } from 'rxjs';
|
|
||||||
import { distinctUntilChanged, map } from 'rxjs/operators';
|
|
||||||
|
|
||||||
import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service';
|
|
||||||
import { SelectableListService } from '../../../shared/object-list/selectable-list/selectable-list.service';
|
|
||||||
import { SelectableListState } from '../../../shared/object-list/selectable-list/selectable-list.reducer';
|
|
||||||
import {
|
import {
|
||||||
buildPaginatedList,
|
buildPaginatedList,
|
||||||
PaginatedList,
|
PaginatedList,
|
||||||
} from '../../../core/data/paginated-list.model';
|
} from '../../../core/data/paginated-list.model';
|
||||||
import { RemoteData } from '../../../core/data/remote-data';
|
import { RemoteData } from '../../../core/data/remote-data';
|
||||||
import { PageInfo } from '../../../core/shared/page-info.model';
|
import { PageInfo } from '../../../core/shared/page-info.model';
|
||||||
import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service';
|
import {
|
||||||
|
SearchConfigurationService,
|
||||||
|
SearchConfigurationService,
|
||||||
|
} from '../../../core/shared/search/search-configuration.service';
|
||||||
|
import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-configuration.service';
|
||||||
import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-page.component';
|
import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-page.component';
|
||||||
import { hasValue } from '../../../shared/empty.util';
|
import { hasValue } from '../../../shared/empty.util';
|
||||||
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
|
||||||
import { AsyncPipe, NgForOf, NgIf } from '@angular/common';
|
|
||||||
import { NgbAccordionModule, NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
|
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
|
||||||
import { ThemedSearchComponent } from '../../../shared/search/themed-search.component';
|
|
||||||
import { BrowserOnlyPipe } from '../../../shared/utils/browser-only.pipe';
|
|
||||||
import { NgxPaginationModule } from 'ngx-pagination';
|
|
||||||
import {
|
|
||||||
SelectableListItemControlComponent
|
|
||||||
} from '../../../shared/object-collection/shared/selectable-list-item-control/selectable-list-item-control.component';
|
|
||||||
import {
|
|
||||||
ListableObjectComponentLoaderComponent
|
|
||||||
} from '../../../shared/object-collection/shared/listable-object/listable-object-component-loader.component';
|
|
||||||
import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-configuration.service';
|
|
||||||
import { ListableObject } from '../../../shared/object-collection/shared/listable-object.model';
|
import { ListableObject } from '../../../shared/object-collection/shared/listable-object.model';
|
||||||
import { SelectableListState } from '../../../shared/object-list/selectable-list/selectable-list.reducer';
|
import { ListableObjectComponentLoaderComponent } from '../../../shared/object-collection/shared/listable-object/listable-object-component-loader.component';
|
||||||
import { SelectableListService } from '../../../shared/object-list/selectable-list/selectable-list.service';
|
import { SelectableListItemControlComponent } from '../../../shared/object-collection/shared/selectable-list-item-control/selectable-list-item-control.component';
|
||||||
|
import {
|
||||||
|
SelectableListState,
|
||||||
|
SelectableListState,
|
||||||
|
} from '../../../shared/object-list/selectable-list/selectable-list.reducer';
|
||||||
|
import {
|
||||||
|
SelectableListService,
|
||||||
|
SelectableListService,
|
||||||
|
} from '../../../shared/object-list/selectable-list/selectable-list.service';
|
||||||
|
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
||||||
import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model';
|
import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model';
|
||||||
import { createSuccessfulRemoteDataObject } from '../../../shared/remote-data.utils';
|
import { createSuccessfulRemoteDataObject } from '../../../shared/remote-data.utils';
|
||||||
|
import { ThemedSearchComponent } from '../../../shared/search/themed-search.component';
|
||||||
|
import { BrowserOnlyPipe } from '../../../shared/utils/browser-only.pipe';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-bulk-access-browse',
|
selector: 'ds-bulk-access-browse',
|
||||||
@@ -55,8 +65,8 @@ import { createSuccessfulRemoteDataObject } from '../../../shared/remote-data.ut
|
|||||||
providers: [
|
providers: [
|
||||||
{
|
{
|
||||||
provide: SEARCH_CONFIG_SERVICE,
|
provide: SEARCH_CONFIG_SERVICE,
|
||||||
useClass: SearchConfigurationService
|
useClass: SearchConfigurationService,
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
PaginationComponent,
|
PaginationComponent,
|
||||||
@@ -70,9 +80,9 @@ import { createSuccessfulRemoteDataObject } from '../../../shared/remote-data.ut
|
|||||||
NgForOf,
|
NgForOf,
|
||||||
NgxPaginationModule,
|
NgxPaginationModule,
|
||||||
SelectableListItemControlComponent,
|
SelectableListItemControlComponent,
|
||||||
ListableObjectComponentLoaderComponent
|
ListableObjectComponentLoaderComponent,
|
||||||
],
|
],
|
||||||
standalone: true
|
standalone: true,
|
||||||
})
|
})
|
||||||
export class BulkAccessBrowseComponent implements OnInit, OnDestroy {
|
export class BulkAccessBrowseComponent implements OnInit, OnDestroy {
|
||||||
|
|
||||||
|
@@ -9,15 +9,15 @@ import { of } from 'rxjs';
|
|||||||
|
|
||||||
import { Process } from '../../process-page/processes/process.model';
|
import { Process } from '../../process-page/processes/process.model';
|
||||||
import { BulkAccessControlService } from '../../shared/access-control-form-container/bulk-access-control.service';
|
import { BulkAccessControlService } from '../../shared/access-control-form-container/bulk-access-control.service';
|
||||||
|
import { getMockThemeService } from '../../shared/mocks/theme-service.mock';
|
||||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||||
import { SelectableListState } from '../../shared/object-list/selectable-list/selectable-list.reducer';
|
import { SelectableListState } from '../../shared/object-list/selectable-list/selectable-list.reducer';
|
||||||
import { SelectableListService } from '../../shared/object-list/selectable-list/selectable-list.service';
|
import { SelectableListService } from '../../shared/object-list/selectable-list/selectable-list.service';
|
||||||
import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';
|
import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';
|
||||||
import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub';
|
import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub';
|
||||||
import { ThemeService } from '../../shared/theme-support/theme.service';
|
import { ThemeService } from '../../shared/theme-support/theme.service';
|
||||||
import { getMockThemeService } from '../../shared/mocks/theme-service.mock';
|
|
||||||
import { BulkAccessSettingsComponent } from './settings/bulk-access-settings.component';
|
|
||||||
import { BulkAccessComponent } from './bulk-access.component';
|
import { BulkAccessComponent } from './bulk-access.component';
|
||||||
|
import { BulkAccessSettingsComponent } from './settings/bulk-access-settings.component';
|
||||||
|
|
||||||
describe('BulkAccessComponent', () => {
|
describe('BulkAccessComponent', () => {
|
||||||
let component: BulkAccessComponent;
|
let component: BulkAccessComponent;
|
||||||
@@ -77,13 +77,13 @@ describe('BulkAccessComponent', () => {
|
|||||||
imports: [
|
imports: [
|
||||||
RouterTestingModule,
|
RouterTestingModule,
|
||||||
TranslateModule.forRoot(),
|
TranslateModule.forRoot(),
|
||||||
BulkAccessComponent
|
BulkAccessComponent,
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: BulkAccessControlService, useValue: bulkAccessControlServiceMock },
|
{ provide: BulkAccessControlService, useValue: bulkAccessControlServiceMock },
|
||||||
{ provide: NotificationsService, useValue: NotificationsServiceStub },
|
{ provide: NotificationsService, useValue: NotificationsServiceStub },
|
||||||
{ provide: SelectableListService, useValue: selectableListServiceMock },
|
{ provide: SelectableListService, useValue: selectableListServiceMock },
|
||||||
{ provide: ThemeService, useValue: getMockThemeService() }
|
{ provide: ThemeService, useValue: getMockThemeService() },
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA],
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
})
|
})
|
||||||
@@ -91,8 +91,8 @@ describe('BulkAccessComponent', () => {
|
|||||||
remove: {
|
remove: {
|
||||||
imports: [
|
imports: [
|
||||||
BulkAccessSettingsComponent,
|
BulkAccessSettingsComponent,
|
||||||
]
|
],
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
});
|
});
|
||||||
|
@@ -3,6 +3,7 @@ import {
|
|||||||
OnInit,
|
OnInit,
|
||||||
ViewChild,
|
ViewChild,
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import {
|
import {
|
||||||
BehaviorSubject,
|
BehaviorSubject,
|
||||||
Subscription,
|
Subscription,
|
||||||
@@ -15,7 +16,6 @@ import {
|
|||||||
import { BulkAccessControlService } from '../../shared/access-control-form-container/bulk-access-control.service';
|
import { BulkAccessControlService } from '../../shared/access-control-form-container/bulk-access-control.service';
|
||||||
import { SelectableListState } from '../../shared/object-list/selectable-list/selectable-list.reducer';
|
import { SelectableListState } from '../../shared/object-list/selectable-list/selectable-list.reducer';
|
||||||
import { SelectableListService } from '../../shared/object-list/selectable-list/selectable-list.service';
|
import { SelectableListService } from '../../shared/object-list/selectable-list/selectable-list.service';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
|
||||||
import { BulkAccessBrowseComponent } from './browse/bulk-access-browse.component';
|
import { BulkAccessBrowseComponent } from './browse/bulk-access-browse.component';
|
||||||
import { BulkAccessSettingsComponent } from './settings/bulk-access-settings.component';
|
import { BulkAccessSettingsComponent } from './settings/bulk-access-settings.component';
|
||||||
|
|
||||||
@@ -26,9 +26,9 @@ import { BulkAccessSettingsComponent } from './settings/bulk-access-settings.com
|
|||||||
imports: [
|
imports: [
|
||||||
TranslateModule,
|
TranslateModule,
|
||||||
BulkAccessSettingsComponent,
|
BulkAccessSettingsComponent,
|
||||||
BulkAccessBrowseComponent
|
BulkAccessBrowseComponent,
|
||||||
],
|
],
|
||||||
standalone: true
|
standalone: true,
|
||||||
})
|
})
|
||||||
export class BulkAccessComponent implements OnInit {
|
export class BulkAccessComponent implements OnInit {
|
||||||
|
|
||||||
|
@@ -1,4 +1,7 @@
|
|||||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
import {
|
||||||
|
NO_ERRORS_SCHEMA,
|
||||||
|
NO_ERRORS_SCHEMA,
|
||||||
|
} from '@angular/core';
|
||||||
import {
|
import {
|
||||||
ComponentFixture,
|
ComponentFixture,
|
||||||
TestBed,
|
TestBed,
|
||||||
@@ -6,11 +9,8 @@ import {
|
|||||||
import { NgbAccordionModule } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbAccordionModule } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
|
|
||||||
|
import { AccessControlFormContainerComponent } from '../../../shared/access-control-form-container/access-control-form-container.component';
|
||||||
import { BulkAccessSettingsComponent } from './bulk-access-settings.component';
|
import { BulkAccessSettingsComponent } from './bulk-access-settings.component';
|
||||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
|
||||||
import {
|
|
||||||
AccessControlFormContainerComponent
|
|
||||||
} from '../../../shared/access-control-form-container/access-control-form-container.component';
|
|
||||||
|
|
||||||
describe('BulkAccessSettingsComponent', () => {
|
describe('BulkAccessSettingsComponent', () => {
|
||||||
let component: BulkAccessSettingsComponent;
|
let component: BulkAccessSettingsComponent;
|
||||||
@@ -49,11 +49,11 @@ describe('BulkAccessSettingsComponent', () => {
|
|||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
imports: [NgbAccordionModule, TranslateModule.forRoot(), BulkAccessSettingsComponent],
|
imports: [NgbAccordionModule, TranslateModule.forRoot(), BulkAccessSettingsComponent],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
})
|
})
|
||||||
.overrideComponent(BulkAccessSettingsComponent, {
|
.overrideComponent(BulkAccessSettingsComponent, {
|
||||||
remove: { imports: [AccessControlFormContainerComponent]}
|
remove: { imports: [AccessControlFormContainerComponent] },
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
});
|
});
|
||||||
|
@@ -1,12 +1,12 @@
|
|||||||
|
import { NgIf } from '@angular/common';
|
||||||
import {
|
import {
|
||||||
Component,
|
Component,
|
||||||
ViewChild,
|
ViewChild,
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
import { AccessControlFormContainerComponent } from '../../../shared/access-control-form-container/access-control-form-container.component';
|
|
||||||
import { NgbAccordionModule } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbAccordionModule } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { NgIf } from '@angular/common';
|
|
||||||
|
import { AccessControlFormContainerComponent } from '../../../shared/access-control-form-container/access-control-form-container.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-bulk-access-settings',
|
selector: 'ds-bulk-access-settings',
|
||||||
@@ -17,9 +17,9 @@ import { NgIf } from '@angular/common';
|
|||||||
NgbAccordionModule,
|
NgbAccordionModule,
|
||||||
TranslateModule,
|
TranslateModule,
|
||||||
NgIf,
|
NgIf,
|
||||||
AccessControlFormContainerComponent
|
AccessControlFormContainerComponent,
|
||||||
],
|
],
|
||||||
standalone: true
|
standalone: true,
|
||||||
})
|
})
|
||||||
export class BulkAccessSettingsComponent {
|
export class BulkAccessSettingsComponent {
|
||||||
|
|
||||||
|
@@ -19,6 +19,7 @@ import {
|
|||||||
By,
|
By,
|
||||||
} from '@angular/platform-browser';
|
} from '@angular/platform-browser';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
|
import { RouterTestingModule } from '@angular/router/testing';
|
||||||
import {
|
import {
|
||||||
NgbModal,
|
NgbModal,
|
||||||
NgbModule,
|
NgbModule,
|
||||||
@@ -29,38 +30,42 @@ import {
|
|||||||
of as observableOf,
|
of as observableOf,
|
||||||
} from 'rxjs';
|
} from 'rxjs';
|
||||||
|
|
||||||
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
|
import {
|
||||||
|
AuthorizationDataService,
|
||||||
|
AuthorizationDataService,
|
||||||
|
} from '../../core/data/feature-authorization/authorization-data.service';
|
||||||
import { FindListOptions } from '../../core/data/find-list-options.model';
|
import { FindListOptions } from '../../core/data/find-list-options.model';
|
||||||
import {
|
import {
|
||||||
buildPaginatedList,
|
buildPaginatedList,
|
||||||
PaginatedList,
|
PaginatedList,
|
||||||
} from '../../core/data/paginated-list.model';
|
} from '../../core/data/paginated-list.model';
|
||||||
import { RemoteData } from '../../core/data/remote-data';
|
import { RemoteData } from '../../core/data/remote-data';
|
||||||
import { RequestService } from '../../core/data/request.service';
|
import {
|
||||||
|
RequestService,
|
||||||
|
RequestService,
|
||||||
|
} from '../../core/data/request.service';
|
||||||
import { EPersonDataService } from '../../core/eperson/eperson-data.service';
|
import { EPersonDataService } from '../../core/eperson/eperson-data.service';
|
||||||
import { EPerson } from '../../core/eperson/models/eperson.model';
|
import { EPerson } from '../../core/eperson/models/eperson.model';
|
||||||
import { PaginationService } from '../../core/pagination/pagination.service';
|
import {
|
||||||
|
PaginationService,
|
||||||
|
PaginationService,
|
||||||
|
} from '../../core/pagination/pagination.service';
|
||||||
import { PageInfo } from '../../core/shared/page-info.model';
|
import { PageInfo } from '../../core/shared/page-info.model';
|
||||||
import { FormBuilderService } from '../../shared/form/builder/form-builder.service';
|
import { FormBuilderService } from '../../shared/form/builder/form-builder.service';
|
||||||
|
import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component';
|
||||||
import { getMockFormBuilderService } from '../../shared/mocks/form-builder-service.mock';
|
import { getMockFormBuilderService } from '../../shared/mocks/form-builder-service.mock';
|
||||||
|
import { RouterMock } from '../../shared/mocks/router.mock';
|
||||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||||
|
import { PaginationComponent } from '../../shared/pagination/pagination.component';
|
||||||
import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';
|
import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';
|
||||||
import {
|
import {
|
||||||
EPersonMock,
|
EPersonMock,
|
||||||
EPersonMock2,
|
EPersonMock2,
|
||||||
} from '../../shared/testing/eperson.mock';
|
} from '../../shared/testing/eperson.mock';
|
||||||
import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub';
|
import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub';
|
||||||
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
|
|
||||||
import { RequestService } from '../../core/data/request.service';
|
|
||||||
import { PaginationService } from '../../core/pagination/pagination.service';
|
|
||||||
import { PaginationServiceStub } from '../../shared/testing/pagination-service.stub';
|
import { PaginationServiceStub } from '../../shared/testing/pagination-service.stub';
|
||||||
import { RouterStub } from '../../shared/testing/router.stub';
|
|
||||||
import { EPeopleRegistryComponent } from './epeople-registry.component';
|
import { EPeopleRegistryComponent } from './epeople-registry.component';
|
||||||
import { EPersonFormComponent } from './eperson-form/eperson-form.component';
|
import { EPersonFormComponent } from './eperson-form/eperson-form.component';
|
||||||
import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component';
|
|
||||||
import { PaginationComponent } from '../../shared/pagination/pagination.component';
|
|
||||||
import { RouterTestingModule } from '@angular/router/testing';
|
|
||||||
import { RouterMock } from '../../shared/mocks/router.mock';
|
|
||||||
|
|
||||||
describe('EPeopleRegistryComponent', () => {
|
describe('EPeopleRegistryComponent', () => {
|
||||||
let component: EPeopleRegistryComponent;
|
let component: EPeopleRegistryComponent;
|
||||||
@@ -154,15 +159,15 @@ describe('EPeopleRegistryComponent', () => {
|
|||||||
|
|
||||||
paginationService = new PaginationServiceStub();
|
paginationService = new PaginationServiceStub();
|
||||||
awaitTestBed.configureTestingModule({
|
awaitTestBed.configureTestingModule({
|
||||||
imports: [CommonModule, NgbModule, FormsModule, ReactiveFormsModule, BrowserModule, RouterTestingModule.withRoutes([]),
|
imports: [CommonModule, NgbModule, FormsModule, ReactiveFormsModule, BrowserModule, RouterTestingModule.withRoutes([]),
|
||||||
TranslateModule.forRoot(), EPeopleRegistryComponent],
|
TranslateModule.forRoot(), EPeopleRegistryComponent],
|
||||||
providers: [
|
providers: [
|
||||||
{provide: EPersonDataService, useValue: ePersonDataServiceStub},
|
{ provide: EPersonDataService, useValue: ePersonDataServiceStub },
|
||||||
{provide: NotificationsService, useValue: new NotificationsServiceStub()},
|
{ provide: NotificationsService, useValue: new NotificationsServiceStub() },
|
||||||
{provide: AuthorizationDataService, useValue: authorizationService},
|
{ provide: AuthorizationDataService, useValue: authorizationService },
|
||||||
{provide: FormBuilderService, useValue: builderService},
|
{ provide: FormBuilderService, useValue: builderService },
|
||||||
{provide: Router, useValue: new RouterMock()},
|
{ provide: Router, useValue: new RouterMock() },
|
||||||
{provide: RequestService, useValue: jasmine.createSpyObj('requestService', ['removeByHrefSubstring'])},
|
{ provide: RequestService, useValue: jasmine.createSpyObj('requestService', ['removeByHrefSubstring']) },
|
||||||
{ provide: PaginationService, useValue: paginationService },
|
{ provide: PaginationService, useValue: paginationService },
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA],
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
@@ -173,8 +178,8 @@ describe('EPeopleRegistryComponent', () => {
|
|||||||
EPersonFormComponent,
|
EPersonFormComponent,
|
||||||
ThemedLoadingComponent,
|
ThemedLoadingComponent,
|
||||||
PaginationComponent,
|
PaginationComponent,
|
||||||
]
|
],
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
}));
|
}));
|
||||||
|
@@ -1,12 +1,30 @@
|
|||||||
|
import {
|
||||||
|
AsyncPipe,
|
||||||
|
NgClass,
|
||||||
|
NgForOf,
|
||||||
|
NgIf,
|
||||||
|
} from '@angular/common';
|
||||||
import {
|
import {
|
||||||
Component,
|
Component,
|
||||||
OnDestroy,
|
OnDestroy,
|
||||||
OnInit,
|
OnInit,
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import { ReactiveFormsModule, UntypedFormBuilder } from '@angular/forms';
|
import {
|
||||||
import { Router, RouterModule } from '@angular/router';
|
ReactiveFormsModule,
|
||||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
UntypedFormBuilder,
|
||||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
} from '@angular/forms';
|
||||||
|
import {
|
||||||
|
Router,
|
||||||
|
RouterModule,
|
||||||
|
} from '@angular/router';
|
||||||
|
import {
|
||||||
|
NgbModal,
|
||||||
|
NgbModal,
|
||||||
|
} from '@ng-bootstrap/ng-bootstrap';
|
||||||
|
import {
|
||||||
|
TranslateModule,
|
||||||
|
TranslateService,
|
||||||
|
} from '@ngx-translate/core';
|
||||||
import {
|
import {
|
||||||
BehaviorSubject,
|
BehaviorSubject,
|
||||||
combineLatest,
|
combineLatest,
|
||||||
@@ -19,49 +37,67 @@ import {
|
|||||||
take,
|
take,
|
||||||
} from 'rxjs/operators';
|
} from 'rxjs/operators';
|
||||||
|
|
||||||
import { DSONameService } from '../../core/breadcrumbs/dso-name.service';
|
import {
|
||||||
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
|
DSONameService,
|
||||||
import { FeatureID } from '../../core/data/feature-authorization/feature-id';
|
DSONameService,
|
||||||
|
} from '../../core/breadcrumbs/dso-name.service';
|
||||||
|
import {
|
||||||
|
AuthorizationDataService,
|
||||||
|
AuthorizationDataService,
|
||||||
|
} from '../../core/data/feature-authorization/authorization-data.service';
|
||||||
|
import {
|
||||||
|
FeatureID,
|
||||||
|
FeatureID,
|
||||||
|
} from '../../core/data/feature-authorization/feature-id';
|
||||||
import {
|
import {
|
||||||
buildPaginatedList,
|
buildPaginatedList,
|
||||||
PaginatedList,
|
PaginatedList,
|
||||||
} from '../../core/data/paginated-list.model';
|
} from '../../core/data/paginated-list.model';
|
||||||
import { RemoteData } from '../../core/data/remote-data';
|
import { RemoteData } from '../../core/data/remote-data';
|
||||||
import { RequestService } from '../../core/data/request.service';
|
import {
|
||||||
|
RequestService,
|
||||||
|
RequestService,
|
||||||
|
} from '../../core/data/request.service';
|
||||||
import { EPersonDataService } from '../../core/eperson/eperson-data.service';
|
import { EPersonDataService } from '../../core/eperson/eperson-data.service';
|
||||||
import { EPerson } from '../../core/eperson/models/eperson.model';
|
import { EPerson } from '../../core/eperson/models/eperson.model';
|
||||||
import { EpersonDtoModel } from '../../core/eperson/models/eperson-dto.model';
|
import {
|
||||||
import { PaginationService } from '../../core/pagination/pagination.service';
|
EpersonDtoModel,
|
||||||
import { NoContent } from '../../core/shared/NoContent.model';
|
EpersonDtoModel,
|
||||||
|
} from '../../core/eperson/models/eperson-dto.model';
|
||||||
|
import {
|
||||||
|
PaginationService,
|
||||||
|
PaginationService,
|
||||||
|
} from '../../core/pagination/pagination.service';
|
||||||
|
import {
|
||||||
|
NoContent,
|
||||||
|
NoContent,
|
||||||
|
} from '../../core/shared/NoContent.model';
|
||||||
import {
|
import {
|
||||||
getAllSucceededRemoteData,
|
getAllSucceededRemoteData,
|
||||||
|
getAllSucceededRemoteData,
|
||||||
|
getFirstCompletedRemoteData,
|
||||||
getFirstCompletedRemoteData,
|
getFirstCompletedRemoteData,
|
||||||
} from '../../core/shared/operators';
|
} from '../../core/shared/operators';
|
||||||
import { PageInfo } from '../../core/shared/page-info.model';
|
import {
|
||||||
import { ConfirmationModalComponent } from '../../shared/confirmation-modal/confirmation-modal.component';
|
PageInfo,
|
||||||
|
PageInfo,
|
||||||
|
} from '../../core/shared/page-info.model';
|
||||||
|
import {
|
||||||
|
ConfirmationModalComponent,
|
||||||
|
ConfirmationModalComponent,
|
||||||
|
} from '../../shared/confirmation-modal/confirmation-modal.component';
|
||||||
import { hasValue } from '../../shared/empty.util';
|
import { hasValue } from '../../shared/empty.util';
|
||||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
|
||||||
import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model';
|
|
||||||
import { EpersonDtoModel } from '../../core/eperson/models/eperson-dto.model';
|
|
||||||
import { FeatureID } from '../../core/data/feature-authorization/feature-id';
|
|
||||||
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
|
|
||||||
import { getAllSucceededRemoteData, getFirstCompletedRemoteData } from '../../core/shared/operators';
|
|
||||||
import { ConfirmationModalComponent } from '../../shared/confirmation-modal/confirmation-modal.component';
|
|
||||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
|
||||||
import { RequestService } from '../../core/data/request.service';
|
|
||||||
import { PageInfo } from '../../core/shared/page-info.model';
|
|
||||||
import { NoContent } from '../../core/shared/NoContent.model';
|
|
||||||
import { PaginationService } from '../../core/pagination/pagination.service';
|
|
||||||
import { DSONameService } from '../../core/breadcrumbs/dso-name.service';
|
|
||||||
import { AsyncPipe, NgClass, NgForOf, NgIf } from '@angular/common';
|
|
||||||
import { EPersonFormComponent } from './eperson-form/eperson-form.component';
|
|
||||||
import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component';
|
import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component';
|
||||||
|
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||||
import { PaginationComponent } from '../../shared/pagination/pagination.component';
|
import { PaginationComponent } from '../../shared/pagination/pagination.component';
|
||||||
import { getEPersonEditRoute, getEPersonsRoute } from '../access-control-routing-paths';
|
import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model';
|
||||||
import {
|
import {
|
||||||
getEPersonEditRoute,
|
getEPersonEditRoute,
|
||||||
|
getEPersonEditRoute,
|
||||||
|
getEPersonsRoute,
|
||||||
getEPersonsRoute,
|
getEPersonsRoute,
|
||||||
} from '../access-control-routing-paths';
|
} from '../access-control-routing-paths';
|
||||||
|
import { EPersonFormComponent } from './eperson-form/eperson-form.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-epeople-registry',
|
selector: 'ds-epeople-registry',
|
||||||
@@ -76,9 +112,9 @@ import {
|
|||||||
ThemedLoadingComponent,
|
ThemedLoadingComponent,
|
||||||
PaginationComponent,
|
PaginationComponent,
|
||||||
NgClass,
|
NgClass,
|
||||||
NgForOf
|
NgForOf,
|
||||||
],
|
],
|
||||||
standalone: true
|
standalone: true,
|
||||||
})
|
})
|
||||||
/**
|
/**
|
||||||
* A component used for managing all existing epeople within the repository.
|
* A component used for managing all existing epeople within the repository.
|
||||||
|
@@ -3,8 +3,13 @@ import { NO_ERRORS_SCHEMA } from '@angular/core';
|
|||||||
import {
|
import {
|
||||||
ComponentFixture,
|
ComponentFixture,
|
||||||
TestBed,
|
TestBed,
|
||||||
waitForAsync,} from '@angular/core/testing';
|
waitForAsync,
|
||||||
import { FormsModule, ReactiveFormsModule, UntypedFormControl, UntypedFormGroup,
|
} from '@angular/core/testing';
|
||||||
|
import {
|
||||||
|
FormsModule,
|
||||||
|
ReactiveFormsModule,
|
||||||
|
UntypedFormControl,
|
||||||
|
UntypedFormGroup,
|
||||||
Validators,
|
Validators,
|
||||||
} from '@angular/forms';
|
} from '@angular/forms';
|
||||||
import {
|
import {
|
||||||
@@ -13,6 +18,8 @@ import {
|
|||||||
} from '@angular/platform-browser';
|
} from '@angular/platform-browser';
|
||||||
import {
|
import {
|
||||||
ActivatedRoute,
|
ActivatedRoute,
|
||||||
|
ActivatedRoute,
|
||||||
|
Router,
|
||||||
Router,
|
Router,
|
||||||
} from '@angular/router';
|
} from '@angular/router';
|
||||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||||
@@ -26,54 +33,72 @@ import {
|
|||||||
} from 'rxjs';
|
} from 'rxjs';
|
||||||
|
|
||||||
import { AuthService } from '../../../core/auth/auth.service';
|
import { AuthService } from '../../../core/auth/auth.service';
|
||||||
import { EpersonRegistrationService } from '../../../core/data/eperson-registration.service';
|
import {
|
||||||
|
EpersonRegistrationService,
|
||||||
|
EpersonRegistrationService,
|
||||||
|
} from '../../../core/data/eperson-registration.service';
|
||||||
import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service';
|
import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service';
|
||||||
import { FindListOptions } from '../../../core/data/find-list-options.model';
|
import {
|
||||||
|
FindListOptions,
|
||||||
|
FindListOptions,
|
||||||
|
} from '../../../core/data/find-list-options.model';
|
||||||
import {
|
import {
|
||||||
buildPaginatedList,
|
buildPaginatedList,
|
||||||
PaginatedList,
|
PaginatedList,
|
||||||
} from '../../../core/data/paginated-list.model';
|
} from '../../../core/data/paginated-list.model';
|
||||||
import { RemoteData } from '../../../core/data/remote-data';
|
import { RemoteData } from '../../../core/data/remote-data';
|
||||||
import { RequestService } from '../../../core/data/request.service';
|
import {
|
||||||
|
RequestService,
|
||||||
|
RequestService,
|
||||||
|
} from '../../../core/data/request.service';
|
||||||
import { EPersonDataService } from '../../../core/eperson/eperson-data.service';
|
import { EPersonDataService } from '../../../core/eperson/eperson-data.service';
|
||||||
import { GroupDataService } from '../../../core/eperson/group-data.service';
|
import { GroupDataService } from '../../../core/eperson/group-data.service';
|
||||||
import { EPerson } from '../../../core/eperson/models/eperson.model';
|
import { EPerson } from '../../../core/eperson/models/eperson.model';
|
||||||
import { PaginationService } from '../../../core/pagination/pagination.service';
|
import {
|
||||||
|
PaginationService,
|
||||||
|
PaginationService,
|
||||||
|
} from '../../../core/pagination/pagination.service';
|
||||||
import { PageInfo } from '../../../core/shared/page-info.model';
|
import { PageInfo } from '../../../core/shared/page-info.model';
|
||||||
import { FormBuilderService } from '../../../shared/form/builder/form-builder.service';
|
import { FormBuilderService } from '../../../shared/form/builder/form-builder.service';
|
||||||
|
import { FormComponent } from '../../../shared/form/form.component';
|
||||||
|
import { ThemedLoadingComponent } from '../../../shared/loading/themed-loading.component';
|
||||||
import { getMockFormBuilderService } from '../../../shared/mocks/form-builder-service.mock';
|
import { getMockFormBuilderService } from '../../../shared/mocks/form-builder-service.mock';
|
||||||
import { TranslateLoaderMock } from '../../../shared/mocks/translate-loader.mock';
|
import { TranslateLoaderMock } from '../../../shared/mocks/translate-loader.mock';
|
||||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||||
import { EPersonFormComponent } from './eperson-form.component';
|
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
||||||
import { EPersonMock, EPersonMock2 } from '../../../shared/testing/eperson.mock';
|
|
||||||
import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils';
|
import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils';
|
||||||
import { ActivatedRouteStub } from '../../../shared/testing/active-router.stub';
|
import {
|
||||||
|
ActivatedRouteStub,
|
||||||
|
ActivatedRouteStub,
|
||||||
|
} from '../../../shared/testing/active-router.stub';
|
||||||
import { AuthServiceStub } from '../../../shared/testing/auth-service.stub';
|
import { AuthServiceStub } from '../../../shared/testing/auth-service.stub';
|
||||||
import {
|
import {
|
||||||
EPersonMock,
|
EPersonMock,
|
||||||
|
EPersonMock,
|
||||||
|
EPersonMock2,
|
||||||
EPersonMock2,
|
EPersonMock2,
|
||||||
} from '../../../shared/testing/eperson.mock';
|
} from '../../../shared/testing/eperson.mock';
|
||||||
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub';
|
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub';
|
||||||
import { PaginationServiceStub } from '../../../shared/testing/pagination-service.stub';
|
import {
|
||||||
import { RouterStub } from '../../../shared/testing/router.stub';
|
PaginationServiceStub,
|
||||||
|
PaginationServiceStub,
|
||||||
|
} from '../../../shared/testing/pagination-service.stub';
|
||||||
|
import {
|
||||||
|
RouterStub,
|
||||||
|
RouterStub,
|
||||||
|
} from '../../../shared/testing/router.stub';
|
||||||
import { createPaginatedList } from '../../../shared/testing/utils.test';
|
import { createPaginatedList } from '../../../shared/testing/utils.test';
|
||||||
import { RequestService } from '../../../core/data/request.service';
|
|
||||||
import { PaginationService } from '../../../core/pagination/pagination.service';
|
|
||||||
import { PaginationServiceStub } from '../../../shared/testing/pagination-service.stub';
|
|
||||||
import { FindListOptions } from '../../../core/data/find-list-options.model';
|
|
||||||
import { ValidateEmailNotTaken } from './validators/email-taken.validator';
|
|
||||||
import { EpersonRegistrationService } from '../../../core/data/eperson-registration.service';
|
|
||||||
import { ThemedLoadingComponent } from '../../../shared/loading/themed-loading.component';
|
|
||||||
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
|
||||||
import { FormComponent } from '../../../shared/form/form.component';
|
|
||||||
import { FollowLinkConfig } from '../../../shared/utils/follow-link-config.model';
|
import { FollowLinkConfig } from '../../../shared/utils/follow-link-config.model';
|
||||||
import { HasNoValuePipe } from '../../../shared/utils/has-no-value.pipe';
|
import { HasNoValuePipe } from '../../../shared/utils/has-no-value.pipe';
|
||||||
import { EPeopleRegistryComponent } from '../epeople-registry.component';
|
import { EPeopleRegistryComponent } from '../epeople-registry.component';
|
||||||
import { EPersonFormComponent } from './eperson-form.component';
|
import {
|
||||||
import { ValidateEmailNotTaken } from './validators/email-taken.validator';
|
EPersonFormComponent,
|
||||||
import { RouterStub } from '../../../shared/testing/router.stub';
|
EPersonFormComponent,
|
||||||
import { ActivatedRouteStub } from '../../../shared/testing/active-router.stub';
|
} from './eperson-form.component';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import {
|
||||||
|
ValidateEmailNotTaken,
|
||||||
|
ValidateEmailNotTaken,
|
||||||
|
} from './validators/email-taken.validator';
|
||||||
|
|
||||||
describe('EPersonFormComponent', () => {
|
describe('EPersonFormComponent', () => {
|
||||||
let component: EPersonFormComponent;
|
let component: EPersonFormComponent;
|
||||||
@@ -233,17 +258,17 @@ describe('EPersonFormComponent', () => {
|
|||||||
route = new ActivatedRouteStub();
|
route = new ActivatedRouteStub();
|
||||||
router = new RouterStub();
|
router = new RouterStub();
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [CommonModule, NgbModule, FormsModule, ReactiveFormsModule, BrowserModule,
|
imports: [CommonModule, NgbModule, FormsModule, ReactiveFormsModule, BrowserModule,
|
||||||
TranslateModule.forRoot({
|
TranslateModule.forRoot({
|
||||||
loader: {
|
loader: {
|
||||||
provide: TranslateLoader,
|
provide: TranslateLoader,
|
||||||
useClass: TranslateLoaderMock,
|
useClass: TranslateLoaderMock,
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
EPersonFormComponent,
|
EPersonFormComponent,
|
||||||
HasNoValuePipe,
|
HasNoValuePipe,
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: EPersonDataService, useValue: ePersonDataServiceStub },
|
{ provide: EPersonDataService, useValue: ePersonDataServiceStub },
|
||||||
{ provide: GroupDataService, useValue: groupsDataService },
|
{ provide: GroupDataService, useValue: groupsDataService },
|
||||||
{ provide: FormBuilderService, useValue: builderService },
|
{ provide: FormBuilderService, useValue: builderService },
|
||||||
@@ -256,11 +281,11 @@ describe('EPersonFormComponent', () => {
|
|||||||
{ provide: ActivatedRoute, useValue: route },
|
{ provide: ActivatedRoute, useValue: route },
|
||||||
{ provide: Router, useValue: router },
|
{ provide: Router, useValue: router },
|
||||||
EPeopleRegistryComponent,
|
EPeopleRegistryComponent,
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA],
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
})
|
})
|
||||||
.overrideComponent(EPersonFormComponent, {
|
.overrideComponent(EPersonFormComponent, {
|
||||||
remove: { imports: [ ThemedLoadingComponent, PaginationComponent,FormComponent]}
|
remove: { imports: [ ThemedLoadingComponent, PaginationComponent,FormComponent] },
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
}));
|
}));
|
||||||
|
@@ -1,3 +1,8 @@
|
|||||||
|
import {
|
||||||
|
AsyncPipe,
|
||||||
|
NgClass,
|
||||||
|
NgIf,
|
||||||
|
} from '@angular/common';
|
||||||
import {
|
import {
|
||||||
ChangeDetectorRef,
|
ChangeDetectorRef,
|
||||||
Component,
|
Component,
|
||||||
@@ -8,8 +13,11 @@ import {
|
|||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import { UntypedFormGroup } from '@angular/forms';
|
import { UntypedFormGroup } from '@angular/forms';
|
||||||
import {
|
import {
|
||||||
|
ActivatedRoute,
|
||||||
ActivatedRoute,
|
ActivatedRoute,
|
||||||
Router,
|
Router,
|
||||||
|
Router,
|
||||||
|
RouterLink,
|
||||||
} from '@angular/router';
|
} from '@angular/router';
|
||||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import {
|
import {
|
||||||
@@ -18,7 +26,10 @@ import {
|
|||||||
DynamicFormLayout,
|
DynamicFormLayout,
|
||||||
DynamicInputModel,
|
DynamicInputModel,
|
||||||
} from '@ng-dynamic-forms/core';
|
} from '@ng-dynamic-forms/core';
|
||||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
import {
|
||||||
|
TranslateModule,
|
||||||
|
TranslateService,
|
||||||
|
} from '@ngx-translate/core';
|
||||||
import {
|
import {
|
||||||
combineLatest as observableCombineLatest,
|
combineLatest as observableCombineLatest,
|
||||||
Observable,
|
Observable,
|
||||||
@@ -34,8 +45,14 @@ import {
|
|||||||
} from 'rxjs/operators';
|
} from 'rxjs/operators';
|
||||||
|
|
||||||
import { AuthService } from '../../../core/auth/auth.service';
|
import { AuthService } from '../../../core/auth/auth.service';
|
||||||
import { DSONameService } from '../../../core/breadcrumbs/dso-name.service';
|
import {
|
||||||
import { EpersonRegistrationService } from '../../../core/data/eperson-registration.service';
|
DSONameService,
|
||||||
|
DSONameService,
|
||||||
|
} from '../../../core/breadcrumbs/dso-name.service';
|
||||||
|
import {
|
||||||
|
EpersonRegistrationService,
|
||||||
|
EpersonRegistrationService,
|
||||||
|
} from '../../../core/data/eperson-registration.service';
|
||||||
import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service';
|
import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service';
|
||||||
import { FeatureID } from '../../../core/data/feature-authorization/feature-id';
|
import { FeatureID } from '../../../core/data/feature-authorization/feature-id';
|
||||||
import { PaginatedList } from '../../../core/data/paginated-list.model';
|
import { PaginatedList } from '../../../core/data/paginated-list.model';
|
||||||
@@ -53,26 +70,28 @@ import {
|
|||||||
getRemoteDataPayload,
|
getRemoteDataPayload,
|
||||||
} from '../../../core/shared/operators';
|
} from '../../../core/shared/operators';
|
||||||
import { PageInfo } from '../../../core/shared/page-info.model';
|
import { PageInfo } from '../../../core/shared/page-info.model';
|
||||||
import { Registration } from '../../../core/shared/registration.model';
|
import {
|
||||||
import { TYPE_REQUEST_FORGOT } from '../../../register-email-form/register-email-form.component';
|
Registration,
|
||||||
|
Registration,
|
||||||
|
} from '../../../core/shared/registration.model';
|
||||||
|
import {
|
||||||
|
TYPE_REQUEST_FORGOT,
|
||||||
|
TYPE_REQUEST_FORGOT,
|
||||||
|
} from '../../../register-email-form/register-email-form.component';
|
||||||
import { ConfirmationModalComponent } from '../../../shared/confirmation-modal/confirmation-modal.component';
|
import { ConfirmationModalComponent } from '../../../shared/confirmation-modal/confirmation-modal.component';
|
||||||
import { hasValue } from '../../../shared/empty.util';
|
import { hasValue } from '../../../shared/empty.util';
|
||||||
import { FormBuilderService } from '../../../shared/form/builder/form-builder.service';
|
import { FormBuilderService } from '../../../shared/form/builder/form-builder.service';
|
||||||
|
import { FormComponent } from '../../../shared/form/form.component';
|
||||||
|
import { ThemedLoadingComponent } from '../../../shared/loading/themed-loading.component';
|
||||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||||
|
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
||||||
import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model';
|
import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model';
|
||||||
import { followLink } from '../../../shared/utils/follow-link-config.model';
|
import { followLink } from '../../../shared/utils/follow-link-config.model';
|
||||||
import { ValidateEmailNotTaken } from './validators/email-taken.validator';
|
|
||||||
import { Registration } from '../../../core/shared/registration.model';
|
|
||||||
import { EpersonRegistrationService } from '../../../core/data/eperson-registration.service';
|
|
||||||
import { TYPE_REQUEST_FORGOT } from '../../../register-email-form/register-email-form.component';
|
|
||||||
import { DSONameService } from '../../../core/breadcrumbs/dso-name.service';
|
|
||||||
import { FormComponent } from '../../../shared/form/form.component';
|
|
||||||
import { AsyncPipe, NgClass, NgIf } from '@angular/common';
|
|
||||||
import { ThemedLoadingComponent } from '../../../shared/loading/themed-loading.component';
|
|
||||||
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
|
||||||
import { ActivatedRoute, Router, RouterLink } from '@angular/router';
|
|
||||||
import { getEPersonsRoute } from '../../access-control-routing-paths';
|
import { getEPersonsRoute } from '../../access-control-routing-paths';
|
||||||
import { ValidateEmailNotTaken } from './validators/email-taken.validator';
|
import {
|
||||||
|
ValidateEmailNotTaken,
|
||||||
|
ValidateEmailNotTaken,
|
||||||
|
} from './validators/email-taken.validator';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-eperson-form',
|
selector: 'ds-eperson-form',
|
||||||
@@ -85,9 +104,9 @@ import { ValidateEmailNotTaken } from './validators/email-taken.validator';
|
|||||||
NgClass,
|
NgClass,
|
||||||
ThemedLoadingComponent,
|
ThemedLoadingComponent,
|
||||||
PaginationComponent,
|
PaginationComponent,
|
||||||
RouterLink
|
RouterLink,
|
||||||
],
|
],
|
||||||
standalone: true
|
standalone: true,
|
||||||
})
|
})
|
||||||
/**
|
/**
|
||||||
* A form used for creating and editing EPeople
|
* A form used for creating and editing EPeople
|
||||||
|
@@ -1,15 +1,38 @@
|
|||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing';
|
import {
|
||||||
import { FormsModule, ReactiveFormsModule, UntypedFormControl, UntypedFormGroup, Validators, } from '@angular/forms';
|
ComponentFixture,
|
||||||
import { BrowserModule, By, } from '@angular/platform-browser';
|
TestBed,
|
||||||
import { ActivatedRoute, Router, } from '@angular/router';
|
waitForAsync,
|
||||||
|
} from '@angular/core/testing';
|
||||||
|
import {
|
||||||
|
FormsModule,
|
||||||
|
ReactiveFormsModule,
|
||||||
|
UntypedFormControl,
|
||||||
|
UntypedFormGroup,
|
||||||
|
Validators,
|
||||||
|
} from '@angular/forms';
|
||||||
|
import {
|
||||||
|
BrowserModule,
|
||||||
|
By,
|
||||||
|
} from '@angular/platform-browser';
|
||||||
|
import {
|
||||||
|
ActivatedRoute,
|
||||||
|
Router,
|
||||||
|
} from '@angular/router';
|
||||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { TranslateLoader, TranslateModule, TranslateService, } from '@ngx-translate/core';
|
import {
|
||||||
|
TranslateLoader,
|
||||||
|
TranslateModule,
|
||||||
|
TranslateService,
|
||||||
|
} from '@ngx-translate/core';
|
||||||
import { Operation } from 'fast-json-patch';
|
import { Operation } from 'fast-json-patch';
|
||||||
import { Observable, of as observableOf, } from 'rxjs';
|
import {
|
||||||
|
Observable,
|
||||||
|
of as observableOf,
|
||||||
|
} from 'rxjs';
|
||||||
|
|
||||||
import { DSONameService } from '../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../core/breadcrumbs/dso-name.service';
|
||||||
import { RemoteDataBuildService } from '../../../core/cache/builders/remote-data-build.service';
|
import { RemoteDataBuildService } from '../../../core/cache/builders/remote-data-build.service';
|
||||||
@@ -17,7 +40,10 @@ import { ObjectCacheService } from '../../../core/cache/object-cache.service';
|
|||||||
import { DSOChangeAnalyzer } from '../../../core/data/dso-change-analyzer.service';
|
import { DSOChangeAnalyzer } from '../../../core/data/dso-change-analyzer.service';
|
||||||
import { DSpaceObjectDataService } from '../../../core/data/dspace-object-data.service';
|
import { DSpaceObjectDataService } from '../../../core/data/dspace-object-data.service';
|
||||||
import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service';
|
import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service';
|
||||||
import { buildPaginatedList, PaginatedList, } from '../../../core/data/paginated-list.model';
|
import {
|
||||||
|
buildPaginatedList,
|
||||||
|
PaginatedList,
|
||||||
|
} from '../../../core/data/paginated-list.model';
|
||||||
import { RemoteData } from '../../../core/data/remote-data';
|
import { RemoteData } from '../../../core/data/remote-data';
|
||||||
import { EPersonDataService } from '../../../core/eperson/eperson-data.service';
|
import { EPersonDataService } from '../../../core/eperson/eperson-data.service';
|
||||||
import { GroupDataService } from '../../../core/eperson/group-data.service';
|
import { GroupDataService } from '../../../core/eperson/group-data.service';
|
||||||
@@ -27,23 +53,26 @@ import { HALEndpointService } from '../../../core/shared/hal-endpoint.service';
|
|||||||
import { NoContent } from '../../../core/shared/NoContent.model';
|
import { NoContent } from '../../../core/shared/NoContent.model';
|
||||||
import { PageInfo } from '../../../core/shared/page-info.model';
|
import { PageInfo } from '../../../core/shared/page-info.model';
|
||||||
import { UUIDService } from '../../../core/shared/uuid.service';
|
import { UUIDService } from '../../../core/shared/uuid.service';
|
||||||
|
import { AlertComponent } from '../../../shared/alert/alert.component';
|
||||||
|
import { ContextHelpDirective } from '../../../shared/context-help.directive';
|
||||||
import { FormBuilderService } from '../../../shared/form/builder/form-builder.service';
|
import { FormBuilderService } from '../../../shared/form/builder/form-builder.service';
|
||||||
|
import { FormComponent } from '../../../shared/form/form.component';
|
||||||
import { DSONameServiceMock } from '../../../shared/mocks/dso-name.service.mock';
|
import { DSONameServiceMock } from '../../../shared/mocks/dso-name.service.mock';
|
||||||
import { getMockFormBuilderService } from '../../../shared/mocks/form-builder-service.mock';
|
import { getMockFormBuilderService } from '../../../shared/mocks/form-builder-service.mock';
|
||||||
import { RouterMock } from '../../../shared/mocks/router.mock';
|
import { RouterMock } from '../../../shared/mocks/router.mock';
|
||||||
import { getMockTranslateService } from '../../../shared/mocks/translate.service.mock';
|
import { getMockTranslateService } from '../../../shared/mocks/translate.service.mock';
|
||||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||||
import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils';
|
import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils';
|
||||||
import { GroupMock, GroupMock2, } from '../../../shared/testing/group-mock';
|
import {
|
||||||
|
GroupMock,
|
||||||
|
GroupMock2,
|
||||||
|
} from '../../../shared/testing/group-mock';
|
||||||
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub';
|
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub';
|
||||||
import { TranslateLoaderMock } from '../../../shared/testing/translate-loader.mock';
|
import { TranslateLoaderMock } from '../../../shared/testing/translate-loader.mock';
|
||||||
import { GroupFormComponent } from './group-form.component';
|
import { GroupFormComponent } from './group-form.component';
|
||||||
import { ValidateGroupExists } from './validators/group-exists.validator';
|
|
||||||
import { FormComponent } from '../../../shared/form/form.component';
|
|
||||||
import { AlertComponent } from '../../../shared/alert/alert.component';
|
|
||||||
import { ContextHelpDirective } from '../../../shared/context-help.directive';
|
|
||||||
import { MembersListComponent } from './members-list/members-list.component';
|
import { MembersListComponent } from './members-list/members-list.component';
|
||||||
import { SubgroupsListComponent } from './subgroup-list/subgroups-list.component';
|
import { SubgroupsListComponent } from './subgroup-list/subgroups-list.component';
|
||||||
|
import { ValidateGroupExists } from './validators/group-exists.validator';
|
||||||
|
|
||||||
describe('GroupFormComponent', () => {
|
describe('GroupFormComponent', () => {
|
||||||
let component: GroupFormComponent;
|
let component: GroupFormComponent;
|
||||||
@@ -197,14 +226,14 @@ describe('GroupFormComponent', () => {
|
|||||||
router = new RouterMock();
|
router = new RouterMock();
|
||||||
notificationService = new NotificationsServiceStub();
|
notificationService = new NotificationsServiceStub();
|
||||||
return TestBed.configureTestingModule({
|
return TestBed.configureTestingModule({
|
||||||
imports: [CommonModule, NgbModule, FormsModule, ReactiveFormsModule, BrowserModule,
|
imports: [CommonModule, NgbModule, FormsModule, ReactiveFormsModule, BrowserModule,
|
||||||
TranslateModule.forRoot({
|
TranslateModule.forRoot({
|
||||||
loader: {
|
loader: {
|
||||||
provide: TranslateLoader,
|
provide: TranslateLoader,
|
||||||
useClass: TranslateLoaderMock,
|
useClass: TranslateLoaderMock,
|
||||||
},
|
},
|
||||||
}), GroupFormComponent],
|
}), GroupFormComponent],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: DSONameService, useValue: new DSONameServiceMock() },
|
{ provide: DSONameService, useValue: new DSONameServiceMock() },
|
||||||
{ provide: EPersonDataService, useValue: ePersonDataServiceStub },
|
{ provide: EPersonDataService, useValue: ePersonDataServiceStub },
|
||||||
{ provide: GroupDataService, useValue: groupsDataServiceStub },
|
{ provide: GroupDataService, useValue: groupsDataServiceStub },
|
||||||
@@ -219,22 +248,22 @@ describe('GroupFormComponent', () => {
|
|||||||
{ provide: RemoteDataBuildService, useValue: {} },
|
{ provide: RemoteDataBuildService, useValue: {} },
|
||||||
{ provide: HALEndpointService, useValue: {} },
|
{ provide: HALEndpointService, useValue: {} },
|
||||||
{
|
{
|
||||||
provide: ActivatedRoute,
|
provide: ActivatedRoute,
|
||||||
useValue: { data: observableOf({ dso: { payload: {} } }), params: observableOf({}) },
|
useValue: { data: observableOf({ dso: { payload: {} } }), params: observableOf({}) },
|
||||||
},
|
},
|
||||||
{ provide: Router, useValue: router },
|
{ provide: Router, useValue: router },
|
||||||
{ provide: AuthorizationDataService, useValue: authorizationService },
|
{ provide: AuthorizationDataService, useValue: authorizationService },
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA],
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
})
|
})
|
||||||
.overrideComponent(GroupFormComponent, {
|
.overrideComponent(GroupFormComponent, {
|
||||||
remove: { imports: [
|
remove: { imports: [
|
||||||
FormComponent,
|
FormComponent,
|
||||||
AlertComponent,
|
AlertComponent,
|
||||||
ContextHelpDirective,
|
ContextHelpDirective,
|
||||||
MembersListComponent,
|
MembersListComponent,
|
||||||
SubgroupsListComponent
|
SubgroupsListComponent,
|
||||||
]}
|
] },
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
}));
|
}));
|
||||||
|
@@ -1,6 +1,21 @@
|
|||||||
import { ChangeDetectorRef, Component, EventEmitter, HostListener, OnDestroy, OnInit, Output, } from '@angular/core';
|
import {
|
||||||
|
AsyncPipe,
|
||||||
|
NgIf,
|
||||||
|
} from '@angular/common';
|
||||||
|
import {
|
||||||
|
ChangeDetectorRef,
|
||||||
|
Component,
|
||||||
|
EventEmitter,
|
||||||
|
HostListener,
|
||||||
|
OnDestroy,
|
||||||
|
OnInit,
|
||||||
|
Output,
|
||||||
|
} from '@angular/core';
|
||||||
import { UntypedFormGroup } from '@angular/forms';
|
import { UntypedFormGroup } from '@angular/forms';
|
||||||
import { ActivatedRoute, Router, } from '@angular/router';
|
import {
|
||||||
|
ActivatedRoute,
|
||||||
|
Router,
|
||||||
|
} from '@angular/router';
|
||||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import {
|
import {
|
||||||
DynamicFormControlModel,
|
DynamicFormControlModel,
|
||||||
@@ -8,10 +23,25 @@ import {
|
|||||||
DynamicInputModel,
|
DynamicInputModel,
|
||||||
DynamicTextAreaModel,
|
DynamicTextAreaModel,
|
||||||
} from '@ng-dynamic-forms/core';
|
} from '@ng-dynamic-forms/core';
|
||||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
import {
|
||||||
|
TranslateModule,
|
||||||
|
TranslateService,
|
||||||
|
} from '@ngx-translate/core';
|
||||||
import { Operation } from 'fast-json-patch';
|
import { Operation } from 'fast-json-patch';
|
||||||
import { combineLatest as observableCombineLatest, Observable, of as observableOf, Subscription, } from 'rxjs';
|
import {
|
||||||
import { catchError, debounceTime, filter, map, switchMap, take, } from 'rxjs/operators';
|
combineLatest as observableCombineLatest,
|
||||||
|
Observable,
|
||||||
|
of as observableOf,
|
||||||
|
Subscription,
|
||||||
|
} from 'rxjs';
|
||||||
|
import {
|
||||||
|
catchError,
|
||||||
|
debounceTime,
|
||||||
|
filter,
|
||||||
|
map,
|
||||||
|
switchMap,
|
||||||
|
take,
|
||||||
|
} from 'rxjs/operators';
|
||||||
|
|
||||||
import { environment } from '../../../../environments/environment';
|
import { environment } from '../../../../environments/environment';
|
||||||
import { getCollectionEditRolesRoute } from '../../../collection-page/collection-page-routing-paths';
|
import { getCollectionEditRolesRoute } from '../../../collection-page/collection-page-routing-paths';
|
||||||
@@ -36,20 +66,26 @@ import {
|
|||||||
getFirstSucceededRemoteDataPayload,
|
getFirstSucceededRemoteDataPayload,
|
||||||
getRemoteDataPayload,
|
getRemoteDataPayload,
|
||||||
} from '../../../core/shared/operators';
|
} from '../../../core/shared/operators';
|
||||||
|
import { AlertComponent } from '../../../shared/alert/alert.component';
|
||||||
import { AlertType } from '../../../shared/alert/alert-type';
|
import { AlertType } from '../../../shared/alert/alert-type';
|
||||||
import { ConfirmationModalComponent } from '../../../shared/confirmation-modal/confirmation-modal.component';
|
import { ConfirmationModalComponent } from '../../../shared/confirmation-modal/confirmation-modal.component';
|
||||||
import { hasValue, hasValueOperator, isNotEmpty, } from '../../../shared/empty.util';
|
import { ContextHelpDirective } from '../../../shared/context-help.directive';
|
||||||
|
import {
|
||||||
|
hasValue,
|
||||||
|
hasValueOperator,
|
||||||
|
isNotEmpty,
|
||||||
|
} from '../../../shared/empty.util';
|
||||||
import { FormBuilderService } from '../../../shared/form/builder/form-builder.service';
|
import { FormBuilderService } from '../../../shared/form/builder/form-builder.service';
|
||||||
|
import { FormComponent } from '../../../shared/form/form.component';
|
||||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||||
import { followLink } from '../../../shared/utils/follow-link-config.model';
|
import { followLink } from '../../../shared/utils/follow-link-config.model';
|
||||||
import { getGroupEditRoute, getGroupsRoute, } from '../../access-control-routing-paths';
|
import {
|
||||||
import { ValidateGroupExists } from './validators/group-exists.validator';
|
getGroupEditRoute,
|
||||||
import { FormComponent } from '../../../shared/form/form.component';
|
getGroupsRoute,
|
||||||
import { AlertComponent } from '../../../shared/alert/alert.component';
|
} from '../../access-control-routing-paths';
|
||||||
import { AsyncPipe, NgIf } from '@angular/common';
|
|
||||||
import { ContextHelpDirective } from '../../../shared/context-help.directive';
|
|
||||||
import { MembersListComponent } from './members-list/members-list.component';
|
import { MembersListComponent } from './members-list/members-list.component';
|
||||||
import { SubgroupsListComponent } from './subgroup-list/subgroups-list.component';
|
import { SubgroupsListComponent } from './subgroup-list/subgroups-list.component';
|
||||||
|
import { ValidateGroupExists } from './validators/group-exists.validator';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-group-form',
|
selector: 'ds-group-form',
|
||||||
@@ -62,9 +98,9 @@ import { SubgroupsListComponent } from './subgroup-list/subgroups-list.component
|
|||||||
TranslateModule,
|
TranslateModule,
|
||||||
ContextHelpDirective,
|
ContextHelpDirective,
|
||||||
MembersListComponent,
|
MembersListComponent,
|
||||||
SubgroupsListComponent
|
SubgroupsListComponent,
|
||||||
],
|
],
|
||||||
standalone: true
|
standalone: true,
|
||||||
})
|
})
|
||||||
/**
|
/**
|
||||||
* A form used for creating and editing groups
|
* A form used for creating and editing groups
|
||||||
|
@@ -1,16 +1,46 @@
|
|||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { DebugElement, NO_ERRORS_SCHEMA, } from '@angular/core';
|
import {
|
||||||
import { ComponentFixture, fakeAsync, flush, inject, TestBed, tick, waitForAsync, } from '@angular/core/testing';
|
DebugElement,
|
||||||
import { FormsModule, ReactiveFormsModule, } from '@angular/forms';
|
NO_ERRORS_SCHEMA,
|
||||||
import { BrowserModule, By, } from '@angular/platform-browser';
|
} from '@angular/core';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import {
|
||||||
|
ComponentFixture,
|
||||||
|
fakeAsync,
|
||||||
|
flush,
|
||||||
|
inject,
|
||||||
|
TestBed,
|
||||||
|
tick,
|
||||||
|
waitForAsync,
|
||||||
|
} from '@angular/core/testing';
|
||||||
|
import {
|
||||||
|
FormsModule,
|
||||||
|
ReactiveFormsModule,
|
||||||
|
} from '@angular/forms';
|
||||||
|
import {
|
||||||
|
BrowserModule,
|
||||||
|
By,
|
||||||
|
} from '@angular/platform-browser';
|
||||||
|
import {
|
||||||
|
ActivatedRoute,
|
||||||
|
Router,
|
||||||
|
} from '@angular/router';
|
||||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { TranslateLoader, TranslateModule, TranslateService, } from '@ngx-translate/core';
|
import {
|
||||||
import { Observable, of as observableOf, } from 'rxjs';
|
TranslateLoader,
|
||||||
|
TranslateModule,
|
||||||
|
TranslateService,
|
||||||
|
} from '@ngx-translate/core';
|
||||||
|
import {
|
||||||
|
Observable,
|
||||||
|
of as observableOf,
|
||||||
|
} from 'rxjs';
|
||||||
|
|
||||||
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
||||||
import { RestResponse } from '../../../../core/cache/response.models';
|
import { RestResponse } from '../../../../core/cache/response.models';
|
||||||
import { buildPaginatedList, PaginatedList, } from '../../../../core/data/paginated-list.model';
|
import {
|
||||||
|
buildPaginatedList,
|
||||||
|
PaginatedList,
|
||||||
|
} from '../../../../core/data/paginated-list.model';
|
||||||
import { RemoteData } from '../../../../core/data/remote-data';
|
import { RemoteData } from '../../../../core/data/remote-data';
|
||||||
import { EPersonDataService } from '../../../../core/eperson/eperson-data.service';
|
import { EPersonDataService } from '../../../../core/eperson/eperson-data.service';
|
||||||
import { GroupDataService } from '../../../../core/eperson/group-data.service';
|
import { GroupDataService } from '../../../../core/eperson/group-data.service';
|
||||||
@@ -18,20 +48,23 @@ import { EPerson } from '../../../../core/eperson/models/eperson.model';
|
|||||||
import { Group } from '../../../../core/eperson/models/group.model';
|
import { Group } from '../../../../core/eperson/models/group.model';
|
||||||
import { PaginationService } from '../../../../core/pagination/pagination.service';
|
import { PaginationService } from '../../../../core/pagination/pagination.service';
|
||||||
import { PageInfo } from '../../../../core/shared/page-info.model';
|
import { PageInfo } from '../../../../core/shared/page-info.model';
|
||||||
|
import { ContextHelpDirective } from '../../../../shared/context-help.directive';
|
||||||
import { FormBuilderService } from '../../../../shared/form/builder/form-builder.service';
|
import { FormBuilderService } from '../../../../shared/form/builder/form-builder.service';
|
||||||
import { DSONameServiceMock } from '../../../../shared/mocks/dso-name.service.mock';
|
import { DSONameServiceMock } from '../../../../shared/mocks/dso-name.service.mock';
|
||||||
import { getMockFormBuilderService } from '../../../../shared/mocks/form-builder-service.mock';
|
import { getMockFormBuilderService } from '../../../../shared/mocks/form-builder-service.mock';
|
||||||
import { RouterMock } from '../../../../shared/mocks/router.mock';
|
import { RouterMock } from '../../../../shared/mocks/router.mock';
|
||||||
import { getMockTranslateService } from '../../../../shared/mocks/translate.service.mock';
|
import { getMockTranslateService } from '../../../../shared/mocks/translate.service.mock';
|
||||||
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
||||||
|
import { PaginationComponent } from '../../../../shared/pagination/pagination.component';
|
||||||
import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils';
|
import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils';
|
||||||
import { EPersonMock, EPersonMock2, } from '../../../../shared/testing/eperson.mock';
|
import { ActivatedRouteStub } from '../../../../shared/testing/active-router.stub';
|
||||||
|
import {
|
||||||
|
EPersonMock,
|
||||||
|
EPersonMock2,
|
||||||
|
} from '../../../../shared/testing/eperson.mock';
|
||||||
import { GroupMock } from '../../../../shared/testing/group-mock';
|
import { GroupMock } from '../../../../shared/testing/group-mock';
|
||||||
import { NotificationsServiceStub } from '../../../../shared/testing/notifications-service.stub';
|
import { NotificationsServiceStub } from '../../../../shared/testing/notifications-service.stub';
|
||||||
import { PaginationServiceStub } from '../../../../shared/testing/pagination-service.stub';
|
import { PaginationServiceStub } from '../../../../shared/testing/pagination-service.stub';
|
||||||
import { PaginationComponent } from '../../../../shared/pagination/pagination.component';
|
|
||||||
import { ContextHelpDirective } from '../../../../shared/context-help.directive';
|
|
||||||
import { ActivatedRouteStub } from '../../../../shared/testing/active-router.stub';
|
|
||||||
import { TranslateLoaderMock } from '../../../../shared/testing/translate-loader.mock';
|
import { TranslateLoaderMock } from '../../../../shared/testing/translate-loader.mock';
|
||||||
import { MembersListComponent } from './members-list.component';
|
import { MembersListComponent } from './members-list.component';
|
||||||
|
|
||||||
@@ -122,14 +155,14 @@ describe('MembersListComponent', () => {
|
|||||||
|
|
||||||
paginationService = new PaginationServiceStub();
|
paginationService = new PaginationServiceStub();
|
||||||
return TestBed.configureTestingModule({
|
return TestBed.configureTestingModule({
|
||||||
imports: [CommonModule, NgbModule, FormsModule, ReactiveFormsModule, BrowserModule,
|
imports: [CommonModule, NgbModule, FormsModule, ReactiveFormsModule, BrowserModule,
|
||||||
TranslateModule.forRoot({
|
TranslateModule.forRoot({
|
||||||
loader: {
|
loader: {
|
||||||
provide: TranslateLoader,
|
provide: TranslateLoader,
|
||||||
useClass: TranslateLoaderMock,
|
useClass: TranslateLoaderMock,
|
||||||
},
|
},
|
||||||
}), MembersListComponent],
|
}), MembersListComponent],
|
||||||
providers: [MembersListComponent,
|
providers: [MembersListComponent,
|
||||||
{ provide: EPersonDataService, useValue: ePersonDataServiceStub },
|
{ provide: EPersonDataService, useValue: ePersonDataServiceStub },
|
||||||
{ provide: GroupDataService, useValue: groupsDataServiceStub },
|
{ provide: GroupDataService, useValue: groupsDataServiceStub },
|
||||||
{ provide: NotificationsService, useValue: new NotificationsServiceStub() },
|
{ provide: NotificationsService, useValue: new NotificationsServiceStub() },
|
||||||
@@ -138,15 +171,15 @@ describe('MembersListComponent', () => {
|
|||||||
{ provide: PaginationService, useValue: paginationService },
|
{ provide: PaginationService, useValue: paginationService },
|
||||||
{ provide: DSONameService, useValue: new DSONameServiceMock() },
|
{ provide: DSONameService, useValue: new DSONameServiceMock() },
|
||||||
{ provide: ActivatedRoute, useValue: new ActivatedRouteStub() },
|
{ provide: ActivatedRoute, useValue: new ActivatedRouteStub() },
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA],
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
})
|
})
|
||||||
.overrideComponent(MembersListComponent, {
|
.overrideComponent(MembersListComponent, {
|
||||||
remove: {
|
remove: {
|
||||||
imports: [PaginationComponent, ContextHelpDirective]
|
imports: [PaginationComponent, ContextHelpDirective],
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
@@ -1,9 +1,37 @@
|
|||||||
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
|
import {
|
||||||
import { ReactiveFormsModule, UntypedFormBuilder } from '@angular/forms';
|
AsyncPipe,
|
||||||
import { Router, RouterLink } from '@angular/router';
|
NgClass,
|
||||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
NgForOf,
|
||||||
import { BehaviorSubject, Observable, Subscription } from 'rxjs';
|
NgIf,
|
||||||
import { map, switchMap, take } from 'rxjs/operators';
|
} from '@angular/common';
|
||||||
|
import {
|
||||||
|
Component,
|
||||||
|
Input,
|
||||||
|
OnDestroy,
|
||||||
|
OnInit,
|
||||||
|
} from '@angular/core';
|
||||||
|
import {
|
||||||
|
ReactiveFormsModule,
|
||||||
|
UntypedFormBuilder,
|
||||||
|
} from '@angular/forms';
|
||||||
|
import {
|
||||||
|
Router,
|
||||||
|
RouterLink,
|
||||||
|
} from '@angular/router';
|
||||||
|
import {
|
||||||
|
TranslateModule,
|
||||||
|
TranslateService,
|
||||||
|
} from '@ngx-translate/core';
|
||||||
|
import {
|
||||||
|
BehaviorSubject,
|
||||||
|
Observable,
|
||||||
|
Subscription,
|
||||||
|
} from 'rxjs';
|
||||||
|
import {
|
||||||
|
map,
|
||||||
|
switchMap,
|
||||||
|
take,
|
||||||
|
} from 'rxjs/operators';
|
||||||
|
|
||||||
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
||||||
import { PaginatedList } from '../../../../core/data/paginated-list.model';
|
import { PaginatedList } from '../../../../core/data/paginated-list.model';
|
||||||
@@ -18,11 +46,10 @@ import {
|
|||||||
getFirstCompletedRemoteData,
|
getFirstCompletedRemoteData,
|
||||||
getRemoteDataPayload,
|
getRemoteDataPayload,
|
||||||
} from '../../../../core/shared/operators';
|
} from '../../../../core/shared/operators';
|
||||||
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
|
||||||
import { PaginationComponentOptions } from '../../../../shared/pagination/pagination-component-options.model';
|
|
||||||
import { ContextHelpDirective } from '../../../../shared/context-help.directive';
|
import { ContextHelpDirective } from '../../../../shared/context-help.directive';
|
||||||
|
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
||||||
import { PaginationComponent } from '../../../../shared/pagination/pagination.component';
|
import { PaginationComponent } from '../../../../shared/pagination/pagination.component';
|
||||||
import { AsyncPipe, NgClass, NgForOf, NgIf } from '@angular/common';
|
import { PaginationComponentOptions } from '../../../../shared/pagination/pagination-component-options.model';
|
||||||
import { getEPersonEditRoute } from '../../../access-control-routing-paths';
|
import { getEPersonEditRoute } from '../../../access-control-routing-paths';
|
||||||
|
|
||||||
// todo: optimize imports
|
// todo: optimize imports
|
||||||
@@ -77,9 +104,9 @@ export interface EPersonListActionConfig {
|
|||||||
AsyncPipe,
|
AsyncPipe,
|
||||||
RouterLink,
|
RouterLink,
|
||||||
NgClass,
|
NgClass,
|
||||||
NgForOf
|
NgForOf,
|
||||||
],
|
],
|
||||||
standalone: true
|
standalone: true,
|
||||||
})
|
})
|
||||||
/**
|
/**
|
||||||
* The list of members in the edit group page
|
* The list of members in the edit group page
|
||||||
|
@@ -1,35 +1,67 @@
|
|||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { DebugElement, NO_ERRORS_SCHEMA, } from '@angular/core';
|
import {
|
||||||
import { ComponentFixture, fakeAsync, flush, inject, TestBed, waitForAsync, } from '@angular/core/testing';
|
DebugElement,
|
||||||
import { FormsModule, ReactiveFormsModule, } from '@angular/forms';
|
NO_ERRORS_SCHEMA,
|
||||||
import { BrowserModule, By, } from '@angular/platform-browser';
|
} from '@angular/core';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import {
|
||||||
|
ComponentFixture,
|
||||||
|
fakeAsync,
|
||||||
|
flush,
|
||||||
|
inject,
|
||||||
|
TestBed,
|
||||||
|
waitForAsync,
|
||||||
|
} from '@angular/core/testing';
|
||||||
|
import {
|
||||||
|
FormsModule,
|
||||||
|
ReactiveFormsModule,
|
||||||
|
} from '@angular/forms';
|
||||||
|
import {
|
||||||
|
BrowserModule,
|
||||||
|
By,
|
||||||
|
} from '@angular/platform-browser';
|
||||||
|
import {
|
||||||
|
ActivatedRoute,
|
||||||
|
Router,
|
||||||
|
} from '@angular/router';
|
||||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { TranslateLoader, TranslateModule, TranslateService, } from '@ngx-translate/core';
|
import {
|
||||||
import { Observable, of as observableOf, } from 'rxjs';
|
TranslateLoader,
|
||||||
|
TranslateModule,
|
||||||
|
TranslateService,
|
||||||
|
} from '@ngx-translate/core';
|
||||||
|
import {
|
||||||
|
Observable,
|
||||||
|
of as observableOf,
|
||||||
|
} from 'rxjs';
|
||||||
import { EPersonMock2 } from 'src/app/shared/testing/eperson.mock';
|
import { EPersonMock2 } from 'src/app/shared/testing/eperson.mock';
|
||||||
|
|
||||||
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
||||||
import { RestResponse } from '../../../../core/cache/response.models';
|
import { RestResponse } from '../../../../core/cache/response.models';
|
||||||
import { buildPaginatedList, PaginatedList, } from '../../../../core/data/paginated-list.model';
|
import {
|
||||||
|
buildPaginatedList,
|
||||||
|
PaginatedList,
|
||||||
|
} from '../../../../core/data/paginated-list.model';
|
||||||
import { RemoteData } from '../../../../core/data/remote-data';
|
import { RemoteData } from '../../../../core/data/remote-data';
|
||||||
import { GroupDataService } from '../../../../core/eperson/group-data.service';
|
import { GroupDataService } from '../../../../core/eperson/group-data.service';
|
||||||
import { Group } from '../../../../core/eperson/models/group.model';
|
import { Group } from '../../../../core/eperson/models/group.model';
|
||||||
import { PaginationService } from '../../../../core/pagination/pagination.service';
|
import { PaginationService } from '../../../../core/pagination/pagination.service';
|
||||||
import { PageInfo } from '../../../../core/shared/page-info.model';
|
import { PageInfo } from '../../../../core/shared/page-info.model';
|
||||||
|
import { ContextHelpDirective } from '../../../../shared/context-help.directive';
|
||||||
import { FormBuilderService } from '../../../../shared/form/builder/form-builder.service';
|
import { FormBuilderService } from '../../../../shared/form/builder/form-builder.service';
|
||||||
import { DSONameServiceMock } from '../../../../shared/mocks/dso-name.service.mock';
|
import { DSONameServiceMock } from '../../../../shared/mocks/dso-name.service.mock';
|
||||||
import { getMockFormBuilderService } from '../../../../shared/mocks/form-builder-service.mock';
|
import { getMockFormBuilderService } from '../../../../shared/mocks/form-builder-service.mock';
|
||||||
import { RouterMock } from '../../../../shared/mocks/router.mock';
|
import { RouterMock } from '../../../../shared/mocks/router.mock';
|
||||||
import { getMockTranslateService } from '../../../../shared/mocks/translate.service.mock';
|
import { getMockTranslateService } from '../../../../shared/mocks/translate.service.mock';
|
||||||
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
||||||
|
import { PaginationComponent } from '../../../../shared/pagination/pagination.component';
|
||||||
import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils';
|
import { createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils';
|
||||||
import { GroupMock, GroupMock2, } from '../../../../shared/testing/group-mock';
|
import { ActivatedRouteStub } from '../../../../shared/testing/active-router.stub';
|
||||||
|
import {
|
||||||
|
GroupMock,
|
||||||
|
GroupMock2,
|
||||||
|
} from '../../../../shared/testing/group-mock';
|
||||||
import { NotificationsServiceStub } from '../../../../shared/testing/notifications-service.stub';
|
import { NotificationsServiceStub } from '../../../../shared/testing/notifications-service.stub';
|
||||||
import { PaginationServiceStub } from '../../../../shared/testing/pagination-service.stub';
|
import { PaginationServiceStub } from '../../../../shared/testing/pagination-service.stub';
|
||||||
import { ContextHelpDirective } from '../../../../shared/context-help.directive';
|
|
||||||
import { PaginationComponent } from '../../../../shared/pagination/pagination.component';
|
|
||||||
import { ActivatedRouteStub } from '../../../../shared/testing/active-router.stub';
|
|
||||||
import { TranslateLoaderMock } from '../../../../shared/testing/translate-loader.mock';
|
import { TranslateLoaderMock } from '../../../../shared/testing/translate-loader.mock';
|
||||||
import { SubgroupsListComponent } from './subgroups-list.component';
|
import { SubgroupsListComponent } from './subgroups-list.component';
|
||||||
|
|
||||||
@@ -94,7 +126,7 @@ describe('SubgroupsListComponent', () => {
|
|||||||
return createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), groupNonMembers));
|
return createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), groupNonMembers));
|
||||||
}
|
}
|
||||||
return createSuccessfulRemoteDataObject$(
|
return createSuccessfulRemoteDataObject$(
|
||||||
buildPaginatedList(new PageInfo(), [])
|
buildPaginatedList(new PageInfo(), []),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
addSubGroupToGroup(parentGroup, subgroupToAdd: Group): Observable<RestResponse> {
|
addSubGroupToGroup(parentGroup, subgroupToAdd: Group): Observable<RestResponse> {
|
||||||
@@ -161,12 +193,12 @@ describe('SubgroupsListComponent', () => {
|
|||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA],
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
})
|
})
|
||||||
.overrideComponent(SubgroupsListComponent, {
|
.overrideComponent(SubgroupsListComponent, {
|
||||||
remove: {
|
remove: {
|
||||||
imports: [ContextHelpDirective, PaginationComponent]
|
imports: [ContextHelpDirective, PaginationComponent],
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
@@ -1,9 +1,36 @@
|
|||||||
import { Component, Input, OnDestroy, OnInit, } from '@angular/core';
|
import {
|
||||||
import { ReactiveFormsModule, UntypedFormBuilder } from '@angular/forms';
|
AsyncPipe,
|
||||||
import { Router, RouterLink } from '@angular/router';
|
NgForOf,
|
||||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
NgIf,
|
||||||
import { BehaviorSubject, Observable, Subscription, } from 'rxjs';
|
} from '@angular/common';
|
||||||
import { map, switchMap, take, } from 'rxjs/operators';
|
import {
|
||||||
|
Component,
|
||||||
|
Input,
|
||||||
|
OnDestroy,
|
||||||
|
OnInit,
|
||||||
|
} from '@angular/core';
|
||||||
|
import {
|
||||||
|
ReactiveFormsModule,
|
||||||
|
UntypedFormBuilder,
|
||||||
|
} from '@angular/forms';
|
||||||
|
import {
|
||||||
|
Router,
|
||||||
|
RouterLink,
|
||||||
|
} from '@angular/router';
|
||||||
|
import {
|
||||||
|
TranslateModule,
|
||||||
|
TranslateService,
|
||||||
|
} from '@ngx-translate/core';
|
||||||
|
import {
|
||||||
|
BehaviorSubject,
|
||||||
|
Observable,
|
||||||
|
Subscription,
|
||||||
|
} from 'rxjs';
|
||||||
|
import {
|
||||||
|
map,
|
||||||
|
switchMap,
|
||||||
|
take,
|
||||||
|
} from 'rxjs/operators';
|
||||||
|
|
||||||
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
||||||
import { PaginatedList } from '../../../../core/data/paginated-list.model';
|
import { PaginatedList } from '../../../../core/data/paginated-list.model';
|
||||||
@@ -12,14 +39,16 @@ import { GroupDataService } from '../../../../core/eperson/group-data.service';
|
|||||||
import { Group } from '../../../../core/eperson/models/group.model';
|
import { Group } from '../../../../core/eperson/models/group.model';
|
||||||
import { PaginationService } from '../../../../core/pagination/pagination.service';
|
import { PaginationService } from '../../../../core/pagination/pagination.service';
|
||||||
import { NoContent } from '../../../../core/shared/NoContent.model';
|
import { NoContent } from '../../../../core/shared/NoContent.model';
|
||||||
import { getAllCompletedRemoteData, getFirstCompletedRemoteData, } from '../../../../core/shared/operators';
|
import {
|
||||||
|
getAllCompletedRemoteData,
|
||||||
|
getFirstCompletedRemoteData,
|
||||||
|
} from '../../../../core/shared/operators';
|
||||||
import { PageInfo } from '../../../../core/shared/page-info.model';
|
import { PageInfo } from '../../../../core/shared/page-info.model';
|
||||||
|
import { ContextHelpDirective } from '../../../../shared/context-help.directive';
|
||||||
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
||||||
|
import { PaginationComponent } from '../../../../shared/pagination/pagination.component';
|
||||||
import { PaginationComponentOptions } from '../../../../shared/pagination/pagination-component-options.model';
|
import { PaginationComponentOptions } from '../../../../shared/pagination/pagination-component-options.model';
|
||||||
import { followLink } from '../../../../shared/utils/follow-link-config.model';
|
import { followLink } from '../../../../shared/utils/follow-link-config.model';
|
||||||
import { AsyncPipe, NgForOf, NgIf } from '@angular/common';
|
|
||||||
import { ContextHelpDirective } from '../../../../shared/context-help.directive';
|
|
||||||
import { PaginationComponent } from '../../../../shared/pagination/pagination.component';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Keys to keep track of specific subscriptions
|
* Keys to keep track of specific subscriptions
|
||||||
@@ -41,9 +70,9 @@ enum SubKey {
|
|||||||
TranslateModule,
|
TranslateModule,
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
PaginationComponent,
|
PaginationComponent,
|
||||||
NgIf
|
NgIf,
|
||||||
],
|
],
|
||||||
standalone: true
|
standalone: true,
|
||||||
})
|
})
|
||||||
/**
|
/**
|
||||||
* The list of subgroups in the edit group page
|
* The list of subgroups in the edit group page
|
||||||
|
@@ -1,18 +1,47 @@
|
|||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { ComponentFixture, fakeAsync, inject, TestBed, tick, waitForAsync, } from '@angular/core/testing';
|
import {
|
||||||
import { FormsModule, ReactiveFormsModule, } from '@angular/forms';
|
ComponentFixture,
|
||||||
import { BrowserModule, By, } from '@angular/platform-browser';
|
fakeAsync,
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
inject,
|
||||||
|
TestBed,
|
||||||
|
tick,
|
||||||
|
waitForAsync,
|
||||||
|
} from '@angular/core/testing';
|
||||||
|
import {
|
||||||
|
FormsModule,
|
||||||
|
ReactiveFormsModule,
|
||||||
|
} from '@angular/forms';
|
||||||
|
import {
|
||||||
|
BrowserModule,
|
||||||
|
By,
|
||||||
|
} from '@angular/platform-browser';
|
||||||
|
import {
|
||||||
|
ActivatedRoute,
|
||||||
|
Router,
|
||||||
|
} from '@angular/router';
|
||||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { TranslateLoader, TranslateModule, } from '@ngx-translate/core';
|
import { provideMockStore } from '@ngrx/store/testing';
|
||||||
import { Observable, of, of as observableOf, } from 'rxjs';
|
import {
|
||||||
|
TranslateLoader,
|
||||||
|
TranslateModule,
|
||||||
|
} from '@ngx-translate/core';
|
||||||
|
import {
|
||||||
|
Observable,
|
||||||
|
of as observableOf,
|
||||||
|
of,
|
||||||
|
} from 'rxjs';
|
||||||
|
|
||||||
|
import { APP_DATA_SERVICES_MAP } from '../../../config/app-config.interface';
|
||||||
import { DSONameService } from '../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../core/breadcrumbs/dso-name.service';
|
||||||
|
import { ConfigurationDataService } from '../../core/data/configuration-data.service';
|
||||||
import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service';
|
import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service';
|
||||||
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
|
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
|
||||||
import { FeatureID } from '../../core/data/feature-authorization/feature-id';
|
import { FeatureID } from '../../core/data/feature-authorization/feature-id';
|
||||||
import { buildPaginatedList, PaginatedList, } from '../../core/data/paginated-list.model';
|
import {
|
||||||
|
buildPaginatedList,
|
||||||
|
PaginatedList,
|
||||||
|
} from '../../core/data/paginated-list.model';
|
||||||
import { RemoteData } from '../../core/data/remote-data';
|
import { RemoteData } from '../../core/data/remote-data';
|
||||||
import { RequestService } from '../../core/data/request.service';
|
import { RequestService } from '../../core/data/request.service';
|
||||||
import { EPersonDataService } from '../../core/eperson/eperson-data.service';
|
import { EPersonDataService } from '../../core/eperson/eperson-data.service';
|
||||||
@@ -24,18 +53,24 @@ import { RouteService } from '../../core/services/route.service';
|
|||||||
import { DSpaceObject } from '../../core/shared/dspace-object.model';
|
import { DSpaceObject } from '../../core/shared/dspace-object.model';
|
||||||
import { NoContent } from '../../core/shared/NoContent.model';
|
import { NoContent } from '../../core/shared/NoContent.model';
|
||||||
import { PageInfo } from '../../core/shared/page-info.model';
|
import { PageInfo } from '../../core/shared/page-info.model';
|
||||||
import { DSONameServiceMock, UNDEFINED_NAME, } from '../../shared/mocks/dso-name.service.mock';
|
import {
|
||||||
|
DSONameServiceMock,
|
||||||
|
UNDEFINED_NAME,
|
||||||
|
} from '../../shared/mocks/dso-name.service.mock';
|
||||||
import { RouterMock } from '../../shared/mocks/router.mock';
|
import { RouterMock } from '../../shared/mocks/router.mock';
|
||||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||||
import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';
|
import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';
|
||||||
import { EPersonMock, EPersonMock2, } from '../../shared/testing/eperson.mock';
|
import { ActivatedRouteStub } from '../../shared/testing/active-router.stub';
|
||||||
import { GroupMock, GroupMock2, } from '../../shared/testing/group-mock';
|
import {
|
||||||
|
EPersonMock,
|
||||||
|
EPersonMock2,
|
||||||
|
} from '../../shared/testing/eperson.mock';
|
||||||
|
import {
|
||||||
|
GroupMock,
|
||||||
|
GroupMock2,
|
||||||
|
} from '../../shared/testing/group-mock';
|
||||||
import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub';
|
import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub';
|
||||||
import { PaginationServiceStub } from '../../shared/testing/pagination-service.stub';
|
import { PaginationServiceStub } from '../../shared/testing/pagination-service.stub';
|
||||||
import { ActivatedRouteStub } from '../../shared/testing/active-router.stub';
|
|
||||||
import { provideMockStore } from '@ngrx/store/testing';
|
|
||||||
import { ConfigurationDataService } from '../../core/data/configuration-data.service';
|
|
||||||
import { APP_DATA_SERVICES_MAP } from '../../../config/app-config.interface';
|
|
||||||
import { routeServiceStub } from '../../shared/testing/route-service.stub';
|
import { routeServiceStub } from '../../shared/testing/route-service.stub';
|
||||||
import { TranslateLoaderMock } from '../../shared/testing/translate-loader.mock';
|
import { TranslateLoaderMock } from '../../shared/testing/translate-loader.mock';
|
||||||
import { GroupsRegistryComponent } from './groups-registry.component';
|
import { GroupsRegistryComponent } from './groups-registry.component';
|
||||||
@@ -173,14 +208,14 @@ describe('GroupsRegistryComponent', () => {
|
|||||||
setIsAuthorized(true, true);
|
setIsAuthorized(true, true);
|
||||||
paginationService = new PaginationServiceStub();
|
paginationService = new PaginationServiceStub();
|
||||||
return TestBed.configureTestingModule({
|
return TestBed.configureTestingModule({
|
||||||
imports: [CommonModule, NgbModule, FormsModule, ReactiveFormsModule, BrowserModule,
|
imports: [CommonModule, NgbModule, FormsModule, ReactiveFormsModule, BrowserModule,
|
||||||
TranslateModule.forRoot({
|
TranslateModule.forRoot({
|
||||||
loader: {
|
loader: {
|
||||||
provide: TranslateLoader,
|
provide: TranslateLoader,
|
||||||
useClass: TranslateLoaderMock,
|
useClass: TranslateLoaderMock,
|
||||||
},
|
},
|
||||||
}), GroupsRegistryComponent],
|
}), GroupsRegistryComponent],
|
||||||
providers: [GroupsRegistryComponent,
|
providers: [GroupsRegistryComponent,
|
||||||
{ provide: DSONameService, useValue: new DSONameServiceMock() },
|
{ provide: DSONameService, useValue: new DSONameServiceMock() },
|
||||||
{ provide: EPersonDataService, useValue: ePersonDataServiceStub },
|
{ provide: EPersonDataService, useValue: ePersonDataServiceStub },
|
||||||
{ provide: GroupDataService, useValue: groupsDataServiceStub },
|
{ provide: GroupDataService, useValue: groupsDataServiceStub },
|
||||||
@@ -195,9 +230,9 @@ describe('GroupsRegistryComponent', () => {
|
|||||||
{ provide: RequestService, useValue: jasmine.createSpyObj('requestService', ['removeByHrefSubstring']) },
|
{ provide: RequestService, useValue: jasmine.createSpyObj('requestService', ['removeByHrefSubstring']) },
|
||||||
{ provide: APP_DATA_SERVICES_MAP, useValue: {} },
|
{ provide: APP_DATA_SERVICES_MAP, useValue: {} },
|
||||||
provideMockStore(),
|
provideMockStore(),
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA],
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
@@ -1,7 +1,28 @@
|
|||||||
import { Component, OnDestroy, OnInit, } from '@angular/core';
|
import {
|
||||||
import { ReactiveFormsModule, UntypedFormBuilder } from '@angular/forms';
|
AsyncPipe,
|
||||||
import { Router, RouterLink } from '@angular/router';
|
NgForOf,
|
||||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
NgIf,
|
||||||
|
NgSwitch,
|
||||||
|
NgSwitchCase,
|
||||||
|
} from '@angular/common';
|
||||||
|
import {
|
||||||
|
Component,
|
||||||
|
OnDestroy,
|
||||||
|
OnInit,
|
||||||
|
} from '@angular/core';
|
||||||
|
import {
|
||||||
|
ReactiveFormsModule,
|
||||||
|
UntypedFormBuilder,
|
||||||
|
} from '@angular/forms';
|
||||||
|
import {
|
||||||
|
Router,
|
||||||
|
RouterLink,
|
||||||
|
} from '@angular/router';
|
||||||
|
import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';
|
||||||
|
import {
|
||||||
|
TranslateModule,
|
||||||
|
TranslateService,
|
||||||
|
} from '@ngx-translate/core';
|
||||||
import {
|
import {
|
||||||
BehaviorSubject,
|
BehaviorSubject,
|
||||||
combineLatest as observableCombineLatest,
|
combineLatest as observableCombineLatest,
|
||||||
@@ -10,13 +31,22 @@ import {
|
|||||||
of as observableOf,
|
of as observableOf,
|
||||||
Subscription,
|
Subscription,
|
||||||
} from 'rxjs';
|
} from 'rxjs';
|
||||||
import { catchError, defaultIfEmpty, map, switchMap, tap, } from 'rxjs/operators';
|
import {
|
||||||
|
catchError,
|
||||||
|
defaultIfEmpty,
|
||||||
|
map,
|
||||||
|
switchMap,
|
||||||
|
tap,
|
||||||
|
} from 'rxjs/operators';
|
||||||
|
|
||||||
import { DSONameService } from '../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../core/breadcrumbs/dso-name.service';
|
||||||
import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service';
|
import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service';
|
||||||
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
|
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
|
||||||
import { FeatureID } from '../../core/data/feature-authorization/feature-id';
|
import { FeatureID } from '../../core/data/feature-authorization/feature-id';
|
||||||
import { buildPaginatedList, PaginatedList, } from '../../core/data/paginated-list.model';
|
import {
|
||||||
|
buildPaginatedList,
|
||||||
|
PaginatedList,
|
||||||
|
} from '../../core/data/paginated-list.model';
|
||||||
import { RemoteData } from '../../core/data/remote-data';
|
import { RemoteData } from '../../core/data/remote-data';
|
||||||
import { RequestService } from '../../core/data/request.service';
|
import { RequestService } from '../../core/data/request.service';
|
||||||
import { EPersonDataService } from '../../core/eperson/eperson-data.service';
|
import { EPersonDataService } from '../../core/eperson/eperson-data.service';
|
||||||
@@ -36,13 +66,11 @@ import {
|
|||||||
} from '../../core/shared/operators';
|
} from '../../core/shared/operators';
|
||||||
import { PageInfo } from '../../core/shared/page-info.model';
|
import { PageInfo } from '../../core/shared/page-info.model';
|
||||||
import { hasValue } from '../../shared/empty.util';
|
import { hasValue } from '../../shared/empty.util';
|
||||||
|
import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component';
|
||||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||||
|
import { PaginationComponent } from '../../shared/pagination/pagination.component';
|
||||||
import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model';
|
import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model';
|
||||||
import { followLink } from '../../shared/utils/follow-link-config.model';
|
import { followLink } from '../../shared/utils/follow-link-config.model';
|
||||||
import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component';
|
|
||||||
import { AsyncPipe, NgForOf, NgIf, NgSwitch, NgSwitchCase } from '@angular/common';
|
|
||||||
import { PaginationComponent } from '../../shared/pagination/pagination.component';
|
|
||||||
import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-groups-registry',
|
selector: 'ds-groups-registry',
|
||||||
@@ -58,9 +86,9 @@ import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';
|
|||||||
NgSwitch,
|
NgSwitch,
|
||||||
NgSwitchCase,
|
NgSwitchCase,
|
||||||
NgbTooltipModule,
|
NgbTooltipModule,
|
||||||
NgForOf
|
NgForOf,
|
||||||
],
|
],
|
||||||
standalone: true
|
standalone: true,
|
||||||
})
|
})
|
||||||
/**
|
/**
|
||||||
* A component used for managing all existing groups within the repository.
|
* A component used for managing all existing groups within the repository.
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||||
import { CurationFormComponent } from '../../curation-form/curation-form.component';
|
|
||||||
import {
|
import {
|
||||||
ComponentFixture,
|
ComponentFixture,
|
||||||
TestBed,
|
TestBed,
|
||||||
@@ -7,6 +6,7 @@ import {
|
|||||||
} from '@angular/core/testing';
|
} from '@angular/core/testing';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
|
|
||||||
|
import { CurationFormComponent } from '../../curation-form/curation-form.component';
|
||||||
import { AdminCurationTasksComponent } from './admin-curation-tasks.component';
|
import { AdminCurationTasksComponent } from './admin-curation-tasks.component';
|
||||||
|
|
||||||
describe('AdminCurationTasksComponent', () => {
|
describe('AdminCurationTasksComponent', () => {
|
||||||
@@ -16,14 +16,14 @@ describe('AdminCurationTasksComponent', () => {
|
|||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [TranslateModule.forRoot(), AdminCurationTasksComponent],
|
imports: [TranslateModule.forRoot(), AdminCurationTasksComponent],
|
||||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||||
})
|
})
|
||||||
.overrideComponent(AdminCurationTasksComponent, {
|
.overrideComponent(AdminCurationTasksComponent, {
|
||||||
remove: {
|
remove: {
|
||||||
imports: [CurationFormComponent]
|
imports: [CurationFormComponent],
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
@@ -1,7 +1,8 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { CurationFormComponent } from '../../curation-form/curation-form.component';
|
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
|
|
||||||
|
import { CurationFormComponent } from '../../curation-form/curation-form.component';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component responsible for rendering the system wide Curation Task UI
|
* Component responsible for rendering the system wide Curation Task UI
|
||||||
*/
|
*/
|
||||||
@@ -10,9 +11,9 @@ import { TranslateModule } from '@ngx-translate/core';
|
|||||||
templateUrl: './admin-curation-tasks.component.html',
|
templateUrl: './admin-curation-tasks.component.html',
|
||||||
imports: [
|
imports: [
|
||||||
CurationFormComponent,
|
CurationFormComponent,
|
||||||
TranslateModule
|
TranslateModule,
|
||||||
],
|
],
|
||||||
standalone: true
|
standalone: true,
|
||||||
})
|
})
|
||||||
export class AdminCurationTasksComponent {
|
export class AdminCurationTasksComponent {
|
||||||
|
|
||||||
|
@@ -54,20 +54,20 @@ describe('BatchImportPageComponent', () => {
|
|||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
init();
|
init();
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [
|
||||||
FormsModule,
|
FormsModule,
|
||||||
TranslateModule.forRoot(),
|
TranslateModule.forRoot(),
|
||||||
RouterTestingModule.withRoutes([]),
|
RouterTestingModule.withRoutes([]),
|
||||||
BatchImportPageComponent, FileValueAccessorDirective, FileValidator
|
BatchImportPageComponent, FileValueAccessorDirective, FileValidator,
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: NotificationsService, useValue: notificationService },
|
{ provide: NotificationsService, useValue: notificationService },
|
||||||
{ provide: ScriptDataService, useValue: scriptService },
|
{ provide: ScriptDataService, useValue: scriptService },
|
||||||
{ provide: Router, useValue: router },
|
{ provide: Router, useValue: router },
|
||||||
{ provide: Location, useValue: locationStub },
|
{ provide: Location, useValue: locationStub },
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA],
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
@@ -1,19 +1,28 @@
|
|||||||
import { Location } from '@angular/common';
|
import {
|
||||||
|
Location,
|
||||||
|
Location,
|
||||||
|
NgIf,
|
||||||
|
} from '@angular/common';
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { Location, NgIf } from '@angular/common';
|
import { FormsModule } from '@angular/forms';
|
||||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
import {
|
||||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
Router,
|
||||||
import { BATCH_IMPORT_SCRIPT_NAME, ScriptDataService } from '../../core/data/processes/script-data.service';
|
Router,
|
||||||
import { Router } from '@angular/router';
|
} from '@angular/router';
|
||||||
import { ProcessParameter } from '../../process-page/processes/process-parameter.model';
|
|
||||||
import { Router } from '@angular/router';
|
|
||||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import {
|
||||||
|
TranslateModule,
|
||||||
|
TranslateService,
|
||||||
|
TranslateService,
|
||||||
|
} from '@ngx-translate/core';
|
||||||
|
import { UiSwitchModule } from 'ngx-ui-switch';
|
||||||
import { take } from 'rxjs/operators';
|
import { take } from 'rxjs/operators';
|
||||||
|
|
||||||
import { DSONameService } from '../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../core/breadcrumbs/dso-name.service';
|
||||||
import {
|
import {
|
||||||
BATCH_IMPORT_SCRIPT_NAME,
|
BATCH_IMPORT_SCRIPT_NAME,
|
||||||
|
BATCH_IMPORT_SCRIPT_NAME,
|
||||||
|
ScriptDataService,
|
||||||
ScriptDataService,
|
ScriptDataService,
|
||||||
} from '../../core/data/processes/script-data.service';
|
} from '../../core/data/processes/script-data.service';
|
||||||
import { RemoteData } from '../../core/data/remote-data';
|
import { RemoteData } from '../../core/data/remote-data';
|
||||||
@@ -21,18 +30,20 @@ import { DSpaceObject } from '../../core/shared/dspace-object.model';
|
|||||||
import { getFirstCompletedRemoteData } from '../../core/shared/operators';
|
import { getFirstCompletedRemoteData } from '../../core/shared/operators';
|
||||||
import { getProcessDetailRoute } from '../../process-page/process-page-routing.paths';
|
import { getProcessDetailRoute } from '../../process-page/process-page-routing.paths';
|
||||||
import { Process } from '../../process-page/processes/process.model';
|
import { Process } from '../../process-page/processes/process.model';
|
||||||
import { ProcessParameter } from '../../process-page/processes/process-parameter.model';
|
import {
|
||||||
|
ProcessParameter,
|
||||||
|
ProcessParameter,
|
||||||
|
} from '../../process-page/processes/process-parameter.model';
|
||||||
import { ImportBatchSelectorComponent } from '../../shared/dso-selector/modal-wrappers/import-batch-selector/import-batch-selector.component';
|
import { ImportBatchSelectorComponent } from '../../shared/dso-selector/modal-wrappers/import-batch-selector/import-batch-selector.component';
|
||||||
import {
|
import {
|
||||||
isEmpty,
|
isEmpty,
|
||||||
isNotEmpty,
|
isNotEmpty,
|
||||||
} from '../../shared/empty.util';
|
} from '../../shared/empty.util';
|
||||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
|
||||||
import { FormsModule } from '@angular/forms';
|
|
||||||
import { UiSwitchModule } from 'ngx-ui-switch';
|
|
||||||
import {
|
import {
|
||||||
FileDropzoneNoUploaderComponent
|
NotificationsService,
|
||||||
} from '../../shared/upload/file-dropzone-no-uploader/file-dropzone-no-uploader.component';
|
NotificationsService,
|
||||||
|
} from '../../shared/notifications/notifications.service';
|
||||||
|
import { FileDropzoneNoUploaderComponent } from '../../shared/upload/file-dropzone-no-uploader/file-dropzone-no-uploader.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-batch-import-page',
|
selector: 'ds-batch-import-page',
|
||||||
@@ -42,9 +53,9 @@ import {
|
|||||||
TranslateModule,
|
TranslateModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
UiSwitchModule,
|
UiSwitchModule,
|
||||||
FileDropzoneNoUploaderComponent
|
FileDropzoneNoUploaderComponent,
|
||||||
],
|
],
|
||||||
standalone: true
|
standalone: true,
|
||||||
})
|
})
|
||||||
export class BatchImportPageComponent {
|
export class BatchImportPageComponent {
|
||||||
/**
|
/**
|
||||||
|
@@ -54,20 +54,20 @@ describe('MetadataImportPageComponent', () => {
|
|||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
init();
|
init();
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [
|
||||||
FormsModule,
|
FormsModule,
|
||||||
TranslateModule.forRoot(),
|
TranslateModule.forRoot(),
|
||||||
RouterTestingModule.withRoutes([]),
|
RouterTestingModule.withRoutes([]),
|
||||||
MetadataImportPageComponent, FileValueAccessorDirective, FileValidator
|
MetadataImportPageComponent, FileValueAccessorDirective, FileValidator,
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: NotificationsService, useValue: notificationService },
|
{ provide: NotificationsService, useValue: notificationService },
|
||||||
{ provide: ScriptDataService, useValue: scriptService },
|
{ provide: ScriptDataService, useValue: scriptService },
|
||||||
{ provide: Router, useValue: router },
|
{ provide: Router, useValue: router },
|
||||||
{ provide: Location, useValue: locationStub },
|
{ provide: Location, useValue: locationStub },
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA],
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
@@ -1,7 +1,11 @@
|
|||||||
import { Location } from '@angular/common';
|
import { Location } from '@angular/common';
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
import { FormsModule } from '@angular/forms';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
import {
|
||||||
|
TranslateModule,
|
||||||
|
TranslateService,
|
||||||
|
} from '@ngx-translate/core';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
METADATA_IMPORT_SCRIPT_NAME,
|
METADATA_IMPORT_SCRIPT_NAME,
|
||||||
@@ -10,14 +14,11 @@ import {
|
|||||||
import { RemoteData } from '../../core/data/remote-data';
|
import { RemoteData } from '../../core/data/remote-data';
|
||||||
import { getFirstCompletedRemoteData } from '../../core/shared/operators';
|
import { getFirstCompletedRemoteData } from '../../core/shared/operators';
|
||||||
import { getProcessDetailRoute } from '../../process-page/process-page-routing.paths';
|
import { getProcessDetailRoute } from '../../process-page/process-page-routing.paths';
|
||||||
import { FormsModule } from '@angular/forms';
|
|
||||||
import {
|
|
||||||
FileDropzoneNoUploaderComponent
|
|
||||||
} from '../../shared/upload/file-dropzone-no-uploader/file-dropzone-no-uploader.component';
|
|
||||||
import { Process } from '../../process-page/processes/process.model';
|
import { Process } from '../../process-page/processes/process.model';
|
||||||
import { ProcessParameter } from '../../process-page/processes/process-parameter.model';
|
import { ProcessParameter } from '../../process-page/processes/process-parameter.model';
|
||||||
import { isNotEmpty } from '../../shared/empty.util';
|
import { isNotEmpty } from '../../shared/empty.util';
|
||||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||||
|
import { FileDropzoneNoUploaderComponent } from '../../shared/upload/file-dropzone-no-uploader/file-dropzone-no-uploader.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-metadata-import-page',
|
selector: 'ds-metadata-import-page',
|
||||||
@@ -25,9 +26,9 @@ import { NotificationsService } from '../../shared/notifications/notifications.s
|
|||||||
imports: [
|
imports: [
|
||||||
TranslateModule,
|
TranslateModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
FileDropzoneNoUploaderComponent
|
FileDropzoneNoUploaderComponent,
|
||||||
],
|
],
|
||||||
standalone: true
|
standalone: true,
|
||||||
})
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
import { Routes ,
|
import { Routes } from '@angular/router';
|
||||||
} from '@angular/router';
|
|
||||||
import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver';
|
import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver';
|
||||||
import { NavigationBreadcrumbResolver } from '../../core/breadcrumbs/navigation-breadcrumb.resolver';
|
import { NavigationBreadcrumbResolver } from '../../core/breadcrumbs/navigation-breadcrumb.resolver';
|
||||||
import { LdnServiceFormComponent } from './ldn-service-form/ldn-service-form.component';
|
import { LdnServiceFormComponent } from './ldn-service-form/ldn-service-form.component';
|
||||||
@@ -28,11 +28,11 @@ const moduleRoutes: Routes = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
export const ROUTES = moduleRoutes.map(route => {
|
export const ROUTES = moduleRoutes.map(route => {
|
||||||
return {...route, data: {
|
return { ...route, data: {
|
||||||
...route.data,
|
...route.data,
|
||||||
relatedRoutes: moduleRoutes.filter(relatedRoute => relatedRoute.path !== route.path)
|
relatedRoutes: moduleRoutes.filter(relatedRoute => relatedRoute.path !== route.path)
|
||||||
.map((relatedRoute) => {
|
.map((relatedRoute) => {
|
||||||
return {path: relatedRoute.path, data: relatedRoute.data};
|
return { path: relatedRoute.path, data: relatedRoute.data };
|
||||||
}),
|
}),
|
||||||
}};
|
} };
|
||||||
});
|
});
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
|
|
||||||
import { LdnItemfiltersService } from './ldn-services-data/ldn-itemfilters-data.service';
|
import { LdnItemfiltersService } from './ldn-services-data/ldn-itemfilters-data.service';
|
||||||
import { LdnServicesOverviewComponent } from './ldn-services-directory/ldn-services-directory.component';
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
@@ -114,8 +114,8 @@ describe('LdnServiceFormEditComponent', () => {
|
|||||||
activatedRoute = new MockActivatedRoute(routeParams, routeUrlSegments);
|
activatedRoute = new MockActivatedRoute(routeParams, routeUrlSegments);
|
||||||
|
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
imports: [ReactiveFormsModule, TranslateModule.forRoot(), NgbDropdownModule, LdnServiceFormComponent],
|
imports: [ReactiveFormsModule, TranslateModule.forRoot(), NgbDropdownModule, LdnServiceFormComponent],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: LdnServicesService, useValue: ldnServicesService },
|
{ provide: LdnServicesService, useValue: ldnServicesService },
|
||||||
{ provide: LdnItemfiltersService, useValue: ldnItemfiltersService },
|
{ provide: LdnItemfiltersService, useValue: ldnItemfiltersService },
|
||||||
{ provide: Router, useValue: new RouterStub() },
|
{ provide: Router, useValue: new RouterStub() },
|
||||||
@@ -129,7 +129,7 @@ describe('LdnServiceFormEditComponent', () => {
|
|||||||
RouteService,
|
RouteService,
|
||||||
provideMockStore({}),
|
provideMockStore({}),
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
|
||||||
fixture = TestBed.createComponent(LdnServiceFormComponent);
|
fixture = TestBed.createComponent(LdnServiceFormComponent);
|
||||||
|
@@ -1,27 +1,63 @@
|
|||||||
import { animate, state, style, transition, trigger, } from '@angular/animations';
|
import {
|
||||||
import { ChangeDetectorRef, Component, OnDestroy, OnInit, TemplateRef, ViewChild, } from '@angular/core';
|
animate,
|
||||||
import { FormArray, FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
|
state,
|
||||||
import { LDN_SERVICE } from '../ldn-services-model/ldn-service.resource-type';
|
style,
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
transition,
|
||||||
import { LdnServicesService } from '../ldn-services-data/ldn-services-data.service';
|
trigger,
|
||||||
import { notifyPatterns } from '../ldn-services-patterns/ldn-service-coar-patterns';
|
} from '@angular/animations';
|
||||||
import { NgbDropdownModule, NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
import {
|
||||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
AsyncPipe,
|
||||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
NgForOf,
|
||||||
import { LdnService } from '../ldn-services-model/ldn-services.model';
|
NgIf,
|
||||||
|
} from '@angular/common';
|
||||||
|
import {
|
||||||
|
ChangeDetectorRef,
|
||||||
|
Component,
|
||||||
|
OnDestroy,
|
||||||
|
OnInit,
|
||||||
|
TemplateRef,
|
||||||
|
ViewChild,
|
||||||
|
} from '@angular/core';
|
||||||
|
import {
|
||||||
|
FormArray,
|
||||||
|
FormBuilder,
|
||||||
|
FormGroup,
|
||||||
|
ReactiveFormsModule,
|
||||||
|
Validators,
|
||||||
|
} from '@angular/forms';
|
||||||
|
import {
|
||||||
|
ActivatedRoute,
|
||||||
|
Router,
|
||||||
|
} from '@angular/router';
|
||||||
|
import {
|
||||||
|
NgbDropdownModule,
|
||||||
|
NgbModal,
|
||||||
|
} from '@ng-bootstrap/ng-bootstrap';
|
||||||
|
import {
|
||||||
|
TranslateModule,
|
||||||
|
TranslateService,
|
||||||
|
} from '@ngx-translate/core';
|
||||||
import { Operation } from 'fast-json-patch';
|
import { Operation } from 'fast-json-patch';
|
||||||
import { combineLatestWith, Observable, Subscription, } from 'rxjs';
|
import {
|
||||||
|
combineLatestWith,
|
||||||
|
Observable,
|
||||||
|
Subscription,
|
||||||
|
} from 'rxjs';
|
||||||
import { RemoteData } from 'src/app/core/data/remote-data';
|
import { RemoteData } from 'src/app/core/data/remote-data';
|
||||||
|
|
||||||
import { FindListOptions } from '../../../core/data/find-list-options.model';
|
import { FindListOptions } from '../../../core/data/find-list-options.model';
|
||||||
import { PaginatedList } from '../../../core/data/paginated-list.model';
|
import { PaginatedList } from '../../../core/data/paginated-list.model';
|
||||||
import { PaginationService } from '../../../core/pagination/pagination.service';
|
import { PaginationService } from '../../../core/pagination/pagination.service';
|
||||||
import { getFirstCompletedRemoteData } from '../../../core/shared/operators';
|
import { getFirstCompletedRemoteData } from '../../../core/shared/operators';
|
||||||
|
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||||
import { IpV4Validator } from '../../../shared/utils/ipV4.validator';
|
import { IpV4Validator } from '../../../shared/utils/ipV4.validator';
|
||||||
import { LdnItemfiltersService } from '../ldn-services-data/ldn-itemfilters-data.service';
|
import { LdnItemfiltersService } from '../ldn-services-data/ldn-itemfilters-data.service';
|
||||||
|
import { LdnServicesService } from '../ldn-services-data/ldn-services-data.service';
|
||||||
|
import { LDN_SERVICE } from '../ldn-services-model/ldn-service.resource-type';
|
||||||
import { Itemfilter } from '../ldn-services-model/ldn-service-itemfilters';
|
import { Itemfilter } from '../ldn-services-model/ldn-service-itemfilters';
|
||||||
import { NotifyServicePattern } from '../ldn-services-model/ldn-service-patterns.model';
|
import { NotifyServicePattern } from '../ldn-services-model/ldn-service-patterns.model';
|
||||||
import { AsyncPipe, NgForOf, NgIf } from '@angular/common';
|
import { LdnService } from '../ldn-services-model/ldn-services.model';
|
||||||
|
import { notifyPatterns } from '../ldn-services-patterns/ldn-service-coar-patterns';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component for editing LDN service through a form that allows to create or edit the properties of a service
|
* Component for editing LDN service through a form that allows to create or edit the properties of a service
|
||||||
@@ -44,8 +80,8 @@ import { AsyncPipe, NgForOf, NgIf } from '@angular/common';
|
|||||||
NgIf,
|
NgIf,
|
||||||
NgbDropdownModule,
|
NgbDropdownModule,
|
||||||
NgForOf,
|
NgForOf,
|
||||||
AsyncPipe
|
AsyncPipe,
|
||||||
]
|
],
|
||||||
})
|
})
|
||||||
export class LdnServiceFormComponent implements OnInit, OnDestroy {
|
export class LdnServiceFormComponent implements OnInit, OnDestroy {
|
||||||
formModel: FormGroup;
|
formModel: FormGroup;
|
||||||
|
@@ -22,7 +22,7 @@ import { Itemfilter } from '../ldn-services-model/ldn-service-itemfilters';
|
|||||||
/**
|
/**
|
||||||
* A service responsible for fetching/sending data from/to the REST API on the itemfilters endpoint
|
* A service responsible for fetching/sending data from/to the REST API on the itemfilters endpoint
|
||||||
*/
|
*/
|
||||||
@Injectable({providedIn: 'root'})
|
@Injectable({ providedIn: 'root' })
|
||||||
@dataService(LDN_SERVICE_CONSTRAINT_FILTERS)
|
@dataService(LDN_SERVICE_CONSTRAINT_FILTERS)
|
||||||
export class LdnItemfiltersService extends IdentifiableDataService<Itemfilter> implements FindAllData<Itemfilter> {
|
export class LdnItemfiltersService extends IdentifiableDataService<Itemfilter> implements FindAllData<Itemfilter> {
|
||||||
private findAllData: FindAllDataImpl<Itemfilter>;
|
private findAllData: FindAllDataImpl<Itemfilter>;
|
||||||
|
@@ -56,7 +56,7 @@ import { LdnService } from '../ldn-services-model/ldn-services.model';
|
|||||||
* @implements {PatchData<LdnService>}
|
* @implements {PatchData<LdnService>}
|
||||||
* @implements {CreateData<LdnService>}
|
* @implements {CreateData<LdnService>}
|
||||||
*/
|
*/
|
||||||
@Injectable({providedIn: 'root'})
|
@Injectable({ providedIn: 'root' })
|
||||||
@dataService(LDN_SERVICE)
|
@dataService(LDN_SERVICE)
|
||||||
export class LdnServicesService extends IdentifiableDataService<LdnService> implements FindAllData<LdnService>, DeleteData<LdnService>, PatchData<LdnService>, CreateData<LdnService> {
|
export class LdnServicesService extends IdentifiableDataService<LdnService> implements FindAllData<LdnService>, DeleteData<LdnService>, PatchData<LdnService>, CreateData<LdnService> {
|
||||||
createData: CreateDataImpl<LdnService>;
|
createData: CreateDataImpl<LdnService>;
|
||||||
|
@@ -50,25 +50,25 @@ describe('LdnServicesOverviewComponent', () => {
|
|||||||
'patch': createSuccessfulRemoteDataObject$({}),
|
'patch': createSuccessfulRemoteDataObject$({}),
|
||||||
});
|
});
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
imports: [TranslateModule.forRoot(), LdnServicesOverviewComponent],
|
imports: [TranslateModule.forRoot(), LdnServicesOverviewComponent],
|
||||||
providers: [
|
providers: [
|
||||||
{
|
{
|
||||||
provide: LdnServicesService,
|
provide: LdnServicesService,
|
||||||
useValue: ldnServicesService,
|
useValue: ldnServicesService,
|
||||||
},
|
},
|
||||||
{ provide: PaginationService, useValue: paginationService },
|
{ provide: PaginationService, useValue: paginationService },
|
||||||
{
|
{
|
||||||
provide: NgbModal, useValue: {
|
provide: NgbModal, useValue: {
|
||||||
open: () => {
|
open: () => {
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{ provide: ChangeDetectorRef, useValue: {} },
|
{ provide: ChangeDetectorRef, useValue: {} },
|
||||||
{ provide: NotificationsService, useValue: new NotificationsServiceStub() },
|
{ provide: NotificationsService, useValue: new NotificationsServiceStub() },
|
||||||
{ provide: TranslateService, useValue: translateServiceStub },
|
{ provide: TranslateService, useValue: translateServiceStub },
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA],
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
@@ -1,3 +1,8 @@
|
|||||||
|
import {
|
||||||
|
AsyncPipe,
|
||||||
|
NgClass,
|
||||||
|
NgIf,
|
||||||
|
} from '@angular/common';
|
||||||
import {
|
import {
|
||||||
ChangeDetectionStrategy,
|
ChangeDetectionStrategy,
|
||||||
ChangeDetectorRef,
|
ChangeDetectorRef,
|
||||||
@@ -7,11 +12,21 @@ import {
|
|||||||
TemplateRef,
|
TemplateRef,
|
||||||
ViewChild,
|
ViewChild,
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
import { RouterLink } from '@angular/router';
|
||||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
import {
|
||||||
|
TranslateModule,
|
||||||
|
TranslateService,
|
||||||
|
} from '@ngx-translate/core';
|
||||||
import { Operation } from 'fast-json-patch';
|
import { Operation } from 'fast-json-patch';
|
||||||
import { Observable, Subscription, } from 'rxjs';
|
import {
|
||||||
import { map, switchMap, } from 'rxjs/operators';
|
Observable,
|
||||||
|
Subscription,
|
||||||
|
} from 'rxjs';
|
||||||
|
import {
|
||||||
|
map,
|
||||||
|
switchMap,
|
||||||
|
} from 'rxjs/operators';
|
||||||
import { LdnServicesService } from 'src/app/admin/admin-ldn-services/ldn-services-data/ldn-services-data.service';
|
import { LdnServicesService } from 'src/app/admin/admin-ldn-services/ldn-services-data/ldn-services-data.service';
|
||||||
import { PaginationService } from 'src/app/core/pagination/pagination.service';
|
import { PaginationService } from 'src/app/core/pagination/pagination.service';
|
||||||
|
|
||||||
@@ -21,13 +36,10 @@ import { RemoteData } from '../../../core/data/remote-data';
|
|||||||
import { getFirstCompletedRemoteData } from '../../../core/shared/operators';
|
import { getFirstCompletedRemoteData } from '../../../core/shared/operators';
|
||||||
import { hasValue } from '../../../shared/empty.util';
|
import { hasValue } from '../../../shared/empty.util';
|
||||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||||
import { AsyncPipe, NgClass, NgIf } from '@angular/common';
|
|
||||||
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
||||||
|
import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model';
|
||||||
import { TruncatableComponent } from '../../../shared/truncatable/truncatable.component';
|
import { TruncatableComponent } from '../../../shared/truncatable/truncatable.component';
|
||||||
import { TruncatablePartComponent } from '../../../shared/truncatable/truncatable-part/truncatable-part.component';
|
import { TruncatablePartComponent } from '../../../shared/truncatable/truncatable-part/truncatable-part.component';
|
||||||
import { RouterLink } from '@angular/router';
|
|
||||||
|
|
||||||
import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model';
|
|
||||||
import { LdnService } from '../ldn-services-model/ldn-services.model';
|
import { LdnService } from '../ldn-services-model/ldn-services.model';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -48,9 +60,9 @@ import { LdnService } from '../ldn-services-model/ldn-services.model';
|
|||||||
TruncatableComponent,
|
TruncatableComponent,
|
||||||
TruncatablePartComponent,
|
TruncatablePartComponent,
|
||||||
NgClass,
|
NgClass,
|
||||||
RouterLink
|
RouterLink,
|
||||||
],
|
],
|
||||||
standalone: true
|
standalone: true,
|
||||||
})
|
})
|
||||||
export class LdnServicesOverviewComponent implements OnInit, OnDestroy {
|
export class LdnServicesOverviewComponent implements OnInit, OnDestroy {
|
||||||
|
|
||||||
|
@@ -15,17 +15,17 @@ describe('NotificationsSuggestionTargetsPageComponent', () => {
|
|||||||
|
|
||||||
beforeEach(async(() => {
|
beforeEach(async(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
TranslateModule.forRoot(),
|
TranslateModule.forRoot(),
|
||||||
NotificationsSuggestionTargetsPageComponent,
|
NotificationsSuggestionTargetsPageComponent,
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
NotificationsSuggestionTargetsPageComponent,
|
NotificationsSuggestionTargetsPageComponent,
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA],
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
@@ -1,16 +1,15 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import {
|
|
||||||
PublicationClaimComponent
|
import { PublicationClaimComponent } from '../../../notifications/suggestion-targets/publication-claim/publication-claim.component';
|
||||||
} from '../../../notifications/suggestion-targets/publication-claim/publication-claim.component';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-admin-notifications-publication-claim-page',
|
selector: 'ds-admin-notifications-publication-claim-page',
|
||||||
templateUrl: './admin-notifications-publication-claim-page.component.html',
|
templateUrl: './admin-notifications-publication-claim-page.component.html',
|
||||||
styleUrls: ['./admin-notifications-publication-claim-page.component.scss'],
|
styleUrls: ['./admin-notifications-publication-claim-page.component.scss'],
|
||||||
imports: [
|
imports: [
|
||||||
PublicationClaimComponent
|
PublicationClaimComponent,
|
||||||
],
|
],
|
||||||
standalone: true
|
standalone: true,
|
||||||
})
|
})
|
||||||
export class AdminNotificationsPublicationClaimPageComponent {
|
export class AdminNotificationsPublicationClaimPageComponent {
|
||||||
|
|
||||||
|
@@ -1,39 +1,27 @@
|
|||||||
import { Route, RouterModule } from '@angular/router';
|
import {
|
||||||
|
Route,
|
||||||
|
RouterModule,
|
||||||
|
} from '@angular/router';
|
||||||
|
|
||||||
import { AuthenticatedGuard } from '../../core/auth/authenticated.guard';
|
import { AuthenticatedGuard } from '../../core/auth/authenticated.guard';
|
||||||
import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver';
|
import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver';
|
||||||
import { I18nBreadcrumbsService } from '../../core/breadcrumbs/i18n-breadcrumbs.service';
|
import { I18nBreadcrumbsService } from '../../core/breadcrumbs/i18n-breadcrumbs.service';
|
||||||
import { PUBLICATION_CLAIMS_PATH, QUALITY_ASSURANCE_EDIT_PATH } from './admin-notifications-routing-paths';
|
|
||||||
import { QualityAssuranceBreadcrumbResolver } from '../../core/breadcrumbs/quality-assurance-breadcrumb.resolver';
|
import { QualityAssuranceBreadcrumbResolver } from '../../core/breadcrumbs/quality-assurance-breadcrumb.resolver';
|
||||||
import { QualityAssuranceBreadcrumbService } from '../../core/breadcrumbs/quality-assurance-breadcrumb.service';
|
import { QualityAssuranceBreadcrumbService } from '../../core/breadcrumbs/quality-assurance-breadcrumb.service';
|
||||||
import {
|
|
||||||
SourceDataResolver
|
|
||||||
} from '../../quality-assurance-notifications-pages/quality-assurance-source-page-component/quality-assurance-source-data.resolver';
|
|
||||||
import {
|
|
||||||
QualityAssuranceSourcePageResolver
|
|
||||||
} from '../../quality-assurance-notifications-pages/quality-assurance-source-page-component/quality-assurance-source-page-resolver.service';
|
|
||||||
import {
|
|
||||||
QualityAssuranceEventsPageResolver
|
|
||||||
} from '../../quality-assurance-notifications-pages/quality-assurance-events-page/quality-assurance-events-page.resolver';
|
|
||||||
import {
|
|
||||||
QualityAssuranceTopicsPageResolver
|
|
||||||
} from '../../quality-assurance-notifications-pages/quality-assurance-topics-page/quality-assurance-topics-page-resolver.service';
|
|
||||||
import {
|
|
||||||
AdminNotificationsPublicationClaimPageComponent
|
|
||||||
} from './admin-notifications-publication-claim-page/admin-notifications-publication-claim-page.component';
|
|
||||||
import {
|
|
||||||
AdminNotificationsPublicationClaimPageResolver
|
|
||||||
} from '../../quality-assurance-notifications-pages/notifications-suggestion-targets-page/notifications-suggestion-targets-page-resolver.service';
|
|
||||||
import {
|
|
||||||
QualityAssuranceTopicsPageComponent
|
|
||||||
} from '../../quality-assurance-notifications-pages/quality-assurance-topics-page/quality-assurance-topics-page.component';
|
|
||||||
import {
|
|
||||||
QualityAssuranceSourcePageComponent
|
|
||||||
} from '../../quality-assurance-notifications-pages/quality-assurance-source-page-component/quality-assurance-source-page.component';
|
|
||||||
import {
|
|
||||||
QualityAssuranceEventsPageComponent
|
|
||||||
} from '../../quality-assurance-notifications-pages/quality-assurance-events-page/quality-assurance-events-page.component';
|
|
||||||
import { provideSuggestionNotifications } from '../../notifications/provide-suggestion-notifications';
|
import { provideSuggestionNotifications } from '../../notifications/provide-suggestion-notifications';
|
||||||
|
import { AdminNotificationsPublicationClaimPageResolver } from '../../quality-assurance-notifications-pages/notifications-suggestion-targets-page/notifications-suggestion-targets-page-resolver.service';
|
||||||
|
import { QualityAssuranceEventsPageComponent } from '../../quality-assurance-notifications-pages/quality-assurance-events-page/quality-assurance-events-page.component';
|
||||||
|
import { QualityAssuranceEventsPageResolver } from '../../quality-assurance-notifications-pages/quality-assurance-events-page/quality-assurance-events-page.resolver';
|
||||||
|
import { SourceDataResolver } from '../../quality-assurance-notifications-pages/quality-assurance-source-page-component/quality-assurance-source-data.resolver';
|
||||||
|
import { QualityAssuranceSourcePageComponent } from '../../quality-assurance-notifications-pages/quality-assurance-source-page-component/quality-assurance-source-page.component';
|
||||||
|
import { QualityAssuranceSourcePageResolver } from '../../quality-assurance-notifications-pages/quality-assurance-source-page-component/quality-assurance-source-page-resolver.service';
|
||||||
|
import { QualityAssuranceTopicsPageComponent } from '../../quality-assurance-notifications-pages/quality-assurance-topics-page/quality-assurance-topics-page.component';
|
||||||
|
import { QualityAssuranceTopicsPageResolver } from '../../quality-assurance-notifications-pages/quality-assurance-topics-page/quality-assurance-topics-page-resolver.service';
|
||||||
|
import { AdminNotificationsPublicationClaimPageComponent } from './admin-notifications-publication-claim-page/admin-notifications-publication-claim-page.component';
|
||||||
|
import {
|
||||||
|
PUBLICATION_CLAIMS_PATH,
|
||||||
|
QUALITY_ASSURANCE_EDIT_PATH,
|
||||||
|
} from './admin-notifications-routing-paths';
|
||||||
|
|
||||||
const providers = [
|
const providers = [
|
||||||
I18nBreadcrumbResolver,
|
I18nBreadcrumbResolver,
|
||||||
@@ -56,14 +44,14 @@ export const ROUTES: Route[] = [
|
|||||||
pathMatch: 'full',
|
pathMatch: 'full',
|
||||||
resolve: {
|
resolve: {
|
||||||
breadcrumb: I18nBreadcrumbResolver,
|
breadcrumb: I18nBreadcrumbResolver,
|
||||||
suggestionTargetParams: AdminNotificationsPublicationClaimPageResolver
|
suggestionTargetParams: AdminNotificationsPublicationClaimPageResolver,
|
||||||
},
|
},
|
||||||
providers,
|
providers,
|
||||||
data: {
|
data: {
|
||||||
title: 'admin.notifications.publicationclaim.page.title',
|
title: 'admin.notifications.publicationclaim.page.title',
|
||||||
breadcrumbKey: 'admin.notifications.publicationclaim',
|
breadcrumbKey: 'admin.notifications.publicationclaim',
|
||||||
showBreadcrumbsFluid: false
|
showBreadcrumbsFluid: false,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
canActivate: [AuthenticatedGuard],
|
canActivate: [AuthenticatedGuard],
|
||||||
@@ -72,14 +60,14 @@ export const ROUTES: Route[] = [
|
|||||||
pathMatch: 'full',
|
pathMatch: 'full',
|
||||||
resolve: {
|
resolve: {
|
||||||
breadcrumb: QualityAssuranceBreadcrumbResolver,
|
breadcrumb: QualityAssuranceBreadcrumbResolver,
|
||||||
openaireQualityAssuranceTopicsParams: QualityAssuranceTopicsPageResolver
|
openaireQualityAssuranceTopicsParams: QualityAssuranceTopicsPageResolver,
|
||||||
},
|
},
|
||||||
providers,
|
providers,
|
||||||
data: {
|
data: {
|
||||||
title: 'admin.quality-assurance.page.title',
|
title: 'admin.quality-assurance.page.title',
|
||||||
breadcrumbKey: 'admin.quality-assurance',
|
breadcrumbKey: 'admin.quality-assurance',
|
||||||
showBreadcrumbsFluid: false
|
showBreadcrumbsFluid: false,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
canActivate: [ AuthenticatedGuard ],
|
canActivate: [ AuthenticatedGuard ],
|
||||||
@@ -88,14 +76,14 @@ export const ROUTES: Route[] = [
|
|||||||
pathMatch: 'full',
|
pathMatch: 'full',
|
||||||
resolve: {
|
resolve: {
|
||||||
breadcrumb: I18nBreadcrumbResolver,
|
breadcrumb: I18nBreadcrumbResolver,
|
||||||
openaireQualityAssuranceTopicsParams: QualityAssuranceTopicsPageResolver
|
openaireQualityAssuranceTopicsParams: QualityAssuranceTopicsPageResolver,
|
||||||
},
|
},
|
||||||
providers,
|
providers,
|
||||||
data: {
|
data: {
|
||||||
title: 'admin.quality-assurance.page.title',
|
title: 'admin.quality-assurance.page.title',
|
||||||
breadcrumbKey: 'admin.quality-assurance',
|
breadcrumbKey: 'admin.quality-assurance',
|
||||||
showBreadcrumbsFluid: false
|
showBreadcrumbsFluid: false,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
canActivate: [AuthenticatedGuard],
|
canActivate: [AuthenticatedGuard],
|
||||||
@@ -105,14 +93,14 @@ export const ROUTES: Route[] = [
|
|||||||
resolve: {
|
resolve: {
|
||||||
breadcrumb: I18nBreadcrumbResolver,
|
breadcrumb: I18nBreadcrumbResolver,
|
||||||
openaireQualityAssuranceSourceParams: QualityAssuranceSourcePageResolver,
|
openaireQualityAssuranceSourceParams: QualityAssuranceSourcePageResolver,
|
||||||
sourceData: SourceDataResolver
|
sourceData: SourceDataResolver,
|
||||||
},
|
},
|
||||||
providers,
|
providers,
|
||||||
data: {
|
data: {
|
||||||
title: 'admin.notifications.source.breadcrumbs',
|
title: 'admin.notifications.source.breadcrumbs',
|
||||||
breadcrumbKey: 'admin.notifications.source',
|
breadcrumbKey: 'admin.notifications.source',
|
||||||
showBreadcrumbsFluid: false
|
showBreadcrumbsFluid: false,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
canActivate: [AuthenticatedGuard],
|
canActivate: [AuthenticatedGuard],
|
||||||
@@ -121,15 +109,15 @@ export const ROUTES: Route[] = [
|
|||||||
pathMatch: 'full',
|
pathMatch: 'full',
|
||||||
resolve: {
|
resolve: {
|
||||||
breadcrumb: QualityAssuranceBreadcrumbResolver,
|
breadcrumb: QualityAssuranceBreadcrumbResolver,
|
||||||
openaireQualityAssuranceEventsParams: QualityAssuranceEventsPageResolver
|
openaireQualityAssuranceEventsParams: QualityAssuranceEventsPageResolver,
|
||||||
},
|
},
|
||||||
providers,
|
providers,
|
||||||
data: {
|
data: {
|
||||||
title: 'admin.notifications.event.page.title',
|
title: 'admin.notifications.event.page.title',
|
||||||
breadcrumbKey: 'admin.notifications.event',
|
breadcrumbKey: 'admin.notifications.event',
|
||||||
showBreadcrumbsFluid: false
|
showBreadcrumbsFluid: false,
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
])
|
]),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@@ -1,32 +1,33 @@
|
|||||||
import { MetadataRegistryComponent } from './metadata-registry/metadata-registry.component';
|
|
||||||
import { Route } from '@angular/router';
|
import { Route } from '@angular/router';
|
||||||
import { MetadataSchemaComponent } from './metadata-schema/metadata-schema.component';
|
|
||||||
import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver';
|
import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver';
|
||||||
import { BITSTREAMFORMATS_MODULE_PATH } from './admin-registries-routing-paths';
|
import { BITSTREAMFORMATS_MODULE_PATH } from './admin-registries-routing-paths';
|
||||||
|
import { MetadataRegistryComponent } from './metadata-registry/metadata-registry.component';
|
||||||
|
import { MetadataSchemaComponent } from './metadata-schema/metadata-schema.component';
|
||||||
|
|
||||||
export const ROUTES: Route[] = [
|
export const ROUTES: Route[] = [
|
||||||
{
|
{
|
||||||
path: 'metadata',
|
path: 'metadata',
|
||||||
resolve: {breadcrumb: I18nBreadcrumbResolver},
|
resolve: { breadcrumb: I18nBreadcrumbResolver },
|
||||||
data: {title: 'admin.registries.metadata.title', breadcrumbKey: 'admin.registries.metadata'},
|
data: { title: 'admin.registries.metadata.title', breadcrumbKey: 'admin.registries.metadata' },
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
component: MetadataRegistryComponent
|
component: MetadataRegistryComponent,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: ':schemaName',
|
path: ':schemaName',
|
||||||
resolve: {breadcrumb: I18nBreadcrumbResolver},
|
resolve: { breadcrumb: I18nBreadcrumbResolver },
|
||||||
component: MetadataSchemaComponent,
|
component: MetadataSchemaComponent,
|
||||||
data: {title: 'admin.registries.schema.title', breadcrumbKey: 'admin.registries.schema'}
|
data: { title: 'admin.registries.schema.title', breadcrumbKey: 'admin.registries.schema' },
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: BITSTREAMFORMATS_MODULE_PATH,
|
path: BITSTREAMFORMATS_MODULE_PATH,
|
||||||
resolve: {breadcrumb: I18nBreadcrumbResolver},
|
resolve: { breadcrumb: I18nBreadcrumbResolver },
|
||||||
loadChildren: () => import('./bitstream-formats/bitstream-formats-routes')
|
loadChildren: () => import('./bitstream-formats/bitstream-formats-routes')
|
||||||
.then((m) => m.ROUTES),
|
.then((m) => m.ROUTES),
|
||||||
data: {title: 'admin.registries.bitstream-formats.title', breadcrumbKey: 'admin.registries.bitstream-formats'}
|
data: { title: 'admin.registries.bitstream-formats.title', breadcrumbKey: 'admin.registries.bitstream-formats' },
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
@@ -14,20 +14,21 @@ import { of as observableOf } from 'rxjs';
|
|||||||
import { BitstreamFormatDataService } from '../../../../core/data/bitstream-format-data.service';
|
import { BitstreamFormatDataService } from '../../../../core/data/bitstream-format-data.service';
|
||||||
import { BitstreamFormat } from '../../../../core/shared/bitstream-format.model';
|
import { BitstreamFormat } from '../../../../core/shared/bitstream-format.model';
|
||||||
import { BitstreamFormatSupportLevel } from '../../../../core/shared/bitstream-format-support-level';
|
import { BitstreamFormatSupportLevel } from '../../../../core/shared/bitstream-format-support-level';
|
||||||
|
import { FormBuilderService } from '../../../../shared/form/builder/form-builder.service';
|
||||||
|
import { FormService } from '../../../../shared/form/form.service';
|
||||||
|
import { getMockFormBuilderService } from '../../../../shared/mocks/form-builder-service.mock';
|
||||||
|
import { getMockFormService } from '../../../../shared/mocks/form-service.mock';
|
||||||
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
||||||
import {
|
import {
|
||||||
createFailedRemoteDataObject$,
|
createFailedRemoteDataObject$,
|
||||||
|
createFailedRemoteDataObject$,
|
||||||
|
createSuccessfulRemoteDataObject$,
|
||||||
createSuccessfulRemoteDataObject$,
|
createSuccessfulRemoteDataObject$,
|
||||||
} from '../../../../shared/remote-data.utils';
|
} from '../../../../shared/remote-data.utils';
|
||||||
import { NotificationsServiceStub } from '../../../../shared/testing/notifications-service.stub';
|
import { NotificationsServiceStub } from '../../../../shared/testing/notifications-service.stub';
|
||||||
import { RouterStub } from '../../../../shared/testing/router.stub';
|
import { RouterStub } from '../../../../shared/testing/router.stub';
|
||||||
import { AddBitstreamFormatComponent } from './add-bitstream-format.component';
|
|
||||||
import { createFailedRemoteDataObject$, createSuccessfulRemoteDataObject$ } from '../../../../shared/remote-data.utils';
|
|
||||||
import { FormService } from '../../../../shared/form/form.service';
|
|
||||||
import { getMockFormService } from '../../../../shared/mocks/form-service.mock';
|
|
||||||
import { FormBuilderService } from '../../../../shared/form/builder/form-builder.service';
|
|
||||||
import { FormatFormComponent } from '../format-form/format-form.component';
|
import { FormatFormComponent } from '../format-form/format-form.component';
|
||||||
import { getMockFormBuilderService } from '../../../../shared/mocks/form-builder-service.mock';
|
import { AddBitstreamFormatComponent } from './add-bitstream-format.component';
|
||||||
|
|
||||||
describe('AddBitstreamFormatComponent', () => {
|
describe('AddBitstreamFormatComponent', () => {
|
||||||
let comp: AddBitstreamFormatComponent;
|
let comp: AddBitstreamFormatComponent;
|
||||||
@@ -66,12 +67,12 @@ describe('AddBitstreamFormatComponent', () => {
|
|||||||
],
|
],
|
||||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||||
})
|
})
|
||||||
.overrideComponent(AddBitstreamFormatComponent, {
|
.overrideComponent(AddBitstreamFormatComponent, {
|
||||||
remove: {
|
remove: {
|
||||||
imports: [FormatFormComponent]
|
imports: [FormatFormComponent],
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
};
|
};
|
||||||
|
|
||||||
const initBeforeEach = () => {
|
const initBeforeEach = () => {
|
||||||
@@ -113,12 +114,12 @@ describe('AddBitstreamFormatComponent', () => {
|
|||||||
],
|
],
|
||||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||||
})
|
})
|
||||||
.overrideComponent(AddBitstreamFormatComponent, {
|
.overrideComponent(AddBitstreamFormatComponent, {
|
||||||
remove: {
|
remove: {
|
||||||
imports: [FormatFormComponent]
|
imports: [FormatFormComponent],
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
}));
|
}));
|
||||||
beforeEach(initBeforeEach);
|
beforeEach(initBeforeEach);
|
||||||
it('should send the updated form to the service, show a notification and navigate to ', () => {
|
it('should send the updated form to the service, show a notification and navigate to ', () => {
|
||||||
|
@@ -1,19 +1,30 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { BitstreamFormat } from '../../../../core/shared/bitstream-format.model';
|
|
||||||
import { BitstreamFormatDataService } from '../../../../core/data/bitstream-format-data.service';
|
|
||||||
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
|
||||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
|
||||||
import { getBitstreamFormatsModuleRoute } from '../../admin-registries-routing-paths';
|
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import {
|
||||||
|
TranslateModule,
|
||||||
|
TranslateService,
|
||||||
|
TranslateService,
|
||||||
|
} from '@ngx-translate/core';
|
||||||
|
|
||||||
import { BitstreamFormatDataService } from '../../../../core/data/bitstream-format-data.service';
|
import {
|
||||||
|
BitstreamFormatDataService,
|
||||||
|
BitstreamFormatDataService,
|
||||||
|
} from '../../../../core/data/bitstream-format-data.service';
|
||||||
import { RemoteData } from '../../../../core/data/remote-data';
|
import { RemoteData } from '../../../../core/data/remote-data';
|
||||||
import { BitstreamFormat } from '../../../../core/shared/bitstream-format.model';
|
import {
|
||||||
|
BitstreamFormat,
|
||||||
|
BitstreamFormat,
|
||||||
|
} from '../../../../core/shared/bitstream-format.model';
|
||||||
import { getFirstCompletedRemoteData } from '../../../../core/shared/operators';
|
import { getFirstCompletedRemoteData } from '../../../../core/shared/operators';
|
||||||
|
import {
|
||||||
|
NotificationsService,
|
||||||
|
NotificationsService,
|
||||||
|
} from '../../../../shared/notifications/notifications.service';
|
||||||
|
import {
|
||||||
|
getBitstreamFormatsModuleRoute,
|
||||||
|
getBitstreamFormatsModuleRoute,
|
||||||
|
} from '../../admin-registries-routing-paths';
|
||||||
import { FormatFormComponent } from '../format-form/format-form.component';
|
import { FormatFormComponent } from '../format-form/format-form.component';
|
||||||
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
|
||||||
import { getBitstreamFormatsModuleRoute } from '../../admin-registries-routing-paths';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This component renders the page to create a new bitstream format.
|
* This component renders the page to create a new bitstream format.
|
||||||
@@ -23,9 +34,9 @@ import { getBitstreamFormatsModuleRoute } from '../../admin-registries-routing-p
|
|||||||
templateUrl: './add-bitstream-format.component.html',
|
templateUrl: './add-bitstream-format.component.html',
|
||||||
imports: [
|
imports: [
|
||||||
FormatFormComponent,
|
FormatFormComponent,
|
||||||
TranslateModule
|
TranslateModule,
|
||||||
],
|
],
|
||||||
standalone: true
|
standalone: true,
|
||||||
})
|
})
|
||||||
export class AddBitstreamFormatComponent {
|
export class AddBitstreamFormatComponent {
|
||||||
|
|
||||||
|
@@ -1,9 +1,10 @@
|
|||||||
import { Route } from '@angular/router';
|
import { Route } from '@angular/router';
|
||||||
|
|
||||||
|
import { I18nBreadcrumbResolver } from '../../../core/breadcrumbs/i18n-breadcrumb.resolver';
|
||||||
|
import { AddBitstreamFormatComponent } from './add-bitstream-format/add-bitstream-format.component';
|
||||||
|
import { BitstreamFormatsComponent } from './bitstream-formats.component';
|
||||||
import { BitstreamFormatsResolver } from './bitstream-formats.resolver';
|
import { BitstreamFormatsResolver } from './bitstream-formats.resolver';
|
||||||
import { EditBitstreamFormatComponent } from './edit-bitstream-format/edit-bitstream-format.component';
|
import { EditBitstreamFormatComponent } from './edit-bitstream-format/edit-bitstream-format.component';
|
||||||
import { BitstreamFormatsComponent } from './bitstream-formats.component';
|
|
||||||
import { AddBitstreamFormatComponent } from './add-bitstream-format/add-bitstream-format.component';
|
|
||||||
import { I18nBreadcrumbResolver } from '../../../core/breadcrumbs/i18n-breadcrumb.resolver';
|
|
||||||
|
|
||||||
const BITSTREAMFORMAT_EDIT_PATH = ':id/edit';
|
const BITSTREAMFORMAT_EDIT_PATH = ':id/edit';
|
||||||
const BITSTREAMFORMAT_ADD_PATH = 'add';
|
const BITSTREAMFORMAT_ADD_PATH = 'add';
|
||||||
@@ -14,14 +15,14 @@ export const ROUTES: Route[] = [
|
|||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
providers,
|
providers,
|
||||||
component: BitstreamFormatsComponent
|
component: BitstreamFormatsComponent,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: BITSTREAMFORMAT_ADD_PATH,
|
path: BITSTREAMFORMAT_ADD_PATH,
|
||||||
resolve: {breadcrumb: I18nBreadcrumbResolver},
|
resolve: { breadcrumb: I18nBreadcrumbResolver },
|
||||||
providers,
|
providers,
|
||||||
component: AddBitstreamFormatComponent,
|
component: AddBitstreamFormatComponent,
|
||||||
data: {breadcrumbKey: 'admin.registries.bitstream-formats.create'}
|
data: { breadcrumbKey: 'admin.registries.bitstream-formats.create' },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: BITSTREAMFORMAT_EDIT_PATH,
|
path: BITSTREAMFORMAT_EDIT_PATH,
|
||||||
@@ -29,8 +30,8 @@ export const ROUTES: Route[] = [
|
|||||||
component: EditBitstreamFormatComponent,
|
component: EditBitstreamFormatComponent,
|
||||||
resolve: {
|
resolve: {
|
||||||
bitstreamFormat: BitstreamFormatsResolver,
|
bitstreamFormat: BitstreamFormatsResolver,
|
||||||
breadcrumb: I18nBreadcrumbResolver
|
breadcrumb: I18nBreadcrumbResolver,
|
||||||
},
|
},
|
||||||
data: {breadcrumbKey: 'admin.registries.bitstream-formats.edit'}
|
data: { breadcrumbKey: 'admin.registries.bitstream-formats.edit' },
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
@@ -1,25 +1,37 @@
|
|||||||
import { BitstreamFormatsComponent } from './bitstream-formats.component';
|
|
||||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
|
||||||
import { of, of as observableOf } from 'rxjs';
|
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import {
|
import {
|
||||||
|
Component,
|
||||||
|
NO_ERRORS_SCHEMA,
|
||||||
|
} from '@angular/core';
|
||||||
|
import {
|
||||||
|
ComponentFixture,
|
||||||
ComponentFixture,
|
ComponentFixture,
|
||||||
TestBed,
|
TestBed,
|
||||||
|
TestBed,
|
||||||
|
waitForAsync,
|
||||||
waitForAsync,
|
waitForAsync,
|
||||||
} from '@angular/core/testing';
|
} from '@angular/core/testing';
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { RouterTestingModule } from '@angular/router/testing';
|
import { RouterTestingModule } from '@angular/router/testing';
|
||||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||||
|
import { provideMockStore } from '@ngrx/store/testing';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import {
|
import {
|
||||||
cold,
|
cold,
|
||||||
getTestScheduler,
|
getTestScheduler,
|
||||||
hot,
|
hot,
|
||||||
} from 'jasmine-marbles';
|
} from 'jasmine-marbles';
|
||||||
import { of as observableOf } from 'rxjs';
|
import {
|
||||||
|
of as observableOf,
|
||||||
|
of as observableOf,
|
||||||
|
of,
|
||||||
|
} from 'rxjs';
|
||||||
import { TestScheduler } from 'rxjs/testing';
|
import { TestScheduler } from 'rxjs/testing';
|
||||||
|
|
||||||
|
import { APP_DATA_SERVICES_MAP } from '../../../../config/app-config.interface';
|
||||||
import { BitstreamFormatDataService } from '../../../core/data/bitstream-format-data.service';
|
import { BitstreamFormatDataService } from '../../../core/data/bitstream-format-data.service';
|
||||||
|
import { ConfigurationDataService } from '../../../core/data/configuration-data.service';
|
||||||
|
import { GroupDataService } from '../../../core/eperson/group-data.service';
|
||||||
import { PaginationService } from '../../../core/pagination/pagination.service';
|
import { PaginationService } from '../../../core/pagination/pagination.service';
|
||||||
import { BitstreamFormat } from '../../../core/shared/bitstream-format.model';
|
import { BitstreamFormat } from '../../../core/shared/bitstream-format.model';
|
||||||
import { BitstreamFormatSupportLevel } from '../../../core/shared/bitstream-format-support-level';
|
import { BitstreamFormatSupportLevel } from '../../../core/shared/bitstream-format-support-level';
|
||||||
@@ -37,12 +49,10 @@ import { NotificationsServiceStub } from '../../../shared/testing/notifications-
|
|||||||
import { PaginationServiceStub } from '../../../shared/testing/pagination-service.stub';
|
import { PaginationServiceStub } from '../../../shared/testing/pagination-service.stub';
|
||||||
import { createPaginatedList } from '../../../shared/testing/utils.test';
|
import { createPaginatedList } from '../../../shared/testing/utils.test';
|
||||||
import { EnumKeysPipe } from '../../../shared/utils/enum-keys-pipe';
|
import { EnumKeysPipe } from '../../../shared/utils/enum-keys-pipe';
|
||||||
import { BitstreamFormatsComponent } from './bitstream-formats.component';
|
import {
|
||||||
import { GroupDataService } from '../../../core/eperson/group-data.service';
|
BitstreamFormatsComponent,
|
||||||
import { ConfigurationDataService } from '../../../core/data/configuration-data.service';
|
BitstreamFormatsComponent,
|
||||||
import { Component, NO_ERRORS_SCHEMA } from '@angular/core';
|
} from './bitstream-formats.component';
|
||||||
import { provideMockStore } from '@ngrx/store/testing';
|
|
||||||
import { APP_DATA_SERVICES_MAP } from '../../../../config/app-config.interface';
|
|
||||||
|
|
||||||
describe('BitstreamFormatsComponent', () => {
|
describe('BitstreamFormatsComponent', () => {
|
||||||
let comp: BitstreamFormatsComponent;
|
let comp: BitstreamFormatsComponent;
|
||||||
@@ -108,7 +118,7 @@ describe('BitstreamFormatsComponent', () => {
|
|||||||
bitstreamFormatService = jasmine.createSpyObj('bitstreamFormatService', {
|
bitstreamFormatService = jasmine.createSpyObj('bitstreamFormatService', {
|
||||||
findAll: observableOf(mockFormatsRD),
|
findAll: observableOf(mockFormatsRD),
|
||||||
find: createSuccessfulRemoteDataObject$(mockFormatsList[0]),
|
find: createSuccessfulRemoteDataObject$(mockFormatsList[0]),
|
||||||
getSelectedBitstreamFormats: hot('a', {a: mockFormatsList}),
|
getSelectedBitstreamFormats: hot('a', { a: mockFormatsList }),
|
||||||
selectBitstreamFormat: {},
|
selectBitstreamFormat: {},
|
||||||
deselectBitstreamFormat: {},
|
deselectBitstreamFormat: {},
|
||||||
deselectAllBitstreamFormats: {},
|
deselectAllBitstreamFormats: {},
|
||||||
@@ -124,7 +134,7 @@ describe('BitstreamFormatsComponent', () => {
|
|||||||
|
|
||||||
|
|
||||||
const configurationDataService = jasmine.createSpyObj('ConfigurationDataService', {
|
const configurationDataService = jasmine.createSpyObj('ConfigurationDataService', {
|
||||||
findByPropertyName: of({payload: {value: 'test'}}),
|
findByPropertyName: of({ payload: { value: 'test' } }),
|
||||||
});
|
});
|
||||||
|
|
||||||
paginationService = new PaginationServiceStub();
|
paginationService = new PaginationServiceStub();
|
||||||
@@ -134,12 +144,12 @@ describe('BitstreamFormatsComponent', () => {
|
|||||||
providers: [
|
providers: [
|
||||||
provideMockStore(),
|
provideMockStore(),
|
||||||
{ provide: APP_DATA_SERVICES_MAP, useValue: {} },
|
{ provide: APP_DATA_SERVICES_MAP, useValue: {} },
|
||||||
{provide: BitstreamFormatDataService, useValue: bitstreamFormatService},
|
{ provide: BitstreamFormatDataService, useValue: bitstreamFormatService },
|
||||||
{provide: HostWindowService, useValue: new HostWindowServiceStub(0)},
|
{ provide: HostWindowService, useValue: new HostWindowServiceStub(0) },
|
||||||
{provide: NotificationsService, useValue: notificationsServiceStub},
|
{ provide: NotificationsService, useValue: notificationsServiceStub },
|
||||||
{provide: PaginationService, useValue: paginationService},
|
{ provide: PaginationService, useValue: paginationService },
|
||||||
{provide: GroupDataService, useValue: groupDataService},
|
{ provide: GroupDataService, useValue: groupDataService },
|
||||||
{provide: ConfigurationDataService, useValue: configurationDataService}
|
{ provide: ConfigurationDataService, useValue: configurationDataService },
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA],
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
@@ -266,7 +276,7 @@ describe('BitstreamFormatsComponent', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const configurationDataService = jasmine.createSpyObj('ConfigurationDataService', {
|
const configurationDataService = jasmine.createSpyObj('ConfigurationDataService', {
|
||||||
findByPropertyName: of({payload: {value: 'test'}}),
|
findByPropertyName: of({ payload: { value: 'test' } }),
|
||||||
});
|
});
|
||||||
|
|
||||||
paginationService = new PaginationServiceStub();
|
paginationService = new PaginationServiceStub();
|
||||||
@@ -278,21 +288,21 @@ describe('BitstreamFormatsComponent', () => {
|
|||||||
BitstreamFormatsComponent, PaginationComponent, EnumKeysPipe],
|
BitstreamFormatsComponent, PaginationComponent, EnumKeysPipe],
|
||||||
providers: [
|
providers: [
|
||||||
provideMockStore(),
|
provideMockStore(),
|
||||||
{provide: BitstreamFormatDataService, useValue: bitstreamFormatService},
|
{ provide: BitstreamFormatDataService, useValue: bitstreamFormatService },
|
||||||
{provide: HostWindowService, useValue: new HostWindowServiceStub(0)},
|
{ provide: HostWindowService, useValue: new HostWindowServiceStub(0) },
|
||||||
{provide: NotificationsService, useValue: notificationsServiceStub},
|
{ provide: NotificationsService, useValue: notificationsServiceStub },
|
||||||
{provide: PaginationService, useValue: paginationService},
|
{ provide: PaginationService, useValue: paginationService },
|
||||||
{provide: GroupDataService, useValue: groupDataService},
|
{ provide: GroupDataService, useValue: groupDataService },
|
||||||
{provide: ConfigurationDataService, useValue: configurationDataService}
|
{ provide: ConfigurationDataService, useValue: configurationDataService },
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
})
|
})
|
||||||
.overrideComponent(BitstreamFormatsComponent, {
|
.overrideComponent(BitstreamFormatsComponent, {
|
||||||
remove: {imports: [PaginationComponent]},
|
remove: { imports: [PaginationComponent] },
|
||||||
add: {imports: [TestPaginationComponent]}
|
add: { imports: [TestPaginationComponent] },
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
}
|
},
|
||||||
));
|
));
|
||||||
|
|
||||||
beforeEach(initBeforeEach);
|
beforeEach(initBeforeEach);
|
||||||
@@ -336,7 +346,7 @@ describe('BitstreamFormatsComponent', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const configurationDataService = jasmine.createSpyObj('ConfigurationDataService', {
|
const configurationDataService = jasmine.createSpyObj('ConfigurationDataService', {
|
||||||
findByPropertyName: of({payload: {value: 'test'}}),
|
findByPropertyName: of({ payload: { value: 'test' } }),
|
||||||
});
|
});
|
||||||
|
|
||||||
paginationService = new PaginationServiceStub();
|
paginationService = new PaginationServiceStub();
|
||||||
@@ -345,22 +355,22 @@ describe('BitstreamFormatsComponent', () => {
|
|||||||
imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, BitstreamFormatsComponent, PaginationComponent, EnumKeysPipe],
|
imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, BitstreamFormatsComponent, PaginationComponent, EnumKeysPipe],
|
||||||
providers: [
|
providers: [
|
||||||
provideMockStore(),
|
provideMockStore(),
|
||||||
{provide: BitstreamFormatDataService, useValue: bitstreamFormatService},
|
{ provide: BitstreamFormatDataService, useValue: bitstreamFormatService },
|
||||||
{provide: HostWindowService, useValue: new HostWindowServiceStub(0)},
|
{ provide: HostWindowService, useValue: new HostWindowServiceStub(0) },
|
||||||
{provide: NotificationsService, useValue: notificationsServiceStub},
|
{ provide: NotificationsService, useValue: notificationsServiceStub },
|
||||||
{provide: PaginationService, useValue: paginationService},
|
{ provide: PaginationService, useValue: paginationService },
|
||||||
{provide: PaginationService, useValue: paginationService},
|
{ provide: PaginationService, useValue: paginationService },
|
||||||
{provide: GroupDataService, useValue: groupDataService},
|
{ provide: GroupDataService, useValue: groupDataService },
|
||||||
{provide: ConfigurationDataService, useValue: configurationDataService}
|
{ provide: ConfigurationDataService, useValue: configurationDataService },
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
})
|
})
|
||||||
.overrideComponent(BitstreamFormatsComponent, {
|
.overrideComponent(BitstreamFormatsComponent, {
|
||||||
remove: {imports: [PaginationComponent]},
|
remove: { imports: [PaginationComponent] },
|
||||||
add: {imports: [TestPaginationComponent]}
|
add: { imports: [TestPaginationComponent] },
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
}
|
},
|
||||||
));
|
));
|
||||||
|
|
||||||
beforeEach(initBeforeEach);
|
beforeEach(initBeforeEach);
|
||||||
|
@@ -1,47 +1,80 @@
|
|||||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
import {
|
||||||
import { combineLatest as observableCombineLatest, Observable} from 'rxjs';
|
AsyncPipe,
|
||||||
import { RemoteData } from '../../../core/data/remote-data';
|
NgForOf,
|
||||||
import { PaginatedList } from '../../../core/data/paginated-list.model';
|
NgIf,
|
||||||
import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model';
|
} from '@angular/common';
|
||||||
import { BitstreamFormat } from '../../../core/shared/bitstream-format.model';
|
|
||||||
import { BitstreamFormatDataService } from '../../../core/data/bitstream-format-data.service';
|
|
||||||
import { map, mergeMap, switchMap, take, toArray } from 'rxjs/operators';
|
|
||||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
|
||||||
import { Router, RouterLink } from '@angular/router';
|
|
||||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
|
||||||
import { NoContent } from '../../../core/shared/NoContent.model';
|
|
||||||
import { PaginationService } from '../../../core/pagination/pagination.service';
|
|
||||||
import {
|
import {
|
||||||
Component,
|
Component,
|
||||||
|
Component,
|
||||||
|
OnDestroy,
|
||||||
OnDestroy,
|
OnDestroy,
|
||||||
OnInit,
|
OnInit,
|
||||||
|
OnInit,
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import { Router } from '@angular/router';
|
import {
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
Router,
|
||||||
|
Router,
|
||||||
|
RouterLink,
|
||||||
|
} from '@angular/router';
|
||||||
|
import {
|
||||||
|
TranslateModule,
|
||||||
|
TranslateService,
|
||||||
|
TranslateService,
|
||||||
|
} from '@ngx-translate/core';
|
||||||
import {
|
import {
|
||||||
combineLatest as observableCombineLatest,
|
combineLatest as observableCombineLatest,
|
||||||
|
combineLatest as observableCombineLatest,
|
||||||
|
Observable,
|
||||||
Observable,
|
Observable,
|
||||||
} from 'rxjs';
|
} from 'rxjs';
|
||||||
import {
|
import {
|
||||||
map,
|
map,
|
||||||
|
map,
|
||||||
|
mergeMap,
|
||||||
mergeMap,
|
mergeMap,
|
||||||
switchMap,
|
switchMap,
|
||||||
|
switchMap,
|
||||||
take,
|
take,
|
||||||
|
take,
|
||||||
|
toArray,
|
||||||
toArray,
|
toArray,
|
||||||
} from 'rxjs/operators';
|
} from 'rxjs/operators';
|
||||||
|
|
||||||
import { BitstreamFormatDataService } from '../../../core/data/bitstream-format-data.service';
|
import {
|
||||||
|
BitstreamFormatDataService,
|
||||||
|
BitstreamFormatDataService,
|
||||||
|
} from '../../../core/data/bitstream-format-data.service';
|
||||||
import { FindListOptions } from '../../../core/data/find-list-options.model';
|
import { FindListOptions } from '../../../core/data/find-list-options.model';
|
||||||
import { PaginatedList } from '../../../core/data/paginated-list.model';
|
import {
|
||||||
import { RemoteData } from '../../../core/data/remote-data';
|
PaginatedList,
|
||||||
import { PaginationService } from '../../../core/pagination/pagination.service';
|
PaginatedList,
|
||||||
import { BitstreamFormat } from '../../../core/shared/bitstream-format.model';
|
} from '../../../core/data/paginated-list.model';
|
||||||
import { NoContent } from '../../../core/shared/NoContent.model';
|
import {
|
||||||
|
RemoteData,
|
||||||
|
RemoteData,
|
||||||
|
} from '../../../core/data/remote-data';
|
||||||
|
import {
|
||||||
|
PaginationService,
|
||||||
|
PaginationService,
|
||||||
|
} from '../../../core/pagination/pagination.service';
|
||||||
|
import {
|
||||||
|
BitstreamFormat,
|
||||||
|
BitstreamFormat,
|
||||||
|
} from '../../../core/shared/bitstream-format.model';
|
||||||
|
import {
|
||||||
|
NoContent,
|
||||||
|
NoContent,
|
||||||
|
} from '../../../core/shared/NoContent.model';
|
||||||
import { getFirstCompletedRemoteData } from '../../../core/shared/operators';
|
import { getFirstCompletedRemoteData } from '../../../core/shared/operators';
|
||||||
import { AsyncPipe, NgForOf, NgIf } from '@angular/common';
|
import {
|
||||||
|
NotificationsService,
|
||||||
|
NotificationsService,
|
||||||
|
} from '../../../shared/notifications/notifications.service';
|
||||||
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
||||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
import {
|
||||||
import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model';
|
PaginationComponentOptions,
|
||||||
|
PaginationComponentOptions,
|
||||||
|
} from '../../../shared/pagination/pagination-component-options.model';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This component renders a list of bitstream formats
|
* This component renders a list of bitstream formats
|
||||||
@@ -55,9 +88,9 @@ import { PaginationComponentOptions } from '../../../shared/pagination/paginatio
|
|||||||
RouterLink,
|
RouterLink,
|
||||||
TranslateModule,
|
TranslateModule,
|
||||||
PaginationComponent,
|
PaginationComponent,
|
||||||
NgForOf
|
NgForOf,
|
||||||
],
|
],
|
||||||
standalone: true
|
standalone: true,
|
||||||
})
|
})
|
||||||
export class BitstreamFormatsComponent implements OnInit, OnDestroy {
|
export class BitstreamFormatsComponent implements OnInit, OnDestroy {
|
||||||
|
|
||||||
|
@@ -24,9 +24,9 @@ import {
|
|||||||
createSuccessfulRemoteDataObject,
|
createSuccessfulRemoteDataObject,
|
||||||
createSuccessfulRemoteDataObject$,
|
createSuccessfulRemoteDataObject$,
|
||||||
} from '../../../../shared/remote-data.utils';
|
} from '../../../../shared/remote-data.utils';
|
||||||
import { FormatFormComponent } from '../format-form/format-form.component';
|
|
||||||
import { NotificationsServiceStub } from '../../../../shared/testing/notifications-service.stub';
|
import { NotificationsServiceStub } from '../../../../shared/testing/notifications-service.stub';
|
||||||
import { RouterStub } from '../../../../shared/testing/router.stub';
|
import { RouterStub } from '../../../../shared/testing/router.stub';
|
||||||
|
import { FormatFormComponent } from '../format-form/format-form.component';
|
||||||
import { EditBitstreamFormatComponent } from './edit-bitstream-format.component';
|
import { EditBitstreamFormatComponent } from './edit-bitstream-format.component';
|
||||||
|
|
||||||
describe('EditBitstreamFormatComponent', () => {
|
describe('EditBitstreamFormatComponent', () => {
|
||||||
@@ -73,8 +73,8 @@ describe('EditBitstreamFormatComponent', () => {
|
|||||||
})
|
})
|
||||||
.overrideComponent(EditBitstreamFormatComponent, {
|
.overrideComponent(EditBitstreamFormatComponent, {
|
||||||
remove: {
|
remove: {
|
||||||
imports: [FormatFormComponent]
|
imports: [FormatFormComponent],
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
};
|
};
|
||||||
@@ -129,8 +129,8 @@ describe('EditBitstreamFormatComponent', () => {
|
|||||||
})
|
})
|
||||||
.overrideComponent(EditBitstreamFormatComponent, {
|
.overrideComponent(EditBitstreamFormatComponent, {
|
||||||
remove: {
|
remove: {
|
||||||
imports: [FormatFormComponent]
|
imports: [FormatFormComponent],
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
}));
|
}));
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
import { AsyncPipe } from '@angular/common';
|
||||||
import {
|
import {
|
||||||
Component,
|
Component,
|
||||||
OnInit,
|
OnInit,
|
||||||
@@ -6,20 +7,24 @@ import {
|
|||||||
ActivatedRoute,
|
ActivatedRoute,
|
||||||
Router,
|
Router,
|
||||||
} from '@angular/router';
|
} from '@angular/router';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import {
|
||||||
|
TranslateModule,
|
||||||
|
TranslateService,
|
||||||
|
TranslateService,
|
||||||
|
} from '@ngx-translate/core';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { map } from 'rxjs/operators';
|
import { map } from 'rxjs/operators';
|
||||||
|
|
||||||
import { BitstreamFormatDataService } from '../../../../core/data/bitstream-format-data.service';
|
import { BitstreamFormatDataService } from '../../../../core/data/bitstream-format-data.service';
|
||||||
import { RemoteData } from '../../../../core/data/remote-data';
|
import { RemoteData } from '../../../../core/data/remote-data';
|
||||||
import { BitstreamFormat } from '../../../../core/shared/bitstream-format.model';
|
import { BitstreamFormat } from '../../../../core/shared/bitstream-format.model';
|
||||||
import { getFirstCompletedRemoteData } from '../../../../core/shared/operators';
|
import {
|
||||||
|
getFirstCompletedRemoteData,
|
||||||
|
getFirstCompletedRemoteData,
|
||||||
|
} from '../../../../core/shared/operators';
|
||||||
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
||||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
|
||||||
import { getBitstreamFormatsModuleRoute } from '../../admin-registries-routing-paths';
|
import { getBitstreamFormatsModuleRoute } from '../../admin-registries-routing-paths';
|
||||||
import { getFirstCompletedRemoteData } from '../../../../core/shared/operators';
|
|
||||||
import { FormatFormComponent } from '../format-form/format-form.component';
|
import { FormatFormComponent } from '../format-form/format-form.component';
|
||||||
import { AsyncPipe } from '@angular/common';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This component renders the edit page of a bitstream format.
|
* This component renders the edit page of a bitstream format.
|
||||||
@@ -31,9 +36,9 @@ import { AsyncPipe } from '@angular/common';
|
|||||||
imports: [
|
imports: [
|
||||||
FormatFormComponent,
|
FormatFormComponent,
|
||||||
TranslateModule,
|
TranslateModule,
|
||||||
AsyncPipe
|
AsyncPipe,
|
||||||
],
|
],
|
||||||
standalone: true
|
standalone: true,
|
||||||
})
|
})
|
||||||
export class EditBitstreamFormatComponent implements OnInit {
|
export class EditBitstreamFormatComponent implements OnInit {
|
||||||
|
|
||||||
|
@@ -1,4 +1,11 @@
|
|||||||
import { Component, EventEmitter, Input, OnInit, Output, } from '@angular/core';
|
import { NgIf } from '@angular/common';
|
||||||
|
import {
|
||||||
|
Component,
|
||||||
|
EventEmitter,
|
||||||
|
Input,
|
||||||
|
OnInit,
|
||||||
|
Output,
|
||||||
|
} from '@angular/core';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import {
|
import {
|
||||||
DynamicCheckboxModel,
|
DynamicCheckboxModel,
|
||||||
@@ -9,14 +16,16 @@ import {
|
|||||||
DynamicSelectModel,
|
DynamicSelectModel,
|
||||||
DynamicTextAreaModel,
|
DynamicTextAreaModel,
|
||||||
} from '@ng-dynamic-forms/core';
|
} from '@ng-dynamic-forms/core';
|
||||||
import { hasValue, isEmpty } from '../../../../shared/empty.util';
|
|
||||||
|
|
||||||
import { environment } from '../../../../../environments/environment';
|
import { environment } from '../../../../../environments/environment';
|
||||||
import { BitstreamFormat } from '../../../../core/shared/bitstream-format.model';
|
import { BitstreamFormat } from '../../../../core/shared/bitstream-format.model';
|
||||||
import { BitstreamFormatSupportLevel } from '../../../../core/shared/bitstream-format-support-level';
|
import { BitstreamFormatSupportLevel } from '../../../../core/shared/bitstream-format-support-level';
|
||||||
import { getBitstreamFormatsModuleRoute } from '../../admin-registries-routing-paths';
|
import {
|
||||||
|
hasValue,
|
||||||
|
isEmpty,
|
||||||
|
} from '../../../../shared/empty.util';
|
||||||
import { FormComponent } from '../../../../shared/form/form.component';
|
import { FormComponent } from '../../../../shared/form/form.component';
|
||||||
import { NgIf } from '@angular/common';
|
import { getBitstreamFormatsModuleRoute } from '../../admin-registries-routing-paths';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The component responsible for rendering the form to create/edit a bitstream format
|
* The component responsible for rendering the form to create/edit a bitstream format
|
||||||
@@ -26,9 +35,9 @@ import { NgIf } from '@angular/common';
|
|||||||
templateUrl: './format-form.component.html',
|
templateUrl: './format-form.component.html',
|
||||||
imports: [
|
imports: [
|
||||||
FormComponent,
|
FormComponent,
|
||||||
NgIf
|
NgIf,
|
||||||
],
|
],
|
||||||
standalone: true
|
standalone: true,
|
||||||
})
|
})
|
||||||
export class FormatFormComponent implements OnInit {
|
export class FormatFormComponent implements OnInit {
|
||||||
|
|
||||||
|
@@ -1,37 +1,45 @@
|
|||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core';
|
import {
|
||||||
import { ComponentFixture, inject, TestBed, waitForAsync, } from '@angular/core/testing';
|
ChangeDetectionStrategy,
|
||||||
|
NO_ERRORS_SCHEMA,
|
||||||
|
} from '@angular/core';
|
||||||
|
import {
|
||||||
|
ComponentFixture,
|
||||||
|
inject,
|
||||||
|
TestBed,
|
||||||
|
waitForAsync,
|
||||||
|
} from '@angular/core/testing';
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
|
import { RouterLink } from '@angular/router';
|
||||||
import { RouterTestingModule } from '@angular/router/testing';
|
import { RouterTestingModule } from '@angular/router/testing';
|
||||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { of as observableOf } from 'rxjs';
|
import { of as observableOf } from 'rxjs';
|
||||||
|
import { FormBuilderService } from 'src/app/shared/form/builder/form-builder.service';
|
||||||
|
|
||||||
import { RestResponse } from '../../../core/cache/response.models';
|
import { RestResponse } from '../../../core/cache/response.models';
|
||||||
|
import { ConfigurationDataService } from '../../../core/data/configuration-data.service';
|
||||||
import { buildPaginatedList } from '../../../core/data/paginated-list.model';
|
import { buildPaginatedList } from '../../../core/data/paginated-list.model';
|
||||||
|
import { GroupDataService } from '../../../core/eperson/group-data.service';
|
||||||
import { MetadataSchema } from '../../../core/metadata/metadata-schema.model';
|
import { MetadataSchema } from '../../../core/metadata/metadata-schema.model';
|
||||||
import { PaginationService } from '../../../core/pagination/pagination.service';
|
import { PaginationService } from '../../../core/pagination/pagination.service';
|
||||||
import { RegistryService } from '../../../core/registry/registry.service';
|
import { RegistryService } from '../../../core/registry/registry.service';
|
||||||
|
import { ConfigurationProperty } from '../../../core/shared/configuration-property.model';
|
||||||
|
import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service';
|
||||||
|
import { FormService } from '../../../shared/form/form.service';
|
||||||
import { HostWindowService } from '../../../shared/host-window.service';
|
import { HostWindowService } from '../../../shared/host-window.service';
|
||||||
|
import { getMockFormBuilderService } from '../../../shared/mocks/form-builder-service.mock';
|
||||||
|
import { getMockFormService } from '../../../shared/mocks/form-service.mock';
|
||||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||||
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
||||||
import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils';
|
import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils';
|
||||||
import { HostWindowServiceStub } from '../../../shared/testing/host-window-service.stub';
|
import { HostWindowServiceStub } from '../../../shared/testing/host-window-service.stub';
|
||||||
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub';
|
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub';
|
||||||
import { PaginationServiceStub } from '../../../shared/testing/pagination-service.stub';
|
import { PaginationServiceStub } from '../../../shared/testing/pagination-service.stub';
|
||||||
import { getMockFormService } from '../../../shared/mocks/form-service.mock';
|
|
||||||
import { FormService } from '../../../shared/form/form.service';
|
|
||||||
import { GroupDataService } from '../../../core/eperson/group-data.service';
|
|
||||||
import { ConfigurationDataService } from '../../../core/data/configuration-data.service';
|
|
||||||
import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service';
|
|
||||||
import { SearchConfigurationServiceStub } from '../../../shared/testing/search-configuration-service.stub';
|
import { SearchConfigurationServiceStub } from '../../../shared/testing/search-configuration-service.stub';
|
||||||
import { ConfigurationProperty } from '../../../core/shared/configuration-property.model';
|
|
||||||
import { FormBuilderService } from 'src/app/shared/form/builder/form-builder.service';
|
|
||||||
import { MetadataSchemaFormComponent } from './metadata-schema-form/metadata-schema-form.component';
|
|
||||||
import { RouterLink } from '@angular/router';
|
|
||||||
import { getMockFormBuilderService } from '../../../shared/mocks/form-builder-service.mock';
|
|
||||||
import { EnumKeysPipe } from '../../../shared/utils/enum-keys-pipe';
|
import { EnumKeysPipe } from '../../../shared/utils/enum-keys-pipe';
|
||||||
import { MetadataRegistryComponent } from './metadata-registry.component';
|
import { MetadataRegistryComponent } from './metadata-registry.component';
|
||||||
|
import { MetadataSchemaFormComponent } from './metadata-schema-form/metadata-schema-form.component';
|
||||||
|
|
||||||
describe('MetadataRegistryComponent', () => {
|
describe('MetadataRegistryComponent', () => {
|
||||||
let comp: MetadataRegistryComponent;
|
let comp: MetadataRegistryComponent;
|
||||||
@@ -83,25 +91,25 @@ describe('MetadataRegistryComponent', () => {
|
|||||||
findByPropertyName: createSuccessfulRemoteDataObject$(Object.assign(new ConfigurationProperty(), {
|
findByPropertyName: createSuccessfulRemoteDataObject$(Object.assign(new ConfigurationProperty(), {
|
||||||
name: 'test',
|
name: 'test',
|
||||||
values: [
|
values: [
|
||||||
'org.dspace.ctask.general.ProfileFormats = test'
|
'org.dspace.ctask.general.ProfileFormats = test',
|
||||||
]
|
],
|
||||||
}))
|
})),
|
||||||
});
|
});
|
||||||
|
|
||||||
const mockGroupService = jasmine.createSpyObj('groupService',
|
const mockGroupService = jasmine.createSpyObj('groupService',
|
||||||
{
|
{
|
||||||
// findByHref: jasmine.createSpy('findByHref'),
|
// findByHref: jasmine.createSpy('findByHref'),
|
||||||
// findAll: jasmine.createSpy('findAll'),
|
// findAll: jasmine.createSpy('findAll'),
|
||||||
// searchGroups: jasmine.createSpy('searchGroups'),
|
// searchGroups: jasmine.createSpy('searchGroups'),
|
||||||
getUUIDFromString: jasmine.createSpy('getUUIDFromString'),
|
getUUIDFromString: jasmine.createSpy('getUUIDFromString'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
linkPath: 'groups'
|
linkPath: 'groups',
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
RouterTestingModule.withRoutes([]),
|
RouterTestingModule.withRoutes([]),
|
||||||
@@ -135,7 +143,7 @@ describe('MetadataRegistryComponent', () => {
|
|||||||
})
|
})
|
||||||
.overrideComponent(MetadataRegistryComponent, {
|
.overrideComponent(MetadataRegistryComponent, {
|
||||||
remove: {
|
remove: {
|
||||||
imports: [MetadataSchemaFormComponent, RouterLink]
|
imports: [MetadataSchemaFormComponent, RouterLink],
|
||||||
},
|
},
|
||||||
add: { changeDetection: ChangeDetectionStrategy.Default },
|
add: { changeDetection: ChangeDetectionStrategy.Default },
|
||||||
})
|
})
|
||||||
|
@@ -1,22 +1,44 @@
|
|||||||
|
import {
|
||||||
|
AsyncPipe,
|
||||||
|
NgClass,
|
||||||
|
NgForOf,
|
||||||
|
NgIf,
|
||||||
|
} from '@angular/common';
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { RegistryService } from '../../../core/registry/registry.service';
|
import {
|
||||||
import { BehaviorSubject, combineLatest as observableCombineLatest, Observable, zip } from 'rxjs';
|
Router,
|
||||||
import { RemoteData } from '../../../core/data/remote-data';
|
RouterLink,
|
||||||
|
} from '@angular/router';
|
||||||
|
import {
|
||||||
|
TranslateModule,
|
||||||
|
TranslateService,
|
||||||
|
} from '@ngx-translate/core';
|
||||||
|
import {
|
||||||
|
BehaviorSubject,
|
||||||
|
combineLatest as observableCombineLatest,
|
||||||
|
Observable,
|
||||||
|
zip,
|
||||||
|
} from 'rxjs';
|
||||||
|
import {
|
||||||
|
filter,
|
||||||
|
map,
|
||||||
|
switchMap,
|
||||||
|
take,
|
||||||
|
} from 'rxjs/operators';
|
||||||
|
|
||||||
import { PaginatedList } from '../../../core/data/paginated-list.model';
|
import { PaginatedList } from '../../../core/data/paginated-list.model';
|
||||||
import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model';
|
import { RemoteData } from '../../../core/data/remote-data';
|
||||||
import { filter, map, switchMap, take } from 'rxjs/operators';
|
|
||||||
import { hasValue } from '../../../shared/empty.util';
|
|
||||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
|
||||||
import { Router, RouterLink } from '@angular/router';
|
|
||||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
|
||||||
import { MetadataSchema } from '../../../core/metadata/metadata-schema.model';
|
import { MetadataSchema } from '../../../core/metadata/metadata-schema.model';
|
||||||
import { PaginationService } from '../../../core/pagination/pagination.service';
|
import { PaginationService } from '../../../core/pagination/pagination.service';
|
||||||
|
import { RegistryService } from '../../../core/registry/registry.service';
|
||||||
import { NoContent } from '../../../core/shared/NoContent.model';
|
import { NoContent } from '../../../core/shared/NoContent.model';
|
||||||
import { getFirstCompletedRemoteData } from '../../../core/shared/operators';
|
import { getFirstCompletedRemoteData } from '../../../core/shared/operators';
|
||||||
import { toFindListOptions } from '../../../shared/pagination/pagination.utils';
|
import { hasValue } from '../../../shared/empty.util';
|
||||||
import { MetadataSchemaFormComponent } from './metadata-schema-form/metadata-schema-form.component';
|
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||||
import { AsyncPipe, NgClass, NgForOf, NgIf } from '@angular/common';
|
|
||||||
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
||||||
|
import { toFindListOptions } from '../../../shared/pagination/pagination.utils';
|
||||||
|
import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model';
|
||||||
|
import { MetadataSchemaFormComponent } from './metadata-schema-form/metadata-schema-form.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-metadata-registry',
|
selector: 'ds-metadata-registry',
|
||||||
@@ -30,9 +52,9 @@ import { PaginationComponent } from '../../../shared/pagination/pagination.compo
|
|||||||
NgIf,
|
NgIf,
|
||||||
NgForOf,
|
NgForOf,
|
||||||
NgClass,
|
NgClass,
|
||||||
RouterLink
|
RouterLink,
|
||||||
],
|
],
|
||||||
standalone: true
|
standalone: true,
|
||||||
})
|
})
|
||||||
/**
|
/**
|
||||||
* A component used for managing all existing metadata schemas within the repository.
|
* A component used for managing all existing metadata schemas within the repository.
|
||||||
|
@@ -1,16 +1,21 @@
|
|||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { ComponentFixture, inject, TestBed, waitForAsync, } from '@angular/core/testing';
|
import {
|
||||||
|
ComponentFixture,
|
||||||
|
inject,
|
||||||
|
TestBed,
|
||||||
|
waitForAsync,
|
||||||
|
} from '@angular/core/testing';
|
||||||
import { RouterTestingModule } from '@angular/router/testing';
|
import { RouterTestingModule } from '@angular/router/testing';
|
||||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { of as observableOf } from 'rxjs';
|
import { of as observableOf } from 'rxjs';
|
||||||
|
|
||||||
import { MetadataSchema } from '../../../../core/metadata/metadata-schema.model';
|
import { MetadataSchema } from '../../../../core/metadata/metadata-schema.model';
|
||||||
import { FormComponent } from '../../../../shared/form/form.component';
|
|
||||||
import { getMockFormBuilderService } from '../../../../shared/mocks/form-builder-service.mock';
|
|
||||||
import { RegistryService } from '../../../../core/registry/registry.service';
|
import { RegistryService } from '../../../../core/registry/registry.service';
|
||||||
import { FormBuilderService } from '../../../../shared/form/builder/form-builder.service';
|
import { FormBuilderService } from '../../../../shared/form/builder/form-builder.service';
|
||||||
|
import { FormComponent } from '../../../../shared/form/form.component';
|
||||||
|
import { getMockFormBuilderService } from '../../../../shared/mocks/form-builder-service.mock';
|
||||||
import { EnumKeysPipe } from '../../../../shared/utils/enum-keys-pipe';
|
import { EnumKeysPipe } from '../../../../shared/utils/enum-keys-pipe';
|
||||||
import { MetadataSchemaFormComponent } from './metadata-schema-form.component';
|
import { MetadataSchemaFormComponent } from './metadata-schema-form.component';
|
||||||
|
|
||||||
@@ -50,8 +55,8 @@ describe('MetadataSchemaFormComponent', () => {
|
|||||||
})
|
})
|
||||||
.overrideComponent(MetadataSchemaFormComponent, {
|
.overrideComponent(MetadataSchemaFormComponent, {
|
||||||
remove: {
|
remove: {
|
||||||
imports: [FormComponent]
|
imports: [FormComponent],
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
}));
|
}));
|
||||||
|
@@ -1,4 +1,14 @@
|
|||||||
import { Component, EventEmitter, OnDestroy, OnInit, Output, } from '@angular/core';
|
import {
|
||||||
|
AsyncPipe,
|
||||||
|
NgIf,
|
||||||
|
} from '@angular/common';
|
||||||
|
import {
|
||||||
|
Component,
|
||||||
|
EventEmitter,
|
||||||
|
OnDestroy,
|
||||||
|
OnInit,
|
||||||
|
Output,
|
||||||
|
} from '@angular/core';
|
||||||
import { UntypedFormGroup } from '@angular/forms';
|
import { UntypedFormGroup } from '@angular/forms';
|
||||||
import {
|
import {
|
||||||
DynamicFormControlModel,
|
DynamicFormControlModel,
|
||||||
@@ -6,14 +16,23 @@ import {
|
|||||||
DynamicFormLayout,
|
DynamicFormLayout,
|
||||||
DynamicInputModel,
|
DynamicInputModel,
|
||||||
} from '@ng-dynamic-forms/core';
|
} from '@ng-dynamic-forms/core';
|
||||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
import {
|
||||||
import { combineLatest, Observable, } from 'rxjs';
|
TranslateModule,
|
||||||
import { switchMap, take, tap, } from 'rxjs/operators';
|
TranslateService,
|
||||||
|
} from '@ngx-translate/core';
|
||||||
|
import {
|
||||||
|
combineLatest,
|
||||||
|
Observable,
|
||||||
|
} from 'rxjs';
|
||||||
|
import {
|
||||||
|
switchMap,
|
||||||
|
take,
|
||||||
|
tap,
|
||||||
|
} from 'rxjs/operators';
|
||||||
|
|
||||||
import { MetadataSchema } from '../../../../core/metadata/metadata-schema.model';
|
import { MetadataSchema } from '../../../../core/metadata/metadata-schema.model';
|
||||||
import { RegistryService } from '../../../../core/registry/registry.service';
|
import { RegistryService } from '../../../../core/registry/registry.service';
|
||||||
import { FormBuilderService } from '../../../../shared/form/builder/form-builder.service';
|
import { FormBuilderService } from '../../../../shared/form/builder/form-builder.service';
|
||||||
import { AsyncPipe, NgIf } from '@angular/common';
|
|
||||||
import { FormComponent } from '../../../../shared/form/form.component';
|
import { FormComponent } from '../../../../shared/form/form.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -23,9 +42,9 @@ import { FormComponent } from '../../../../shared/form/form.component';
|
|||||||
NgIf,
|
NgIf,
|
||||||
AsyncPipe,
|
AsyncPipe,
|
||||||
TranslateModule,
|
TranslateModule,
|
||||||
FormComponent
|
FormComponent,
|
||||||
],
|
],
|
||||||
standalone: true
|
standalone: true,
|
||||||
})
|
})
|
||||||
/**
|
/**
|
||||||
* A form used for creating and editing metadata schemas
|
* A form used for creating and editing metadata schemas
|
||||||
|
@@ -1,6 +1,11 @@
|
|||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { ComponentFixture, inject, TestBed, waitForAsync, } from '@angular/core/testing';
|
import {
|
||||||
|
ComponentFixture,
|
||||||
|
inject,
|
||||||
|
TestBed,
|
||||||
|
waitForAsync,
|
||||||
|
} from '@angular/core/testing';
|
||||||
import { RouterTestingModule } from '@angular/router/testing';
|
import { RouterTestingModule } from '@angular/router/testing';
|
||||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
@@ -8,10 +13,10 @@ import { of as observableOf } from 'rxjs';
|
|||||||
|
|
||||||
import { MetadataField } from '../../../../core/metadata/metadata-field.model';
|
import { MetadataField } from '../../../../core/metadata/metadata-field.model';
|
||||||
import { MetadataSchema } from '../../../../core/metadata/metadata-schema.model';
|
import { MetadataSchema } from '../../../../core/metadata/metadata-schema.model';
|
||||||
import { FormComponent } from '../../../../shared/form/form.component';
|
|
||||||
import { getMockFormBuilderService } from '../../../../shared/mocks/form-builder-service.mock';
|
|
||||||
import { RegistryService } from '../../../../core/registry/registry.service';
|
import { RegistryService } from '../../../../core/registry/registry.service';
|
||||||
import { FormBuilderService } from '../../../../shared/form/builder/form-builder.service';
|
import { FormBuilderService } from '../../../../shared/form/builder/form-builder.service';
|
||||||
|
import { FormComponent } from '../../../../shared/form/form.component';
|
||||||
|
import { getMockFormBuilderService } from '../../../../shared/mocks/form-builder-service.mock';
|
||||||
import { EnumKeysPipe } from '../../../../shared/utils/enum-keys-pipe';
|
import { EnumKeysPipe } from '../../../../shared/utils/enum-keys-pipe';
|
||||||
import { MetadataFieldFormComponent } from './metadata-field-form.component';
|
import { MetadataFieldFormComponent } from './metadata-field-form.component';
|
||||||
|
|
||||||
@@ -51,15 +56,15 @@ describe('MetadataFieldFormComponent', () => {
|
|||||||
|
|
||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
return TestBed.configureTestingModule({
|
return TestBed.configureTestingModule({
|
||||||
imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, MetadataFieldFormComponent, EnumKeysPipe],
|
imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, MetadataFieldFormComponent, EnumKeysPipe],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: RegistryService, useValue: registryServiceStub },
|
{ provide: RegistryService, useValue: registryServiceStub },
|
||||||
{ provide: FormBuilderService, useValue: getMockFormBuilderService() }
|
{ provide: FormBuilderService, useValue: getMockFormBuilderService() },
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
})
|
})
|
||||||
.overrideComponent(MetadataFieldFormComponent, {
|
.overrideComponent(MetadataFieldFormComponent, {
|
||||||
remove: { imports: [FormComponent]}
|
remove: { imports: [FormComponent] },
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
}));
|
}));
|
||||||
|
@@ -1,3 +1,7 @@
|
|||||||
|
import {
|
||||||
|
AsyncPipe,
|
||||||
|
NgIf,
|
||||||
|
} from '@angular/common';
|
||||||
import {
|
import {
|
||||||
Component,
|
Component,
|
||||||
EventEmitter,
|
EventEmitter,
|
||||||
@@ -14,7 +18,10 @@ import {
|
|||||||
DynamicInputModel,
|
DynamicInputModel,
|
||||||
DynamicTextAreaModel,
|
DynamicTextAreaModel,
|
||||||
} from '@ng-dynamic-forms/core';
|
} from '@ng-dynamic-forms/core';
|
||||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
import {
|
||||||
|
TranslateModule,
|
||||||
|
TranslateService,
|
||||||
|
} from '@ngx-translate/core';
|
||||||
import { combineLatest } from 'rxjs';
|
import { combineLatest } from 'rxjs';
|
||||||
import { take } from 'rxjs/operators';
|
import { take } from 'rxjs/operators';
|
||||||
|
|
||||||
@@ -22,7 +29,6 @@ import { MetadataField } from '../../../../core/metadata/metadata-field.model';
|
|||||||
import { MetadataSchema } from '../../../../core/metadata/metadata-schema.model';
|
import { MetadataSchema } from '../../../../core/metadata/metadata-schema.model';
|
||||||
import { RegistryService } from '../../../../core/registry/registry.service';
|
import { RegistryService } from '../../../../core/registry/registry.service';
|
||||||
import { FormBuilderService } from '../../../../shared/form/builder/form-builder.service';
|
import { FormBuilderService } from '../../../../shared/form/builder/form-builder.service';
|
||||||
import { AsyncPipe, NgIf } from '@angular/common';
|
|
||||||
import { FormComponent } from '../../../../shared/form/form.component';
|
import { FormComponent } from '../../../../shared/form/form.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -32,9 +38,9 @@ import { FormComponent } from '../../../../shared/form/form.component';
|
|||||||
NgIf,
|
NgIf,
|
||||||
FormComponent,
|
FormComponent,
|
||||||
TranslateModule,
|
TranslateModule,
|
||||||
AsyncPipe
|
AsyncPipe,
|
||||||
],
|
],
|
||||||
standalone: true
|
standalone: true,
|
||||||
})
|
})
|
||||||
/**
|
/**
|
||||||
* A form used for creating and editing metadata fields
|
* A form used for creating and editing metadata fields
|
||||||
|
@@ -1,19 +1,31 @@
|
|||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { ComponentFixture, inject, TestBed, waitForAsync, } from '@angular/core/testing';
|
import {
|
||||||
|
ComponentFixture,
|
||||||
|
inject,
|
||||||
|
TestBed,
|
||||||
|
waitForAsync,
|
||||||
|
} from '@angular/core/testing';
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { ActivatedRoute, Router, } from '@angular/router';
|
import {
|
||||||
|
ActivatedRoute,
|
||||||
|
Router,
|
||||||
|
} from '@angular/router';
|
||||||
import { RouterTestingModule } from '@angular/router/testing';
|
import { RouterTestingModule } from '@angular/router/testing';
|
||||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { of as observableOf } from 'rxjs';
|
import { of as observableOf } from 'rxjs';
|
||||||
|
|
||||||
import { RestResponse } from '../../../core/cache/response.models';
|
import { RestResponse } from '../../../core/cache/response.models';
|
||||||
|
import { ConfigurationDataService } from '../../../core/data/configuration-data.service';
|
||||||
import { buildPaginatedList } from '../../../core/data/paginated-list.model';
|
import { buildPaginatedList } from '../../../core/data/paginated-list.model';
|
||||||
|
import { GroupDataService } from '../../../core/eperson/group-data.service';
|
||||||
import { MetadataField } from '../../../core/metadata/metadata-field.model';
|
import { MetadataField } from '../../../core/metadata/metadata-field.model';
|
||||||
import { MetadataSchema } from '../../../core/metadata/metadata-schema.model';
|
import { MetadataSchema } from '../../../core/metadata/metadata-schema.model';
|
||||||
import { PaginationService } from '../../../core/pagination/pagination.service';
|
import { PaginationService } from '../../../core/pagination/pagination.service';
|
||||||
import { RegistryService } from '../../../core/registry/registry.service';
|
import { RegistryService } from '../../../core/registry/registry.service';
|
||||||
|
import { ConfigurationProperty } from '../../../core/shared/configuration-property.model';
|
||||||
|
import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service';
|
||||||
import { HostWindowService } from '../../../shared/host-window.service';
|
import { HostWindowService } from '../../../shared/host-window.service';
|
||||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||||
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
||||||
@@ -22,16 +34,12 @@ import { ActivatedRouteStub } from '../../../shared/testing/active-router.stub';
|
|||||||
import { HostWindowServiceStub } from '../../../shared/testing/host-window-service.stub';
|
import { HostWindowServiceStub } from '../../../shared/testing/host-window-service.stub';
|
||||||
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub';
|
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub';
|
||||||
import { PaginationServiceStub } from '../../../shared/testing/pagination-service.stub';
|
import { PaginationServiceStub } from '../../../shared/testing/pagination-service.stub';
|
||||||
import { MetadataFieldFormComponent } from './metadata-field-form/metadata-field-form.component';
|
|
||||||
import { GroupDataService } from '../../../core/eperson/group-data.service';
|
|
||||||
import { ConfigurationDataService } from '../../../core/data/configuration-data.service';
|
|
||||||
import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service';
|
|
||||||
import { SearchConfigurationServiceStub } from '../../../shared/testing/search-configuration-service.stub';
|
|
||||||
import { ConfigurationProperty } from '../../../core/shared/configuration-property.model';
|
|
||||||
import { createPaginatedList } from '../../../shared/testing/utils.test';
|
|
||||||
import { RouterStub } from '../../../shared/testing/router.stub';
|
import { RouterStub } from '../../../shared/testing/router.stub';
|
||||||
|
import { SearchConfigurationServiceStub } from '../../../shared/testing/search-configuration-service.stub';
|
||||||
|
import { createPaginatedList } from '../../../shared/testing/utils.test';
|
||||||
import { EnumKeysPipe } from '../../../shared/utils/enum-keys-pipe';
|
import { EnumKeysPipe } from '../../../shared/utils/enum-keys-pipe';
|
||||||
import { VarDirective } from '../../../shared/utils/var.directive';
|
import { VarDirective } from '../../../shared/utils/var.directive';
|
||||||
|
import { MetadataFieldFormComponent } from './metadata-field-form/metadata-field-form.component';
|
||||||
import { MetadataSchemaComponent } from './metadata-schema.component';
|
import { MetadataSchemaComponent } from './metadata-schema.component';
|
||||||
|
|
||||||
describe('MetadataSchemaComponent', () => {
|
describe('MetadataSchemaComponent', () => {
|
||||||
@@ -141,9 +149,9 @@ describe('MetadataSchemaComponent', () => {
|
|||||||
findByPropertyName: createSuccessfulRemoteDataObject$(Object.assign(new ConfigurationProperty(), {
|
findByPropertyName: createSuccessfulRemoteDataObject$(Object.assign(new ConfigurationProperty(), {
|
||||||
name: 'test',
|
name: 'test',
|
||||||
values: [
|
values: [
|
||||||
'org.dspace.ctask.general.ProfileFormats = test'
|
'org.dspace.ctask.general.ProfileFormats = test',
|
||||||
]
|
],
|
||||||
}))
|
})),
|
||||||
});
|
});
|
||||||
|
|
||||||
const groupDataService = jasmine.createSpyObj('groupsDataService', {
|
const groupDataService = jasmine.createSpyObj('groupsDataService', {
|
||||||
|
@@ -1,6 +1,22 @@
|
|||||||
import { Component, OnDestroy, OnInit, } from '@angular/core';
|
import {
|
||||||
import { ActivatedRoute, RouterLink } from '@angular/router';
|
AsyncPipe,
|
||||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
NgClass,
|
||||||
|
NgForOf,
|
||||||
|
NgIf,
|
||||||
|
} from '@angular/common';
|
||||||
|
import {
|
||||||
|
Component,
|
||||||
|
OnDestroy,
|
||||||
|
OnInit,
|
||||||
|
} from '@angular/core';
|
||||||
|
import {
|
||||||
|
ActivatedRoute,
|
||||||
|
RouterLink,
|
||||||
|
} from '@angular/router';
|
||||||
|
import {
|
||||||
|
TranslateModule,
|
||||||
|
TranslateService,
|
||||||
|
} from '@ngx-translate/core';
|
||||||
import {
|
import {
|
||||||
BehaviorSubject,
|
BehaviorSubject,
|
||||||
combineLatest,
|
combineLatest,
|
||||||
@@ -9,7 +25,11 @@ import {
|
|||||||
of as observableOf,
|
of as observableOf,
|
||||||
zip,
|
zip,
|
||||||
} from 'rxjs';
|
} from 'rxjs';
|
||||||
import { map, switchMap, take, } from 'rxjs/operators';
|
import {
|
||||||
|
map,
|
||||||
|
switchMap,
|
||||||
|
take,
|
||||||
|
} from 'rxjs/operators';
|
||||||
|
|
||||||
import { PaginatedList } from '../../../core/data/paginated-list.model';
|
import { PaginatedList } from '../../../core/data/paginated-list.model';
|
||||||
import { RemoteData } from '../../../core/data/remote-data';
|
import { RemoteData } from '../../../core/data/remote-data';
|
||||||
@@ -18,15 +38,17 @@ import { MetadataSchema } from '../../../core/metadata/metadata-schema.model';
|
|||||||
import { PaginationService } from '../../../core/pagination/pagination.service';
|
import { PaginationService } from '../../../core/pagination/pagination.service';
|
||||||
import { RegistryService } from '../../../core/registry/registry.service';
|
import { RegistryService } from '../../../core/registry/registry.service';
|
||||||
import { NoContent } from '../../../core/shared/NoContent.model';
|
import { NoContent } from '../../../core/shared/NoContent.model';
|
||||||
import { getFirstCompletedRemoteData, getFirstSucceededRemoteDataPayload, } from '../../../core/shared/operators';
|
import {
|
||||||
|
getFirstCompletedRemoteData,
|
||||||
|
getFirstSucceededRemoteDataPayload,
|
||||||
|
} from '../../../core/shared/operators';
|
||||||
import { hasValue } from '../../../shared/empty.util';
|
import { hasValue } from '../../../shared/empty.util';
|
||||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||||
|
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
||||||
import { toFindListOptions } from '../../../shared/pagination/pagination.utils';
|
import { toFindListOptions } from '../../../shared/pagination/pagination.utils';
|
||||||
import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model';
|
import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model';
|
||||||
import { AsyncPipe, NgClass, NgForOf, NgIf } from '@angular/common';
|
|
||||||
import { VarDirective } from '../../../shared/utils/var.directive';
|
import { VarDirective } from '../../../shared/utils/var.directive';
|
||||||
import { MetadataFieldFormComponent } from './metadata-field-form/metadata-field-form.component';
|
import { MetadataFieldFormComponent } from './metadata-field-form/metadata-field-form.component';
|
||||||
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-metadata-schema',
|
selector: 'ds-metadata-schema',
|
||||||
@@ -41,9 +63,9 @@ import { PaginationComponent } from '../../../shared/pagination/pagination.compo
|
|||||||
NgIf,
|
NgIf,
|
||||||
NgForOf,
|
NgForOf,
|
||||||
NgClass,
|
NgClass,
|
||||||
RouterLink
|
RouterLink,
|
||||||
],
|
],
|
||||||
standalone: true
|
standalone: true,
|
||||||
})
|
})
|
||||||
/**
|
/**
|
||||||
* A component used for managing all existing metadata fields within the current metadata schema.
|
* A component used for managing all existing metadata fields within the current metadata schema.
|
||||||
|
@@ -1,28 +1,28 @@
|
|||||||
|
import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver';
|
||||||
import { FilteredCollectionsComponent } from './filtered-collections/filtered-collections.component';
|
import { FilteredCollectionsComponent } from './filtered-collections/filtered-collections.component';
|
||||||
import { FilteredItemsComponent } from './filtered-items/filtered-items.component';
|
import { FilteredItemsComponent } from './filtered-items/filtered-items.component';
|
||||||
import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver';
|
|
||||||
|
|
||||||
export const ROUTES = [
|
export const ROUTES = [
|
||||||
{
|
{
|
||||||
path: 'collections',
|
path: 'collections',
|
||||||
resolve: {breadcrumb: I18nBreadcrumbResolver},
|
resolve: { breadcrumb: I18nBreadcrumbResolver },
|
||||||
data: {title: 'admin.reports.collections.title', breadcrumbKey: 'admin.reports.collections'},
|
data: { title: 'admin.reports.collections.title', breadcrumbKey: 'admin.reports.collections' },
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
component: FilteredCollectionsComponent
|
component: FilteredCollectionsComponent,
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'queries',
|
path: 'queries',
|
||||||
resolve: {breadcrumb: I18nBreadcrumbResolver},
|
resolve: { breadcrumb: I18nBreadcrumbResolver },
|
||||||
data: {title: 'admin.reports.items.title', breadcrumbKey: 'admin.reports.items'},
|
data: { title: 'admin.reports.items.title', breadcrumbKey: 'admin.reports.items' },
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
component: FilteredItemsComponent
|
component: FilteredItemsComponent,
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
}
|
},
|
||||||
];
|
];
|
||||||
|
@@ -1,8 +1,9 @@
|
|||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { RouterModule } from '@angular/router';
|
import { RouterModule } from '@angular/router';
|
||||||
import { FormModule } from '../../shared/form/form.module';
|
|
||||||
import { NgbAccordionModule } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbAccordionModule } from '@ng-bootstrap/ng-bootstrap';
|
||||||
|
|
||||||
|
import { FormModule } from '../../shared/form/form.module';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
|
@@ -39,23 +39,23 @@ describe('FiltersComponent', () => {
|
|||||||
|
|
||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [
|
||||||
NgbAccordionModule,
|
NgbAccordionModule,
|
||||||
TranslateModule.forRoot({
|
TranslateModule.forRoot({
|
||||||
loader: {
|
loader: {
|
||||||
provide: TranslateLoader,
|
provide: TranslateLoader,
|
||||||
useClass: TranslateLoaderMock,
|
useClass: TranslateLoaderMock,
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
HttpClientTestingModule,
|
HttpClientTestingModule,
|
||||||
FilteredCollectionsComponent
|
FilteredCollectionsComponent,
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
FormBuilder,
|
FormBuilder,
|
||||||
DspaceRestService,
|
DspaceRestService,
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA],
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
|
|
||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
|
@@ -1,3 +1,7 @@
|
|||||||
|
import {
|
||||||
|
KeyValuePipe,
|
||||||
|
NgForOf,
|
||||||
|
} from '@angular/common';
|
||||||
import {
|
import {
|
||||||
Component,
|
Component,
|
||||||
ViewChild,
|
ViewChild,
|
||||||
@@ -6,7 +10,11 @@ import {
|
|||||||
FormBuilder,
|
FormBuilder,
|
||||||
FormGroup,
|
FormGroup,
|
||||||
} from '@angular/forms';
|
} from '@angular/forms';
|
||||||
import { NgbAccordion, NgbAccordionModule } from '@ng-bootstrap/ng-bootstrap';
|
import {
|
||||||
|
NgbAccordion,
|
||||||
|
NgbAccordionModule,
|
||||||
|
} from '@ng-bootstrap/ng-bootstrap';
|
||||||
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { RestRequestMethod } from 'src/app/core/data/rest-request-method';
|
import { RestRequestMethod } from 'src/app/core/data/rest-request-method';
|
||||||
import { DspaceRestService } from 'src/app/core/dspace-rest/dspace-rest.service';
|
import { DspaceRestService } from 'src/app/core/dspace-rest/dspace-rest.service';
|
||||||
@@ -15,8 +23,6 @@ import { environment } from 'src/environments/environment';
|
|||||||
|
|
||||||
import { FiltersComponent } from '../filters-section/filters-section.component';
|
import { FiltersComponent } from '../filters-section/filters-section.component';
|
||||||
import { FilteredCollections } from './filtered-collections.model';
|
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
|
* Component representing the Filtered Collections content report
|
||||||
@@ -30,9 +36,9 @@ import { KeyValuePipe, NgForOf } from '@angular/common';
|
|||||||
NgbAccordionModule,
|
NgbAccordionModule,
|
||||||
FiltersComponent,
|
FiltersComponent,
|
||||||
KeyValuePipe,
|
KeyValuePipe,
|
||||||
NgForOf
|
NgForOf,
|
||||||
],
|
],
|
||||||
standalone: true
|
standalone: true,
|
||||||
})
|
})
|
||||||
export class FilteredCollectionsComponent {
|
export class FilteredCollectionsComponent {
|
||||||
|
|
||||||
|
@@ -1,8 +1,30 @@
|
|||||||
import { Component, ViewChild } from '@angular/core';
|
import {
|
||||||
import { FormArray, FormBuilder, FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
AsyncPipe,
|
||||||
import { NgbAccordion, NgbAccordionModule } from '@ng-bootstrap/ng-bootstrap';
|
NgForOf,
|
||||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
} from '@angular/common';
|
||||||
import { map, Observable } from 'rxjs';
|
import {
|
||||||
|
Component,
|
||||||
|
ViewChild,
|
||||||
|
} from '@angular/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 { CollectionDataService } from 'src/app/core/data/collection-data.service';
|
||||||
import { CommunityDataService } from 'src/app/core/data/community-data.service';
|
import { CommunityDataService } from 'src/app/core/data/community-data.service';
|
||||||
import { MetadataFieldDataService } from 'src/app/core/data/metadata-field-data.service';
|
import { MetadataFieldDataService } from 'src/app/core/data/metadata-field-data.service';
|
||||||
@@ -24,7 +46,6 @@ import { FilteredItems } from './filtered-items-model';
|
|||||||
import { OptionVO } from './option-vo.model';
|
import { OptionVO } from './option-vo.model';
|
||||||
import { PresetQuery } from './preset-query.model';
|
import { PresetQuery } from './preset-query.model';
|
||||||
import { QueryPredicate } from './query-predicate.model';
|
import { QueryPredicate } from './query-predicate.model';
|
||||||
import { AsyncPipe, NgForOf } from '@angular/common';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component representing the Filtered Items content report.
|
* Component representing the Filtered Items content report.
|
||||||
@@ -39,9 +60,9 @@ import { AsyncPipe, NgForOf } from '@angular/common';
|
|||||||
TranslateModule,
|
TranslateModule,
|
||||||
AsyncPipe,
|
AsyncPipe,
|
||||||
NgForOf,
|
NgForOf,
|
||||||
FiltersComponent
|
FiltersComponent,
|
||||||
],
|
],
|
||||||
standalone: true
|
standalone: true,
|
||||||
})
|
})
|
||||||
export class FilteredItemsComponent {
|
export class FilteredItemsComponent {
|
||||||
|
|
||||||
|
@@ -20,20 +20,20 @@ describe('FiltersComponent', () => {
|
|||||||
|
|
||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [
|
||||||
TranslateModule.forRoot({
|
TranslateModule.forRoot({
|
||||||
loader: {
|
loader: {
|
||||||
provide: TranslateLoader,
|
provide: TranslateLoader,
|
||||||
useClass: TranslateLoaderMock
|
useClass: TranslateLoaderMock,
|
||||||
}
|
},
|
||||||
}),
|
}),
|
||||||
FiltersComponent
|
FiltersComponent,
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
FormBuilder,
|
FormBuilder,
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA],
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
|
|
||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
|
@@ -1,10 +1,18 @@
|
|||||||
import { Component, Input } from '@angular/core';
|
import { NgForOf } from '@angular/common';
|
||||||
import { FormBuilder, FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
import {
|
||||||
import { FilterGroup } from './filter-group.model';
|
Component,
|
||||||
|
Input,
|
||||||
|
} from '@angular/core';
|
||||||
|
import {
|
||||||
|
FormBuilder,
|
||||||
|
FormControl,
|
||||||
|
FormGroup,
|
||||||
|
ReactiveFormsModule,
|
||||||
|
} from '@angular/forms';
|
||||||
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
|
|
||||||
import { Filter } from './filter.model';
|
import { Filter } from './filter.model';
|
||||||
import { NgForOf } from '@angular/common';
|
import { FilterGroup } from './filter-group.model';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component representing the Query Filters section used in both
|
* Component representing the Query Filters section used in both
|
||||||
@@ -17,9 +25,9 @@ import { TranslateModule } from '@ngx-translate/core';
|
|||||||
imports: [
|
imports: [
|
||||||
NgForOf,
|
NgForOf,
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
TranslateModule
|
TranslateModule,
|
||||||
],
|
],
|
||||||
standalone: true
|
standalone: true,
|
||||||
})
|
})
|
||||||
export class FiltersComponent {
|
export class FiltersComponent {
|
||||||
|
|
||||||
|
@@ -1,21 +1,22 @@
|
|||||||
import { Route } from '@angular/router';
|
import { Route } from '@angular/router';
|
||||||
import { MetadataImportPageComponent } from './admin-import-metadata-page/metadata-import-page.component';
|
|
||||||
import { AdminSearchPageComponent } from './admin-search-page/admin-search-page.component';
|
|
||||||
import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver';
|
import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver';
|
||||||
import { AdminWorkflowPageComponent } from './admin-workflow-page/admin-workflow-page.component';
|
|
||||||
import { I18nBreadcrumbsService } from '../core/breadcrumbs/i18n-breadcrumbs.service';
|
import { I18nBreadcrumbsService } from '../core/breadcrumbs/i18n-breadcrumbs.service';
|
||||||
import { AdminCurationTasksComponent } from './admin-curation-tasks/admin-curation-tasks.component';
|
import { AdminCurationTasksComponent } from './admin-curation-tasks/admin-curation-tasks.component';
|
||||||
|
import { BatchImportPageComponent } from './admin-import-batch-page/batch-import-page.component';
|
||||||
|
import { MetadataImportPageComponent } from './admin-import-metadata-page/metadata-import-page.component';
|
||||||
import {
|
import {
|
||||||
LDN_PATH,
|
LDN_PATH,
|
||||||
NOTIFICATIONS_MODULE_PATH,
|
NOTIFICATIONS_MODULE_PATH,
|
||||||
REGISTRIES_MODULE_PATH,
|
REGISTRIES_MODULE_PATH,
|
||||||
REPORTS_MODULE_PATH
|
REPORTS_MODULE_PATH,
|
||||||
} from './admin-routing-paths';
|
} from './admin-routing-paths';
|
||||||
import { BatchImportPageComponent } from './admin-import-batch-page/batch-import-page.component';
|
import { AdminSearchPageComponent } from './admin-search-page/admin-search-page.component';
|
||||||
|
import { AdminWorkflowPageComponent } from './admin-workflow-page/admin-workflow-page.component';
|
||||||
|
|
||||||
const providers = [
|
const providers = [
|
||||||
I18nBreadcrumbResolver,
|
I18nBreadcrumbResolver,
|
||||||
I18nBreadcrumbsService
|
I18nBreadcrumbsService,
|
||||||
];
|
];
|
||||||
|
|
||||||
export const ROUTES: Route[] = [
|
export const ROUTES: Route[] = [
|
||||||
@@ -34,44 +35,44 @@ export const ROUTES: Route[] = [
|
|||||||
{
|
{
|
||||||
path: 'search',
|
path: 'search',
|
||||||
providers,
|
providers,
|
||||||
resolve: {breadcrumb: I18nBreadcrumbResolver},
|
resolve: { breadcrumb: I18nBreadcrumbResolver },
|
||||||
component: AdminSearchPageComponent,
|
component: AdminSearchPageComponent,
|
||||||
data: {title: 'admin.search.title', breadcrumbKey: 'admin.search'}
|
data: { title: 'admin.search.title', breadcrumbKey: 'admin.search' },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'workflow',
|
path: 'workflow',
|
||||||
providers,
|
providers,
|
||||||
resolve: {breadcrumb: I18nBreadcrumbResolver},
|
resolve: { breadcrumb: I18nBreadcrumbResolver },
|
||||||
component: AdminWorkflowPageComponent,
|
component: AdminWorkflowPageComponent,
|
||||||
data: {title: 'admin.workflow.title', breadcrumbKey: 'admin.workflow'}
|
data: { title: 'admin.workflow.title', breadcrumbKey: 'admin.workflow' },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'curation-tasks',
|
path: 'curation-tasks',
|
||||||
providers,
|
providers,
|
||||||
resolve: {breadcrumb: I18nBreadcrumbResolver},
|
resolve: { breadcrumb: I18nBreadcrumbResolver },
|
||||||
component: AdminCurationTasksComponent,
|
component: AdminCurationTasksComponent,
|
||||||
data: {title: 'admin.curation-tasks.title', breadcrumbKey: 'admin.curation-tasks'}
|
data: { title: 'admin.curation-tasks.title', breadcrumbKey: 'admin.curation-tasks' },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'metadata-import',
|
path: 'metadata-import',
|
||||||
providers,
|
providers,
|
||||||
resolve: {breadcrumb: I18nBreadcrumbResolver},
|
resolve: { breadcrumb: I18nBreadcrumbResolver },
|
||||||
component: MetadataImportPageComponent,
|
component: MetadataImportPageComponent,
|
||||||
data: {title: 'admin.metadata-import.title', breadcrumbKey: 'admin.metadata-import'}
|
data: { title: 'admin.metadata-import.title', breadcrumbKey: 'admin.metadata-import' },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'batch-import',
|
path: 'batch-import',
|
||||||
providers,
|
providers,
|
||||||
resolve: {breadcrumb: I18nBreadcrumbResolver},
|
resolve: { breadcrumb: I18nBreadcrumbResolver },
|
||||||
component: BatchImportPageComponent,
|
component: BatchImportPageComponent,
|
||||||
data: {title: 'admin.batch-import.title', breadcrumbKey: 'admin.batch-import'}
|
data: { title: 'admin.batch-import.title', breadcrumbKey: 'admin.batch-import' },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'system-wide-alert',
|
path: 'system-wide-alert',
|
||||||
providers,
|
providers,
|
||||||
resolve: {breadcrumb: I18nBreadcrumbResolver},
|
resolve: { breadcrumb: I18nBreadcrumbResolver },
|
||||||
loadChildren: () => import('../system-wide-alert/system-wide-alert-routes').then((m) => m.ROUTES),
|
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'}
|
data: { title: 'admin.system-wide-alert.title', breadcrumbKey: 'admin.system-wide-alert' },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: LDN_PATH,
|
path: LDN_PATH,
|
||||||
@@ -81,7 +82,7 @@ export const ROUTES: Route[] = [
|
|||||||
path: 'services',
|
path: 'services',
|
||||||
loadChildren: () => import('./admin-ldn-services/admin-ldn-services-routes')
|
loadChildren: () => import('./admin-ldn-services/admin-ldn-services-routes')
|
||||||
.then((m) => m.ROUTES),
|
.then((m) => m.ROUTES),
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@@ -1,13 +1,13 @@
|
|||||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { ConfigurationSearchPageComponent } from '../../search-page/configuration-search-page.component';
|
|
||||||
import { ActivatedRoute } from '@angular/router';
|
|
||||||
import { ActivatedRouteStub } from '../../shared/testing/active-router.stub';
|
|
||||||
import {
|
import {
|
||||||
ComponentFixture,
|
ComponentFixture,
|
||||||
TestBed,
|
TestBed,
|
||||||
waitForAsync,
|
waitForAsync,
|
||||||
} from '@angular/core/testing';
|
} from '@angular/core/testing';
|
||||||
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
|
||||||
|
import { ConfigurationSearchPageComponent } from '../../search-page/configuration-search-page.component';
|
||||||
|
import { ActivatedRouteStub } from '../../shared/testing/active-router.stub';
|
||||||
import { AdminSearchPageComponent } from './admin-search-page.component';
|
import { AdminSearchPageComponent } from './admin-search-page.component';
|
||||||
|
|
||||||
describe('AdminSearchPageComponent', () => {
|
describe('AdminSearchPageComponent', () => {
|
||||||
@@ -18,13 +18,13 @@ describe('AdminSearchPageComponent', () => {
|
|||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
imports: [AdminSearchPageComponent],
|
imports: [AdminSearchPageComponent],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: ActivatedRoute, useValue: new ActivatedRouteStub() }
|
{ provide: ActivatedRoute, useValue: new ActivatedRouteStub() },
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA]
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
}).overrideComponent(AdminSearchPageComponent, {
|
}).overrideComponent(AdminSearchPageComponent, {
|
||||||
remove: {
|
remove: {
|
||||||
imports: [ConfigurationSearchPageComponent]
|
imports: [ConfigurationSearchPageComponent],
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
}));
|
}));
|
||||||
|
@@ -4,11 +4,11 @@ import { Context } from '../../core/shared/context.model';
|
|||||||
import { ConfigurationSearchPageComponent } from '../../search-page/configuration-search-page.component';
|
import { ConfigurationSearchPageComponent } from '../../search-page/configuration-search-page.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-admin-search-page',
|
selector: 'ds-admin-search-page',
|
||||||
templateUrl: './admin-search-page.component.html',
|
templateUrl: './admin-search-page.component.html',
|
||||||
styleUrls: ['./admin-search-page.component.scss'],
|
styleUrls: ['./admin-search-page.component.scss'],
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [ConfigurationSearchPageComponent]
|
imports: [ConfigurationSearchPageComponent],
|
||||||
})
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -6,7 +6,10 @@ import {
|
|||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||||
import { RouterTestingModule } from '@angular/router/testing';
|
import { RouterTestingModule } from '@angular/router/testing';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import {
|
||||||
|
TranslateModule,
|
||||||
|
TranslateModule,
|
||||||
|
} from '@ngx-translate/core';
|
||||||
|
|
||||||
import { getCollectionEditRoute } from '../../../../../collection-page/collection-page-routing-paths';
|
import { getCollectionEditRoute } from '../../../../../collection-page/collection-page-routing-paths';
|
||||||
import { AuthService } from '../../../../../core/auth/auth.service';
|
import { AuthService } from '../../../../../core/auth/auth.service';
|
||||||
@@ -17,19 +20,21 @@ import { Collection } from '../../../../../core/shared/collection.model';
|
|||||||
import { FileService } from '../../../../../core/shared/file.service';
|
import { FileService } from '../../../../../core/shared/file.service';
|
||||||
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
||||||
import { mockTruncatableService } from '../../../../../shared/mocks/mock-trucatable.service';
|
import { mockTruncatableService } from '../../../../../shared/mocks/mock-trucatable.service';
|
||||||
import { CollectionAdminSearchResultGridElementComponent } from './collection-admin-search-result-grid-element.component';
|
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
|
||||||
import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
|
|
||||||
import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock';
|
import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock';
|
||||||
import { CollectionElementLinkType } from '../../../../../shared/object-collection/collection-element-link.type';
|
import { CollectionElementLinkType } from '../../../../../shared/object-collection/collection-element-link.type';
|
||||||
import { CollectionSearchResult } from '../../../../../shared/object-collection/shared/collection-search-result.model';
|
import { CollectionSearchResult } from '../../../../../shared/object-collection/shared/collection-search-result.model';
|
||||||
import { SharedModule } from '../../../../../shared/shared.module';
|
|
||||||
import { AuthServiceStub } from '../../../../../shared/testing/auth-service.stub';
|
import { AuthServiceStub } from '../../../../../shared/testing/auth-service.stub';
|
||||||
import { AuthorizationDataServiceStub } from '../../../../../shared/testing/authorization-service.stub';
|
import { AuthorizationDataServiceStub } from '../../../../../shared/testing/authorization-service.stub';
|
||||||
import { FileServiceStub } from '../../../../../shared/testing/file-service.stub';
|
import { FileServiceStub } from '../../../../../shared/testing/file-service.stub';
|
||||||
import { ThemeService } from '../../../../../shared/theme-support/theme.service';
|
import { ThemeService } from '../../../../../shared/theme-support/theme.service';
|
||||||
import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
|
import {
|
||||||
import { CollectionAdminSearchResultGridElementComponent } from './collection-admin-search-result-grid-element.component';
|
TruncatableService,
|
||||||
|
TruncatableService,
|
||||||
|
} from '../../../../../shared/truncatable/truncatable.service';
|
||||||
|
import {
|
||||||
|
CollectionAdminSearchResultGridElementComponent,
|
||||||
|
CollectionAdminSearchResultGridElementComponent,
|
||||||
|
} from './collection-admin-search-result-grid-element.component';
|
||||||
|
|
||||||
describe('CollectionAdminSearchResultGridElementComponent', () => {
|
describe('CollectionAdminSearchResultGridElementComponent', () => {
|
||||||
let component: CollectionAdminSearchResultGridElementComponent;
|
let component: CollectionAdminSearchResultGridElementComponent;
|
||||||
@@ -51,13 +56,13 @@ describe('CollectionAdminSearchResultGridElementComponent', () => {
|
|||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
init();
|
init();
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [
|
||||||
NoopAnimationsModule,
|
NoopAnimationsModule,
|
||||||
TranslateModule.forRoot(),
|
TranslateModule.forRoot(),
|
||||||
RouterTestingModule.withRoutes([]),
|
RouterTestingModule.withRoutes([]),
|
||||||
CollectionAdminSearchResultGridElementComponent
|
CollectionAdminSearchResultGridElementComponent,
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: TruncatableService, useValue: mockTruncatableService },
|
{ provide: TruncatableService, useValue: mockTruncatableService },
|
||||||
{ provide: BitstreamDataService, useValue: {} },
|
{ provide: BitstreamDataService, useValue: {} },
|
||||||
{ provide: LinkService, useValue: linkService },
|
{ provide: LinkService, useValue: linkService },
|
||||||
@@ -66,7 +71,7 @@ describe('CollectionAdminSearchResultGridElementComponent', () => {
|
|||||||
{ provide: AuthorizationDataService, useClass: AuthorizationDataServiceStub },
|
{ provide: AuthorizationDataService, useClass: AuthorizationDataServiceStub },
|
||||||
{ provide: ThemeService, useValue: getMockThemeService() },
|
{ provide: ThemeService, useValue: getMockThemeService() },
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@@ -1,29 +1,31 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
import { RouterLink } from '@angular/router';
|
||||||
|
|
||||||
import { getCollectionEditRoute } from '../../../../../collection-page/collection-page-routing-paths';
|
|
||||||
import {
|
import {
|
||||||
Collection
|
getCollectionEditRoute,
|
||||||
|
getCollectionEditRoute,
|
||||||
|
} from '../../../../../collection-page/collection-page-routing-paths';
|
||||||
|
import {
|
||||||
|
Collection,
|
||||||
|
Collection,
|
||||||
} from '../../../../../core/shared/collection.model';
|
} from '../../../../../core/shared/collection.model';
|
||||||
import { Context } from '../../../../../core/shared/context.model';
|
import { Context } from '../../../../../core/shared/context.model';
|
||||||
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
||||||
import { CollectionSearchResult } from '../../../../../shared/object-collection/shared/collection-search-result.model';
|
import { CollectionSearchResult } from '../../../../../shared/object-collection/shared/collection-search-result.model';
|
||||||
import { Collection } from '../../../../../core/shared/collection.model';
|
|
||||||
import {
|
|
||||||
SearchResultGridElementComponent
|
|
||||||
} from '../../../../../shared/object-grid/search-result-grid-element/search-result-grid-element.component';
|
|
||||||
import { getCollectionEditRoute } from '../../../../../collection-page/collection-page-routing-paths';
|
|
||||||
import { RouterLink } from '@angular/router';
|
|
||||||
import { CollectionSearchResultGridElementComponent } from '../../../../../shared/object-grid/search-result-grid-element/collection-search-result/collection-search-result-grid-element.component';
|
|
||||||
import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
|
import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
|
||||||
import { SearchResultGridElementComponent } from '../../../../../shared/object-grid/search-result-grid-element/search-result-grid-element.component';
|
import { CollectionSearchResultGridElementComponent } from '../../../../../shared/object-grid/search-result-grid-element/collection-search-result/collection-search-result-grid-element.component';
|
||||||
|
import {
|
||||||
|
SearchResultGridElementComponent,
|
||||||
|
SearchResultGridElementComponent,
|
||||||
|
} from '../../../../../shared/object-grid/search-result-grid-element/search-result-grid-element.component';
|
||||||
|
|
||||||
@listableObjectComponent(CollectionSearchResult, ViewMode.GridElement, Context.AdminSearch)
|
@listableObjectComponent(CollectionSearchResult, ViewMode.GridElement, Context.AdminSearch)
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-collection-admin-search-result-list-element',
|
selector: 'ds-collection-admin-search-result-list-element',
|
||||||
styleUrls: ['./collection-admin-search-result-grid-element.component.scss'],
|
styleUrls: ['./collection-admin-search-result-grid-element.component.scss'],
|
||||||
templateUrl: './collection-admin-search-result-grid-element.component.html',
|
templateUrl: './collection-admin-search-result-grid-element.component.html',
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [CollectionSearchResultGridElementComponent, RouterLink]
|
imports: [CollectionSearchResultGridElementComponent, RouterLink],
|
||||||
})
|
})
|
||||||
/**
|
/**
|
||||||
* The component for displaying a list element for a collection search result on the admin search page
|
* The component for displaying a list element for a collection search result on the admin search page
|
||||||
|
@@ -18,16 +18,17 @@ import { Community } from '../../../../../core/shared/community.model';
|
|||||||
import { FileService } from '../../../../../core/shared/file.service';
|
import { FileService } from '../../../../../core/shared/file.service';
|
||||||
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
||||||
import { mockTruncatableService } from '../../../../../shared/mocks/mock-trucatable.service';
|
import { mockTruncatableService } from '../../../../../shared/mocks/mock-trucatable.service';
|
||||||
import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
|
|
||||||
import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock';
|
import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock';
|
||||||
import { CollectionElementLinkType } from '../../../../../shared/object-collection/collection-element-link.type';
|
import { CollectionElementLinkType } from '../../../../../shared/object-collection/collection-element-link.type';
|
||||||
import { CommunitySearchResult } from '../../../../../shared/object-collection/shared/community-search-result.model';
|
import { CommunitySearchResult } from '../../../../../shared/object-collection/shared/community-search-result.model';
|
||||||
import { SharedModule } from '../../../../../shared/shared.module';
|
|
||||||
import { AuthServiceStub } from '../../../../../shared/testing/auth-service.stub';
|
import { AuthServiceStub } from '../../../../../shared/testing/auth-service.stub';
|
||||||
import { AuthorizationDataServiceStub } from '../../../../../shared/testing/authorization-service.stub';
|
import { AuthorizationDataServiceStub } from '../../../../../shared/testing/authorization-service.stub';
|
||||||
import { FileServiceStub } from '../../../../../shared/testing/file-service.stub';
|
import { FileServiceStub } from '../../../../../shared/testing/file-service.stub';
|
||||||
import { ThemeService } from '../../../../../shared/theme-support/theme.service';
|
import { ThemeService } from '../../../../../shared/theme-support/theme.service';
|
||||||
import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
|
import {
|
||||||
|
TruncatableService,
|
||||||
|
TruncatableService,
|
||||||
|
} from '../../../../../shared/truncatable/truncatable.service';
|
||||||
import { CommunityAdminSearchResultGridElementComponent } from './community-admin-search-result-grid-element.component';
|
import { CommunityAdminSearchResultGridElementComponent } from './community-admin-search-result-grid-element.component';
|
||||||
|
|
||||||
describe('CommunityAdminSearchResultGridElementComponent', () => {
|
describe('CommunityAdminSearchResultGridElementComponent', () => {
|
||||||
@@ -50,13 +51,13 @@ describe('CommunityAdminSearchResultGridElementComponent', () => {
|
|||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
init();
|
init();
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [
|
||||||
NoopAnimationsModule,
|
NoopAnimationsModule,
|
||||||
TranslateModule.forRoot(),
|
TranslateModule.forRoot(),
|
||||||
RouterTestingModule.withRoutes([]),
|
RouterTestingModule.withRoutes([]),
|
||||||
CommunityAdminSearchResultGridElementComponent
|
CommunityAdminSearchResultGridElementComponent,
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: TruncatableService, useValue: mockTruncatableService },
|
{ provide: TruncatableService, useValue: mockTruncatableService },
|
||||||
{ provide: BitstreamDataService, useValue: {} },
|
{ provide: BitstreamDataService, useValue: {} },
|
||||||
{ provide: LinkService, useValue: linkService },
|
{ provide: LinkService, useValue: linkService },
|
||||||
@@ -64,9 +65,9 @@ describe('CommunityAdminSearchResultGridElementComponent', () => {
|
|||||||
{ provide: FileService, useClass: FileServiceStub },
|
{ provide: FileService, useClass: FileServiceStub },
|
||||||
{ provide: AuthorizationDataService, useClass: AuthorizationDataServiceStub },
|
{ provide: AuthorizationDataService, useClass: AuthorizationDataServiceStub },
|
||||||
{ provide: ThemeService, useValue: getMockThemeService() },
|
{ provide: ThemeService, useValue: getMockThemeService() },
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA],
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@@ -1,29 +1,31 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
import { RouterLink } from '@angular/router';
|
||||||
|
|
||||||
import { getCommunityEditRoute } from '../../../../../community-page/community-page-routing-paths';
|
|
||||||
import {
|
import {
|
||||||
Community
|
getCommunityEditRoute,
|
||||||
|
getCommunityEditRoute,
|
||||||
|
} from '../../../../../community-page/community-page-routing-paths';
|
||||||
|
import {
|
||||||
|
Community,
|
||||||
|
Community,
|
||||||
} from '../../../../../core/shared/community.model';
|
} from '../../../../../core/shared/community.model';
|
||||||
import { Context } from '../../../../../core/shared/context.model';
|
import { Context } from '../../../../../core/shared/context.model';
|
||||||
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
||||||
import { CommunitySearchResult } from '../../../../../shared/object-collection/shared/community-search-result.model';
|
import { CommunitySearchResult } from '../../../../../shared/object-collection/shared/community-search-result.model';
|
||||||
import { Community } from '../../../../../core/shared/community.model';
|
|
||||||
import {
|
|
||||||
SearchResultGridElementComponent
|
|
||||||
} from '../../../../../shared/object-grid/search-result-grid-element/search-result-grid-element.component';
|
|
||||||
import { getCommunityEditRoute } from '../../../../../community-page/community-page-routing-paths';
|
|
||||||
import { RouterLink } from '@angular/router';
|
|
||||||
import { CommunitySearchResultGridElementComponent } from '../../../../../shared/object-grid/search-result-grid-element/community-search-result/community-search-result-grid-element.component';
|
|
||||||
import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
|
import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
|
||||||
import { SearchResultGridElementComponent } from '../../../../../shared/object-grid/search-result-grid-element/search-result-grid-element.component';
|
import { CommunitySearchResultGridElementComponent } from '../../../../../shared/object-grid/search-result-grid-element/community-search-result/community-search-result-grid-element.component';
|
||||||
|
import {
|
||||||
|
SearchResultGridElementComponent,
|
||||||
|
SearchResultGridElementComponent,
|
||||||
|
} from '../../../../../shared/object-grid/search-result-grid-element/search-result-grid-element.component';
|
||||||
|
|
||||||
@listableObjectComponent(CommunitySearchResult, ViewMode.GridElement, Context.AdminSearch)
|
@listableObjectComponent(CommunitySearchResult, ViewMode.GridElement, Context.AdminSearch)
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-community-admin-search-result-grid-element',
|
selector: 'ds-community-admin-search-result-grid-element',
|
||||||
styleUrls: ['./community-admin-search-result-grid-element.component.scss'],
|
styleUrls: ['./community-admin-search-result-grid-element.component.scss'],
|
||||||
templateUrl: './community-admin-search-result-grid-element.component.html',
|
templateUrl: './community-admin-search-result-grid-element.component.html',
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [CommunitySearchResultGridElementComponent, RouterLink]
|
imports: [CommunitySearchResultGridElementComponent, RouterLink],
|
||||||
})
|
})
|
||||||
/**
|
/**
|
||||||
* The component for displaying a list element for a community search result on the admin search page
|
* The component for displaying a list element for a community search result on the admin search page
|
||||||
|
@@ -1,5 +1,9 @@
|
|||||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing';
|
import {
|
||||||
|
ComponentFixture,
|
||||||
|
TestBed,
|
||||||
|
waitForAsync,
|
||||||
|
} from '@angular/core/testing';
|
||||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||||
import { RouterTestingModule } from '@angular/router/testing';
|
import { RouterTestingModule } from '@angular/router/testing';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
@@ -13,22 +17,20 @@ import { RemoteData } from '../../../../../core/data/remote-data';
|
|||||||
import { Bitstream } from '../../../../../core/shared/bitstream.model';
|
import { Bitstream } from '../../../../../core/shared/bitstream.model';
|
||||||
import { FileService } from '../../../../../core/shared/file.service';
|
import { FileService } from '../../../../../core/shared/file.service';
|
||||||
import { Item } from '../../../../../core/shared/item.model';
|
import { Item } from '../../../../../core/shared/item.model';
|
||||||
|
import { ListableModule } from '../../../../../core/shared/listable.module';
|
||||||
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
||||||
import { mockTruncatableService } from '../../../../../shared/mocks/mock-trucatable.service';
|
import { mockTruncatableService } from '../../../../../shared/mocks/mock-trucatable.service';
|
||||||
import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
|
|
||||||
import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock';
|
import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock';
|
||||||
import { CollectionElementLinkType } from '../../../../../shared/object-collection/collection-element-link.type';
|
import { CollectionElementLinkType } from '../../../../../shared/object-collection/collection-element-link.type';
|
||||||
import {
|
import { AccessStatusObject } from '../../../../../shared/object-collection/shared/badges/access-status-badge/access-status.model';
|
||||||
AccessStatusObject
|
|
||||||
} from '../../../../../shared/object-collection/shared/badges/access-status-badge/access-status.model';
|
|
||||||
import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model';
|
import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model';
|
||||||
import { createSuccessfulRemoteDataObject$ } from '../../../../../shared/remote-data.utils';
|
import { createSuccessfulRemoteDataObject$ } from '../../../../../shared/remote-data.utils';
|
||||||
import { AuthServiceStub } from '../../../../../shared/testing/auth-service.stub';
|
import { AuthServiceStub } from '../../../../../shared/testing/auth-service.stub';
|
||||||
import { AuthorizationDataServiceStub } from '../../../../../shared/testing/authorization-service.stub';
|
import { AuthorizationDataServiceStub } from '../../../../../shared/testing/authorization-service.stub';
|
||||||
import { FileServiceStub } from '../../../../../shared/testing/file-service.stub';
|
import { FileServiceStub } from '../../../../../shared/testing/file-service.stub';
|
||||||
import { ThemeService } from '../../../../../shared/theme-support/theme.service';
|
import { ThemeService } from '../../../../../shared/theme-support/theme.service';
|
||||||
|
import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
|
||||||
import { ItemAdminSearchResultGridElementComponent } from './item-admin-search-result-grid-element.component';
|
import { ItemAdminSearchResultGridElementComponent } from './item-admin-search-result-grid-element.component';
|
||||||
import { ListableModule } from '../../../../../core/shared/listable.module';
|
|
||||||
|
|
||||||
describe('ItemAdminSearchResultGridElementComponent', () => {
|
describe('ItemAdminSearchResultGridElementComponent', () => {
|
||||||
let component: ItemAdminSearchResultGridElementComponent;
|
let component: ItemAdminSearchResultGridElementComponent;
|
||||||
@@ -61,24 +63,24 @@ describe('ItemAdminSearchResultGridElementComponent', () => {
|
|||||||
init();
|
init();
|
||||||
TestBed.configureTestingModule(
|
TestBed.configureTestingModule(
|
||||||
{
|
{
|
||||||
imports: [
|
imports: [
|
||||||
NoopAnimationsModule,
|
NoopAnimationsModule,
|
||||||
TranslateModule.forRoot(),
|
TranslateModule.forRoot(),
|
||||||
RouterTestingModule.withRoutes([]),
|
RouterTestingModule.withRoutes([]),
|
||||||
ListableModule,
|
ListableModule,
|
||||||
ItemAdminSearchResultGridElementComponent
|
ItemAdminSearchResultGridElementComponent,
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: TruncatableService, useValue: mockTruncatableService },
|
{ provide: TruncatableService, useValue: mockTruncatableService },
|
||||||
{ provide: BitstreamDataService, useValue: mockBitstreamDataService },
|
{ provide: BitstreamDataService, useValue: mockBitstreamDataService },
|
||||||
{ provide: ThemeService, useValue: mockThemeService },
|
{ provide: ThemeService, useValue: mockThemeService },
|
||||||
{ provide: AccessStatusDataService, useValue: mockAccessStatusDataService },
|
{ provide: AccessStatusDataService, useValue: mockAccessStatusDataService },
|
||||||
{ provide: AuthService, useClass: AuthServiceStub },
|
{ provide: AuthService, useClass: AuthServiceStub },
|
||||||
{ provide: FileService, useClass: FileServiceStub },
|
{ provide: FileService, useClass: FileServiceStub },
|
||||||
{ provide: AuthorizationDataService, useClass: AuthorizationDataServiceStub },
|
{ provide: AuthorizationDataService, useClass: AuthorizationDataServiceStub },
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA],
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@@ -1,4 +1,11 @@
|
|||||||
import { Component, ComponentRef, ElementRef, OnDestroy, OnInit, ViewChild, } from '@angular/core';
|
import {
|
||||||
|
Component,
|
||||||
|
ComponentRef,
|
||||||
|
ElementRef,
|
||||||
|
OnDestroy,
|
||||||
|
OnInit,
|
||||||
|
ViewChild,
|
||||||
|
} from '@angular/core';
|
||||||
|
|
||||||
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
||||||
import { BitstreamDataService } from '../../../../../core/data/bitstream-data.service';
|
import { BitstreamDataService } from '../../../../../core/data/bitstream-data.service';
|
||||||
@@ -6,30 +13,25 @@ import { Context } from '../../../../../core/shared/context.model';
|
|||||||
import { GenericConstructor } from '../../../../../core/shared/generic-constructor';
|
import { GenericConstructor } from '../../../../../core/shared/generic-constructor';
|
||||||
import { Item } from '../../../../../core/shared/item.model';
|
import { Item } from '../../../../../core/shared/item.model';
|
||||||
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
||||||
import {
|
import { DynamicComponentLoaderDirective } from '../../../../../shared/abstract-component-loader/dynamic-component-loader.directive';
|
||||||
DynamicComponentLoaderDirective
|
|
||||||
} from '../../../../../shared/abstract-component-loader/dynamic-component-loader.directive';
|
|
||||||
import { hasValue } from '../../../../../shared/empty.util';
|
import { hasValue } from '../../../../../shared/empty.util';
|
||||||
import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model';
|
import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model';
|
||||||
import {
|
import {
|
||||||
getListableObjectComponent,
|
getListableObjectComponent,
|
||||||
listableObjectComponent,
|
listableObjectComponent,
|
||||||
} from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
|
} from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
|
||||||
|
import { SearchResultGridElementComponent } from '../../../../../shared/object-grid/search-result-grid-element/search-result-grid-element.component';
|
||||||
import {
|
|
||||||
SearchResultGridElementComponent
|
|
||||||
} from '../../../../../shared/object-grid/search-result-grid-element/search-result-grid-element.component';
|
|
||||||
import { ThemeService } from '../../../../../shared/theme-support/theme.service';
|
import { ThemeService } from '../../../../../shared/theme-support/theme.service';
|
||||||
import { ItemAdminSearchResultActionsComponent } from '../../item-admin-search-result-actions.component';
|
|
||||||
import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
|
import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
|
||||||
|
import { ItemAdminSearchResultActionsComponent } from '../../item-admin-search-result-actions.component';
|
||||||
|
|
||||||
@listableObjectComponent(ItemSearchResult, ViewMode.GridElement, Context.AdminSearch)
|
@listableObjectComponent(ItemSearchResult, ViewMode.GridElement, Context.AdminSearch)
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-item-admin-search-result-grid-element',
|
selector: 'ds-item-admin-search-result-grid-element',
|
||||||
styleUrls: ['./item-admin-search-result-grid-element.component.scss'],
|
styleUrls: ['./item-admin-search-result-grid-element.component.scss'],
|
||||||
templateUrl: './item-admin-search-result-grid-element.component.html',
|
templateUrl: './item-admin-search-result-grid-element.component.html',
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [ItemAdminSearchResultActionsComponent, DynamicComponentLoaderDirective]
|
imports: [ItemAdminSearchResultActionsComponent, DynamicComponentLoaderDirective],
|
||||||
})
|
})
|
||||||
/**
|
/**
|
||||||
* The component for displaying a list element for an item search result on the admin search page
|
* The component for displaying a list element for an item search result on the admin search page
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import {
|
import {
|
||||||
|
|
||||||
ComponentFixture,
|
ComponentFixture,
|
||||||
TestBed,
|
TestBed,
|
||||||
waitForAsync,
|
waitForAsync,
|
||||||
@@ -16,13 +15,13 @@ import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service
|
|||||||
import { Collection } from '../../../../../core/shared/collection.model';
|
import { Collection } from '../../../../../core/shared/collection.model';
|
||||||
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
||||||
import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock';
|
import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock';
|
||||||
import { CollectionElementLinkType } from '../../../../../shared/object-collection/collection-element-link.type';
|
|
||||||
import { CollectionSearchResult } from '../../../../../shared/object-collection/shared/collection-search-result.model';
|
|
||||||
import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
|
|
||||||
import { CollectionAdminSearchResultListElementComponent } from './collection-admin-search-result-list-element.component';
|
|
||||||
import { mockTruncatableService } from '../../../../../shared/mocks/mock-trucatable.service';
|
import { mockTruncatableService } from '../../../../../shared/mocks/mock-trucatable.service';
|
||||||
import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock';
|
import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock';
|
||||||
|
import { CollectionElementLinkType } from '../../../../../shared/object-collection/collection-element-link.type';
|
||||||
|
import { CollectionSearchResult } from '../../../../../shared/object-collection/shared/collection-search-result.model';
|
||||||
import { ThemeService } from '../../../../../shared/theme-support/theme.service';
|
import { ThemeService } from '../../../../../shared/theme-support/theme.service';
|
||||||
|
import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
|
||||||
|
import { CollectionAdminSearchResultListElementComponent } from './collection-admin-search-result-list-element.component';
|
||||||
|
|
||||||
describe('CollectionAdminSearchResultListElementComponent', () => {
|
describe('CollectionAdminSearchResultListElementComponent', () => {
|
||||||
let component: CollectionAdminSearchResultListElementComponent;
|
let component: CollectionAdminSearchResultListElementComponent;
|
||||||
@@ -40,19 +39,19 @@ describe('CollectionAdminSearchResultListElementComponent', () => {
|
|||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
init();
|
init();
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [
|
||||||
TranslateModule.forRoot(),
|
TranslateModule.forRoot(),
|
||||||
RouterTestingModule.withRoutes([]),
|
RouterTestingModule.withRoutes([]),
|
||||||
CollectionAdminSearchResultListElementComponent
|
CollectionAdminSearchResultListElementComponent,
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: TruncatableService, useValue: mockTruncatableService },
|
{ provide: TruncatableService, useValue: mockTruncatableService },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock },
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
{ provide: APP_CONFIG, useValue: environment },
|
{ provide: APP_CONFIG, useValue: environment },
|
||||||
{ provide: ThemeService, useValue: getMockThemeService() }
|
{ provide: ThemeService, useValue: getMockThemeService() },
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA],
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@@ -1,33 +1,41 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
import { RouterLink } from '@angular/router';
|
||||||
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
|
|
||||||
import { getCollectionEditRoute } from '../../../../../collection-page/collection-page-routing-paths';
|
import {
|
||||||
import { Collection } from '../../../../../core/shared/collection.model';
|
getCollectionEditRoute,
|
||||||
import { Context } from '../../../../../core/shared/context.model';
|
getCollectionEditRoute,
|
||||||
|
} from '../../../../../collection-page/collection-page-routing-paths';
|
||||||
|
import {
|
||||||
|
Collection,
|
||||||
|
Collection,
|
||||||
|
} from '../../../../../core/shared/collection.model';
|
||||||
|
import {
|
||||||
|
Context,
|
||||||
|
Context,
|
||||||
|
} from '../../../../../core/shared/context.model';
|
||||||
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
||||||
import {
|
import {
|
||||||
listableObjectComponent
|
CollectionSearchResult,
|
||||||
} from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
|
CollectionSearchResult,
|
||||||
import { Context } from '../../../../../core/shared/context.model';
|
} from '../../../../../shared/object-collection/shared/collection-search-result.model';
|
||||||
import {
|
import {
|
||||||
SearchResultListElementComponent
|
listableObjectComponent,
|
||||||
} from '../../../../../shared/object-list/search-result-list-element/search-result-list-element.component';
|
listableObjectComponent,
|
||||||
import { CollectionSearchResult } from '../../../../../shared/object-collection/shared/collection-search-result.model';
|
} from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
|
||||||
import { Collection } from '../../../../../core/shared/collection.model';
|
|
||||||
import { getCollectionEditRoute } from '../../../../../collection-page/collection-page-routing-paths';
|
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
|
||||||
import { RouterLink } from '@angular/router';
|
|
||||||
import { CollectionSearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component';
|
import { CollectionSearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component';
|
||||||
import { CollectionSearchResult } from '../../../../../shared/object-collection/shared/collection-search-result.model';
|
import {
|
||||||
import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
|
SearchResultListElementComponent,
|
||||||
import { SearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/search-result-list-element.component';
|
SearchResultListElementComponent,
|
||||||
|
} from '../../../../../shared/object-list/search-result-list-element/search-result-list-element.component';
|
||||||
|
|
||||||
@listableObjectComponent(CollectionSearchResult, ViewMode.ListElement, Context.AdminSearch)
|
@listableObjectComponent(CollectionSearchResult, ViewMode.ListElement, Context.AdminSearch)
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-collection-admin-search-result-list-element',
|
selector: 'ds-collection-admin-search-result-list-element',
|
||||||
styleUrls: ['./collection-admin-search-result-list-element.component.scss'],
|
styleUrls: ['./collection-admin-search-result-list-element.component.scss'],
|
||||||
templateUrl: './collection-admin-search-result-list-element.component.html',
|
templateUrl: './collection-admin-search-result-list-element.component.html',
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [CollectionSearchResultListElementComponent, RouterLink, TranslateModule]
|
imports: [CollectionSearchResultListElementComponent, RouterLink, TranslateModule],
|
||||||
})
|
})
|
||||||
/**
|
/**
|
||||||
* The component for displaying a list element for a collection search result on the admin search page
|
* The component for displaying a list element for a collection search result on the admin search page
|
||||||
|
@@ -15,11 +15,11 @@ import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service
|
|||||||
import { Community } from '../../../../../core/shared/community.model';
|
import { Community } from '../../../../../core/shared/community.model';
|
||||||
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
||||||
import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock';
|
import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock';
|
||||||
|
import { mockTruncatableService } from '../../../../../shared/mocks/mock-trucatable.service';
|
||||||
import { CollectionElementLinkType } from '../../../../../shared/object-collection/collection-element-link.type';
|
import { CollectionElementLinkType } from '../../../../../shared/object-collection/collection-element-link.type';
|
||||||
import { CommunitySearchResult } from '../../../../../shared/object-collection/shared/community-search-result.model';
|
import { CommunitySearchResult } from '../../../../../shared/object-collection/shared/community-search-result.model';
|
||||||
import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
|
import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
|
||||||
import { CommunityAdminSearchResultListElementComponent } from './community-admin-search-result-list-element.component';
|
import { CommunityAdminSearchResultListElementComponent } from './community-admin-search-result-list-element.component';
|
||||||
import { mockTruncatableService } from '../../../../../shared/mocks/mock-trucatable.service';
|
|
||||||
|
|
||||||
describe('CommunityAdminSearchResultListElementComponent', () => {
|
describe('CommunityAdminSearchResultListElementComponent', () => {
|
||||||
let component: CommunityAdminSearchResultListElementComponent;
|
let component: CommunityAdminSearchResultListElementComponent;
|
||||||
@@ -37,18 +37,18 @@ describe('CommunityAdminSearchResultListElementComponent', () => {
|
|||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
init();
|
init();
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [
|
||||||
TranslateModule.forRoot(),
|
TranslateModule.forRoot(),
|
||||||
RouterTestingModule.withRoutes([]),
|
RouterTestingModule.withRoutes([]),
|
||||||
CommunityAdminSearchResultListElementComponent
|
CommunityAdminSearchResultListElementComponent,
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: TruncatableService, useValue: mockTruncatableService },
|
{ provide: TruncatableService, useValue: mockTruncatableService },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock },
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
{ provide: APP_CONFIG, useValue: environment }
|
{ provide: APP_CONFIG, useValue: environment },
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA],
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@@ -1,33 +1,41 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
import { RouterLink } from '@angular/router';
|
||||||
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
|
|
||||||
import { getCommunityEditRoute } from '../../../../../community-page/community-page-routing-paths';
|
import {
|
||||||
import { Community } from '../../../../../core/shared/community.model';
|
getCommunityEditRoute,
|
||||||
import { Context } from '../../../../../core/shared/context.model';
|
getCommunityEditRoute,
|
||||||
|
} from '../../../../../community-page/community-page-routing-paths';
|
||||||
|
import {
|
||||||
|
Community,
|
||||||
|
Community,
|
||||||
|
} from '../../../../../core/shared/community.model';
|
||||||
|
import {
|
||||||
|
Context,
|
||||||
|
Context,
|
||||||
|
} from '../../../../../core/shared/context.model';
|
||||||
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
||||||
import {
|
import {
|
||||||
listableObjectComponent
|
CommunitySearchResult,
|
||||||
} from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
|
CommunitySearchResult,
|
||||||
import { Context } from '../../../../../core/shared/context.model';
|
} from '../../../../../shared/object-collection/shared/community-search-result.model';
|
||||||
import {
|
import {
|
||||||
SearchResultListElementComponent
|
listableObjectComponent,
|
||||||
} from '../../../../../shared/object-list/search-result-list-element/search-result-list-element.component';
|
listableObjectComponent,
|
||||||
import { CommunitySearchResult } from '../../../../../shared/object-collection/shared/community-search-result.model';
|
} from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
|
||||||
import { Community } from '../../../../../core/shared/community.model';
|
|
||||||
import { getCommunityEditRoute } from '../../../../../community-page/community-page-routing-paths';
|
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
|
||||||
import { RouterLink } from '@angular/router';
|
|
||||||
import { CommunitySearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component';
|
import { CommunitySearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/community-search-result/community-search-result-list-element.component';
|
||||||
import { CommunitySearchResult } from '../../../../../shared/object-collection/shared/community-search-result.model';
|
import {
|
||||||
import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
|
SearchResultListElementComponent,
|
||||||
import { SearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/search-result-list-element.component';
|
SearchResultListElementComponent,
|
||||||
|
} from '../../../../../shared/object-list/search-result-list-element/search-result-list-element.component';
|
||||||
|
|
||||||
@listableObjectComponent(CommunitySearchResult, ViewMode.ListElement, Context.AdminSearch)
|
@listableObjectComponent(CommunitySearchResult, ViewMode.ListElement, Context.AdminSearch)
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-community-admin-search-result-list-element',
|
selector: 'ds-community-admin-search-result-list-element',
|
||||||
styleUrls: ['./community-admin-search-result-list-element.component.scss'],
|
styleUrls: ['./community-admin-search-result-list-element.component.scss'],
|
||||||
templateUrl: './community-admin-search-result-list-element.component.html',
|
templateUrl: './community-admin-search-result-list-element.component.html',
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [CommunitySearchResultListElementComponent, RouterLink, TranslateModule]
|
imports: [CommunitySearchResultListElementComponent, RouterLink, TranslateModule],
|
||||||
})
|
})
|
||||||
/**
|
/**
|
||||||
* The component for displaying a list element for a community search result on the admin search page
|
* The component for displaying a list element for a community search result on the admin search page
|
||||||
|
@@ -1,5 +1,9 @@
|
|||||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing';
|
import {
|
||||||
|
ComponentFixture,
|
||||||
|
TestBed,
|
||||||
|
waitForAsync,
|
||||||
|
} from '@angular/core/testing';
|
||||||
import { RouterTestingModule } from '@angular/router/testing';
|
import { RouterTestingModule } from '@angular/router/testing';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
|
|
||||||
@@ -9,15 +13,13 @@ import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service
|
|||||||
import { Item } from '../../../../../core/shared/item.model';
|
import { Item } from '../../../../../core/shared/item.model';
|
||||||
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
||||||
import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock';
|
import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock';
|
||||||
|
import { mockTruncatableService } from '../../../../../shared/mocks/mock-trucatable.service';
|
||||||
import { CollectionElementLinkType } from '../../../../../shared/object-collection/collection-element-link.type';
|
import { CollectionElementLinkType } from '../../../../../shared/object-collection/collection-element-link.type';
|
||||||
import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model';
|
import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model';
|
||||||
|
import { ListableObjectComponentLoaderComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object-component-loader.component';
|
||||||
import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
|
import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
|
||||||
import { ItemAdminSearchResultListElementComponent } from './item-admin-search-result-list-element.component';
|
|
||||||
import { mockTruncatableService } from '../../../../../shared/mocks/mock-trucatable.service';
|
|
||||||
import {
|
|
||||||
ListableObjectComponentLoaderComponent
|
|
||||||
} from '../../../../../shared/object-collection/shared/listable-object/listable-object-component-loader.component';
|
|
||||||
import { ItemAdminSearchResultActionsComponent } from '../../item-admin-search-result-actions.component';
|
import { ItemAdminSearchResultActionsComponent } from '../../item-admin-search-result-actions.component';
|
||||||
|
import { ItemAdminSearchResultListElementComponent } from './item-admin-search-result-list-element.component';
|
||||||
|
|
||||||
describe('ItemAdminSearchResultListElementComponent', () => {
|
describe('ItemAdminSearchResultListElementComponent', () => {
|
||||||
let component: ItemAdminSearchResultListElementComponent;
|
let component: ItemAdminSearchResultListElementComponent;
|
||||||
@@ -35,20 +37,20 @@ describe('ItemAdminSearchResultListElementComponent', () => {
|
|||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
init();
|
init();
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [
|
||||||
TranslateModule.forRoot(),
|
TranslateModule.forRoot(),
|
||||||
RouterTestingModule.withRoutes([]),
|
RouterTestingModule.withRoutes([]),
|
||||||
ItemAdminSearchResultListElementComponent
|
ItemAdminSearchResultListElementComponent,
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: TruncatableService, useValue: mockTruncatableService },
|
{ provide: TruncatableService, useValue: mockTruncatableService },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock },
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
{ provide: APP_CONFIG, useValue: environment }
|
{ provide: APP_CONFIG, useValue: environment },
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA],
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
})
|
})
|
||||||
.overrideComponent(ItemAdminSearchResultListElementComponent, {
|
.overrideComponent(ItemAdminSearchResultListElementComponent, {
|
||||||
remove: { imports: [ListableObjectComponentLoaderComponent, ItemAdminSearchResultActionsComponent]}
|
remove: { imports: [ListableObjectComponentLoaderComponent, ItemAdminSearchResultActionsComponent] },
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
}));
|
}));
|
||||||
|
@@ -1,27 +1,27 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
import { Context } from '../../../../../core/shared/context.model';
|
import {
|
||||||
|
Context,
|
||||||
|
Context,
|
||||||
|
} from '../../../../../core/shared/context.model';
|
||||||
import { Item } from '../../../../../core/shared/item.model';
|
import { Item } from '../../../../../core/shared/item.model';
|
||||||
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
||||||
import {
|
|
||||||
listableObjectComponent
|
|
||||||
} from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
|
|
||||||
import { Context } from '../../../../../core/shared/context.model';
|
|
||||||
import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model';
|
import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model';
|
||||||
import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
|
|
||||||
import {
|
import {
|
||||||
SearchResultListElementComponent
|
listableObjectComponent,
|
||||||
} from '../../../../../shared/object-list/search-result-list-element/search-result-list-element.component';
|
listableObjectComponent,
|
||||||
import { ItemAdminSearchResultActionsComponent } from '../../item-admin-search-result-actions.component';
|
} from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
|
||||||
import { ListableObjectComponentLoaderComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object-component-loader.component';
|
import { ListableObjectComponentLoaderComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object-component-loader.component';
|
||||||
|
import { SearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/search-result-list-element.component';
|
||||||
|
import { ItemAdminSearchResultActionsComponent } from '../../item-admin-search-result-actions.component';
|
||||||
|
|
||||||
@listableObjectComponent(ItemSearchResult, ViewMode.ListElement, Context.AdminSearch)
|
@listableObjectComponent(ItemSearchResult, ViewMode.ListElement, Context.AdminSearch)
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-item-admin-search-result-list-element',
|
selector: 'ds-item-admin-search-result-list-element',
|
||||||
styleUrls: ['./item-admin-search-result-list-element.component.scss'],
|
styleUrls: ['./item-admin-search-result-list-element.component.scss'],
|
||||||
templateUrl: './item-admin-search-result-list-element.component.html',
|
templateUrl: './item-admin-search-result-list-element.component.html',
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [ListableObjectComponentLoaderComponent, ItemAdminSearchResultActionsComponent]
|
imports: [ListableObjectComponentLoaderComponent, ItemAdminSearchResultActionsComponent],
|
||||||
})
|
})
|
||||||
/**
|
/**
|
||||||
* The component for displaying a list element for an item search result on the admin search page
|
* The component for displaying a list element for an item search result on the admin search page
|
||||||
|
@@ -36,13 +36,13 @@ describe('ItemAdminSearchResultActionsComponent', () => {
|
|||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
init();
|
init();
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [
|
||||||
TranslateModule.forRoot(),
|
TranslateModule.forRoot(),
|
||||||
RouterTestingModule.withRoutes([]),
|
RouterTestingModule.withRoutes([]),
|
||||||
ItemAdminSearchResultActionsComponent
|
ItemAdminSearchResultActionsComponent,
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA],
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@@ -1,7 +1,13 @@
|
|||||||
|
import {
|
||||||
|
NgClass,
|
||||||
|
NgIf,
|
||||||
|
} from '@angular/common';
|
||||||
import {
|
import {
|
||||||
Component,
|
Component,
|
||||||
Input,
|
Input,
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
import { RouterLink } from '@angular/router';
|
||||||
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
|
|
||||||
import { Item } from '../../../core/shared/item.model';
|
import { Item } from '../../../core/shared/item.model';
|
||||||
import { URLCombiner } from '../../../core/url-combiner/url-combiner';
|
import { URLCombiner } from '../../../core/url-combiner/url-combiner';
|
||||||
@@ -13,17 +19,14 @@ import {
|
|||||||
ITEM_EDIT_REINSTATE_PATH,
|
ITEM_EDIT_REINSTATE_PATH,
|
||||||
ITEM_EDIT_WITHDRAW_PATH,
|
ITEM_EDIT_WITHDRAW_PATH,
|
||||||
} from '../../../item-page/edit-item-page/edit-item-page.routing-paths';
|
} from '../../../item-page/edit-item-page/edit-item-page.routing-paths';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
|
||||||
import { RouterLink } from '@angular/router';
|
|
||||||
import { NgClass, NgIf } from '@angular/common';
|
|
||||||
import { getItemEditRoute } from '../../../item-page/item-page-routing-paths';
|
import { getItemEditRoute } from '../../../item-page/item-page-routing-paths';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-item-admin-search-result-actions-element',
|
selector: 'ds-item-admin-search-result-actions-element',
|
||||||
styleUrls: ['./item-admin-search-result-actions.component.scss'],
|
styleUrls: ['./item-admin-search-result-actions.component.scss'],
|
||||||
templateUrl: './item-admin-search-result-actions.component.html',
|
templateUrl: './item-admin-search-result-actions.component.html',
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [NgClass, RouterLink, NgIf, TranslateModule]
|
imports: [NgClass, RouterLink, NgIf, TranslateModule],
|
||||||
})
|
})
|
||||||
/**
|
/**
|
||||||
* The component for displaying the actions for a list element for an item search result on the admin search page
|
* The component for displaying the actions for a list element for an item search result on the admin search page
|
||||||
|
@@ -25,13 +25,13 @@ describe('AdminSidebarSectionComponent', () => {
|
|||||||
|
|
||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [NoopAnimationsModule, RouterTestingModule, TranslateModule.forRoot(), AdminSidebarSectionComponent, TestComponent],
|
imports: [NoopAnimationsModule, RouterTestingModule, TranslateModule.forRoot(), AdminSidebarSectionComponent, TestComponent],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: 'sectionDataProvider', useValue: { model: { link: 'google.com' }, icon: iconString } },
|
{ provide: 'sectionDataProvider', useValue: { model: { link: 'google.com' }, icon: iconString } },
|
||||||
{ provide: MenuService, useValue: menuService },
|
{ provide: MenuService, useValue: menuService },
|
||||||
{ provide: CSSVariableService, useClass: CSSVariableServiceStub },
|
{ provide: CSSVariableService, useClass: CSSVariableServiceStub },
|
||||||
],
|
],
|
||||||
}).overrideComponent(AdminSidebarSectionComponent, {
|
}).overrideComponent(AdminSidebarSectionComponent, {
|
||||||
set: {
|
set: {
|
||||||
entryComponents: [TestComponent],
|
entryComponents: [TestComponent],
|
||||||
},
|
},
|
||||||
@@ -64,13 +64,13 @@ describe('AdminSidebarSectionComponent', () => {
|
|||||||
|
|
||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [NoopAnimationsModule, RouterTestingModule, TranslateModule.forRoot(), AdminSidebarSectionComponent, TestComponent],
|
imports: [NoopAnimationsModule, RouterTestingModule, TranslateModule.forRoot(), AdminSidebarSectionComponent, TestComponent],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: 'sectionDataProvider', useValue: { model: { link: 'google.com', disabled: true }, icon: iconString } },
|
{ provide: 'sectionDataProvider', useValue: { model: { link: 'google.com', disabled: true }, icon: iconString } },
|
||||||
{ provide: MenuService, useValue: menuService },
|
{ provide: MenuService, useValue: menuService },
|
||||||
{ provide: CSSVariableService, useClass: CSSVariableServiceStub },
|
{ provide: CSSVariableService, useClass: CSSVariableServiceStub },
|
||||||
],
|
],
|
||||||
}).overrideComponent(AdminSidebarSectionComponent, {
|
}).overrideComponent(AdminSidebarSectionComponent, {
|
||||||
set: {
|
set: {
|
||||||
entryComponents: [TestComponent],
|
entryComponents: [TestComponent],
|
||||||
},
|
},
|
||||||
@@ -103,10 +103,10 @@ describe('AdminSidebarSectionComponent', () => {
|
|||||||
|
|
||||||
// declare a test component
|
// declare a test component
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-test-cmp',
|
selector: 'ds-test-cmp',
|
||||||
template: ``,
|
template: ``,
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [RouterTestingModule]
|
imports: [RouterTestingModule],
|
||||||
})
|
})
|
||||||
class TestComponent {
|
class TestComponent {
|
||||||
}
|
}
|
||||||
|
@@ -1,21 +1,25 @@
|
|||||||
|
import { NgClass } from '@angular/common';
|
||||||
import {
|
import {
|
||||||
Component,
|
Component,
|
||||||
Inject,
|
Inject,
|
||||||
Injector,
|
Injector,
|
||||||
OnInit,
|
OnInit,
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import { Router } from '@angular/router';
|
import {
|
||||||
|
Router,
|
||||||
import { isEmpty } from '../../../shared/empty.util';
|
Router,
|
||||||
import { MenuService } from '../../../shared/menu/menu.service';
|
RouterLink,
|
||||||
import { LinkMenuItemModel } from '../../../shared/menu/menu-item/models/link.model';
|
} from '@angular/router';
|
||||||
import { rendersSectionForMenu } from '../../../shared/menu/menu-section.decorator';
|
|
||||||
import { MenuSection } from '../../../shared/menu/menu-section.model';
|
|
||||||
import { MenuID } from '../../../shared/menu/menu-id.model';
|
|
||||||
import { isEmpty } from '../../../shared/empty.util';
|
|
||||||
import { Router, RouterLink } from '@angular/router';
|
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { NgClass } from '@angular/common';
|
|
||||||
|
import {
|
||||||
|
isEmpty,
|
||||||
|
isEmpty,
|
||||||
|
} from '../../../shared/empty.util';
|
||||||
|
import { MenuService } from '../../../shared/menu/menu.service';
|
||||||
|
import { MenuID } from '../../../shared/menu/menu-id.model';
|
||||||
|
import { LinkMenuItemModel } from '../../../shared/menu/menu-item/models/link.model';
|
||||||
|
import { MenuSection } from '../../../shared/menu/menu-section.model';
|
||||||
import { MenuSectionComponent } from '../../../shared/menu/menu-section/menu-section.component';
|
import { MenuSectionComponent } from '../../../shared/menu/menu-section/menu-section.component';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -26,7 +30,7 @@ import { MenuSectionComponent } from '../../../shared/menu/menu-section/menu-sec
|
|||||||
templateUrl: './admin-sidebar-section.component.html',
|
templateUrl: './admin-sidebar-section.component.html',
|
||||||
styleUrls: ['./admin-sidebar-section.component.scss'],
|
styleUrls: ['./admin-sidebar-section.component.scss'],
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [NgClass, RouterLink, TranslateModule]
|
imports: [NgClass, RouterLink, TranslateModule],
|
||||||
|
|
||||||
})
|
})
|
||||||
export class AdminSidebarSectionComponent extends MenuSectionComponent implements OnInit {
|
export class AdminSidebarSectionComponent extends MenuSectionComponent implements OnInit {
|
||||||
|
@@ -10,35 +10,56 @@ import {
|
|||||||
tick,
|
tick,
|
||||||
waitForAsync,
|
waitForAsync,
|
||||||
} from '@angular/core/testing';
|
} from '@angular/core/testing';
|
||||||
import { By } from '@angular/platform-browser';
|
import {
|
||||||
|
By,
|
||||||
|
By,
|
||||||
|
} from '@angular/platform-browser';
|
||||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||||
import { ActivatedRoute } from '@angular/router';
|
import {
|
||||||
import { RouterTestingModule } from '@angular/router/testing';
|
ActivatedRoute,
|
||||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
ActivatedRoute,
|
||||||
|
} from '@angular/router';
|
||||||
|
import {
|
||||||
|
RouterTestingModule,
|
||||||
|
RouterTestingModule,
|
||||||
|
} from '@angular/router/testing';
|
||||||
|
import {
|
||||||
|
NgbModal,
|
||||||
|
NgbModal,
|
||||||
|
NgbModalRef,
|
||||||
|
} from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { of as observableOf } from 'rxjs';
|
import {
|
||||||
|
of as observableOf,
|
||||||
|
of as observableOf,
|
||||||
|
} from 'rxjs';
|
||||||
|
|
||||||
import { AuthService } from '../../core/auth/auth.service';
|
import {
|
||||||
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
|
AuthService,
|
||||||
|
AuthService,
|
||||||
|
} from '../../core/auth/auth.service';
|
||||||
|
import {
|
||||||
|
AuthorizationDataService,
|
||||||
|
AuthorizationDataService,
|
||||||
|
} from '../../core/data/feature-authorization/authorization-data.service';
|
||||||
import { ScriptDataService } from '../../core/data/processes/script-data.service';
|
import { ScriptDataService } from '../../core/data/processes/script-data.service';
|
||||||
import { Item } from '../../core/shared/item.model';
|
import {
|
||||||
|
Item,
|
||||||
|
Item,
|
||||||
|
} from '../../core/shared/item.model';
|
||||||
import { MenuService } from '../../shared/menu/menu.service';
|
import { MenuService } from '../../shared/menu/menu.service';
|
||||||
import { getMockThemeService } from '../../shared/mocks/theme-service.mock';
|
import { getMockThemeService } from '../../shared/mocks/theme-service.mock';
|
||||||
import { createSuccessfulRemoteDataObject } from '../../shared/remote-data.utils';
|
import {
|
||||||
|
createSuccessfulRemoteDataObject,
|
||||||
|
createSuccessfulRemoteDataObject,
|
||||||
|
} from '../../shared/remote-data.utils';
|
||||||
import { CSSVariableService } from '../../shared/sass-helper/css-variable.service';
|
import { CSSVariableService } from '../../shared/sass-helper/css-variable.service';
|
||||||
import { AuthServiceStub } from '../../shared/testing/auth-service.stub';
|
import {
|
||||||
|
AuthServiceStub,
|
||||||
|
AuthServiceStub,
|
||||||
|
} from '../../shared/testing/auth-service.stub';
|
||||||
import { CSSVariableServiceStub } from '../../shared/testing/css-variable-service.stub';
|
import { CSSVariableServiceStub } from '../../shared/testing/css-variable-service.stub';
|
||||||
import { AuthServiceStub } from '../../shared/testing/auth-service.stub';
|
|
||||||
import { AuthService } from '../../core/auth/auth.service';
|
|
||||||
import { of as observableOf } from 'rxjs';
|
|
||||||
import { By } from '@angular/platform-browser';
|
|
||||||
import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
|
|
||||||
import { RouterTestingModule } from '@angular/router/testing';
|
|
||||||
import { ActivatedRoute } from '@angular/router';
|
|
||||||
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
|
|
||||||
import createSpy = jasmine.createSpy;
|
import createSpy = jasmine.createSpy;
|
||||||
import { createSuccessfulRemoteDataObject } from '../../shared/remote-data.utils';
|
|
||||||
import { Item } from '../../core/shared/item.model';
|
|
||||||
import { MenuServiceStub } from '../../shared/testing/menu-service.stub';
|
import { MenuServiceStub } from '../../shared/testing/menu-service.stub';
|
||||||
import { ThemeService } from '../../shared/theme-support/theme.service';
|
import { ThemeService } from '../../shared/theme-support/theme.service';
|
||||||
import { AdminSidebarComponent } from './admin-sidebar.component';
|
import { AdminSidebarComponent } from './admin-sidebar.component';
|
||||||
@@ -73,8 +94,8 @@ describe('AdminSidebarComponent', () => {
|
|||||||
|
|
||||||
const mockNgbModal = {
|
const mockNgbModal = {
|
||||||
open: jasmine.createSpy('open').and.returnValue(
|
open: jasmine.createSpy('open').and.returnValue(
|
||||||
{ componentInstance: {}, closed: observableOf({})} as NgbModalRef
|
{ componentInstance: {}, closed: observableOf({}) } as NgbModalRef,
|
||||||
)
|
),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -84,8 +105,8 @@ describe('AdminSidebarComponent', () => {
|
|||||||
});
|
});
|
||||||
scriptService = jasmine.createSpyObj('scriptService', { scriptWithNameExistsAndCanExecute: observableOf(true) });
|
scriptService = jasmine.createSpyObj('scriptService', { scriptWithNameExistsAndCanExecute: observableOf(true) });
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [TranslateModule.forRoot(), NoopAnimationsModule, RouterTestingModule, AdminSidebarComponent],
|
imports: [TranslateModule.forRoot(), NoopAnimationsModule, RouterTestingModule, AdminSidebarComponent],
|
||||||
providers: [
|
providers: [
|
||||||
Injector,
|
Injector,
|
||||||
{ provide: ThemeService, useValue: getMockThemeService() },
|
{ provide: ThemeService, useValue: getMockThemeService() },
|
||||||
{ provide: MenuService, useValue: menuService },
|
{ provide: MenuService, useValue: menuService },
|
||||||
@@ -95,10 +116,10 @@ describe('AdminSidebarComponent', () => {
|
|||||||
{ provide: AuthorizationDataService, useValue: authorizationService },
|
{ provide: AuthorizationDataService, useValue: authorizationService },
|
||||||
{ provide: ScriptDataService, useValue: scriptService },
|
{ provide: ScriptDataService, useValue: scriptService },
|
||||||
{ provide: ActivatedRoute, useValue: routeStub },
|
{ provide: ActivatedRoute, useValue: routeStub },
|
||||||
{ provide: NgbModal, useValue: mockNgbModal }
|
{ provide: NgbModal, useValue: mockNgbModal },
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA],
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
}).overrideComponent(AdminSidebarComponent, {
|
}).overrideComponent(AdminSidebarComponent, {
|
||||||
set: {
|
set: {
|
||||||
changeDetection: ChangeDetectionStrategy.Default,
|
changeDetection: ChangeDetectionStrategy.Default,
|
||||||
},
|
},
|
||||||
|
@@ -1,3 +1,10 @@
|
|||||||
|
import {
|
||||||
|
AsyncPipe,
|
||||||
|
NgClass,
|
||||||
|
NgComponentOutlet,
|
||||||
|
NgFor,
|
||||||
|
NgIf,
|
||||||
|
} from '@angular/common';
|
||||||
import {
|
import {
|
||||||
Component,
|
Component,
|
||||||
HostListener,
|
HostListener,
|
||||||
@@ -6,6 +13,8 @@ import {
|
|||||||
OnInit,
|
OnInit,
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
|
||||||
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import {
|
import {
|
||||||
BehaviorSubject,
|
BehaviorSubject,
|
||||||
combineLatest,
|
combineLatest,
|
||||||
@@ -27,20 +36,17 @@ import { MenuService } from '../../shared/menu/menu.service';
|
|||||||
import { MenuID } from '../../shared/menu/menu-id.model';
|
import { MenuID } from '../../shared/menu/menu-id.model';
|
||||||
import { CSSVariableService } from '../../shared/sass-helper/css-variable.service';
|
import { CSSVariableService } from '../../shared/sass-helper/css-variable.service';
|
||||||
import { ThemeService } from '../../shared/theme-support/theme.service';
|
import { ThemeService } from '../../shared/theme-support/theme.service';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
|
||||||
import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
|
|
||||||
import { NgIf, NgClass, NgFor, NgComponentOutlet, AsyncPipe } from '@angular/common';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component representing the admin sidebar
|
* Component representing the admin sidebar
|
||||||
*/
|
*/
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-admin-sidebar',
|
selector: 'ds-admin-sidebar',
|
||||||
templateUrl: './admin-sidebar.component.html',
|
templateUrl: './admin-sidebar.component.html',
|
||||||
styleUrls: ['./admin-sidebar.component.scss'],
|
styleUrls: ['./admin-sidebar.component.scss'],
|
||||||
animations: [slideSidebar],
|
animations: [slideSidebar],
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [NgIf, NgbDropdownModule, NgClass, NgFor, NgComponentOutlet, AsyncPipe, TranslateModule]
|
imports: [NgIf, NgbDropdownModule, NgClass, NgFor, NgComponentOutlet, AsyncPipe, TranslateModule],
|
||||||
})
|
})
|
||||||
export class AdminSidebarComponent extends MenuComponent implements OnInit {
|
export class AdminSidebarComponent extends MenuComponent implements OnInit {
|
||||||
/**
|
/**
|
||||||
|
@@ -24,14 +24,14 @@ describe('ExpandableAdminSidebarSectionComponent', () => {
|
|||||||
const iconString = 'test';
|
const iconString = 'test';
|
||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [NoopAnimationsModule, TranslateModule.forRoot(), ExpandableAdminSidebarSectionComponent, TestComponent],
|
imports: [NoopAnimationsModule, TranslateModule.forRoot(), ExpandableAdminSidebarSectionComponent, TestComponent],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: 'sectionDataProvider', useValue: { icon: iconString, model: {} } },
|
{ provide: 'sectionDataProvider', useValue: { icon: iconString, model: {} } },
|
||||||
{ provide: MenuService, useValue: menuService },
|
{ provide: MenuService, useValue: menuService },
|
||||||
{ provide: CSSVariableService, useClass: CSSVariableServiceStub },
|
{ provide: CSSVariableService, useClass: CSSVariableServiceStub },
|
||||||
{ provide: Router, useValue: new RouterStub() },
|
{ provide: Router, useValue: new RouterStub() },
|
||||||
],
|
],
|
||||||
}).overrideComponent(ExpandableAdminSidebarSectionComponent, {
|
}).overrideComponent(ExpandableAdminSidebarSectionComponent, {
|
||||||
set: {
|
set: {
|
||||||
entryComponents: [TestComponent],
|
entryComponents: [TestComponent],
|
||||||
},
|
},
|
||||||
@@ -74,9 +74,9 @@ describe('ExpandableAdminSidebarSectionComponent', () => {
|
|||||||
|
|
||||||
// declare a test component
|
// declare a test component
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-test-cmp',
|
selector: 'ds-test-cmp',
|
||||||
template: ``,
|
template: ``,
|
||||||
standalone: true
|
standalone: true,
|
||||||
})
|
})
|
||||||
class TestComponent {
|
class TestComponent {
|
||||||
}
|
}
|
||||||
|
@@ -1,3 +1,10 @@
|
|||||||
|
import {
|
||||||
|
AsyncPipe,
|
||||||
|
NgClass,
|
||||||
|
NgComponentOutlet,
|
||||||
|
NgFor,
|
||||||
|
NgIf,
|
||||||
|
} from '@angular/common';
|
||||||
import {
|
import {
|
||||||
Component,
|
Component,
|
||||||
Inject,
|
Inject,
|
||||||
@@ -5,24 +12,25 @@ import {
|
|||||||
OnInit,
|
OnInit,
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import {
|
import {
|
||||||
combineLatest as combineLatestObservable,
|
combineLatest as combineLatestObservable,
|
||||||
|
combineLatest as combineLatestObservable,
|
||||||
|
Observable,
|
||||||
Observable,
|
Observable,
|
||||||
} from 'rxjs';
|
} from 'rxjs';
|
||||||
import { map } from 'rxjs/operators';
|
import {
|
||||||
|
map,
|
||||||
|
map,
|
||||||
|
} from 'rxjs/operators';
|
||||||
|
|
||||||
import { bgColor } from '../../../shared/animations/bgColor';
|
import { bgColor } from '../../../shared/animations/bgColor';
|
||||||
import { rotate } from '../../../shared/animations/rotate';
|
import { rotate } from '../../../shared/animations/rotate';
|
||||||
import { slide } from '../../../shared/animations/slide';
|
import { slide } from '../../../shared/animations/slide';
|
||||||
import { MenuService } from '../../../shared/menu/menu.service';
|
import { MenuService } from '../../../shared/menu/menu.service';
|
||||||
import { combineLatest as combineLatestObservable, Observable } from 'rxjs';
|
|
||||||
import { map } from 'rxjs/operators';
|
|
||||||
import { MenuID } from '../../../shared/menu/menu-id.model';
|
import { MenuID } from '../../../shared/menu/menu-id.model';
|
||||||
import { rendersSectionForMenu } from '../../../shared/menu/menu-section.decorator';
|
|
||||||
import { CSSVariableService } from '../../../shared/sass-helper/css-variable.service';
|
import { CSSVariableService } from '../../../shared/sass-helper/css-variable.service';
|
||||||
import { AdminSidebarSectionComponent } from '../admin-sidebar-section/admin-sidebar-section.component';
|
import { AdminSidebarSectionComponent } from '../admin-sidebar-section/admin-sidebar-section.component';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
|
||||||
import { AsyncPipe, NgClass, NgComponentOutlet, NgFor, NgIf } from '@angular/common';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a expandable section in the sidebar
|
* Represents a expandable section in the sidebar
|
||||||
@@ -33,7 +41,7 @@ import { AsyncPipe, NgClass, NgComponentOutlet, NgFor, NgIf } from '@angular/com
|
|||||||
styleUrls: ['./expandable-admin-sidebar-section.component.scss'],
|
styleUrls: ['./expandable-admin-sidebar-section.component.scss'],
|
||||||
animations: [rotate, slide, bgColor],
|
animations: [rotate, slide, bgColor],
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [NgClass, NgComponentOutlet, NgIf, NgFor, AsyncPipe, TranslateModule]
|
imports: [NgClass, NgComponentOutlet, NgIf, NgFor, AsyncPipe, TranslateModule],
|
||||||
})
|
})
|
||||||
|
|
||||||
export class ExpandableAdminSidebarSectionComponent extends AdminSidebarSectionComponent implements OnInit {
|
export class ExpandableAdminSidebarSectionComponent extends AdminSidebarSectionComponent implements OnInit {
|
||||||
|
@@ -11,10 +11,10 @@ import { AdminSidebarComponent } from './admin-sidebar.component';
|
|||||||
* Themed wrapper for AdminSidebarComponent
|
* Themed wrapper for AdminSidebarComponent
|
||||||
*/
|
*/
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-themed-admin-sidebar',
|
selector: 'ds-themed-admin-sidebar',
|
||||||
styleUrls: [],
|
styleUrls: [],
|
||||||
templateUrl: '../../shared/theme-support/themed.component.html',
|
templateUrl: '../../shared/theme-support/themed.component.html',
|
||||||
standalone: true
|
standalone: true,
|
||||||
})
|
})
|
||||||
export class ThemedAdminSidebarComponent extends ThemedComponent<AdminSidebarComponent> {
|
export class ThemedAdminSidebarComponent extends ThemedComponent<AdminSidebarComponent> {
|
||||||
|
|
||||||
|
@@ -1,11 +1,11 @@
|
|||||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { ConfigurationSearchPageComponent } from '../../search-page/configuration-search-page.component';
|
|
||||||
import {
|
import {
|
||||||
ComponentFixture,
|
ComponentFixture,
|
||||||
TestBed,
|
TestBed,
|
||||||
waitForAsync,
|
waitForAsync,
|
||||||
} from '@angular/core/testing';
|
} from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { ConfigurationSearchPageComponent } from '../../search-page/configuration-search-page.component';
|
||||||
import { AdminWorkflowPageComponent } from './admin-workflow-page.component';
|
import { AdminWorkflowPageComponent } from './admin-workflow-page.component';
|
||||||
|
|
||||||
describe('AdminSearchPageComponent', () => {
|
describe('AdminSearchPageComponent', () => {
|
||||||
@@ -20,9 +20,9 @@ describe('AdminSearchPageComponent', () => {
|
|||||||
.overrideComponent(AdminWorkflowPageComponent, {
|
.overrideComponent(AdminWorkflowPageComponent, {
|
||||||
remove: {
|
remove: {
|
||||||
imports: [
|
imports: [
|
||||||
ConfigurationSearchPageComponent
|
ConfigurationSearchPageComponent,
|
||||||
]
|
],
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
}));
|
}));
|
||||||
|
@@ -4,11 +4,11 @@ import { Context } from '../../core/shared/context.model';
|
|||||||
import { ConfigurationSearchPageComponent } from '../../search-page/configuration-search-page.component';
|
import { ConfigurationSearchPageComponent } from '../../search-page/configuration-search-page.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-admin-workflow-page',
|
selector: 'ds-admin-workflow-page',
|
||||||
templateUrl: './admin-workflow-page.component.html',
|
templateUrl: './admin-workflow-page.component.html',
|
||||||
styleUrls: ['./admin-workflow-page.component.scss'],
|
styleUrls: ['./admin-workflow-page.component.scss'],
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [ConfigurationSearchPageComponent]
|
imports: [ConfigurationSearchPageComponent],
|
||||||
})
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,5 +1,9 @@
|
|||||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing';
|
import {
|
||||||
|
ComponentFixture,
|
||||||
|
TestBed,
|
||||||
|
waitForAsync,
|
||||||
|
} from '@angular/core/testing';
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { RouterTestingModule } from '@angular/router/testing';
|
import { RouterTestingModule } from '@angular/router/testing';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
@@ -35,13 +39,13 @@ describe('WorkflowItemAdminWorkflowActionsComponent', () => {
|
|||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
init();
|
init();
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [
|
||||||
TranslateModule.forRoot(),
|
TranslateModule.forRoot(),
|
||||||
RouterTestingModule.withRoutes([]),
|
RouterTestingModule.withRoutes([]),
|
||||||
WorkflowItemAdminWorkflowActionsComponent
|
WorkflowItemAdminWorkflowActionsComponent,
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA],
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@@ -1,23 +1,26 @@
|
|||||||
|
import {
|
||||||
|
NgClass,
|
||||||
|
NgIf,
|
||||||
|
} from '@angular/common';
|
||||||
import {
|
import {
|
||||||
Component,
|
Component,
|
||||||
Input,
|
Input,
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
import { RouterLink } from '@angular/router';
|
||||||
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
|
|
||||||
import { WorkflowItem } from '../../../../../core/submission/models/workflowitem.model';
|
import { WorkflowItem } from '../../../../../core/submission/models/workflowitem.model';
|
||||||
import {
|
import {
|
||||||
getWorkflowItemDeleteRoute,
|
getWorkflowItemDeleteRoute,
|
||||||
getWorkflowItemSendBackRoute,
|
getWorkflowItemSendBackRoute,
|
||||||
} from '../../../../../workflowitems-edit-page/workflowitems-edit-page-routing-paths';
|
} from '../../../../../workflowitems-edit-page/workflowitems-edit-page-routing-paths';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
|
||||||
import { RouterLink } from '@angular/router';
|
|
||||||
import { NgClass, NgIf } from '@angular/common';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-workflow-item-admin-workflow-actions-element',
|
selector: 'ds-workflow-item-admin-workflow-actions-element',
|
||||||
styleUrls: ['./workflow-item-admin-workflow-actions.component.scss'],
|
styleUrls: ['./workflow-item-admin-workflow-actions.component.scss'],
|
||||||
templateUrl: './workflow-item-admin-workflow-actions.component.html',
|
templateUrl: './workflow-item-admin-workflow-actions.component.html',
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [NgClass, RouterLink, NgIf, TranslateModule]
|
imports: [NgClass, RouterLink, NgIf, TranslateModule],
|
||||||
})
|
})
|
||||||
/**
|
/**
|
||||||
* The component for displaying the actions for a list element for a workflow-item on the admin workflow search page
|
* The component for displaying the actions for a list element for a workflow-item on the admin workflow search page
|
||||||
|
@@ -7,15 +7,19 @@ import {
|
|||||||
TestBed,
|
TestBed,
|
||||||
waitForAsync,
|
waitForAsync,
|
||||||
} from '@angular/core/testing';
|
} from '@angular/core/testing';
|
||||||
import { NgbActiveModal, NgbPaginationModule } from '@ng-bootstrap/ng-bootstrap';
|
import {
|
||||||
|
NgbActiveModal,
|
||||||
|
NgbPaginationModule,
|
||||||
|
} from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { of } from 'rxjs';
|
import { of } from 'rxjs';
|
||||||
|
|
||||||
import { Group } from '../../../../../../core/eperson/models/group.model';
|
import { Group } from '../../../../../../core/eperson/models/group.model';
|
||||||
import { SupervisionOrder } from '../../../../../../core/supervision-order/models/supervision-order.model';
|
import { SupervisionOrder } from '../../../../../../core/supervision-order/models/supervision-order.model';
|
||||||
import { SupervisionOrderDataService } from '../../../../../../core/supervision-order/supervision-order-data.service';
|
import { SupervisionOrderDataService } from '../../../../../../core/supervision-order/supervision-order-data.service';
|
||||||
|
import { EpersonGroupListComponent } from '../../../../../../shared/eperson-group-list/eperson-group-list.component';
|
||||||
import { NotificationsService } from '../../../../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../../../../../shared/notifications/notifications.service';
|
||||||
import { SupervisionOrderGroupSelectorComponent } from './supervision-order-group-selector.component';
|
import { SupervisionOrderGroupSelectorComponent } from './supervision-order-group-selector.component';
|
||||||
import { EpersonGroupListComponent } from '../../../../../../shared/eperson-group-list/eperson-group-list.component';
|
|
||||||
|
|
||||||
describe('SupervisionOrderGroupSelectorComponent', () => {
|
describe('SupervisionOrderGroupSelectorComponent', () => {
|
||||||
let component: SupervisionOrderGroupSelectorComponent;
|
let component: SupervisionOrderGroupSelectorComponent;
|
||||||
@@ -39,20 +43,20 @@ describe('SupervisionOrderGroupSelectorComponent', () => {
|
|||||||
|
|
||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [
|
||||||
NgbPaginationModule,
|
NgbPaginationModule,
|
||||||
TranslateModule.forRoot(),
|
TranslateModule.forRoot(),
|
||||||
SupervisionOrderGroupSelectorComponent
|
SupervisionOrderGroupSelectorComponent,
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: NgbActiveModal, useValue: modalStub },
|
{ provide: NgbActiveModal, useValue: modalStub },
|
||||||
{ provide: SupervisionOrderDataService, useValue: supervisionOrderDataService },
|
{ provide: SupervisionOrderDataService, useValue: supervisionOrderDataService },
|
||||||
{ provide: NotificationsService, useValue: {} },
|
{ provide: NotificationsService, useValue: {} },
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA],
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
})
|
})
|
||||||
.overrideComponent(SupervisionOrderGroupSelectorComponent, {
|
.overrideComponent(SupervisionOrderGroupSelectorComponent, {
|
||||||
remove: { imports: [EpersonGroupListComponent]}
|
remove: { imports: [EpersonGroupListComponent] },
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
|
||||||
|
@@ -1,6 +1,15 @@
|
|||||||
import { Component, EventEmitter, Output, } from '@angular/core';
|
import { NgIf } from '@angular/common';
|
||||||
|
import {
|
||||||
|
Component,
|
||||||
|
EventEmitter,
|
||||||
|
Output,
|
||||||
|
} from '@angular/core';
|
||||||
|
import { FormsModule } from '@angular/forms';
|
||||||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
import {
|
||||||
|
TranslateModule,
|
||||||
|
TranslateService,
|
||||||
|
} from '@ngx-translate/core';
|
||||||
import { getFirstCompletedRemoteData } from 'src/app/core/shared/operators';
|
import { getFirstCompletedRemoteData } from 'src/app/core/shared/operators';
|
||||||
import { NotificationsService } from 'src/app/shared/notifications/notifications.service';
|
import { NotificationsService } from 'src/app/shared/notifications/notifications.service';
|
||||||
|
|
||||||
@@ -11,8 +20,6 @@ import { SupervisionOrder } from '../../../../../../core/supervision-order/model
|
|||||||
import { SupervisionOrderDataService } from '../../../../../../core/supervision-order/supervision-order-data.service';
|
import { SupervisionOrderDataService } from '../../../../../../core/supervision-order/supervision-order-data.service';
|
||||||
import { EpersonGroupListComponent } from '../../../../../../shared/eperson-group-list/eperson-group-list.component';
|
import { EpersonGroupListComponent } from '../../../../../../shared/eperson-group-list/eperson-group-list.component';
|
||||||
import { ErrorComponent } from '../../../../../../shared/error/error.component';
|
import { ErrorComponent } from '../../../../../../shared/error/error.component';
|
||||||
import { NgIf } from '@angular/common';
|
|
||||||
import { FormsModule } from '@angular/forms';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component to wrap a dropdown - for type of order -
|
* Component to wrap a dropdown - for type of order -
|
||||||
@@ -22,11 +29,11 @@ import { FormsModule } from '@angular/forms';
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-supervision-group-selector',
|
selector: 'ds-supervision-group-selector',
|
||||||
styleUrls: ['./supervision-order-group-selector.component.scss'],
|
styleUrls: ['./supervision-order-group-selector.component.scss'],
|
||||||
templateUrl: './supervision-order-group-selector.component.html',
|
templateUrl: './supervision-order-group-selector.component.html',
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [FormsModule, NgIf, ErrorComponent, EpersonGroupListComponent, TranslateModule]
|
imports: [FormsModule, NgIf, ErrorComponent, EpersonGroupListComponent, TranslateModule],
|
||||||
})
|
})
|
||||||
export class SupervisionOrderGroupSelectorComponent {
|
export class SupervisionOrderGroupSelectorComponent {
|
||||||
|
|
||||||
|
@@ -24,21 +24,21 @@ describe('SupervisionOrderStatusComponent', () => {
|
|||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [
|
||||||
NgbTooltipModule,
|
NgbTooltipModule,
|
||||||
TranslateModule.forRoot({
|
TranslateModule.forRoot({
|
||||||
loader: {
|
loader: {
|
||||||
provide: TranslateLoader,
|
provide: TranslateLoader,
|
||||||
useClass: TranslateLoaderMock
|
useClass: TranslateLoaderMock,
|
||||||
}
|
},
|
||||||
}),
|
}),
|
||||||
SupervisionOrderStatusComponent, VarDirective
|
SupervisionOrderStatusComponent, VarDirective,
|
||||||
],
|
],
|
||||||
schemas: [
|
schemas: [
|
||||||
NO_ERRORS_SCHEMA,
|
NO_ERRORS_SCHEMA,
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
@@ -1,6 +1,28 @@
|
|||||||
import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges, } from '@angular/core';
|
import {
|
||||||
import { BehaviorSubject, from, Observable, } from 'rxjs';
|
AsyncPipe,
|
||||||
import { map, mergeMap, reduce, } from 'rxjs/operators';
|
NgFor,
|
||||||
|
NgIf,
|
||||||
|
} from '@angular/common';
|
||||||
|
import {
|
||||||
|
Component,
|
||||||
|
EventEmitter,
|
||||||
|
Input,
|
||||||
|
OnChanges,
|
||||||
|
Output,
|
||||||
|
SimpleChanges,
|
||||||
|
} from '@angular/core';
|
||||||
|
import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';
|
||||||
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
|
import {
|
||||||
|
BehaviorSubject,
|
||||||
|
from,
|
||||||
|
Observable,
|
||||||
|
} from 'rxjs';
|
||||||
|
import {
|
||||||
|
map,
|
||||||
|
mergeMap,
|
||||||
|
reduce,
|
||||||
|
} from 'rxjs/operators';
|
||||||
|
|
||||||
import { DSONameService } from '../../../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../../../core/breadcrumbs/dso-name.service';
|
||||||
import { RemoteData } from '../../../../../../core/data/remote-data';
|
import { RemoteData } from '../../../../../../core/data/remote-data';
|
||||||
@@ -8,9 +30,6 @@ import { Group } from '../../../../../../core/eperson/models/group.model';
|
|||||||
import { getFirstCompletedRemoteData } from '../../../../../../core/shared/operators';
|
import { getFirstCompletedRemoteData } from '../../../../../../core/shared/operators';
|
||||||
import { SupervisionOrder } from '../../../../../../core/supervision-order/models/supervision-order.model';
|
import { SupervisionOrder } from '../../../../../../core/supervision-order/models/supervision-order.model';
|
||||||
import { isNotEmpty } from '../../../../../../shared/empty.util';
|
import { isNotEmpty } from '../../../../../../shared/empty.util';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
|
||||||
import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';
|
|
||||||
import { AsyncPipe, NgFor, NgIf } from '@angular/common';
|
|
||||||
import { VarDirective } from '../../../../../../shared/utils/var.directive';
|
import { VarDirective } from '../../../../../../shared/utils/var.directive';
|
||||||
|
|
||||||
export interface SupervisionOrderListEntry {
|
export interface SupervisionOrderListEntry {
|
||||||
@@ -19,11 +38,11 @@ export interface SupervisionOrderListEntry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-supervision-order-status',
|
selector: 'ds-supervision-order-status',
|
||||||
templateUrl: './supervision-order-status.component.html',
|
templateUrl: './supervision-order-status.component.html',
|
||||||
styleUrls: ['./supervision-order-status.component.scss'],
|
styleUrls: ['./supervision-order-status.component.scss'],
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [VarDirective, NgIf, NgFor, NgbTooltipModule, AsyncPipe, TranslateModule]
|
imports: [VarDirective, NgIf, NgFor, NgbTooltipModule, AsyncPipe, TranslateModule],
|
||||||
})
|
})
|
||||||
export class SupervisionOrderStatusComponent implements OnChanges {
|
export class SupervisionOrderStatusComponent implements OnChanges {
|
||||||
|
|
||||||
|
@@ -52,19 +52,19 @@ describe('WorkspaceItemAdminWorkflowActionsComponent', () => {
|
|||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
init();
|
init();
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [
|
||||||
NgbModalModule,
|
NgbModalModule,
|
||||||
TranslateModule.forRoot(),
|
TranslateModule.forRoot(),
|
||||||
RouterTestingModule.withRoutes([]),
|
RouterTestingModule.withRoutes([]),
|
||||||
WorkspaceItemAdminWorkflowActionsComponent
|
WorkspaceItemAdminWorkflowActionsComponent,
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock },
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
{ provide: NotificationsService, useValue: notificationService },
|
{ provide: NotificationsService, useValue: notificationService },
|
||||||
{ provide: SupervisionOrderDataService, useValue: supervisionOrderDataService },
|
{ provide: SupervisionOrderDataService, useValue: supervisionOrderDataService },
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA],
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@@ -1,3 +1,7 @@
|
|||||||
|
import {
|
||||||
|
NgClass,
|
||||||
|
NgIf,
|
||||||
|
} from '@angular/common';
|
||||||
import {
|
import {
|
||||||
Component,
|
Component,
|
||||||
EventEmitter,
|
EventEmitter,
|
||||||
@@ -5,11 +9,15 @@ import {
|
|||||||
OnInit,
|
OnInit,
|
||||||
Output,
|
Output,
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
import { RouterLink } from '@angular/router';
|
||||||
import {
|
import {
|
||||||
NgbModal,
|
NgbModal,
|
||||||
NgbModalRef,
|
NgbModalRef,
|
||||||
} from '@ng-bootstrap/ng-bootstrap';
|
} from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { TranslateService, TranslateModule } from '@ngx-translate/core';
|
import {
|
||||||
|
TranslateModule,
|
||||||
|
TranslateService,
|
||||||
|
} from '@ngx-translate/core';
|
||||||
import {
|
import {
|
||||||
map,
|
map,
|
||||||
Observable,
|
Observable,
|
||||||
@@ -26,25 +34,26 @@ import { Item } from '../../../../../core/shared/item.model';
|
|||||||
import { getFirstSucceededRemoteDataPayload } from '../../../../../core/shared/operators';
|
import { getFirstSucceededRemoteDataPayload } from '../../../../../core/shared/operators';
|
||||||
import { WorkspaceItem } from '../../../../../core/submission/models/workspaceitem.model';
|
import { WorkspaceItem } from '../../../../../core/submission/models/workspaceitem.model';
|
||||||
import { SupervisionOrder } from '../../../../../core/supervision-order/models/supervision-order.model';
|
import { SupervisionOrder } from '../../../../../core/supervision-order/models/supervision-order.model';
|
||||||
import { SupervisionOrderListEntry, SupervisionOrderStatusComponent } from './supervision-order-status/supervision-order-status.component';
|
|
||||||
import { SupervisionOrderDataService } from '../../../../../core/supervision-order/supervision-order-data.service';
|
import { SupervisionOrderDataService } from '../../../../../core/supervision-order/supervision-order-data.service';
|
||||||
import { ITEM_EDIT_AUTHORIZATIONS_PATH } from '../../../../../item-page/edit-item-page/edit-item-page.routing-paths';
|
import { ITEM_EDIT_AUTHORIZATIONS_PATH } from '../../../../../item-page/edit-item-page/edit-item-page.routing-paths';
|
||||||
import { ConfirmationModalComponent } from '../../../../../shared/confirmation-modal/confirmation-modal.component';
|
import { ConfirmationModalComponent } from '../../../../../shared/confirmation-modal/confirmation-modal.component';
|
||||||
import { hasValue } from '../../../../../shared/empty.util';
|
import { hasValue } from '../../../../../shared/empty.util';
|
||||||
import { NotificationsService } from '../../../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../../../../shared/notifications/notifications.service';
|
||||||
import { getSearchResultFor } from '../../../../../shared/search/search-result-element-decorator';
|
import { getSearchResultFor } from '../../../../../shared/search/search-result-element-decorator';
|
||||||
import { RouterLink } from '@angular/router';
|
|
||||||
import { NgClass, NgIf } from '@angular/common';
|
|
||||||
import { getWorkspaceItemDeleteRoute } from '../../../../../workflowitems-edit-page/workflowitems-edit-page-routing-paths';
|
import { getWorkspaceItemDeleteRoute } from '../../../../../workflowitems-edit-page/workflowitems-edit-page-routing-paths';
|
||||||
import { SupervisionOrderGroupSelectorComponent } from './supervision-order-group-selector/supervision-order-group-selector.component';
|
import { SupervisionOrderGroupSelectorComponent } from './supervision-order-group-selector/supervision-order-group-selector.component';
|
||||||
import { SupervisionOrderListEntry } from './supervision-order-status/supervision-order-status.component';
|
import {
|
||||||
|
SupervisionOrderListEntry,
|
||||||
|
SupervisionOrderListEntry,
|
||||||
|
SupervisionOrderStatusComponent,
|
||||||
|
} from './supervision-order-status/supervision-order-status.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-workspace-item-admin-workflow-actions-element',
|
selector: 'ds-workspace-item-admin-workflow-actions-element',
|
||||||
styleUrls: ['./workspace-item-admin-workflow-actions.component.scss'],
|
styleUrls: ['./workspace-item-admin-workflow-actions.component.scss'],
|
||||||
templateUrl: './workspace-item-admin-workflow-actions.component.html',
|
templateUrl: './workspace-item-admin-workflow-actions.component.html',
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [SupervisionOrderStatusComponent, NgClass, RouterLink, NgIf, TranslateModule]
|
imports: [SupervisionOrderStatusComponent, NgClass, RouterLink, NgIf, TranslateModule],
|
||||||
})
|
})
|
||||||
/**
|
/**
|
||||||
* The component for displaying the actions for a list element for a workspace-item on the admin workflow search page
|
* The component for displaying the actions for a list element for a workspace-item on the admin workflow search page
|
||||||
|
@@ -1,39 +1,35 @@
|
|||||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing';
|
import {
|
||||||
|
ComponentFixture,
|
||||||
|
TestBed,
|
||||||
|
waitForAsync,
|
||||||
|
} from '@angular/core/testing';
|
||||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||||
import { RouterTestingModule } from '@angular/router/testing';
|
import { RouterTestingModule } from '@angular/router/testing';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { of as observableOf } from 'rxjs';
|
import { of as observableOf } from 'rxjs';
|
||||||
|
|
||||||
|
import { AuthService } from '../../../../../core/auth/auth.service';
|
||||||
import { LinkService } from '../../../../../core/cache/builders/link.service';
|
import { LinkService } from '../../../../../core/cache/builders/link.service';
|
||||||
import { BitstreamDataService } from '../../../../../core/data/bitstream-data.service';
|
import { BitstreamDataService } from '../../../../../core/data/bitstream-data.service';
|
||||||
|
import { AuthorizationDataService } from '../../../../../core/data/feature-authorization/authorization-data.service';
|
||||||
import { Item } from '../../../../../core/shared/item.model';
|
import { Item } from '../../../../../core/shared/item.model';
|
||||||
|
import { ListableModule } from '../../../../../core/shared/listable.module';
|
||||||
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
||||||
import { WorkflowItem } from '../../../../../core/submission/models/workflowitem.model';
|
import { WorkflowItem } from '../../../../../core/submission/models/workflowitem.model';
|
||||||
import {
|
import { DynamicComponentLoaderDirective } from '../../../../../shared/abstract-component-loader/dynamic-component-loader.directive';
|
||||||
DynamicComponentLoaderDirective
|
import { AuthServiceMock } from '../../../../../shared/mocks/auth.service.mock';
|
||||||
} from '../../../../../shared/abstract-component-loader/dynamic-component-loader.directive';
|
|
||||||
import { getMockLinkService } from '../../../../../shared/mocks/link-service.mock';
|
import { getMockLinkService } from '../../../../../shared/mocks/link-service.mock';
|
||||||
import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock';
|
import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock';
|
||||||
import { CollectionElementLinkType } from '../../../../../shared/object-collection/collection-element-link.type';
|
import { CollectionElementLinkType } from '../../../../../shared/object-collection/collection-element-link.type';
|
||||||
import {
|
import { WorkflowItemSearchResult } from '../../../../../shared/object-collection/shared/workflow-item-search-result.model';
|
||||||
WorkflowItemSearchResult
|
import { ItemGridElementComponent } from '../../../../../shared/object-grid/item-grid-element/item-types/item/item-grid-element.component';
|
||||||
} from '../../../../../shared/object-collection/shared/workflow-item-search-result.model';
|
|
||||||
import {
|
|
||||||
ItemGridElementComponent
|
|
||||||
} from '../../../../../shared/object-grid/item-grid-element/item-types/item/item-grid-element.component';
|
|
||||||
import { createSuccessfulRemoteDataObject$ } from '../../../../../shared/remote-data.utils';
|
import { createSuccessfulRemoteDataObject$ } from '../../../../../shared/remote-data.utils';
|
||||||
import { ThemeService } from '../../../../../shared/theme-support/theme.service';
|
|
||||||
import { AuthService } from '../../../../../core/auth/auth.service';
|
|
||||||
import { AuthServiceMock } from '../../../../../shared/mocks/auth.service.mock';
|
|
||||||
import { AuthorizationDataServiceStub } from '../../../../../shared/testing/authorization-service.stub';
|
import { AuthorizationDataServiceStub } from '../../../../../shared/testing/authorization-service.stub';
|
||||||
import { AuthorizationDataService } from '../../../../../core/data/feature-authorization/authorization-data.service';
|
import { ThemeService } from '../../../../../shared/theme-support/theme.service';
|
||||||
import { ListableModule } from '../../../../../core/shared/listable.module';
|
|
||||||
import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
|
import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
|
||||||
import { followLink } from '../../../../../shared/utils/follow-link-config.model';
|
import { followLink } from '../../../../../shared/utils/follow-link-config.model';
|
||||||
import {
|
import { WorkflowItemSearchResultAdminWorkflowGridElementComponent } from './workflow-item-search-result-admin-workflow-grid-element.component';
|
||||||
WorkflowItemSearchResultAdminWorkflowGridElementComponent
|
|
||||||
} from './workflow-item-search-result-admin-workflow-grid-element.component';
|
|
||||||
|
|
||||||
describe('WorkflowItemSearchResultAdminWorkflowGridElementComponent', () => {
|
describe('WorkflowItemSearchResultAdminWorkflowGridElementComponent', () => {
|
||||||
let component: WorkflowItemSearchResultAdminWorkflowGridElementComponent;
|
let component: WorkflowItemSearchResultAdminWorkflowGridElementComponent;
|
||||||
@@ -60,30 +56,30 @@ describe('WorkflowItemSearchResultAdminWorkflowGridElementComponent', () => {
|
|||||||
init();
|
init();
|
||||||
TestBed.configureTestingModule(
|
TestBed.configureTestingModule(
|
||||||
{
|
{
|
||||||
imports: [
|
imports: [
|
||||||
WorkflowItemSearchResultAdminWorkflowGridElementComponent,
|
WorkflowItemSearchResultAdminWorkflowGridElementComponent,
|
||||||
ItemGridElementComponent,
|
ItemGridElementComponent,
|
||||||
DynamicComponentLoaderDirective,
|
DynamicComponentLoaderDirective,
|
||||||
NoopAnimationsModule,
|
NoopAnimationsModule,
|
||||||
TranslateModule.forRoot(),
|
TranslateModule.forRoot(),
|
||||||
RouterTestingModule.withRoutes([]),
|
RouterTestingModule.withRoutes([]),
|
||||||
ListableModule,
|
ListableModule,
|
||||||
WorkflowItemSearchResultAdminWorkflowGridElementComponent
|
WorkflowItemSearchResultAdminWorkflowGridElementComponent,
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: LinkService, useValue: linkService },
|
{ provide: LinkService, useValue: linkService },
|
||||||
{ provide: ThemeService, useValue: themeService },
|
{ provide: ThemeService, useValue: themeService },
|
||||||
{
|
{
|
||||||
provide: TruncatableService, useValue: {
|
provide: TruncatableService, useValue: {
|
||||||
isCollapsed: () => observableOf(true),
|
isCollapsed: () => observableOf(true),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{ provide: BitstreamDataService, useValue: {} },
|
{ provide: BitstreamDataService, useValue: {} },
|
||||||
{ provide: AuthService, useValue: new AuthServiceMock() },
|
{ provide: AuthService, useValue: new AuthServiceMock() },
|
||||||
{ provide: AuthorizationDataService, useClass: AuthorizationDataServiceStub },
|
{ provide: AuthorizationDataService, useClass: AuthorizationDataServiceStub },
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA],
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@@ -1,4 +1,13 @@
|
|||||||
import { Component, ComponentRef, ElementRef, OnDestroy, OnInit, ViewChild, } from '@angular/core';
|
import { NgIf } from '@angular/common';
|
||||||
|
import {
|
||||||
|
Component,
|
||||||
|
ComponentRef,
|
||||||
|
ElementRef,
|
||||||
|
OnDestroy,
|
||||||
|
OnInit,
|
||||||
|
ViewChild,
|
||||||
|
} from '@angular/core';
|
||||||
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { take } from 'rxjs/operators';
|
import { take } from 'rxjs/operators';
|
||||||
|
|
||||||
@@ -9,39 +18,32 @@ import { RemoteData } from '../../../../../core/data/remote-data';
|
|||||||
import { Context } from '../../../../../core/shared/context.model';
|
import { Context } from '../../../../../core/shared/context.model';
|
||||||
import { GenericConstructor } from '../../../../../core/shared/generic-constructor';
|
import { GenericConstructor } from '../../../../../core/shared/generic-constructor';
|
||||||
import { Item } from '../../../../../core/shared/item.model';
|
import { Item } from '../../../../../core/shared/item.model';
|
||||||
import { getAllSucceededRemoteData, getRemoteDataPayload, } from '../../../../../core/shared/operators';
|
import {
|
||||||
|
getAllSucceededRemoteData,
|
||||||
|
getRemoteDataPayload,
|
||||||
|
} from '../../../../../core/shared/operators';
|
||||||
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
||||||
import { WorkflowItem } from '../../../../../core/submission/models/workflowitem.model';
|
import { WorkflowItem } from '../../../../../core/submission/models/workflowitem.model';
|
||||||
import {
|
import { DynamicComponentLoaderDirective } from '../../../../../shared/abstract-component-loader/dynamic-component-loader.directive';
|
||||||
DynamicComponentLoaderDirective
|
|
||||||
} from '../../../../../shared/abstract-component-loader/dynamic-component-loader.directive';
|
|
||||||
import { hasValue } from '../../../../../shared/empty.util';
|
import { hasValue } from '../../../../../shared/empty.util';
|
||||||
import {
|
import {
|
||||||
getListableObjectComponent,
|
getListableObjectComponent,
|
||||||
listableObjectComponent,
|
listableObjectComponent,
|
||||||
} from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
|
} from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
|
||||||
import {
|
import { WorkflowItemSearchResult } from '../../../../../shared/object-collection/shared/workflow-item-search-result.model';
|
||||||
WorkflowItemSearchResult
|
import { SearchResultGridElementComponent } from '../../../../../shared/object-grid/search-result-grid-element/search-result-grid-element.component';
|
||||||
} from '../../../../../shared/object-collection/shared/workflow-item-search-result.model';
|
|
||||||
import {
|
|
||||||
SearchResultGridElementComponent
|
|
||||||
} from '../../../../../shared/object-grid/search-result-grid-element/search-result-grid-element.component';
|
|
||||||
import { ThemeService } from '../../../../../shared/theme-support/theme.service';
|
import { ThemeService } from '../../../../../shared/theme-support/theme.service';
|
||||||
import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
|
import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
|
||||||
import { followLink } from '../../../../../shared/utils/follow-link-config.model';
|
import { followLink } from '../../../../../shared/utils/follow-link-config.model';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { WorkflowItemAdminWorkflowActionsComponent } from '../../actions/workflow-item/workflow-item-admin-workflow-actions.component';
|
||||||
import {
|
|
||||||
WorkflowItemAdminWorkflowActionsComponent
|
|
||||||
} from '../../actions/workflow-item/workflow-item-admin-workflow-actions.component';
|
|
||||||
import { NgIf } from '@angular/common';
|
|
||||||
|
|
||||||
@listableObjectComponent(WorkflowItemSearchResult, ViewMode.GridElement, Context.AdminWorkflowSearch)
|
@listableObjectComponent(WorkflowItemSearchResult, ViewMode.GridElement, Context.AdminWorkflowSearch)
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-workflow-item-search-result-admin-workflow-grid-element',
|
selector: 'ds-workflow-item-search-result-admin-workflow-grid-element',
|
||||||
styleUrls: ['./workflow-item-search-result-admin-workflow-grid-element.component.scss'],
|
styleUrls: ['./workflow-item-search-result-admin-workflow-grid-element.component.scss'],
|
||||||
templateUrl: './workflow-item-search-result-admin-workflow-grid-element.component.html',
|
templateUrl: './workflow-item-search-result-admin-workflow-grid-element.component.html',
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [NgIf, WorkflowItemAdminWorkflowActionsComponent, TranslateModule, DynamicComponentLoaderDirective]
|
imports: [NgIf, WorkflowItemAdminWorkflowActionsComponent, TranslateModule, DynamicComponentLoaderDirective],
|
||||||
})
|
})
|
||||||
/**
|
/**
|
||||||
* The component for displaying a grid element for an workflow item on the admin workflow search page
|
* The component for displaying a grid element for an workflow item on the admin workflow search page
|
||||||
|
@@ -9,32 +9,36 @@ import { RouterTestingModule } from '@angular/router/testing';
|
|||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { of as observableOf } from 'rxjs';
|
import { of as observableOf } from 'rxjs';
|
||||||
|
|
||||||
|
import { AuthService } from '../../../../../core/auth/auth.service';
|
||||||
import { LinkService } from '../../../../../core/cache/builders/link.service';
|
import { LinkService } from '../../../../../core/cache/builders/link.service';
|
||||||
import { BitstreamDataService } from '../../../../../core/data/bitstream-data.service';
|
import { BitstreamDataService } from '../../../../../core/data/bitstream-data.service';
|
||||||
import { DSpaceObject } from '../../../../../core/shared/dspace-object.model';
|
import { AuthorizationDataService } from '../../../../../core/data/feature-authorization/authorization-data.service';
|
||||||
|
import {
|
||||||
|
DSpaceObject,
|
||||||
|
DSpaceObject,
|
||||||
|
} from '../../../../../core/shared/dspace-object.model';
|
||||||
import { Item } from '../../../../../core/shared/item.model';
|
import { Item } from '../../../../../core/shared/item.model';
|
||||||
|
import { ListableModule } from '../../../../../core/shared/listable.module';
|
||||||
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
||||||
import { WorkflowItem } from '../../../../../core/submission/models/workflowitem.model';
|
import { WorkflowItem } from '../../../../../core/submission/models/workflowitem.model';
|
||||||
import { SupervisionOrderDataService } from '../../../../../core/supervision-order/supervision-order-data.service';
|
import {
|
||||||
|
SupervisionOrderDataService,
|
||||||
|
SupervisionOrderDataService,
|
||||||
|
} from '../../../../../core/supervision-order/supervision-order-data.service';
|
||||||
import { DynamicComponentLoaderDirective } from '../../../../../shared/abstract-component-loader/dynamic-component-loader.directive';
|
import { DynamicComponentLoaderDirective } from '../../../../../shared/abstract-component-loader/dynamic-component-loader.directive';
|
||||||
|
import { AuthServiceMock } from '../../../../../shared/mocks/auth.service.mock';
|
||||||
import { getMockLinkService } from '../../../../../shared/mocks/link-service.mock';
|
import { getMockLinkService } from '../../../../../shared/mocks/link-service.mock';
|
||||||
import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock';
|
import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock';
|
||||||
|
import { NotificationsService } from '../../../../../shared/notifications/notifications.service';
|
||||||
import { CollectionElementLinkType } from '../../../../../shared/object-collection/collection-element-link.type';
|
import { CollectionElementLinkType } from '../../../../../shared/object-collection/collection-element-link.type';
|
||||||
import { WorkflowItemSearchResult } from '../../../../../shared/object-collection/shared/workflow-item-search-result.model';
|
import { WorkflowItemSearchResult } from '../../../../../shared/object-collection/shared/workflow-item-search-result.model';
|
||||||
import { ItemGridElementComponent } from '../../../../../shared/object-grid/item-grid-element/item-types/item/item-grid-element.component';
|
import { ItemGridElementComponent } from '../../../../../shared/object-grid/item-grid-element/item-types/item/item-grid-element.component';
|
||||||
import { createSuccessfulRemoteDataObject$ } from '../../../../../shared/remote-data.utils';
|
import { createSuccessfulRemoteDataObject$ } from '../../../../../shared/remote-data.utils';
|
||||||
|
import { NotificationsServiceStub } from '../../../../../shared/testing/notifications-service.stub';
|
||||||
import {
|
import {
|
||||||
supervisionOrderPaginatedListRD,
|
supervisionOrderPaginatedListRD,
|
||||||
supervisionOrderPaginatedListRD$,
|
supervisionOrderPaginatedListRD$,
|
||||||
} from '../../../../../shared/testing/supervision-order.mock';
|
} from '../../../../../shared/testing/supervision-order.mock';
|
||||||
import { SupervisionOrderDataService } from '../../../../../core/supervision-order/supervision-order-data.service';
|
|
||||||
import { DSpaceObject } from '../../../../../core/shared/dspace-object.model';
|
|
||||||
import { NotificationsService } from '../../../../../shared/notifications/notifications.service';
|
|
||||||
import { NotificationsServiceStub } from '../../../../../shared/testing/notifications-service.stub';
|
|
||||||
import { AuthService } from '../../../../../core/auth/auth.service';
|
|
||||||
import { AuthServiceMock } from '../../../../../shared/mocks/auth.service.mock';
|
|
||||||
import { AuthorizationDataService } from '../../../../../core/data/feature-authorization/authorization-data.service';
|
|
||||||
import { ListableModule } from '../../../../../core/shared/listable.module';
|
|
||||||
import { ThemeService } from '../../../../../shared/theme-support/theme.service';
|
import { ThemeService } from '../../../../../shared/theme-support/theme.service';
|
||||||
import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
|
import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
|
||||||
import { followLink } from '../../../../../shared/utils/follow-link-config.model';
|
import { followLink } from '../../../../../shared/utils/follow-link-config.model';
|
||||||
@@ -70,32 +74,32 @@ describe('WorkspaceItemSearchResultAdminWorkflowGridElementComponent', () => {
|
|||||||
init();
|
init();
|
||||||
TestBed.configureTestingModule(
|
TestBed.configureTestingModule(
|
||||||
{
|
{
|
||||||
imports: [
|
imports: [
|
||||||
WorkspaceItemSearchResultAdminWorkflowGridElementComponent,
|
WorkspaceItemSearchResultAdminWorkflowGridElementComponent,
|
||||||
ItemGridElementComponent,
|
ItemGridElementComponent,
|
||||||
DynamicComponentLoaderDirective,
|
DynamicComponentLoaderDirective,
|
||||||
NoopAnimationsModule,
|
NoopAnimationsModule,
|
||||||
TranslateModule.forRoot(),
|
TranslateModule.forRoot(),
|
||||||
RouterTestingModule.withRoutes([]),
|
RouterTestingModule.withRoutes([]),
|
||||||
ListableModule,
|
ListableModule,
|
||||||
WorkspaceItemSearchResultAdminWorkflowGridElementComponent
|
WorkspaceItemSearchResultAdminWorkflowGridElementComponent,
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: LinkService, useValue: linkService },
|
{ provide: LinkService, useValue: linkService },
|
||||||
{ provide: ThemeService, useValue: themeService },
|
{ provide: ThemeService, useValue: themeService },
|
||||||
{
|
{
|
||||||
provide: TruncatableService, useValue: {
|
provide: TruncatableService, useValue: {
|
||||||
isCollapsed: () => observableOf(true),
|
isCollapsed: () => observableOf(true),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{ provide: BitstreamDataService, useValue: {} },
|
{ provide: BitstreamDataService, useValue: {} },
|
||||||
{ provide: SupervisionOrderDataService, useValue: supervisionOrderDataService },
|
{ provide: SupervisionOrderDataService, useValue: supervisionOrderDataService },
|
||||||
{ provide: NotificationsService, useValue: new NotificationsServiceStub() },
|
{ provide: NotificationsService, useValue: new NotificationsServiceStub() },
|
||||||
{ provide: AuthService, useValue: new AuthServiceMock() },
|
{ provide: AuthService, useValue: new AuthServiceMock() },
|
||||||
{ provide: AuthorizationDataService, useValue: {} },
|
{ provide: AuthorizationDataService, useValue: {} },
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA],
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@@ -1,18 +1,27 @@
|
|||||||
import { Component, ComponentRef, ElementRef, OnDestroy, OnInit, ViewChild } from '@angular/core';
|
import { AsyncPipe } from '@angular/common';
|
||||||
|
import {
|
||||||
import { BehaviorSubject, Observable } from 'rxjs';
|
Component,
|
||||||
import { map, mergeMap, take, tap } from 'rxjs/operators';
|
ComponentRef,
|
||||||
|
ElementRef,
|
||||||
import { Item } from '../../../../../core/shared/item.model';
|
OnDestroy,
|
||||||
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
OnInit,
|
||||||
|
ViewChild,
|
||||||
|
} from '@angular/core';
|
||||||
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import {
|
import {
|
||||||
BehaviorSubject,
|
BehaviorSubject,
|
||||||
|
BehaviorSubject,
|
||||||
|
Observable,
|
||||||
Observable,
|
Observable,
|
||||||
} from 'rxjs';
|
} from 'rxjs';
|
||||||
import {
|
import {
|
||||||
map,
|
map,
|
||||||
|
map,
|
||||||
|
mergeMap,
|
||||||
mergeMap,
|
mergeMap,
|
||||||
take,
|
take,
|
||||||
|
take,
|
||||||
|
tap,
|
||||||
tap,
|
tap,
|
||||||
} from 'rxjs/operators';
|
} from 'rxjs/operators';
|
||||||
|
|
||||||
@@ -25,23 +34,23 @@ import { Context } from '../../../../../core/shared/context.model';
|
|||||||
import { DSpaceObject } from '../../../../../core/shared/dspace-object.model';
|
import { DSpaceObject } from '../../../../../core/shared/dspace-object.model';
|
||||||
import { GenericConstructor } from '../../../../../core/shared/generic-constructor';
|
import { GenericConstructor } from '../../../../../core/shared/generic-constructor';
|
||||||
import {
|
import {
|
||||||
Item } from '../../../../../core/shared/item.model';
|
Item,
|
||||||
|
Item,
|
||||||
|
} from '../../../../../core/shared/item.model';
|
||||||
import {
|
import {
|
||||||
getAllSucceededRemoteData,
|
getAllSucceededRemoteData,
|
||||||
getFirstCompletedRemoteData,
|
getFirstCompletedRemoteData,
|
||||||
getRemoteDataPayload,
|
getRemoteDataPayload,
|
||||||
} from '../../../../../core/shared/operators';
|
} from '../../../../../core/shared/operators';
|
||||||
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
import {
|
||||||
|
ViewMode,
|
||||||
|
ViewMode,
|
||||||
|
} from '../../../../../core/shared/view-mode.model';
|
||||||
import { WorkspaceItem } from '../../../../../core/submission/models/workspaceitem.model';
|
import { WorkspaceItem } from '../../../../../core/submission/models/workspaceitem.model';
|
||||||
import { SupervisionOrder } from '../../../../../core/supervision-order/models/supervision-order.model';
|
import { SupervisionOrder } from '../../../../../core/supervision-order/models/supervision-order.model';
|
||||||
import { SupervisionOrderDataService } from '../../../../../core/supervision-order/supervision-order-data.service';
|
import { SupervisionOrderDataService } from '../../../../../core/supervision-order/supervision-order-data.service';
|
||||||
import { DynamicComponentLoaderDirective } from '../../../../../shared/abstract-component-loader/dynamic-component-loader.directive';
|
import { DynamicComponentLoaderDirective } from '../../../../../shared/abstract-component-loader/dynamic-component-loader.directive';
|
||||||
import { hasValue } from '../../../../../shared/empty.util';
|
import { hasValue } from '../../../../../shared/empty.util';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
|
||||||
import { AsyncPipe } from '@angular/common';
|
|
||||||
import {
|
|
||||||
WorkspaceItemAdminWorkflowActionsComponent
|
|
||||||
} from '../../actions/workspace-item/workspace-item-admin-workflow-actions.component';
|
|
||||||
import {
|
import {
|
||||||
getListableObjectComponent,
|
getListableObjectComponent,
|
||||||
listableObjectComponent,
|
listableObjectComponent,
|
||||||
@@ -51,14 +60,15 @@ import { SearchResultGridElementComponent } from '../../../../../shared/object-g
|
|||||||
import { ThemeService } from '../../../../../shared/theme-support/theme.service';
|
import { ThemeService } from '../../../../../shared/theme-support/theme.service';
|
||||||
import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
|
import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
|
||||||
import { followLink } from '../../../../../shared/utils/follow-link-config.model';
|
import { followLink } from '../../../../../shared/utils/follow-link-config.model';
|
||||||
|
import { WorkspaceItemAdminWorkflowActionsComponent } from '../../actions/workspace-item/workspace-item-admin-workflow-actions.component';
|
||||||
|
|
||||||
@listableObjectComponent(WorkspaceItemSearchResult, ViewMode.GridElement, Context.AdminWorkflowSearch)
|
@listableObjectComponent(WorkspaceItemSearchResult, ViewMode.GridElement, Context.AdminWorkflowSearch)
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-workflow-item-search-result-admin-workflow-grid-element',
|
selector: 'ds-workflow-item-search-result-admin-workflow-grid-element',
|
||||||
styleUrls: ['./workspace-item-search-result-admin-workflow-grid-element.component.scss'],
|
styleUrls: ['./workspace-item-search-result-admin-workflow-grid-element.component.scss'],
|
||||||
templateUrl: './workspace-item-search-result-admin-workflow-grid-element.component.html',
|
templateUrl: './workspace-item-search-result-admin-workflow-grid-element.component.html',
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [WorkspaceItemAdminWorkflowActionsComponent, AsyncPipe, TranslateModule, DynamicComponentLoaderDirective]
|
imports: [WorkspaceItemAdminWorkflowActionsComponent, AsyncPipe, TranslateModule, DynamicComponentLoaderDirective],
|
||||||
})
|
})
|
||||||
/**
|
/**
|
||||||
* The component for displaying a grid element for an workflow item on the admin workflow search page
|
* The component for displaying a grid element for an workflow item on the admin workflow search page
|
||||||
|
@@ -1,34 +1,34 @@
|
|||||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing';
|
import {
|
||||||
|
ComponentFixture,
|
||||||
|
TestBed,
|
||||||
|
waitForAsync,
|
||||||
|
} from '@angular/core/testing';
|
||||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||||
import { RouterTestingModule } from '@angular/router/testing';
|
import { RouterTestingModule } from '@angular/router/testing';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
|
|
||||||
import { APP_CONFIG } from '../../../../../../config/app-config.interface';
|
import { APP_CONFIG } from '../../../../../../config/app-config.interface';
|
||||||
import { environment } from '../../../../../../environments/environment';
|
import { environment } from '../../../../../../environments/environment';
|
||||||
|
import { AuthService } from '../../../../../core/auth/auth.service';
|
||||||
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service';
|
||||||
import { LinkService } from '../../../../../core/cache/builders/link.service';
|
import { LinkService } from '../../../../../core/cache/builders/link.service';
|
||||||
|
import { AuthorizationDataService } from '../../../../../core/data/feature-authorization/authorization-data.service';
|
||||||
import { Item } from '../../../../../core/shared/item.model';
|
import { Item } from '../../../../../core/shared/item.model';
|
||||||
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
||||||
import { WorkflowItem } from '../../../../../core/submission/models/workflowitem.model';
|
import { WorkflowItem } from '../../../../../core/submission/models/workflowitem.model';
|
||||||
|
import { AuthServiceMock } from '../../../../../shared/mocks/auth.service.mock';
|
||||||
import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock';
|
import { DSONameServiceMock } from '../../../../../shared/mocks/dso-name.service.mock';
|
||||||
import { getMockLinkService } from '../../../../../shared/mocks/link-service.mock';
|
import { getMockLinkService } from '../../../../../shared/mocks/link-service.mock';
|
||||||
import { mockTruncatableService } from '../../../../../shared/mocks/mock-trucatable.service';
|
import { mockTruncatableService } from '../../../../../shared/mocks/mock-trucatable.service';
|
||||||
|
import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock';
|
||||||
import { CollectionElementLinkType } from '../../../../../shared/object-collection/collection-element-link.type';
|
import { CollectionElementLinkType } from '../../../../../shared/object-collection/collection-element-link.type';
|
||||||
import {
|
import { WorkflowItemSearchResult } from '../../../../../shared/object-collection/shared/workflow-item-search-result.model';
|
||||||
WorkflowItemSearchResult
|
|
||||||
} from '../../../../../shared/object-collection/shared/workflow-item-search-result.model';
|
|
||||||
import { createSuccessfulRemoteDataObject$ } from '../../../../../shared/remote-data.utils';
|
import { createSuccessfulRemoteDataObject$ } from '../../../../../shared/remote-data.utils';
|
||||||
|
import { ThemeService } from '../../../../../shared/theme-support/theme.service';
|
||||||
import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
|
import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
|
||||||
import { followLink } from '../../../../../shared/utils/follow-link-config.model';
|
import { followLink } from '../../../../../shared/utils/follow-link-config.model';
|
||||||
import {
|
import { WorkflowItemSearchResultAdminWorkflowListElementComponent } from './workflow-item-search-result-admin-workflow-list-element.component';
|
||||||
WorkflowItemSearchResultAdminWorkflowListElementComponent
|
|
||||||
} from './workflow-item-search-result-admin-workflow-list-element.component';
|
|
||||||
import { ThemeService } from '../../../../../shared/theme-support/theme.service';
|
|
||||||
import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock';
|
|
||||||
import { AuthService } from '../../../../../core/auth/auth.service';
|
|
||||||
import { AuthServiceMock } from '../../../../../shared/mocks/auth.service.mock';
|
|
||||||
import { AuthorizationDataService } from '../../../../../core/data/feature-authorization/authorization-data.service';
|
|
||||||
|
|
||||||
describe('WorkflowItemSearchResultAdminWorkflowListElementComponent', () => {
|
describe('WorkflowItemSearchResultAdminWorkflowListElementComponent', () => {
|
||||||
let component: WorkflowItemSearchResultAdminWorkflowListElementComponent;
|
let component: WorkflowItemSearchResultAdminWorkflowListElementComponent;
|
||||||
@@ -53,23 +53,23 @@ describe('WorkflowItemSearchResultAdminWorkflowListElementComponent', () => {
|
|||||||
init();
|
init();
|
||||||
TestBed.configureTestingModule(
|
TestBed.configureTestingModule(
|
||||||
{
|
{
|
||||||
imports: [
|
imports: [
|
||||||
NoopAnimationsModule,
|
NoopAnimationsModule,
|
||||||
TranslateModule.forRoot(),
|
TranslateModule.forRoot(),
|
||||||
RouterTestingModule.withRoutes([]),
|
RouterTestingModule.withRoutes([]),
|
||||||
WorkflowItemSearchResultAdminWorkflowListElementComponent
|
WorkflowItemSearchResultAdminWorkflowListElementComponent,
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: TruncatableService, useValue: mockTruncatableService },
|
{ provide: TruncatableService, useValue: mockTruncatableService },
|
||||||
{ provide: LinkService, useValue: linkService },
|
{ provide: LinkService, useValue: linkService },
|
||||||
{ provide: DSONameService, useClass: DSONameServiceMock },
|
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||||
{ provide: APP_CONFIG, useValue: environment },
|
{ provide: APP_CONFIG, useValue: environment },
|
||||||
{ provide: ThemeService, useValue: getMockThemeService() },
|
{ provide: ThemeService, useValue: getMockThemeService() },
|
||||||
{ provide: AuthService, useValue: new AuthServiceMock() },
|
{ provide: AuthService, useValue: new AuthServiceMock() },
|
||||||
{ provide: AuthorizationDataService, useValue: {} },
|
{ provide: AuthorizationDataService, useValue: {} },
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA],
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user