mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +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 { 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 { Route } from '@angular/router';
|
||||
|
||||
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 {
|
||||
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';
|
||||
EPERSON_PATH,
|
||||
GROUP_PATH,
|
||||
} from './access-control-routing-paths';
|
||||
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 { 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[] = [
|
||||
{
|
||||
path: EPERSON_PATH,
|
||||
component: EPeopleRegistryComponent,
|
||||
resolve: {
|
||||
breadcrumb: I18nBreadcrumbResolver
|
||||
breadcrumb: I18nBreadcrumbResolver,
|
||||
},
|
||||
data: {title: 'admin.access-control.epeople.title', breadcrumbKey: 'admin.access-control.epeople'},
|
||||
canActivate: [SiteAdministratorGuard]
|
||||
data: { title: 'admin.access-control.epeople.title', breadcrumbKey: 'admin.access-control.epeople' },
|
||||
canActivate: [SiteAdministratorGuard],
|
||||
},
|
||||
{
|
||||
path: `${EPERSON_PATH}/create`,
|
||||
@@ -31,7 +31,7 @@ export const ROUTES: Route[] = [
|
||||
resolve: {
|
||||
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],
|
||||
},
|
||||
{
|
||||
@@ -41,46 +41,46 @@ export const ROUTES: Route[] = [
|
||||
breadcrumb: I18nBreadcrumbResolver,
|
||||
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],
|
||||
},
|
||||
{
|
||||
path: GROUP_PATH,
|
||||
component: GroupsRegistryComponent,
|
||||
resolve: {
|
||||
breadcrumb: I18nBreadcrumbResolver
|
||||
breadcrumb: I18nBreadcrumbResolver,
|
||||
},
|
||||
data: {title: 'admin.access-control.groups.title', breadcrumbKey: 'admin.access-control.groups'},
|
||||
canActivate: [GroupAdministratorGuard]
|
||||
data: { title: 'admin.access-control.groups.title', breadcrumbKey: 'admin.access-control.groups' },
|
||||
canActivate: [GroupAdministratorGuard],
|
||||
},
|
||||
{
|
||||
path: `${GROUP_PATH}/create`,
|
||||
component: GroupFormComponent,
|
||||
resolve: {
|
||||
breadcrumb: I18nBreadcrumbResolver
|
||||
breadcrumb: I18nBreadcrumbResolver,
|
||||
},
|
||||
data: {title: 'admin.access-control.groups.title.addGroup', breadcrumbKey: 'admin.access-control.groups.addGroup'},
|
||||
canActivate: [GroupAdministratorGuard]
|
||||
data: { title: 'admin.access-control.groups.title.addGroup', breadcrumbKey: 'admin.access-control.groups.addGroup' },
|
||||
canActivate: [GroupAdministratorGuard],
|
||||
},
|
||||
{
|
||||
path: `${GROUP_PATH}/:groupId/edit`,
|
||||
component: GroupFormComponent,
|
||||
resolve: {
|
||||
breadcrumb: I18nBreadcrumbResolver
|
||||
breadcrumb: I18nBreadcrumbResolver,
|
||||
},
|
||||
data: {
|
||||
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',
|
||||
component: BulkAccessComponent,
|
||||
resolve: {
|
||||
breadcrumb: I18nBreadcrumbResolver
|
||||
breadcrumb: I18nBreadcrumbResolver,
|
||||
},
|
||||
data: {title: 'admin.access-control.bulk-access.title', breadcrumbKey: 'admin.access-control.bulk-access'},
|
||||
canActivate: [SiteAdministratorGuard]
|
||||
data: { title: 'admin.access-control.bulk-access.title', breadcrumbKey: 'admin.access-control.bulk-access' },
|
||||
canActivate: [SiteAdministratorGuard],
|
||||
},
|
||||
];
|
||||
|
@@ -1,21 +1,27 @@
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { AbstractControl } from '@angular/forms';
|
||||
import {
|
||||
AbstractControl,
|
||||
AbstractControl,
|
||||
} from '@angular/forms';
|
||||
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 { EPersonFormComponent } from './epeople-registry/eperson-form/eperson-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 { SubgroupsListComponent } from './group-registry/group-form/subgroup-list/subgroups-list.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
|
||||
@@ -26,30 +32,30 @@ export const ValidateEmailErrorStateMatcher: DynamicErrorMessagesMatcher =
|
||||
};
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
RouterModule,
|
||||
FormModule,
|
||||
NgbAccordionModule,
|
||||
SearchModule,
|
||||
EPeopleRegistryComponent,
|
||||
EPersonFormComponent,
|
||||
GroupsRegistryComponent,
|
||||
GroupFormComponent,
|
||||
SubgroupsListComponent,
|
||||
MembersListComponent,
|
||||
BulkAccessComponent,
|
||||
BulkAccessBrowseComponent,
|
||||
BulkAccessSettingsComponent
|
||||
],
|
||||
exports: [
|
||||
MembersListComponent,
|
||||
],
|
||||
providers: [
|
||||
{
|
||||
provide: DYNAMIC_ERROR_MESSAGES_MATCHER,
|
||||
imports: [
|
||||
CommonModule,
|
||||
RouterModule,
|
||||
FormModule,
|
||||
NgbAccordionModule,
|
||||
SearchModule,
|
||||
EPeopleRegistryComponent,
|
||||
EPersonFormComponent,
|
||||
GroupsRegistryComponent,
|
||||
GroupFormComponent,
|
||||
SubgroupsListComponent,
|
||||
MembersListComponent,
|
||||
BulkAccessComponent,
|
||||
BulkAccessBrowseComponent,
|
||||
BulkAccessSettingsComponent,
|
||||
],
|
||||
exports: [
|
||||
MembersListComponent,
|
||||
],
|
||||
providers: [
|
||||
{
|
||||
provide: DYNAMIC_ERROR_MESSAGES_MATCHER,
|
||||
useValue: ValidateEmailErrorStateMatcher,
|
||||
},
|
||||
},
|
||||
],
|
||||
})
|
||||
/**
|
||||
|
@@ -13,20 +13,16 @@ import { of } from 'rxjs';
|
||||
|
||||
import { buildPaginatedList } from '../../../core/data/paginated-list.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 { 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 { createSuccessfulRemoteDataObject } from '../../../shared/remote-data.utils';
|
||||
import { ThemedSearchComponent } from '../../../shared/search/themed-search.component';
|
||||
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 { ThemeService } from '../../../shared/theme-support/theme.service';
|
||||
import { BulkAccessBrowseComponent } from './bulk-access-browse.component';
|
||||
|
||||
describe('BulkAccessBrowseComponent', () => {
|
||||
let component: BulkAccessBrowseComponent;
|
||||
@@ -48,7 +44,7 @@ describe('BulkAccessBrowseComponent', () => {
|
||||
NgbAccordionModule,
|
||||
NgbNavModule,
|
||||
TranslateModule.forRoot(),
|
||||
BulkAccessBrowseComponent
|
||||
BulkAccessBrowseComponent,
|
||||
],
|
||||
providers: [
|
||||
{ provide: SelectableListService, useValue: selectableListService },
|
||||
@@ -64,9 +60,9 @@ describe('BulkAccessBrowseComponent', () => {
|
||||
PaginationComponent,
|
||||
ThemedSearchComponent,
|
||||
SelectableListItemControlComponent,
|
||||
ListableObjectComponentLoaderComponent
|
||||
]
|
||||
}
|
||||
ListableObjectComponentLoaderComponent,
|
||||
],
|
||||
},
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
@@ -1,52 +1,62 @@
|
||||
import {
|
||||
AsyncPipe,
|
||||
NgForOf,
|
||||
NgIf,
|
||||
} from '@angular/common';
|
||||
import {
|
||||
Component,
|
||||
Input,
|
||||
OnDestroy,
|
||||
OnInit,
|
||||
} from '@angular/core';
|
||||
import {
|
||||
NgbAccordionModule,
|
||||
NgbNavModule,
|
||||
} from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { NgxPaginationModule } from 'ngx-pagination';
|
||||
import {
|
||||
BehaviorSubject,
|
||||
BehaviorSubject,
|
||||
Subscription,
|
||||
Subscription,
|
||||
} from 'rxjs';
|
||||
import {
|
||||
distinctUntilChanged,
|
||||
distinctUntilChanged,
|
||||
map,
|
||||
map,
|
||||
} 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 {
|
||||
buildPaginatedList,
|
||||
PaginatedList,
|
||||
} from '../../../core/data/paginated-list.model';
|
||||
import { RemoteData } from '../../../core/data/remote-data';
|
||||
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 { 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 { SelectableListState } from '../../../shared/object-list/selectable-list/selectable-list.reducer';
|
||||
import { SelectableListService } from '../../../shared/object-list/selectable-list/selectable-list.service';
|
||||
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 {
|
||||
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 { createSuccessfulRemoteDataObject } from '../../../shared/remote-data.utils';
|
||||
import { ThemedSearchComponent } from '../../../shared/search/themed-search.component';
|
||||
import { BrowserOnlyPipe } from '../../../shared/utils/browser-only.pipe';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-bulk-access-browse',
|
||||
@@ -55,8 +65,8 @@ import { createSuccessfulRemoteDataObject } from '../../../shared/remote-data.ut
|
||||
providers: [
|
||||
{
|
||||
provide: SEARCH_CONFIG_SERVICE,
|
||||
useClass: SearchConfigurationService
|
||||
}
|
||||
useClass: SearchConfigurationService,
|
||||
},
|
||||
],
|
||||
imports: [
|
||||
PaginationComponent,
|
||||
@@ -70,9 +80,9 @@ import { createSuccessfulRemoteDataObject } from '../../../shared/remote-data.ut
|
||||
NgForOf,
|
||||
NgxPaginationModule,
|
||||
SelectableListItemControlComponent,
|
||||
ListableObjectComponentLoaderComponent
|
||||
ListableObjectComponentLoaderComponent,
|
||||
],
|
||||
standalone: true
|
||||
standalone: true,
|
||||
})
|
||||
export class BulkAccessBrowseComponent implements OnInit, OnDestroy {
|
||||
|
||||
|
@@ -9,15 +9,15 @@ import { of } from 'rxjs';
|
||||
|
||||
import { Process } from '../../process-page/processes/process.model';
|
||||
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 { SelectableListState } from '../../shared/object-list/selectable-list/selectable-list.reducer';
|
||||
import { SelectableListService } from '../../shared/object-list/selectable-list/selectable-list.service';
|
||||
import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';
|
||||
import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub';
|
||||
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 { BulkAccessSettingsComponent } from './settings/bulk-access-settings.component';
|
||||
|
||||
describe('BulkAccessComponent', () => {
|
||||
let component: BulkAccessComponent;
|
||||
@@ -77,13 +77,13 @@ describe('BulkAccessComponent', () => {
|
||||
imports: [
|
||||
RouterTestingModule,
|
||||
TranslateModule.forRoot(),
|
||||
BulkAccessComponent
|
||||
BulkAccessComponent,
|
||||
],
|
||||
providers: [
|
||||
{ provide: BulkAccessControlService, useValue: bulkAccessControlServiceMock },
|
||||
{ provide: NotificationsService, useValue: NotificationsServiceStub },
|
||||
{ provide: SelectableListService, useValue: selectableListServiceMock },
|
||||
{ provide: ThemeService, useValue: getMockThemeService() }
|
||||
{ provide: ThemeService, useValue: getMockThemeService() },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
})
|
||||
@@ -91,8 +91,8 @@ describe('BulkAccessComponent', () => {
|
||||
remove: {
|
||||
imports: [
|
||||
BulkAccessSettingsComponent,
|
||||
]
|
||||
}
|
||||
],
|
||||
},
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
@@ -3,6 +3,7 @@ import {
|
||||
OnInit,
|
||||
ViewChild,
|
||||
} from '@angular/core';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import {
|
||||
BehaviorSubject,
|
||||
Subscription,
|
||||
@@ -15,7 +16,6 @@ import {
|
||||
import { BulkAccessControlService } from '../../shared/access-control-form-container/bulk-access-control.service';
|
||||
import { SelectableListState } from '../../shared/object-list/selectable-list/selectable-list.reducer';
|
||||
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 { BulkAccessSettingsComponent } from './settings/bulk-access-settings.component';
|
||||
|
||||
@@ -26,9 +26,9 @@ import { BulkAccessSettingsComponent } from './settings/bulk-access-settings.com
|
||||
imports: [
|
||||
TranslateModule,
|
||||
BulkAccessSettingsComponent,
|
||||
BulkAccessBrowseComponent
|
||||
BulkAccessBrowseComponent,
|
||||
],
|
||||
standalone: true
|
||||
standalone: true,
|
||||
})
|
||||
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 {
|
||||
ComponentFixture,
|
||||
TestBed,
|
||||
@@ -6,11 +9,8 @@ import {
|
||||
import { NgbAccordionModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
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 { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import {
|
||||
AccessControlFormContainerComponent
|
||||
} from '../../../shared/access-control-form-container/access-control-form-container.component';
|
||||
|
||||
describe('BulkAccessSettingsComponent', () => {
|
||||
let component: BulkAccessSettingsComponent;
|
||||
@@ -49,11 +49,11 @@ describe('BulkAccessSettingsComponent', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [NgbAccordionModule, TranslateModule.forRoot(), BulkAccessSettingsComponent],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
})
|
||||
imports: [NgbAccordionModule, TranslateModule.forRoot(), BulkAccessSettingsComponent],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
})
|
||||
.overrideComponent(BulkAccessSettingsComponent, {
|
||||
remove: { imports: [AccessControlFormContainerComponent]}
|
||||
remove: { imports: [AccessControlFormContainerComponent] },
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
@@ -1,12 +1,12 @@
|
||||
import { NgIf } from '@angular/common';
|
||||
import {
|
||||
Component,
|
||||
ViewChild,
|
||||
} from '@angular/core';
|
||||
|
||||
import { AccessControlFormContainerComponent } from '../../../shared/access-control-form-container/access-control-form-container.component';
|
||||
import { NgbAccordionModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
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({
|
||||
selector: 'ds-bulk-access-settings',
|
||||
@@ -17,9 +17,9 @@ import { NgIf } from '@angular/common';
|
||||
NgbAccordionModule,
|
||||
TranslateModule,
|
||||
NgIf,
|
||||
AccessControlFormContainerComponent
|
||||
AccessControlFormContainerComponent,
|
||||
],
|
||||
standalone: true
|
||||
standalone: true,
|
||||
})
|
||||
export class BulkAccessSettingsComponent {
|
||||
|
||||
|
@@ -19,6 +19,7 @@ import {
|
||||
By,
|
||||
} from '@angular/platform-browser';
|
||||
import { Router } from '@angular/router';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import {
|
||||
NgbModal,
|
||||
NgbModule,
|
||||
@@ -29,38 +30,42 @@ import {
|
||||
of as observableOf,
|
||||
} 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 {
|
||||
buildPaginatedList,
|
||||
PaginatedList,
|
||||
} from '../../core/data/paginated-list.model';
|
||||
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 { 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 { 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 { RouterMock } from '../../shared/mocks/router.mock';
|
||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||
import { PaginationComponent } from '../../shared/pagination/pagination.component';
|
||||
import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';
|
||||
import {
|
||||
EPersonMock,
|
||||
EPersonMock2,
|
||||
} from '../../shared/testing/eperson.mock';
|
||||
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 { RouterStub } from '../../shared/testing/router.stub';
|
||||
import { EPeopleRegistryComponent } from './epeople-registry.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', () => {
|
||||
let component: EPeopleRegistryComponent;
|
||||
@@ -154,15 +159,15 @@ describe('EPeopleRegistryComponent', () => {
|
||||
|
||||
paginationService = new PaginationServiceStub();
|
||||
awaitTestBed.configureTestingModule({
|
||||
imports: [CommonModule, NgbModule, FormsModule, ReactiveFormsModule, BrowserModule, RouterTestingModule.withRoutes([]),
|
||||
imports: [CommonModule, NgbModule, FormsModule, ReactiveFormsModule, BrowserModule, RouterTestingModule.withRoutes([]),
|
||||
TranslateModule.forRoot(), EPeopleRegistryComponent],
|
||||
providers: [
|
||||
{provide: EPersonDataService, useValue: ePersonDataServiceStub},
|
||||
{provide: NotificationsService, useValue: new NotificationsServiceStub()},
|
||||
{provide: AuthorizationDataService, useValue: authorizationService},
|
||||
{provide: FormBuilderService, useValue: builderService},
|
||||
{provide: Router, useValue: new RouterMock()},
|
||||
{provide: RequestService, useValue: jasmine.createSpyObj('requestService', ['removeByHrefSubstring'])},
|
||||
{ provide: EPersonDataService, useValue: ePersonDataServiceStub },
|
||||
{ provide: NotificationsService, useValue: new NotificationsServiceStub() },
|
||||
{ provide: AuthorizationDataService, useValue: authorizationService },
|
||||
{ provide: FormBuilderService, useValue: builderService },
|
||||
{ provide: Router, useValue: new RouterMock() },
|
||||
{ provide: RequestService, useValue: jasmine.createSpyObj('requestService', ['removeByHrefSubstring']) },
|
||||
{ provide: PaginationService, useValue: paginationService },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
@@ -173,8 +178,8 @@ describe('EPeopleRegistryComponent', () => {
|
||||
EPersonFormComponent,
|
||||
ThemedLoadingComponent,
|
||||
PaginationComponent,
|
||||
]
|
||||
}
|
||||
],
|
||||
},
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
@@ -1,12 +1,30 @@
|
||||
import {
|
||||
AsyncPipe,
|
||||
NgClass,
|
||||
NgForOf,
|
||||
NgIf,
|
||||
} from '@angular/common';
|
||||
import {
|
||||
Component,
|
||||
OnDestroy,
|
||||
OnInit,
|
||||
} from '@angular/core';
|
||||
import { ReactiveFormsModule, UntypedFormBuilder } from '@angular/forms';
|
||||
import { Router, RouterModule } from '@angular/router';
|
||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
||||
import {
|
||||
ReactiveFormsModule,
|
||||
UntypedFormBuilder,
|
||||
} 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 {
|
||||
BehaviorSubject,
|
||||
combineLatest,
|
||||
@@ -19,49 +37,67 @@ import {
|
||||
take,
|
||||
} from 'rxjs/operators';
|
||||
|
||||
import { DSONameService } from '../../core/breadcrumbs/dso-name.service';
|
||||
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
|
||||
import { FeatureID } from '../../core/data/feature-authorization/feature-id';
|
||||
import {
|
||||
DSONameService,
|
||||
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 {
|
||||
buildPaginatedList,
|
||||
PaginatedList,
|
||||
} from '../../core/data/paginated-list.model';
|
||||
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 { EPerson } from '../../core/eperson/models/eperson.model';
|
||||
import { EpersonDtoModel } from '../../core/eperson/models/eperson-dto.model';
|
||||
import { PaginationService } from '../../core/pagination/pagination.service';
|
||||
import { NoContent } from '../../core/shared/NoContent.model';
|
||||
import {
|
||||
EpersonDtoModel,
|
||||
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 {
|
||||
getAllSucceededRemoteData,
|
||||
getAllSucceededRemoteData,
|
||||
getFirstCompletedRemoteData,
|
||||
getFirstCompletedRemoteData,
|
||||
} from '../../core/shared/operators';
|
||||
import { PageInfo } from '../../core/shared/page-info.model';
|
||||
import { ConfirmationModalComponent } from '../../shared/confirmation-modal/confirmation-modal.component';
|
||||
import {
|
||||
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 { 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 { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||
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 {
|
||||
getEPersonEditRoute,
|
||||
getEPersonEditRoute,
|
||||
getEPersonsRoute,
|
||||
getEPersonsRoute,
|
||||
} from '../access-control-routing-paths';
|
||||
import { EPersonFormComponent } from './eperson-form/eperson-form.component';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-epeople-registry',
|
||||
@@ -76,9 +112,9 @@ import {
|
||||
ThemedLoadingComponent,
|
||||
PaginationComponent,
|
||||
NgClass,
|
||||
NgForOf
|
||||
NgForOf,
|
||||
],
|
||||
standalone: true
|
||||
standalone: true,
|
||||
})
|
||||
/**
|
||||
* A component used for managing all existing epeople within the repository.
|
||||
|
@@ -3,8 +3,13 @@ import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import {
|
||||
ComponentFixture,
|
||||
TestBed,
|
||||
waitForAsync,} from '@angular/core/testing';
|
||||
import { FormsModule, ReactiveFormsModule, UntypedFormControl, UntypedFormGroup,
|
||||
waitForAsync,
|
||||
} from '@angular/core/testing';
|
||||
import {
|
||||
FormsModule,
|
||||
ReactiveFormsModule,
|
||||
UntypedFormControl,
|
||||
UntypedFormGroup,
|
||||
Validators,
|
||||
} from '@angular/forms';
|
||||
import {
|
||||
@@ -13,6 +18,8 @@ import {
|
||||
} from '@angular/platform-browser';
|
||||
import {
|
||||
ActivatedRoute,
|
||||
ActivatedRoute,
|
||||
Router,
|
||||
Router,
|
||||
} from '@angular/router';
|
||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
@@ -26,54 +33,72 @@ import {
|
||||
} from 'rxjs';
|
||||
|
||||
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 { FindListOptions } from '../../../core/data/find-list-options.model';
|
||||
import {
|
||||
FindListOptions,
|
||||
FindListOptions,
|
||||
} from '../../../core/data/find-list-options.model';
|
||||
import {
|
||||
buildPaginatedList,
|
||||
PaginatedList,
|
||||
} from '../../../core/data/paginated-list.model';
|
||||
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 { GroupDataService } from '../../../core/eperson/group-data.service';
|
||||
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 { 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 { TranslateLoaderMock } from '../../../shared/mocks/translate-loader.mock';
|
||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||
import { EPersonFormComponent } from './eperson-form.component';
|
||||
import { EPersonMock, EPersonMock2 } from '../../../shared/testing/eperson.mock';
|
||||
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
||||
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 {
|
||||
EPersonMock,
|
||||
EPersonMock,
|
||||
EPersonMock2,
|
||||
EPersonMock2,
|
||||
} from '../../../shared/testing/eperson.mock';
|
||||
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub';
|
||||
import { PaginationServiceStub } from '../../../shared/testing/pagination-service.stub';
|
||||
import { RouterStub } from '../../../shared/testing/router.stub';
|
||||
import {
|
||||
PaginationServiceStub,
|
||||
PaginationServiceStub,
|
||||
} from '../../../shared/testing/pagination-service.stub';
|
||||
import {
|
||||
RouterStub,
|
||||
RouterStub,
|
||||
} from '../../../shared/testing/router.stub';
|
||||
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 { HasNoValuePipe } from '../../../shared/utils/has-no-value.pipe';
|
||||
import { EPeopleRegistryComponent } from '../epeople-registry.component';
|
||||
import { EPersonFormComponent } from './eperson-form.component';
|
||||
import { ValidateEmailNotTaken } from './validators/email-taken.validator';
|
||||
import { RouterStub } from '../../../shared/testing/router.stub';
|
||||
import { ActivatedRouteStub } from '../../../shared/testing/active-router.stub';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import {
|
||||
EPersonFormComponent,
|
||||
EPersonFormComponent,
|
||||
} from './eperson-form.component';
|
||||
import {
|
||||
ValidateEmailNotTaken,
|
||||
ValidateEmailNotTaken,
|
||||
} from './validators/email-taken.validator';
|
||||
|
||||
describe('EPersonFormComponent', () => {
|
||||
let component: EPersonFormComponent;
|
||||
@@ -233,17 +258,17 @@ describe('EPersonFormComponent', () => {
|
||||
route = new ActivatedRouteStub();
|
||||
router = new RouterStub();
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CommonModule, NgbModule, FormsModule, ReactiveFormsModule, BrowserModule,
|
||||
imports: [CommonModule, NgbModule, FormsModule, ReactiveFormsModule, BrowserModule,
|
||||
TranslateModule.forRoot({
|
||||
loader: {
|
||||
provide: TranslateLoader,
|
||||
useClass: TranslateLoaderMock,
|
||||
},
|
||||
loader: {
|
||||
provide: TranslateLoader,
|
||||
useClass: TranslateLoaderMock,
|
||||
},
|
||||
}),
|
||||
EPersonFormComponent,
|
||||
HasNoValuePipe,
|
||||
],
|
||||
providers: [
|
||||
providers: [
|
||||
{ provide: EPersonDataService, useValue: ePersonDataServiceStub },
|
||||
{ provide: GroupDataService, useValue: groupsDataService },
|
||||
{ provide: FormBuilderService, useValue: builderService },
|
||||
@@ -256,11 +281,11 @@ describe('EPersonFormComponent', () => {
|
||||
{ provide: ActivatedRoute, useValue: route },
|
||||
{ provide: Router, useValue: router },
|
||||
EPeopleRegistryComponent,
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
})
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
})
|
||||
.overrideComponent(EPersonFormComponent, {
|
||||
remove: { imports: [ ThemedLoadingComponent, PaginationComponent,FormComponent]}
|
||||
remove: { imports: [ ThemedLoadingComponent, PaginationComponent,FormComponent] },
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
@@ -1,3 +1,8 @@
|
||||
import {
|
||||
AsyncPipe,
|
||||
NgClass,
|
||||
NgIf,
|
||||
} from '@angular/common';
|
||||
import {
|
||||
ChangeDetectorRef,
|
||||
Component,
|
||||
@@ -8,8 +13,11 @@ import {
|
||||
} from '@angular/core';
|
||||
import { UntypedFormGroup } from '@angular/forms';
|
||||
import {
|
||||
ActivatedRoute,
|
||||
ActivatedRoute,
|
||||
Router,
|
||||
Router,
|
||||
RouterLink,
|
||||
} from '@angular/router';
|
||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import {
|
||||
@@ -18,7 +26,10 @@ import {
|
||||
DynamicFormLayout,
|
||||
DynamicInputModel,
|
||||
} from '@ng-dynamic-forms/core';
|
||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
||||
import {
|
||||
TranslateModule,
|
||||
TranslateService,
|
||||
} from '@ngx-translate/core';
|
||||
import {
|
||||
combineLatest as observableCombineLatest,
|
||||
Observable,
|
||||
@@ -34,8 +45,14 @@ import {
|
||||
} from 'rxjs/operators';
|
||||
|
||||
import { AuthService } from '../../../core/auth/auth.service';
|
||||
import { DSONameService } from '../../../core/breadcrumbs/dso-name.service';
|
||||
import { EpersonRegistrationService } from '../../../core/data/eperson-registration.service';
|
||||
import {
|
||||
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 { FeatureID } from '../../../core/data/feature-authorization/feature-id';
|
||||
import { PaginatedList } from '../../../core/data/paginated-list.model';
|
||||
@@ -53,26 +70,28 @@ import {
|
||||
getRemoteDataPayload,
|
||||
} from '../../../core/shared/operators';
|
||||
import { PageInfo } from '../../../core/shared/page-info.model';
|
||||
import { Registration } from '../../../core/shared/registration.model';
|
||||
import { TYPE_REQUEST_FORGOT } from '../../../register-email-form/register-email-form.component';
|
||||
import {
|
||||
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 { hasValue } from '../../../shared/empty.util';
|
||||
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 { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
||||
import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.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 { ValidateEmailNotTaken } from './validators/email-taken.validator';
|
||||
import {
|
||||
ValidateEmailNotTaken,
|
||||
ValidateEmailNotTaken,
|
||||
} from './validators/email-taken.validator';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-eperson-form',
|
||||
@@ -85,9 +104,9 @@ import { ValidateEmailNotTaken } from './validators/email-taken.validator';
|
||||
NgClass,
|
||||
ThemedLoadingComponent,
|
||||
PaginationComponent,
|
||||
RouterLink
|
||||
RouterLink,
|
||||
],
|
||||
standalone: true
|
||||
standalone: true,
|
||||
})
|
||||
/**
|
||||
* A form used for creating and editing EPeople
|
||||
|
@@ -1,15 +1,38 @@
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { ComponentFixture, TestBed, 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 {
|
||||
ComponentFixture,
|
||||
TestBed,
|
||||
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 { 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 { Observable, of as observableOf, } from 'rxjs';
|
||||
import {
|
||||
Observable,
|
||||
of as observableOf,
|
||||
} from 'rxjs';
|
||||
|
||||
import { DSONameService } from '../../../core/breadcrumbs/dso-name.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 { DSpaceObjectDataService } from '../../../core/data/dspace-object-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 { EPersonDataService } from '../../../core/eperson/eperson-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 { PageInfo } from '../../../core/shared/page-info.model';
|
||||
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 { FormComponent } from '../../../shared/form/form.component';
|
||||
import { DSONameServiceMock } from '../../../shared/mocks/dso-name.service.mock';
|
||||
import { getMockFormBuilderService } from '../../../shared/mocks/form-builder-service.mock';
|
||||
import { RouterMock } from '../../../shared/mocks/router.mock';
|
||||
import { getMockTranslateService } from '../../../shared/mocks/translate.service.mock';
|
||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||
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 { TranslateLoaderMock } from '../../../shared/testing/translate-loader.mock';
|
||||
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 { SubgroupsListComponent } from './subgroup-list/subgroups-list.component';
|
||||
import { ValidateGroupExists } from './validators/group-exists.validator';
|
||||
|
||||
describe('GroupFormComponent', () => {
|
||||
let component: GroupFormComponent;
|
||||
@@ -197,14 +226,14 @@ describe('GroupFormComponent', () => {
|
||||
router = new RouterMock();
|
||||
notificationService = new NotificationsServiceStub();
|
||||
return TestBed.configureTestingModule({
|
||||
imports: [CommonModule, NgbModule, FormsModule, ReactiveFormsModule, BrowserModule,
|
||||
imports: [CommonModule, NgbModule, FormsModule, ReactiveFormsModule, BrowserModule,
|
||||
TranslateModule.forRoot({
|
||||
loader: {
|
||||
provide: TranslateLoader,
|
||||
useClass: TranslateLoaderMock,
|
||||
},
|
||||
loader: {
|
||||
provide: TranslateLoader,
|
||||
useClass: TranslateLoaderMock,
|
||||
},
|
||||
}), GroupFormComponent],
|
||||
providers: [
|
||||
providers: [
|
||||
{ provide: DSONameService, useValue: new DSONameServiceMock() },
|
||||
{ provide: EPersonDataService, useValue: ePersonDataServiceStub },
|
||||
{ provide: GroupDataService, useValue: groupsDataServiceStub },
|
||||
@@ -219,22 +248,22 @@ describe('GroupFormComponent', () => {
|
||||
{ provide: RemoteDataBuildService, useValue: {} },
|
||||
{ provide: HALEndpointService, useValue: {} },
|
||||
{
|
||||
provide: ActivatedRoute,
|
||||
provide: ActivatedRoute,
|
||||
useValue: { data: observableOf({ dso: { payload: {} } }), params: observableOf({}) },
|
||||
},
|
||||
{ provide: Router, useValue: router },
|
||||
{ provide: AuthorizationDataService, useValue: authorizationService },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
})
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
})
|
||||
.overrideComponent(GroupFormComponent, {
|
||||
remove: { imports: [
|
||||
FormComponent,
|
||||
AlertComponent,
|
||||
ContextHelpDirective,
|
||||
MembersListComponent,
|
||||
SubgroupsListComponent
|
||||
]}
|
||||
FormComponent,
|
||||
AlertComponent,
|
||||
ContextHelpDirective,
|
||||
MembersListComponent,
|
||||
SubgroupsListComponent,
|
||||
] },
|
||||
})
|
||||
.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 { ActivatedRoute, Router, } from '@angular/router';
|
||||
import {
|
||||
ActivatedRoute,
|
||||
Router,
|
||||
} from '@angular/router';
|
||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import {
|
||||
DynamicFormControlModel,
|
||||
@@ -8,10 +23,25 @@ import {
|
||||
DynamicInputModel,
|
||||
DynamicTextAreaModel,
|
||||
} 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 { combineLatest as observableCombineLatest, Observable, of as observableOf, Subscription, } from 'rxjs';
|
||||
import { catchError, debounceTime, filter, map, switchMap, take, } from 'rxjs/operators';
|
||||
import {
|
||||
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 { getCollectionEditRolesRoute } from '../../../collection-page/collection-page-routing-paths';
|
||||
@@ -36,20 +66,26 @@ import {
|
||||
getFirstSucceededRemoteDataPayload,
|
||||
getRemoteDataPayload,
|
||||
} from '../../../core/shared/operators';
|
||||
import { AlertComponent } from '../../../shared/alert/alert.component';
|
||||
import { AlertType } from '../../../shared/alert/alert-type';
|
||||
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 { FormComponent } from '../../../shared/form/form.component';
|
||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||
import { followLink } from '../../../shared/utils/follow-link-config.model';
|
||||
import { getGroupEditRoute, getGroupsRoute, } from '../../access-control-routing-paths';
|
||||
import { ValidateGroupExists } from './validators/group-exists.validator';
|
||||
import { FormComponent } from '../../../shared/form/form.component';
|
||||
import { AlertComponent } from '../../../shared/alert/alert.component';
|
||||
import { AsyncPipe, NgIf } from '@angular/common';
|
||||
import { ContextHelpDirective } from '../../../shared/context-help.directive';
|
||||
import {
|
||||
getGroupEditRoute,
|
||||
getGroupsRoute,
|
||||
} from '../../access-control-routing-paths';
|
||||
import { MembersListComponent } from './members-list/members-list.component';
|
||||
import { SubgroupsListComponent } from './subgroup-list/subgroups-list.component';
|
||||
import { ValidateGroupExists } from './validators/group-exists.validator';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-group-form',
|
||||
@@ -62,9 +98,9 @@ import { SubgroupsListComponent } from './subgroup-list/subgroups-list.component
|
||||
TranslateModule,
|
||||
ContextHelpDirective,
|
||||
MembersListComponent,
|
||||
SubgroupsListComponent
|
||||
SubgroupsListComponent,
|
||||
],
|
||||
standalone: true
|
||||
standalone: true,
|
||||
})
|
||||
/**
|
||||
* A form used for creating and editing groups
|
||||
|
@@ -1,16 +1,46 @@
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { DebugElement, NO_ERRORS_SCHEMA, } from '@angular/core';
|
||||
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 {
|
||||
DebugElement,
|
||||
NO_ERRORS_SCHEMA,
|
||||
} from '@angular/core';
|
||||
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 { TranslateLoader, TranslateModule, TranslateService, } from '@ngx-translate/core';
|
||||
import { Observable, of as observableOf, } from 'rxjs';
|
||||
import {
|
||||
TranslateLoader,
|
||||
TranslateModule,
|
||||
TranslateService,
|
||||
} from '@ngx-translate/core';
|
||||
import {
|
||||
Observable,
|
||||
of as observableOf,
|
||||
} from 'rxjs';
|
||||
|
||||
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
||||
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 { EPersonDataService } from '../../../../core/eperson/eperson-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 { PaginationService } from '../../../../core/pagination/pagination.service';
|
||||
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 { DSONameServiceMock } from '../../../../shared/mocks/dso-name.service.mock';
|
||||
import { getMockFormBuilderService } from '../../../../shared/mocks/form-builder-service.mock';
|
||||
import { RouterMock } from '../../../../shared/mocks/router.mock';
|
||||
import { getMockTranslateService } from '../../../../shared/mocks/translate.service.mock';
|
||||
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
||||
import { PaginationComponent } from '../../../../shared/pagination/pagination.component';
|
||||
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 { NotificationsServiceStub } from '../../../../shared/testing/notifications-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 { MembersListComponent } from './members-list.component';
|
||||
|
||||
@@ -122,14 +155,14 @@ describe('MembersListComponent', () => {
|
||||
|
||||
paginationService = new PaginationServiceStub();
|
||||
return TestBed.configureTestingModule({
|
||||
imports: [CommonModule, NgbModule, FormsModule, ReactiveFormsModule, BrowserModule,
|
||||
imports: [CommonModule, NgbModule, FormsModule, ReactiveFormsModule, BrowserModule,
|
||||
TranslateModule.forRoot({
|
||||
loader: {
|
||||
provide: TranslateLoader,
|
||||
useClass: TranslateLoaderMock,
|
||||
},
|
||||
loader: {
|
||||
provide: TranslateLoader,
|
||||
useClass: TranslateLoaderMock,
|
||||
},
|
||||
}), MembersListComponent],
|
||||
providers: [MembersListComponent,
|
||||
providers: [MembersListComponent,
|
||||
{ provide: EPersonDataService, useValue: ePersonDataServiceStub },
|
||||
{ provide: GroupDataService, useValue: groupsDataServiceStub },
|
||||
{ provide: NotificationsService, useValue: new NotificationsServiceStub() },
|
||||
@@ -138,15 +171,15 @@ describe('MembersListComponent', () => {
|
||||
{ provide: PaginationService, useValue: paginationService },
|
||||
{ provide: DSONameService, useValue: new DSONameServiceMock() },
|
||||
{ provide: ActivatedRoute, useValue: new ActivatedRouteStub() },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
})
|
||||
.overrideComponent(MembersListComponent, {
|
||||
remove: {
|
||||
imports: [PaginationComponent, ContextHelpDirective]
|
||||
}
|
||||
})
|
||||
.compileComponents();
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
})
|
||||
.overrideComponent(MembersListComponent, {
|
||||
remove: {
|
||||
imports: [PaginationComponent, ContextHelpDirective],
|
||||
},
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
@@ -1,9 +1,37 @@
|
||||
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 {
|
||||
AsyncPipe,
|
||||
NgClass,
|
||||
NgForOf,
|
||||
NgIf,
|
||||
} 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 { PaginatedList } from '../../../../core/data/paginated-list.model';
|
||||
@@ -18,11 +46,10 @@ import {
|
||||
getFirstCompletedRemoteData,
|
||||
getRemoteDataPayload,
|
||||
} 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 { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
||||
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';
|
||||
|
||||
// todo: optimize imports
|
||||
@@ -77,9 +104,9 @@ export interface EPersonListActionConfig {
|
||||
AsyncPipe,
|
||||
RouterLink,
|
||||
NgClass,
|
||||
NgForOf
|
||||
NgForOf,
|
||||
],
|
||||
standalone: true
|
||||
standalone: true,
|
||||
})
|
||||
/**
|
||||
* The list of members in the edit group page
|
||||
|
@@ -1,35 +1,67 @@
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { DebugElement, NO_ERRORS_SCHEMA, } from '@angular/core';
|
||||
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 {
|
||||
DebugElement,
|
||||
NO_ERRORS_SCHEMA,
|
||||
} from '@angular/core';
|
||||
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 { TranslateLoader, TranslateModule, TranslateService, } from '@ngx-translate/core';
|
||||
import { Observable, of as observableOf, } from 'rxjs';
|
||||
import {
|
||||
TranslateLoader,
|
||||
TranslateModule,
|
||||
TranslateService,
|
||||
} from '@ngx-translate/core';
|
||||
import {
|
||||
Observable,
|
||||
of as observableOf,
|
||||
} from 'rxjs';
|
||||
import { EPersonMock2 } from 'src/app/shared/testing/eperson.mock';
|
||||
|
||||
import { DSONameService } from '../../../../core/breadcrumbs/dso-name.service';
|
||||
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 { GroupDataService } from '../../../../core/eperson/group-data.service';
|
||||
import { Group } from '../../../../core/eperson/models/group.model';
|
||||
import { PaginationService } from '../../../../core/pagination/pagination.service';
|
||||
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 { DSONameServiceMock } from '../../../../shared/mocks/dso-name.service.mock';
|
||||
import { getMockFormBuilderService } from '../../../../shared/mocks/form-builder-service.mock';
|
||||
import { RouterMock } from '../../../../shared/mocks/router.mock';
|
||||
import { getMockTranslateService } from '../../../../shared/mocks/translate.service.mock';
|
||||
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
||||
import { PaginationComponent } from '../../../../shared/pagination/pagination.component';
|
||||
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 { 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 { SubgroupsListComponent } from './subgroups-list.component';
|
||||
|
||||
@@ -94,7 +126,7 @@ describe('SubgroupsListComponent', () => {
|
||||
return createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), groupNonMembers));
|
||||
}
|
||||
return createSuccessfulRemoteDataObject$(
|
||||
buildPaginatedList(new PageInfo(), [])
|
||||
buildPaginatedList(new PageInfo(), []),
|
||||
);
|
||||
},
|
||||
addSubGroupToGroup(parentGroup, subgroupToAdd: Group): Observable<RestResponse> {
|
||||
@@ -161,12 +193,12 @@ describe('SubgroupsListComponent', () => {
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
})
|
||||
.overrideComponent(SubgroupsListComponent, {
|
||||
remove: {
|
||||
imports: [ContextHelpDirective, PaginationComponent]
|
||||
}
|
||||
})
|
||||
.compileComponents();
|
||||
.overrideComponent(SubgroupsListComponent, {
|
||||
remove: {
|
||||
imports: [ContextHelpDirective, PaginationComponent],
|
||||
},
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
@@ -1,9 +1,36 @@
|
||||
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 {
|
||||
AsyncPipe,
|
||||
NgForOf,
|
||||
NgIf,
|
||||
} 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 { 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 { PaginationService } from '../../../../core/pagination/pagination.service';
|
||||
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 { ContextHelpDirective } from '../../../../shared/context-help.directive';
|
||||
import { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
||||
import { PaginationComponent } from '../../../../shared/pagination/pagination.component';
|
||||
import { PaginationComponentOptions } from '../../../../shared/pagination/pagination-component-options.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
|
||||
@@ -41,9 +70,9 @@ enum SubKey {
|
||||
TranslateModule,
|
||||
ReactiveFormsModule,
|
||||
PaginationComponent,
|
||||
NgIf
|
||||
NgIf,
|
||||
],
|
||||
standalone: true
|
||||
standalone: true,
|
||||
})
|
||||
/**
|
||||
* The list of subgroups in the edit group page
|
||||
|
@@ -1,18 +1,47 @@
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { ComponentFixture, fakeAsync, 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 {
|
||||
ComponentFixture,
|
||||
fakeAsync,
|
||||
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 { TranslateLoader, TranslateModule, } from '@ngx-translate/core';
|
||||
import { Observable, of, of as observableOf, } from 'rxjs';
|
||||
import { provideMockStore } from '@ngrx/store/testing';
|
||||
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 { ConfigurationDataService } from '../../core/data/configuration-data.service';
|
||||
import { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service';
|
||||
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
|
||||
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 { RequestService } from '../../core/data/request.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 { NoContent } from '../../core/shared/NoContent.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 { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||
import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';
|
||||
import { EPersonMock, EPersonMock2, } from '../../shared/testing/eperson.mock';
|
||||
import { GroupMock, GroupMock2, } from '../../shared/testing/group-mock';
|
||||
import { ActivatedRouteStub } from '../../shared/testing/active-router.stub';
|
||||
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 { 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 { TranslateLoaderMock } from '../../shared/testing/translate-loader.mock';
|
||||
import { GroupsRegistryComponent } from './groups-registry.component';
|
||||
@@ -173,14 +208,14 @@ describe('GroupsRegistryComponent', () => {
|
||||
setIsAuthorized(true, true);
|
||||
paginationService = new PaginationServiceStub();
|
||||
return TestBed.configureTestingModule({
|
||||
imports: [CommonModule, NgbModule, FormsModule, ReactiveFormsModule, BrowserModule,
|
||||
imports: [CommonModule, NgbModule, FormsModule, ReactiveFormsModule, BrowserModule,
|
||||
TranslateModule.forRoot({
|
||||
loader: {
|
||||
provide: TranslateLoader,
|
||||
useClass: TranslateLoaderMock,
|
||||
},
|
||||
loader: {
|
||||
provide: TranslateLoader,
|
||||
useClass: TranslateLoaderMock,
|
||||
},
|
||||
}), GroupsRegistryComponent],
|
||||
providers: [GroupsRegistryComponent,
|
||||
providers: [GroupsRegistryComponent,
|
||||
{ provide: DSONameService, useValue: new DSONameServiceMock() },
|
||||
{ provide: EPersonDataService, useValue: ePersonDataServiceStub },
|
||||
{ provide: GroupDataService, useValue: groupsDataServiceStub },
|
||||
@@ -195,9 +230,9 @@ describe('GroupsRegistryComponent', () => {
|
||||
{ provide: RequestService, useValue: jasmine.createSpyObj('requestService', ['removeByHrefSubstring']) },
|
||||
{ provide: APP_DATA_SERVICES_MAP, useValue: {} },
|
||||
provideMockStore(),
|
||||
],
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
}).compileComponents();
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
@@ -1,7 +1,28 @@
|
||||
import { Component, 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 {
|
||||
AsyncPipe,
|
||||
NgForOf,
|
||||
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 {
|
||||
BehaviorSubject,
|
||||
combineLatest as observableCombineLatest,
|
||||
@@ -10,13 +31,22 @@ import {
|
||||
of as observableOf,
|
||||
Subscription,
|
||||
} 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 { DSpaceObjectDataService } from '../../core/data/dspace-object-data.service';
|
||||
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
|
||||
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 { RequestService } from '../../core/data/request.service';
|
||||
import { EPersonDataService } from '../../core/eperson/eperson-data.service';
|
||||
@@ -36,13 +66,11 @@ import {
|
||||
} from '../../core/shared/operators';
|
||||
import { PageInfo } from '../../core/shared/page-info.model';
|
||||
import { hasValue } from '../../shared/empty.util';
|
||||
import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component';
|
||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||
import { PaginationComponent } from '../../shared/pagination/pagination.component';
|
||||
import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.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({
|
||||
selector: 'ds-groups-registry',
|
||||
@@ -58,9 +86,9 @@ import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
NgSwitch,
|
||||
NgSwitchCase,
|
||||
NgbTooltipModule,
|
||||
NgForOf
|
||||
NgForOf,
|
||||
],
|
||||
standalone: true
|
||||
standalone: true,
|
||||
})
|
||||
/**
|
||||
* A component used for managing all existing groups within the repository.
|
||||
|
@@ -1,5 +1,4 @@
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { CurationFormComponent } from '../../curation-form/curation-form.component';
|
||||
import {
|
||||
ComponentFixture,
|
||||
TestBed,
|
||||
@@ -7,6 +6,7 @@ import {
|
||||
} from '@angular/core/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
import { CurationFormComponent } from '../../curation-form/curation-form.component';
|
||||
import { AdminCurationTasksComponent } from './admin-curation-tasks.component';
|
||||
|
||||
describe('AdminCurationTasksComponent', () => {
|
||||
@@ -16,14 +16,14 @@ describe('AdminCurationTasksComponent', () => {
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [TranslateModule.forRoot(), AdminCurationTasksComponent],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
})
|
||||
.overrideComponent(AdminCurationTasksComponent, {
|
||||
remove: {
|
||||
imports: [CurationFormComponent]
|
||||
}
|
||||
})
|
||||
.compileComponents();
|
||||
.overrideComponent(AdminCurationTasksComponent, {
|
||||
remove: {
|
||||
imports: [CurationFormComponent],
|
||||
},
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
@@ -1,7 +1,8 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { CurationFormComponent } from '../../curation-form/curation-form.component';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
import { CurationFormComponent } from '../../curation-form/curation-form.component';
|
||||
|
||||
/**
|
||||
* 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',
|
||||
imports: [
|
||||
CurationFormComponent,
|
||||
TranslateModule
|
||||
TranslateModule,
|
||||
],
|
||||
standalone: true
|
||||
standalone: true,
|
||||
})
|
||||
export class AdminCurationTasksComponent {
|
||||
|
||||
|
@@ -54,20 +54,20 @@ describe('BatchImportPageComponent', () => {
|
||||
beforeEach(waitForAsync(() => {
|
||||
init();
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
imports: [
|
||||
FormsModule,
|
||||
TranslateModule.forRoot(),
|
||||
RouterTestingModule.withRoutes([]),
|
||||
BatchImportPageComponent, FileValueAccessorDirective, FileValidator
|
||||
],
|
||||
providers: [
|
||||
BatchImportPageComponent, FileValueAccessorDirective, FileValidator,
|
||||
],
|
||||
providers: [
|
||||
{ provide: NotificationsService, useValue: notificationService },
|
||||
{ provide: ScriptDataService, useValue: scriptService },
|
||||
{ provide: Router, useValue: router },
|
||||
{ provide: Location, useValue: locationStub },
|
||||
],
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
}).compileComponents();
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
@@ -1,19 +1,28 @@
|
||||
import { Location } from '@angular/common';
|
||||
import {
|
||||
Location,
|
||||
Location,
|
||||
NgIf,
|
||||
} from '@angular/common';
|
||||
import { Component } from '@angular/core';
|
||||
import { Location, NgIf } from '@angular/common';
|
||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||
import { BATCH_IMPORT_SCRIPT_NAME, ScriptDataService } from '../../core/data/processes/script-data.service';
|
||||
import { Router } from '@angular/router';
|
||||
import { ProcessParameter } from '../../process-page/processes/process-parameter.model';
|
||||
import { Router } from '@angular/router';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import {
|
||||
Router,
|
||||
Router,
|
||||
} from '@angular/router';
|
||||
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 { DSONameService } from '../../core/breadcrumbs/dso-name.service';
|
||||
import {
|
||||
BATCH_IMPORT_SCRIPT_NAME,
|
||||
BATCH_IMPORT_SCRIPT_NAME,
|
||||
ScriptDataService,
|
||||
ScriptDataService,
|
||||
} from '../../core/data/processes/script-data.service';
|
||||
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 { getProcessDetailRoute } from '../../process-page/process-page-routing.paths';
|
||||
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 {
|
||||
isEmpty,
|
||||
isNotEmpty,
|
||||
} from '../../shared/empty.util';
|
||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { UiSwitchModule } from 'ngx-ui-switch';
|
||||
import {
|
||||
FileDropzoneNoUploaderComponent
|
||||
} from '../../shared/upload/file-dropzone-no-uploader/file-dropzone-no-uploader.component';
|
||||
NotificationsService,
|
||||
NotificationsService,
|
||||
} from '../../shared/notifications/notifications.service';
|
||||
import { FileDropzoneNoUploaderComponent } from '../../shared/upload/file-dropzone-no-uploader/file-dropzone-no-uploader.component';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-batch-import-page',
|
||||
@@ -42,9 +53,9 @@ import {
|
||||
TranslateModule,
|
||||
FormsModule,
|
||||
UiSwitchModule,
|
||||
FileDropzoneNoUploaderComponent
|
||||
FileDropzoneNoUploaderComponent,
|
||||
],
|
||||
standalone: true
|
||||
standalone: true,
|
||||
})
|
||||
export class BatchImportPageComponent {
|
||||
/**
|
||||
|
@@ -54,20 +54,20 @@ describe('MetadataImportPageComponent', () => {
|
||||
beforeEach(waitForAsync(() => {
|
||||
init();
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
imports: [
|
||||
FormsModule,
|
||||
TranslateModule.forRoot(),
|
||||
RouterTestingModule.withRoutes([]),
|
||||
MetadataImportPageComponent, FileValueAccessorDirective, FileValidator
|
||||
],
|
||||
providers: [
|
||||
MetadataImportPageComponent, FileValueAccessorDirective, FileValidator,
|
||||
],
|
||||
providers: [
|
||||
{ provide: NotificationsService, useValue: notificationService },
|
||||
{ provide: ScriptDataService, useValue: scriptService },
|
||||
{ provide: Router, useValue: router },
|
||||
{ provide: Location, useValue: locationStub },
|
||||
],
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
}).compileComponents();
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
@@ -1,7 +1,11 @@
|
||||
import { Location } from '@angular/common';
|
||||
import { Component } from '@angular/core';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { Router } from '@angular/router';
|
||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
||||
import {
|
||||
TranslateModule,
|
||||
TranslateService,
|
||||
} from '@ngx-translate/core';
|
||||
|
||||
import {
|
||||
METADATA_IMPORT_SCRIPT_NAME,
|
||||
@@ -10,14 +14,11 @@ import {
|
||||
import { RemoteData } from '../../core/data/remote-data';
|
||||
import { getFirstCompletedRemoteData } from '../../core/shared/operators';
|
||||
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 { ProcessParameter } from '../../process-page/processes/process-parameter.model';
|
||||
import { isNotEmpty } from '../../shared/empty.util';
|
||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||
import { FileDropzoneNoUploaderComponent } from '../../shared/upload/file-dropzone-no-uploader/file-dropzone-no-uploader.component';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-metadata-import-page',
|
||||
@@ -25,9 +26,9 @@ import { NotificationsService } from '../../shared/notifications/notifications.s
|
||||
imports: [
|
||||
TranslateModule,
|
||||
FormsModule,
|
||||
FileDropzoneNoUploaderComponent
|
||||
FileDropzoneNoUploaderComponent,
|
||||
],
|
||||
standalone: true
|
||||
standalone: true,
|
||||
})
|
||||
|
||||
/**
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { Routes ,
|
||||
} from '@angular/router';
|
||||
import { Routes } from '@angular/router';
|
||||
|
||||
import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver';
|
||||
import { NavigationBreadcrumbResolver } from '../../core/breadcrumbs/navigation-breadcrumb.resolver';
|
||||
import { LdnServiceFormComponent } from './ldn-service-form/ldn-service-form.component';
|
||||
@@ -28,11 +28,11 @@ const moduleRoutes: Routes = [
|
||||
];
|
||||
|
||||
export const ROUTES = moduleRoutes.map(route => {
|
||||
return {...route, data: {
|
||||
...route.data,
|
||||
relatedRoutes: moduleRoutes.filter(relatedRoute => relatedRoute.path !== route.path)
|
||||
.map((relatedRoute) => {
|
||||
return {path: relatedRoute.path, data: relatedRoute.data};
|
||||
}),
|
||||
}};
|
||||
return { ...route, data: {
|
||||
...route.data,
|
||||
relatedRoutes: moduleRoutes.filter(relatedRoute => relatedRoute.path !== route.path)
|
||||
.map((relatedRoute) => {
|
||||
return { path: relatedRoute.path, data: relatedRoute.data };
|
||||
}),
|
||||
} };
|
||||
});
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { LdnItemfiltersService } from './ldn-services-data/ldn-itemfilters-data.service';
|
||||
import { LdnServicesOverviewComponent } from './ldn-services-directory/ldn-services-directory.component';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
|
@@ -114,8 +114,8 @@ describe('LdnServiceFormEditComponent', () => {
|
||||
activatedRoute = new MockActivatedRoute(routeParams, routeUrlSegments);
|
||||
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [ReactiveFormsModule, TranslateModule.forRoot(), NgbDropdownModule, LdnServiceFormComponent],
|
||||
providers: [
|
||||
imports: [ReactiveFormsModule, TranslateModule.forRoot(), NgbDropdownModule, LdnServiceFormComponent],
|
||||
providers: [
|
||||
{ provide: LdnServicesService, useValue: ldnServicesService },
|
||||
{ provide: LdnItemfiltersService, useValue: ldnItemfiltersService },
|
||||
{ provide: Router, useValue: new RouterStub() },
|
||||
@@ -129,7 +129,7 @@ describe('LdnServiceFormEditComponent', () => {
|
||||
RouteService,
|
||||
provideMockStore({}),
|
||||
],
|
||||
})
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(LdnServiceFormComponent);
|
||||
|
@@ -1,27 +1,63 @@
|
||||
import { animate, state, style, transition, trigger, } from '@angular/animations';
|
||||
import { ChangeDetectorRef, Component, OnDestroy, OnInit, TemplateRef, ViewChild, } from '@angular/core';
|
||||
import { FormArray, FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
|
||||
import { LDN_SERVICE } from '../ldn-services-model/ldn-service.resource-type';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { LdnServicesService } from '../ldn-services-data/ldn-services-data.service';
|
||||
import { notifyPatterns } from '../ldn-services-patterns/ldn-service-coar-patterns';
|
||||
import { NgbDropdownModule, NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
||||
import { LdnService } from '../ldn-services-model/ldn-services.model';
|
||||
import {
|
||||
animate,
|
||||
state,
|
||||
style,
|
||||
transition,
|
||||
trigger,
|
||||
} from '@angular/animations';
|
||||
import {
|
||||
AsyncPipe,
|
||||
NgForOf,
|
||||
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 { combineLatestWith, Observable, Subscription, } from 'rxjs';
|
||||
import {
|
||||
combineLatestWith,
|
||||
Observable,
|
||||
Subscription,
|
||||
} from 'rxjs';
|
||||
import { RemoteData } from 'src/app/core/data/remote-data';
|
||||
|
||||
import { FindListOptions } from '../../../core/data/find-list-options.model';
|
||||
import { PaginatedList } from '../../../core/data/paginated-list.model';
|
||||
import { PaginationService } from '../../../core/pagination/pagination.service';
|
||||
import { getFirstCompletedRemoteData } from '../../../core/shared/operators';
|
||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||
import { IpV4Validator } from '../../../shared/utils/ipV4.validator';
|
||||
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 { 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
|
||||
@@ -44,8 +80,8 @@ import { AsyncPipe, NgForOf, NgIf } from '@angular/common';
|
||||
NgIf,
|
||||
NgbDropdownModule,
|
||||
NgForOf,
|
||||
AsyncPipe
|
||||
]
|
||||
AsyncPipe,
|
||||
],
|
||||
})
|
||||
export class LdnServiceFormComponent implements OnInit, OnDestroy {
|
||||
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
|
||||
*/
|
||||
@Injectable({providedIn: 'root'})
|
||||
@Injectable({ providedIn: 'root' })
|
||||
@dataService(LDN_SERVICE_CONSTRAINT_FILTERS)
|
||||
export class LdnItemfiltersService extends IdentifiableDataService<Itemfilter> implements FindAllData<Itemfilter> {
|
||||
private findAllData: FindAllDataImpl<Itemfilter>;
|
||||
|
@@ -56,7 +56,7 @@ import { LdnService } from '../ldn-services-model/ldn-services.model';
|
||||
* @implements {PatchData<LdnService>}
|
||||
* @implements {CreateData<LdnService>}
|
||||
*/
|
||||
@Injectable({providedIn: 'root'})
|
||||
@Injectable({ providedIn: 'root' })
|
||||
@dataService(LDN_SERVICE)
|
||||
export class LdnServicesService extends IdentifiableDataService<LdnService> implements FindAllData<LdnService>, DeleteData<LdnService>, PatchData<LdnService>, CreateData<LdnService> {
|
||||
createData: CreateDataImpl<LdnService>;
|
||||
|
@@ -50,25 +50,25 @@ describe('LdnServicesOverviewComponent', () => {
|
||||
'patch': createSuccessfulRemoteDataObject$({}),
|
||||
});
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [TranslateModule.forRoot(), LdnServicesOverviewComponent],
|
||||
providers: [
|
||||
imports: [TranslateModule.forRoot(), LdnServicesOverviewComponent],
|
||||
providers: [
|
||||
{
|
||||
provide: LdnServicesService,
|
||||
provide: LdnServicesService,
|
||||
useValue: ldnServicesService,
|
||||
},
|
||||
{ provide: PaginationService, useValue: paginationService },
|
||||
{
|
||||
provide: NgbModal, useValue: {
|
||||
open: () => {
|
||||
},
|
||||
provide: NgbModal, useValue: {
|
||||
open: () => {
|
||||
},
|
||||
},
|
||||
},
|
||||
{ provide: ChangeDetectorRef, useValue: {} },
|
||||
{ provide: NotificationsService, useValue: new NotificationsServiceStub() },
|
||||
{ provide: TranslateService, useValue: translateServiceStub },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
}).compileComponents();
|
||||
}).compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
|
@@ -1,3 +1,8 @@
|
||||
import {
|
||||
AsyncPipe,
|
||||
NgClass,
|
||||
NgIf,
|
||||
} from '@angular/common';
|
||||
import {
|
||||
ChangeDetectionStrategy,
|
||||
ChangeDetectorRef,
|
||||
@@ -7,11 +12,21 @@ import {
|
||||
TemplateRef,
|
||||
ViewChild,
|
||||
} from '@angular/core';
|
||||
import { RouterLink } from '@angular/router';
|
||||
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 { Observable, Subscription, } from 'rxjs';
|
||||
import { map, switchMap, } from 'rxjs/operators';
|
||||
import {
|
||||
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 { 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 { hasValue } from '../../../shared/empty.util';
|
||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||
import { AsyncPipe, NgClass, NgIf } from '@angular/common';
|
||||
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
||||
import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model';
|
||||
import { TruncatableComponent } from '../../../shared/truncatable/truncatable.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';
|
||||
|
||||
/**
|
||||
@@ -48,9 +60,9 @@ import { LdnService } from '../ldn-services-model/ldn-services.model';
|
||||
TruncatableComponent,
|
||||
TruncatablePartComponent,
|
||||
NgClass,
|
||||
RouterLink
|
||||
RouterLink,
|
||||
],
|
||||
standalone: true
|
||||
standalone: true,
|
||||
})
|
||||
export class LdnServicesOverviewComponent implements OnInit, OnDestroy {
|
||||
|
||||
|
@@ -15,17 +15,17 @@ describe('NotificationsSuggestionTargetsPageComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
imports: [
|
||||
CommonModule,
|
||||
TranslateModule.forRoot(),
|
||||
NotificationsSuggestionTargetsPageComponent,
|
||||
],
|
||||
providers: [
|
||||
],
|
||||
providers: [
|
||||
NotificationsSuggestionTargetsPageComponent,
|
||||
],
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
})
|
||||
.compileComponents();
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
@@ -1,16 +1,15 @@
|
||||
import { Component } from '@angular/core';
|
||||
import {
|
||||
PublicationClaimComponent
|
||||
} from '../../../notifications/suggestion-targets/publication-claim/publication-claim.component';
|
||||
|
||||
import { PublicationClaimComponent } from '../../../notifications/suggestion-targets/publication-claim/publication-claim.component';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-admin-notifications-publication-claim-page',
|
||||
templateUrl: './admin-notifications-publication-claim-page.component.html',
|
||||
styleUrls: ['./admin-notifications-publication-claim-page.component.scss'],
|
||||
imports: [
|
||||
PublicationClaimComponent
|
||||
PublicationClaimComponent,
|
||||
],
|
||||
standalone: true
|
||||
standalone: true,
|
||||
})
|
||||
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 { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver';
|
||||
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 { 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 { 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 = [
|
||||
I18nBreadcrumbResolver,
|
||||
@@ -56,14 +44,14 @@ export const ROUTES: Route[] = [
|
||||
pathMatch: 'full',
|
||||
resolve: {
|
||||
breadcrumb: I18nBreadcrumbResolver,
|
||||
suggestionTargetParams: AdminNotificationsPublicationClaimPageResolver
|
||||
suggestionTargetParams: AdminNotificationsPublicationClaimPageResolver,
|
||||
},
|
||||
providers,
|
||||
data: {
|
||||
title: 'admin.notifications.publicationclaim.page.title',
|
||||
breadcrumbKey: 'admin.notifications.publicationclaim',
|
||||
showBreadcrumbsFluid: false
|
||||
}
|
||||
showBreadcrumbsFluid: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
canActivate: [AuthenticatedGuard],
|
||||
@@ -72,14 +60,14 @@ export const ROUTES: Route[] = [
|
||||
pathMatch: 'full',
|
||||
resolve: {
|
||||
breadcrumb: QualityAssuranceBreadcrumbResolver,
|
||||
openaireQualityAssuranceTopicsParams: QualityAssuranceTopicsPageResolver
|
||||
openaireQualityAssuranceTopicsParams: QualityAssuranceTopicsPageResolver,
|
||||
},
|
||||
providers,
|
||||
data: {
|
||||
title: 'admin.quality-assurance.page.title',
|
||||
breadcrumbKey: 'admin.quality-assurance',
|
||||
showBreadcrumbsFluid: false
|
||||
}
|
||||
showBreadcrumbsFluid: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
canActivate: [ AuthenticatedGuard ],
|
||||
@@ -88,14 +76,14 @@ export const ROUTES: Route[] = [
|
||||
pathMatch: 'full',
|
||||
resolve: {
|
||||
breadcrumb: I18nBreadcrumbResolver,
|
||||
openaireQualityAssuranceTopicsParams: QualityAssuranceTopicsPageResolver
|
||||
openaireQualityAssuranceTopicsParams: QualityAssuranceTopicsPageResolver,
|
||||
},
|
||||
providers,
|
||||
data: {
|
||||
title: 'admin.quality-assurance.page.title',
|
||||
breadcrumbKey: 'admin.quality-assurance',
|
||||
showBreadcrumbsFluid: false
|
||||
}
|
||||
showBreadcrumbsFluid: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
canActivate: [AuthenticatedGuard],
|
||||
@@ -105,14 +93,14 @@ export const ROUTES: Route[] = [
|
||||
resolve: {
|
||||
breadcrumb: I18nBreadcrumbResolver,
|
||||
openaireQualityAssuranceSourceParams: QualityAssuranceSourcePageResolver,
|
||||
sourceData: SourceDataResolver
|
||||
sourceData: SourceDataResolver,
|
||||
},
|
||||
providers,
|
||||
data: {
|
||||
title: 'admin.notifications.source.breadcrumbs',
|
||||
breadcrumbKey: 'admin.notifications.source',
|
||||
showBreadcrumbsFluid: false
|
||||
}
|
||||
showBreadcrumbsFluid: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
canActivate: [AuthenticatedGuard],
|
||||
@@ -121,15 +109,15 @@ export const ROUTES: Route[] = [
|
||||
pathMatch: 'full',
|
||||
resolve: {
|
||||
breadcrumb: QualityAssuranceBreadcrumbResolver,
|
||||
openaireQualityAssuranceEventsParams: QualityAssuranceEventsPageResolver
|
||||
openaireQualityAssuranceEventsParams: QualityAssuranceEventsPageResolver,
|
||||
},
|
||||
providers,
|
||||
data: {
|
||||
title: 'admin.notifications.event.page.title',
|
||||
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 { MetadataSchemaComponent } from './metadata-schema/metadata-schema.component';
|
||||
|
||||
import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver';
|
||||
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[] = [
|
||||
{
|
||||
path: 'metadata',
|
||||
resolve: {breadcrumb: I18nBreadcrumbResolver},
|
||||
data: {title: 'admin.registries.metadata.title', breadcrumbKey: 'admin.registries.metadata'},
|
||||
resolve: { breadcrumb: I18nBreadcrumbResolver },
|
||||
data: { title: 'admin.registries.metadata.title', breadcrumbKey: 'admin.registries.metadata' },
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: MetadataRegistryComponent
|
||||
component: MetadataRegistryComponent,
|
||||
},
|
||||
{
|
||||
path: ':schemaName',
|
||||
resolve: {breadcrumb: I18nBreadcrumbResolver},
|
||||
resolve: { breadcrumb: I18nBreadcrumbResolver },
|
||||
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,
|
||||
resolve: {breadcrumb: I18nBreadcrumbResolver},
|
||||
resolve: { breadcrumb: I18nBreadcrumbResolver },
|
||||
loadChildren: () => import('./bitstream-formats/bitstream-formats-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 { BitstreamFormat } from '../../../../core/shared/bitstream-format.model';
|
||||
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 {
|
||||
createFailedRemoteDataObject$,
|
||||
createFailedRemoteDataObject$,
|
||||
createSuccessfulRemoteDataObject$,
|
||||
createSuccessfulRemoteDataObject$,
|
||||
} from '../../../../shared/remote-data.utils';
|
||||
import { NotificationsServiceStub } from '../../../../shared/testing/notifications-service.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 { getMockFormBuilderService } from '../../../../shared/mocks/form-builder-service.mock';
|
||||
import { AddBitstreamFormatComponent } from './add-bitstream-format.component';
|
||||
|
||||
describe('AddBitstreamFormatComponent', () => {
|
||||
let comp: AddBitstreamFormatComponent;
|
||||
@@ -66,12 +67,12 @@ describe('AddBitstreamFormatComponent', () => {
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
})
|
||||
.overrideComponent(AddBitstreamFormatComponent, {
|
||||
remove: {
|
||||
imports: [FormatFormComponent]
|
||||
}
|
||||
})
|
||||
.compileComponents();
|
||||
.overrideComponent(AddBitstreamFormatComponent, {
|
||||
remove: {
|
||||
imports: [FormatFormComponent],
|
||||
},
|
||||
})
|
||||
.compileComponents();
|
||||
};
|
||||
|
||||
const initBeforeEach = () => {
|
||||
@@ -113,12 +114,12 @@ describe('AddBitstreamFormatComponent', () => {
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
})
|
||||
.overrideComponent(AddBitstreamFormatComponent, {
|
||||
remove: {
|
||||
imports: [FormatFormComponent]
|
||||
}
|
||||
})
|
||||
.compileComponents();
|
||||
.overrideComponent(AddBitstreamFormatComponent, {
|
||||
remove: {
|
||||
imports: [FormatFormComponent],
|
||||
},
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
beforeEach(initBeforeEach);
|
||||
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 { 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 { 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 { BitstreamFormat } from '../../../../core/shared/bitstream-format.model';
|
||||
import {
|
||||
BitstreamFormat,
|
||||
BitstreamFormat,
|
||||
} from '../../../../core/shared/bitstream-format.model';
|
||||
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 { NotificationsService } from '../../../../shared/notifications/notifications.service';
|
||||
import { getBitstreamFormatsModuleRoute } from '../../admin-registries-routing-paths';
|
||||
|
||||
/**
|
||||
* 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',
|
||||
imports: [
|
||||
FormatFormComponent,
|
||||
TranslateModule
|
||||
TranslateModule,
|
||||
],
|
||||
standalone: true
|
||||
standalone: true,
|
||||
})
|
||||
export class AddBitstreamFormatComponent {
|
||||
|
||||
|
@@ -1,9 +1,10 @@
|
||||
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 { 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_ADD_PATH = 'add';
|
||||
@@ -14,14 +15,14 @@ export const ROUTES: Route[] = [
|
||||
{
|
||||
path: '',
|
||||
providers,
|
||||
component: BitstreamFormatsComponent
|
||||
component: BitstreamFormatsComponent,
|
||||
},
|
||||
{
|
||||
path: BITSTREAMFORMAT_ADD_PATH,
|
||||
resolve: {breadcrumb: I18nBreadcrumbResolver},
|
||||
resolve: { breadcrumb: I18nBreadcrumbResolver },
|
||||
providers,
|
||||
component: AddBitstreamFormatComponent,
|
||||
data: {breadcrumbKey: 'admin.registries.bitstream-formats.create'}
|
||||
data: { breadcrumbKey: 'admin.registries.bitstream-formats.create' },
|
||||
},
|
||||
{
|
||||
path: BITSTREAMFORMAT_EDIT_PATH,
|
||||
@@ -29,8 +30,8 @@ export const ROUTES: Route[] = [
|
||||
component: EditBitstreamFormatComponent,
|
||||
resolve: {
|
||||
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 {
|
||||
Component,
|
||||
NO_ERRORS_SCHEMA,
|
||||
} from '@angular/core';
|
||||
import {
|
||||
ComponentFixture,
|
||||
ComponentFixture,
|
||||
TestBed,
|
||||
TestBed,
|
||||
waitForAsync,
|
||||
waitForAsync,
|
||||
} from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { provideMockStore } from '@ngrx/store/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import {
|
||||
cold,
|
||||
getTestScheduler,
|
||||
hot,
|
||||
} 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 { APP_DATA_SERVICES_MAP } from '../../../../config/app-config.interface';
|
||||
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 { BitstreamFormat } from '../../../core/shared/bitstream-format.model';
|
||||
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 { createPaginatedList } from '../../../shared/testing/utils.test';
|
||||
import { EnumKeysPipe } from '../../../shared/utils/enum-keys-pipe';
|
||||
import { BitstreamFormatsComponent } from './bitstream-formats.component';
|
||||
import { GroupDataService } from '../../../core/eperson/group-data.service';
|
||||
import { ConfigurationDataService } from '../../../core/data/configuration-data.service';
|
||||
import { Component, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { provideMockStore } from '@ngrx/store/testing';
|
||||
import { APP_DATA_SERVICES_MAP } from '../../../../config/app-config.interface';
|
||||
import {
|
||||
BitstreamFormatsComponent,
|
||||
BitstreamFormatsComponent,
|
||||
} from './bitstream-formats.component';
|
||||
|
||||
describe('BitstreamFormatsComponent', () => {
|
||||
let comp: BitstreamFormatsComponent;
|
||||
@@ -108,7 +118,7 @@ describe('BitstreamFormatsComponent', () => {
|
||||
bitstreamFormatService = jasmine.createSpyObj('bitstreamFormatService', {
|
||||
findAll: observableOf(mockFormatsRD),
|
||||
find: createSuccessfulRemoteDataObject$(mockFormatsList[0]),
|
||||
getSelectedBitstreamFormats: hot('a', {a: mockFormatsList}),
|
||||
getSelectedBitstreamFormats: hot('a', { a: mockFormatsList }),
|
||||
selectBitstreamFormat: {},
|
||||
deselectBitstreamFormat: {},
|
||||
deselectAllBitstreamFormats: {},
|
||||
@@ -124,7 +134,7 @@ describe('BitstreamFormatsComponent', () => {
|
||||
|
||||
|
||||
const configurationDataService = jasmine.createSpyObj('ConfigurationDataService', {
|
||||
findByPropertyName: of({payload: {value: 'test'}}),
|
||||
findByPropertyName: of({ payload: { value: 'test' } }),
|
||||
});
|
||||
|
||||
paginationService = new PaginationServiceStub();
|
||||
@@ -134,12 +144,12 @@ describe('BitstreamFormatsComponent', () => {
|
||||
providers: [
|
||||
provideMockStore(),
|
||||
{ provide: APP_DATA_SERVICES_MAP, useValue: {} },
|
||||
{provide: BitstreamFormatDataService, useValue: bitstreamFormatService},
|
||||
{provide: HostWindowService, useValue: new HostWindowServiceStub(0)},
|
||||
{provide: NotificationsService, useValue: notificationsServiceStub},
|
||||
{provide: PaginationService, useValue: paginationService},
|
||||
{provide: GroupDataService, useValue: groupDataService},
|
||||
{provide: ConfigurationDataService, useValue: configurationDataService}
|
||||
{ provide: BitstreamFormatDataService, useValue: bitstreamFormatService },
|
||||
{ provide: HostWindowService, useValue: new HostWindowServiceStub(0) },
|
||||
{ provide: NotificationsService, useValue: notificationsServiceStub },
|
||||
{ provide: PaginationService, useValue: paginationService },
|
||||
{ provide: GroupDataService, useValue: groupDataService },
|
||||
{ provide: ConfigurationDataService, useValue: configurationDataService },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
}).compileComponents();
|
||||
@@ -266,7 +276,7 @@ describe('BitstreamFormatsComponent', () => {
|
||||
});
|
||||
|
||||
const configurationDataService = jasmine.createSpyObj('ConfigurationDataService', {
|
||||
findByPropertyName: of({payload: {value: 'test'}}),
|
||||
findByPropertyName: of({ payload: { value: 'test' } }),
|
||||
});
|
||||
|
||||
paginationService = new PaginationServiceStub();
|
||||
@@ -278,21 +288,21 @@ describe('BitstreamFormatsComponent', () => {
|
||||
BitstreamFormatsComponent, PaginationComponent, EnumKeysPipe],
|
||||
providers: [
|
||||
provideMockStore(),
|
||||
{provide: BitstreamFormatDataService, useValue: bitstreamFormatService},
|
||||
{provide: HostWindowService, useValue: new HostWindowServiceStub(0)},
|
||||
{provide: NotificationsService, useValue: notificationsServiceStub},
|
||||
{provide: PaginationService, useValue: paginationService},
|
||||
{provide: GroupDataService, useValue: groupDataService},
|
||||
{provide: ConfigurationDataService, useValue: configurationDataService}
|
||||
{ provide: BitstreamFormatDataService, useValue: bitstreamFormatService },
|
||||
{ provide: HostWindowService, useValue: new HostWindowServiceStub(0) },
|
||||
{ provide: NotificationsService, useValue: notificationsServiceStub },
|
||||
{ provide: PaginationService, useValue: paginationService },
|
||||
{ provide: GroupDataService, useValue: groupDataService },
|
||||
{ provide: ConfigurationDataService, useValue: configurationDataService },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
})
|
||||
.overrideComponent(BitstreamFormatsComponent, {
|
||||
remove: {imports: [PaginationComponent]},
|
||||
add: {imports: [TestPaginationComponent]}
|
||||
remove: { imports: [PaginationComponent] },
|
||||
add: { imports: [TestPaginationComponent] },
|
||||
})
|
||||
.compileComponents();
|
||||
}
|
||||
},
|
||||
));
|
||||
|
||||
beforeEach(initBeforeEach);
|
||||
@@ -336,7 +346,7 @@ describe('BitstreamFormatsComponent', () => {
|
||||
});
|
||||
|
||||
const configurationDataService = jasmine.createSpyObj('ConfigurationDataService', {
|
||||
findByPropertyName: of({payload: {value: 'test'}}),
|
||||
findByPropertyName: of({ payload: { value: 'test' } }),
|
||||
});
|
||||
|
||||
paginationService = new PaginationServiceStub();
|
||||
@@ -345,22 +355,22 @@ describe('BitstreamFormatsComponent', () => {
|
||||
imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, BitstreamFormatsComponent, PaginationComponent, EnumKeysPipe],
|
||||
providers: [
|
||||
provideMockStore(),
|
||||
{provide: BitstreamFormatDataService, useValue: bitstreamFormatService},
|
||||
{provide: HostWindowService, useValue: new HostWindowServiceStub(0)},
|
||||
{provide: NotificationsService, useValue: notificationsServiceStub},
|
||||
{provide: PaginationService, useValue: paginationService},
|
||||
{provide: PaginationService, useValue: paginationService},
|
||||
{provide: GroupDataService, useValue: groupDataService},
|
||||
{provide: ConfigurationDataService, useValue: configurationDataService}
|
||||
{ provide: BitstreamFormatDataService, useValue: bitstreamFormatService },
|
||||
{ provide: HostWindowService, useValue: new HostWindowServiceStub(0) },
|
||||
{ provide: NotificationsService, useValue: notificationsServiceStub },
|
||||
{ provide: PaginationService, useValue: paginationService },
|
||||
{ provide: PaginationService, useValue: paginationService },
|
||||
{ provide: GroupDataService, useValue: groupDataService },
|
||||
{ provide: ConfigurationDataService, useValue: configurationDataService },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
})
|
||||
.overrideComponent(BitstreamFormatsComponent, {
|
||||
remove: {imports: [PaginationComponent]},
|
||||
add: {imports: [TestPaginationComponent]}
|
||||
remove: { imports: [PaginationComponent] },
|
||||
add: { imports: [TestPaginationComponent] },
|
||||
})
|
||||
.compileComponents();
|
||||
}
|
||||
},
|
||||
));
|
||||
|
||||
beforeEach(initBeforeEach);
|
||||
|
@@ -1,47 +1,80 @@
|
||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||
import { combineLatest as observableCombineLatest, Observable} from 'rxjs';
|
||||
import { RemoteData } from '../../../core/data/remote-data';
|
||||
import { PaginatedList } from '../../../core/data/paginated-list.model';
|
||||
import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model';
|
||||
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 {
|
||||
AsyncPipe,
|
||||
NgForOf,
|
||||
NgIf,
|
||||
} from '@angular/common';
|
||||
import {
|
||||
Component,
|
||||
Component,
|
||||
OnDestroy,
|
||||
OnDestroy,
|
||||
OnInit,
|
||||
OnInit,
|
||||
} from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import {
|
||||
Router,
|
||||
Router,
|
||||
RouterLink,
|
||||
} from '@angular/router';
|
||||
import {
|
||||
TranslateModule,
|
||||
TranslateService,
|
||||
TranslateService,
|
||||
} from '@ngx-translate/core';
|
||||
import {
|
||||
combineLatest as observableCombineLatest,
|
||||
combineLatest as observableCombineLatest,
|
||||
Observable,
|
||||
Observable,
|
||||
} from 'rxjs';
|
||||
import {
|
||||
map,
|
||||
map,
|
||||
mergeMap,
|
||||
mergeMap,
|
||||
switchMap,
|
||||
switchMap,
|
||||
take,
|
||||
take,
|
||||
toArray,
|
||||
toArray,
|
||||
} 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 { PaginatedList } from '../../../core/data/paginated-list.model';
|
||||
import { RemoteData } from '../../../core/data/remote-data';
|
||||
import { PaginationService } from '../../../core/pagination/pagination.service';
|
||||
import { BitstreamFormat } from '../../../core/shared/bitstream-format.model';
|
||||
import { NoContent } from '../../../core/shared/NoContent.model';
|
||||
import {
|
||||
PaginatedList,
|
||||
PaginatedList,
|
||||
} from '../../../core/data/paginated-list.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 { AsyncPipe, NgForOf, NgIf } from '@angular/common';
|
||||
import {
|
||||
NotificationsService,
|
||||
NotificationsService,
|
||||
} from '../../../shared/notifications/notifications.service';
|
||||
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||
import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model';
|
||||
import {
|
||||
PaginationComponentOptions,
|
||||
PaginationComponentOptions,
|
||||
} from '../../../shared/pagination/pagination-component-options.model';
|
||||
|
||||
/**
|
||||
* This component renders a list of bitstream formats
|
||||
@@ -55,9 +88,9 @@ import { PaginationComponentOptions } from '../../../shared/pagination/paginatio
|
||||
RouterLink,
|
||||
TranslateModule,
|
||||
PaginationComponent,
|
||||
NgForOf
|
||||
NgForOf,
|
||||
],
|
||||
standalone: true
|
||||
standalone: true,
|
||||
})
|
||||
export class BitstreamFormatsComponent implements OnInit, OnDestroy {
|
||||
|
||||
|
@@ -24,9 +24,9 @@ import {
|
||||
createSuccessfulRemoteDataObject,
|
||||
createSuccessfulRemoteDataObject$,
|
||||
} from '../../../../shared/remote-data.utils';
|
||||
import { FormatFormComponent } from '../format-form/format-form.component';
|
||||
import { NotificationsServiceStub } from '../../../../shared/testing/notifications-service.stub';
|
||||
import { RouterStub } from '../../../../shared/testing/router.stub';
|
||||
import { FormatFormComponent } from '../format-form/format-form.component';
|
||||
import { EditBitstreamFormatComponent } from './edit-bitstream-format.component';
|
||||
|
||||
describe('EditBitstreamFormatComponent', () => {
|
||||
@@ -73,8 +73,8 @@ describe('EditBitstreamFormatComponent', () => {
|
||||
})
|
||||
.overrideComponent(EditBitstreamFormatComponent, {
|
||||
remove: {
|
||||
imports: [FormatFormComponent]
|
||||
}
|
||||
imports: [FormatFormComponent],
|
||||
},
|
||||
})
|
||||
.compileComponents();
|
||||
};
|
||||
@@ -129,8 +129,8 @@ describe('EditBitstreamFormatComponent', () => {
|
||||
})
|
||||
.overrideComponent(EditBitstreamFormatComponent, {
|
||||
remove: {
|
||||
imports: [FormatFormComponent]
|
||||
}
|
||||
imports: [FormatFormComponent],
|
||||
},
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
@@ -1,3 +1,4 @@
|
||||
import { AsyncPipe } from '@angular/common';
|
||||
import {
|
||||
Component,
|
||||
OnInit,
|
||||
@@ -6,20 +7,24 @@ import {
|
||||
ActivatedRoute,
|
||||
Router,
|
||||
} from '@angular/router';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import {
|
||||
TranslateModule,
|
||||
TranslateService,
|
||||
TranslateService,
|
||||
} from '@ngx-translate/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
|
||||
import { BitstreamFormatDataService } from '../../../../core/data/bitstream-format-data.service';
|
||||
import { RemoteData } from '../../../../core/data/remote-data';
|
||||
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 { TranslateModule, TranslateService } from '@ngx-translate/core';
|
||||
import { getBitstreamFormatsModuleRoute } from '../../admin-registries-routing-paths';
|
||||
import { getFirstCompletedRemoteData } from '../../../../core/shared/operators';
|
||||
import { FormatFormComponent } from '../format-form/format-form.component';
|
||||
import { AsyncPipe } from '@angular/common';
|
||||
|
||||
/**
|
||||
* This component renders the edit page of a bitstream format.
|
||||
@@ -31,9 +36,9 @@ import { AsyncPipe } from '@angular/common';
|
||||
imports: [
|
||||
FormatFormComponent,
|
||||
TranslateModule,
|
||||
AsyncPipe
|
||||
AsyncPipe,
|
||||
],
|
||||
standalone: true
|
||||
standalone: true,
|
||||
})
|
||||
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 {
|
||||
DynamicCheckboxModel,
|
||||
@@ -9,14 +16,16 @@ import {
|
||||
DynamicSelectModel,
|
||||
DynamicTextAreaModel,
|
||||
} from '@ng-dynamic-forms/core';
|
||||
import { hasValue, isEmpty } from '../../../../shared/empty.util';
|
||||
|
||||
import { environment } from '../../../../../environments/environment';
|
||||
import { BitstreamFormat } from '../../../../core/shared/bitstream-format.model';
|
||||
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 { NgIf } from '@angular/common';
|
||||
import { getBitstreamFormatsModuleRoute } from '../../admin-registries-routing-paths';
|
||||
|
||||
/**
|
||||
* 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',
|
||||
imports: [
|
||||
FormComponent,
|
||||
NgIf
|
||||
NgIf,
|
||||
],
|
||||
standalone: true
|
||||
standalone: true,
|
||||
})
|
||||
export class FormatFormComponent implements OnInit {
|
||||
|
||||
|
@@ -1,37 +1,45 @@
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA, } from '@angular/core';
|
||||
import { ComponentFixture, inject, TestBed, waitForAsync, } from '@angular/core/testing';
|
||||
import {
|
||||
ChangeDetectionStrategy,
|
||||
NO_ERRORS_SCHEMA,
|
||||
} from '@angular/core';
|
||||
import {
|
||||
ComponentFixture,
|
||||
inject,
|
||||
TestBed,
|
||||
waitForAsync,
|
||||
} from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { RouterLink } from '@angular/router';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
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 { ConfigurationDataService } from '../../../core/data/configuration-data.service';
|
||||
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 { PaginationService } from '../../../core/pagination/pagination.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 { getMockFormBuilderService } from '../../../shared/mocks/form-builder-service.mock';
|
||||
import { getMockFormService } from '../../../shared/mocks/form-service.mock';
|
||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
||||
import { createSuccessfulRemoteDataObject$ } from '../../../shared/remote-data.utils';
|
||||
import { HostWindowServiceStub } from '../../../shared/testing/host-window-service.stub';
|
||||
import { NotificationsServiceStub } from '../../../shared/testing/notifications-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 { 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 { MetadataRegistryComponent } from './metadata-registry.component';
|
||||
import { MetadataSchemaFormComponent } from './metadata-schema-form/metadata-schema-form.component';
|
||||
|
||||
describe('MetadataRegistryComponent', () => {
|
||||
let comp: MetadataRegistryComponent;
|
||||
@@ -83,25 +91,25 @@ describe('MetadataRegistryComponent', () => {
|
||||
findByPropertyName: createSuccessfulRemoteDataObject$(Object.assign(new ConfigurationProperty(), {
|
||||
name: 'test',
|
||||
values: [
|
||||
'org.dspace.ctask.general.ProfileFormats = test'
|
||||
]
|
||||
}))
|
||||
'org.dspace.ctask.general.ProfileFormats = test',
|
||||
],
|
||||
})),
|
||||
});
|
||||
|
||||
const mockGroupService = jasmine.createSpyObj('groupService',
|
||||
{
|
||||
{
|
||||
// findByHref: jasmine.createSpy('findByHref'),
|
||||
// findAll: jasmine.createSpy('findAll'),
|
||||
// searchGroups: jasmine.createSpy('searchGroups'),
|
||||
getUUIDFromString: jasmine.createSpy('getUUIDFromString'),
|
||||
},
|
||||
{
|
||||
linkPath: 'groups'
|
||||
}
|
||||
);
|
||||
getUUIDFromString: jasmine.createSpy('getUUIDFromString'),
|
||||
},
|
||||
{
|
||||
linkPath: 'groups',
|
||||
},
|
||||
);
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
RouterTestingModule.withRoutes([]),
|
||||
@@ -135,7 +143,7 @@ describe('MetadataRegistryComponent', () => {
|
||||
})
|
||||
.overrideComponent(MetadataRegistryComponent, {
|
||||
remove: {
|
||||
imports: [MetadataSchemaFormComponent, RouterLink]
|
||||
imports: [MetadataSchemaFormComponent, RouterLink],
|
||||
},
|
||||
add: { changeDetection: ChangeDetectionStrategy.Default },
|
||||
})
|
||||
|
@@ -1,22 +1,44 @@
|
||||
import {
|
||||
AsyncPipe,
|
||||
NgClass,
|
||||
NgForOf,
|
||||
NgIf,
|
||||
} from '@angular/common';
|
||||
import { Component } from '@angular/core';
|
||||
import { RegistryService } from '../../../core/registry/registry.service';
|
||||
import { BehaviorSubject, combineLatest as observableCombineLatest, Observable, zip } from 'rxjs';
|
||||
import { RemoteData } from '../../../core/data/remote-data';
|
||||
import {
|
||||
Router,
|
||||
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 { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model';
|
||||
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 { RemoteData } from '../../../core/data/remote-data';
|
||||
import { MetadataSchema } from '../../../core/metadata/metadata-schema.model';
|
||||
import { PaginationService } from '../../../core/pagination/pagination.service';
|
||||
import { RegistryService } from '../../../core/registry/registry.service';
|
||||
import { NoContent } from '../../../core/shared/NoContent.model';
|
||||
import { getFirstCompletedRemoteData } from '../../../core/shared/operators';
|
||||
import { toFindListOptions } from '../../../shared/pagination/pagination.utils';
|
||||
import { MetadataSchemaFormComponent } from './metadata-schema-form/metadata-schema-form.component';
|
||||
import { AsyncPipe, NgClass, NgForOf, NgIf } from '@angular/common';
|
||||
import { hasValue } from '../../../shared/empty.util';
|
||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||
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({
|
||||
selector: 'ds-metadata-registry',
|
||||
@@ -30,9 +52,9 @@ import { PaginationComponent } from '../../../shared/pagination/pagination.compo
|
||||
NgIf,
|
||||
NgForOf,
|
||||
NgClass,
|
||||
RouterLink
|
||||
RouterLink,
|
||||
],
|
||||
standalone: true
|
||||
standalone: true,
|
||||
})
|
||||
/**
|
||||
* A component used for managing all existing metadata schemas within the repository.
|
||||
|
@@ -1,16 +1,21 @@
|
||||
import { CommonModule } from '@angular/common';
|
||||
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 { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { of as observableOf } from 'rxjs';
|
||||
|
||||
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 { 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 { MetadataSchemaFormComponent } from './metadata-schema-form.component';
|
||||
|
||||
@@ -50,8 +55,8 @@ describe('MetadataSchemaFormComponent', () => {
|
||||
})
|
||||
.overrideComponent(MetadataSchemaFormComponent, {
|
||||
remove: {
|
||||
imports: [FormComponent]
|
||||
}
|
||||
imports: [FormComponent],
|
||||
},
|
||||
})
|
||||
.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 {
|
||||
DynamicFormControlModel,
|
||||
@@ -6,14 +16,23 @@ import {
|
||||
DynamicFormLayout,
|
||||
DynamicInputModel,
|
||||
} from '@ng-dynamic-forms/core';
|
||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
||||
import { combineLatest, Observable, } from 'rxjs';
|
||||
import { switchMap, take, tap, } from 'rxjs/operators';
|
||||
import {
|
||||
TranslateModule,
|
||||
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 { RegistryService } from '../../../../core/registry/registry.service';
|
||||
import { FormBuilderService } from '../../../../shared/form/builder/form-builder.service';
|
||||
import { AsyncPipe, NgIf } from '@angular/common';
|
||||
import { FormComponent } from '../../../../shared/form/form.component';
|
||||
|
||||
@Component({
|
||||
@@ -23,9 +42,9 @@ import { FormComponent } from '../../../../shared/form/form.component';
|
||||
NgIf,
|
||||
AsyncPipe,
|
||||
TranslateModule,
|
||||
FormComponent
|
||||
FormComponent,
|
||||
],
|
||||
standalone: true
|
||||
standalone: true,
|
||||
})
|
||||
/**
|
||||
* A form used for creating and editing metadata schemas
|
||||
|
@@ -1,6 +1,11 @@
|
||||
import { CommonModule } from '@angular/common';
|
||||
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 { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
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 { 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 { 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 { MetadataFieldFormComponent } from './metadata-field-form.component';
|
||||
|
||||
@@ -51,15 +56,15 @@ describe('MetadataFieldFormComponent', () => {
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
return TestBed.configureTestingModule({
|
||||
imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, MetadataFieldFormComponent, EnumKeysPipe],
|
||||
providers: [
|
||||
imports: [CommonModule, RouterTestingModule.withRoutes([]), TranslateModule.forRoot(), NgbModule, MetadataFieldFormComponent, EnumKeysPipe],
|
||||
providers: [
|
||||
{ provide: RegistryService, useValue: registryServiceStub },
|
||||
{ provide: FormBuilderService, useValue: getMockFormBuilderService() }
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
})
|
||||
{ provide: FormBuilderService, useValue: getMockFormBuilderService() },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
})
|
||||
.overrideComponent(MetadataFieldFormComponent, {
|
||||
remove: { imports: [FormComponent]}
|
||||
remove: { imports: [FormComponent] },
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
@@ -1,3 +1,7 @@
|
||||
import {
|
||||
AsyncPipe,
|
||||
NgIf,
|
||||
} from '@angular/common';
|
||||
import {
|
||||
Component,
|
||||
EventEmitter,
|
||||
@@ -14,7 +18,10 @@ import {
|
||||
DynamicInputModel,
|
||||
DynamicTextAreaModel,
|
||||
} from '@ng-dynamic-forms/core';
|
||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
||||
import {
|
||||
TranslateModule,
|
||||
TranslateService,
|
||||
} from '@ngx-translate/core';
|
||||
import { combineLatest } from 'rxjs';
|
||||
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 { RegistryService } from '../../../../core/registry/registry.service';
|
||||
import { FormBuilderService } from '../../../../shared/form/builder/form-builder.service';
|
||||
import { AsyncPipe, NgIf } from '@angular/common';
|
||||
import { FormComponent } from '../../../../shared/form/form.component';
|
||||
|
||||
@Component({
|
||||
@@ -32,9 +38,9 @@ import { FormComponent } from '../../../../shared/form/form.component';
|
||||
NgIf,
|
||||
FormComponent,
|
||||
TranslateModule,
|
||||
AsyncPipe
|
||||
AsyncPipe,
|
||||
],
|
||||
standalone: true
|
||||
standalone: true,
|
||||
})
|
||||
/**
|
||||
* A form used for creating and editing metadata fields
|
||||
|
@@ -1,19 +1,31 @@
|
||||
import { CommonModule } from '@angular/common';
|
||||
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 { ActivatedRoute, Router, } from '@angular/router';
|
||||
import {
|
||||
ActivatedRoute,
|
||||
Router,
|
||||
} from '@angular/router';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { of as observableOf } from 'rxjs';
|
||||
|
||||
import { RestResponse } from '../../../core/cache/response.models';
|
||||
import { ConfigurationDataService } from '../../../core/data/configuration-data.service';
|
||||
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 { MetadataSchema } from '../../../core/metadata/metadata-schema.model';
|
||||
import { PaginationService } from '../../../core/pagination/pagination.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 { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||
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 { NotificationsServiceStub } from '../../../shared/testing/notifications-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 { SearchConfigurationServiceStub } from '../../../shared/testing/search-configuration-service.stub';
|
||||
import { createPaginatedList } from '../../../shared/testing/utils.test';
|
||||
import { EnumKeysPipe } from '../../../shared/utils/enum-keys-pipe';
|
||||
import { VarDirective } from '../../../shared/utils/var.directive';
|
||||
import { MetadataFieldFormComponent } from './metadata-field-form/metadata-field-form.component';
|
||||
import { MetadataSchemaComponent } from './metadata-schema.component';
|
||||
|
||||
describe('MetadataSchemaComponent', () => {
|
||||
@@ -141,9 +149,9 @@ describe('MetadataSchemaComponent', () => {
|
||||
findByPropertyName: createSuccessfulRemoteDataObject$(Object.assign(new ConfigurationProperty(), {
|
||||
name: 'test',
|
||||
values: [
|
||||
'org.dspace.ctask.general.ProfileFormats = test'
|
||||
]
|
||||
}))
|
||||
'org.dspace.ctask.general.ProfileFormats = test',
|
||||
],
|
||||
})),
|
||||
});
|
||||
|
||||
const groupDataService = jasmine.createSpyObj('groupsDataService', {
|
||||
|
@@ -1,6 +1,22 @@
|
||||
import { Component, OnDestroy, OnInit, } from '@angular/core';
|
||||
import { ActivatedRoute, RouterLink } from '@angular/router';
|
||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
||||
import {
|
||||
AsyncPipe,
|
||||
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 {
|
||||
BehaviorSubject,
|
||||
combineLatest,
|
||||
@@ -9,7 +25,11 @@ import {
|
||||
of as observableOf,
|
||||
zip,
|
||||
} 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 { 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 { RegistryService } from '../../../core/registry/registry.service';
|
||||
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 { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
||||
import { toFindListOptions } from '../../../shared/pagination/pagination.utils';
|
||||
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 { MetadataFieldFormComponent } from './metadata-field-form/metadata-field-form.component';
|
||||
import { PaginationComponent } from '../../../shared/pagination/pagination.component';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-metadata-schema',
|
||||
@@ -41,9 +63,9 @@ import { PaginationComponent } from '../../../shared/pagination/pagination.compo
|
||||
NgIf,
|
||||
NgForOf,
|
||||
NgClass,
|
||||
RouterLink
|
||||
RouterLink,
|
||||
],
|
||||
standalone: true
|
||||
standalone: true,
|
||||
})
|
||||
/**
|
||||
* 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 { FilteredItemsComponent } from './filtered-items/filtered-items.component';
|
||||
import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver';
|
||||
|
||||
export const ROUTES = [
|
||||
{
|
||||
path: 'collections',
|
||||
resolve: {breadcrumb: I18nBreadcrumbResolver},
|
||||
data: {title: 'admin.reports.collections.title', breadcrumbKey: 'admin.reports.collections'},
|
||||
resolve: { breadcrumb: I18nBreadcrumbResolver },
|
||||
data: { title: 'admin.reports.collections.title', breadcrumbKey: 'admin.reports.collections' },
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: FilteredCollectionsComponent
|
||||
}
|
||||
]
|
||||
component: FilteredCollectionsComponent,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'queries',
|
||||
resolve: {breadcrumb: I18nBreadcrumbResolver},
|
||||
data: {title: 'admin.reports.items.title', breadcrumbKey: 'admin.reports.items'},
|
||||
resolve: { breadcrumb: I18nBreadcrumbResolver },
|
||||
data: { title: 'admin.reports.items.title', breadcrumbKey: 'admin.reports.items' },
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: FilteredItemsComponent
|
||||
}
|
||||
]
|
||||
}
|
||||
component: FilteredItemsComponent,
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
@@ -1,8 +1,9 @@
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { FormModule } from '../../shared/form/form.module';
|
||||
import { NgbAccordionModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
|
||||
import { FormModule } from '../../shared/form/form.module';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
|
@@ -39,23 +39,23 @@ describe('FiltersComponent', () => {
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
imports: [
|
||||
NgbAccordionModule,
|
||||
TranslateModule.forRoot({
|
||||
loader: {
|
||||
provide: TranslateLoader,
|
||||
loader: {
|
||||
provide: TranslateLoader,
|
||||
useClass: TranslateLoaderMock,
|
||||
},
|
||||
}),
|
||||
HttpClientTestingModule,
|
||||
FilteredCollectionsComponent
|
||||
],
|
||||
providers: [
|
||||
FilteredCollectionsComponent,
|
||||
],
|
||||
providers: [
|
||||
FormBuilder,
|
||||
DspaceRestService,
|
||||
],
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
});
|
||||
});
|
||||
}));
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
|
@@ -1,3 +1,7 @@
|
||||
import {
|
||||
KeyValuePipe,
|
||||
NgForOf,
|
||||
} from '@angular/common';
|
||||
import {
|
||||
Component,
|
||||
ViewChild,
|
||||
@@ -6,7 +10,11 @@ import {
|
||||
FormBuilder,
|
||||
FormGroup,
|
||||
} 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 { RestRequestMethod } from 'src/app/core/data/rest-request-method';
|
||||
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 { FilteredCollections } from './filtered-collections.model';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { KeyValuePipe, NgForOf } from '@angular/common';
|
||||
|
||||
/**
|
||||
* Component representing the Filtered Collections content report
|
||||
@@ -30,9 +36,9 @@ import { KeyValuePipe, NgForOf } from '@angular/common';
|
||||
NgbAccordionModule,
|
||||
FiltersComponent,
|
||||
KeyValuePipe,
|
||||
NgForOf
|
||||
NgForOf,
|
||||
],
|
||||
standalone: true
|
||||
standalone: true,
|
||||
})
|
||||
export class FilteredCollectionsComponent {
|
||||
|
||||
|
@@ -1,8 +1,30 @@
|
||||
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 {
|
||||
AsyncPipe,
|
||||
NgForOf,
|
||||
} from '@angular/common';
|
||||
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 { CommunityDataService } from 'src/app/core/data/community-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 { PresetQuery } from './preset-query.model';
|
||||
import { QueryPredicate } from './query-predicate.model';
|
||||
import { AsyncPipe, NgForOf } from '@angular/common';
|
||||
|
||||
/**
|
||||
* Component representing the Filtered Items content report.
|
||||
@@ -39,9 +60,9 @@ import { AsyncPipe, NgForOf } from '@angular/common';
|
||||
TranslateModule,
|
||||
AsyncPipe,
|
||||
NgForOf,
|
||||
FiltersComponent
|
||||
FiltersComponent,
|
||||
],
|
||||
standalone: true
|
||||
standalone: true,
|
||||
})
|
||||
export class FilteredItemsComponent {
|
||||
|
||||
|
@@ -20,20 +20,20 @@ describe('FiltersComponent', () => {
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
imports: [
|
||||
TranslateModule.forRoot({
|
||||
loader: {
|
||||
provide: TranslateLoader,
|
||||
useClass: TranslateLoaderMock
|
||||
}
|
||||
loader: {
|
||||
provide: TranslateLoader,
|
||||
useClass: TranslateLoaderMock,
|
||||
},
|
||||
}),
|
||||
FiltersComponent
|
||||
],
|
||||
providers: [
|
||||
FiltersComponent,
|
||||
],
|
||||
providers: [
|
||||
FormBuilder,
|
||||
],
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
});
|
||||
});
|
||||
}));
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
|
@@ -1,10 +1,18 @@
|
||||
import { Component, Input } from '@angular/core';
|
||||
import { FormBuilder, FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
||||
import { FilterGroup } from './filter-group.model';
|
||||
import { NgForOf } from '@angular/common';
|
||||
import {
|
||||
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 { NgForOf } from '@angular/common';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { FilterGroup } from './filter-group.model';
|
||||
|
||||
/**
|
||||
* Component representing the Query Filters section used in both
|
||||
@@ -17,9 +25,9 @@ import { TranslateModule } from '@ngx-translate/core';
|
||||
imports: [
|
||||
NgForOf,
|
||||
ReactiveFormsModule,
|
||||
TranslateModule
|
||||
TranslateModule,
|
||||
],
|
||||
standalone: true
|
||||
standalone: true,
|
||||
})
|
||||
export class FiltersComponent {
|
||||
|
||||
|
@@ -1,21 +1,22 @@
|
||||
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 { AdminWorkflowPageComponent } from './admin-workflow-page/admin-workflow-page.component';
|
||||
import { I18nBreadcrumbsService } from '../core/breadcrumbs/i18n-breadcrumbs.service';
|
||||
import { AdminCurationTasksComponent } from './admin-curation-tasks/admin-curation-tasks.component';
|
||||
import { BatchImportPageComponent } from './admin-import-batch-page/batch-import-page.component';
|
||||
import { MetadataImportPageComponent } from './admin-import-metadata-page/metadata-import-page.component';
|
||||
import {
|
||||
LDN_PATH,
|
||||
NOTIFICATIONS_MODULE_PATH,
|
||||
REGISTRIES_MODULE_PATH,
|
||||
REPORTS_MODULE_PATH
|
||||
REPORTS_MODULE_PATH,
|
||||
} 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 = [
|
||||
I18nBreadcrumbResolver,
|
||||
I18nBreadcrumbsService
|
||||
I18nBreadcrumbsService,
|
||||
];
|
||||
|
||||
export const ROUTES: Route[] = [
|
||||
@@ -34,44 +35,44 @@ export const ROUTES: Route[] = [
|
||||
{
|
||||
path: 'search',
|
||||
providers,
|
||||
resolve: {breadcrumb: I18nBreadcrumbResolver},
|
||||
resolve: { breadcrumb: I18nBreadcrumbResolver },
|
||||
component: AdminSearchPageComponent,
|
||||
data: {title: 'admin.search.title', breadcrumbKey: 'admin.search'}
|
||||
data: { title: 'admin.search.title', breadcrumbKey: 'admin.search' },
|
||||
},
|
||||
{
|
||||
path: 'workflow',
|
||||
providers,
|
||||
resolve: {breadcrumb: I18nBreadcrumbResolver},
|
||||
resolve: { breadcrumb: I18nBreadcrumbResolver },
|
||||
component: AdminWorkflowPageComponent,
|
||||
data: {title: 'admin.workflow.title', breadcrumbKey: 'admin.workflow'}
|
||||
data: { title: 'admin.workflow.title', breadcrumbKey: 'admin.workflow' },
|
||||
},
|
||||
{
|
||||
path: 'curation-tasks',
|
||||
providers,
|
||||
resolve: {breadcrumb: I18nBreadcrumbResolver},
|
||||
resolve: { breadcrumb: I18nBreadcrumbResolver },
|
||||
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',
|
||||
providers,
|
||||
resolve: {breadcrumb: I18nBreadcrumbResolver},
|
||||
resolve: { breadcrumb: I18nBreadcrumbResolver },
|
||||
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',
|
||||
providers,
|
||||
resolve: {breadcrumb: I18nBreadcrumbResolver},
|
||||
resolve: { breadcrumb: I18nBreadcrumbResolver },
|
||||
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',
|
||||
providers,
|
||||
resolve: {breadcrumb: I18nBreadcrumbResolver},
|
||||
resolve: { breadcrumb: I18nBreadcrumbResolver },
|
||||
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,
|
||||
@@ -81,7 +82,7 @@ export const ROUTES: Route[] = [
|
||||
path: 'services',
|
||||
loadChildren: () => import('./admin-ldn-services/admin-ldn-services-routes')
|
||||
.then((m) => m.ROUTES),
|
||||
}
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
@@ -1,13 +1,13 @@
|
||||
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 {
|
||||
ComponentFixture,
|
||||
TestBed,
|
||||
waitForAsync,
|
||||
} 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';
|
||||
|
||||
describe('AdminSearchPageComponent', () => {
|
||||
@@ -18,13 +18,13 @@ describe('AdminSearchPageComponent', () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [AdminSearchPageComponent],
|
||||
providers: [
|
||||
{ provide: ActivatedRoute, useValue: new ActivatedRouteStub() }
|
||||
{ provide: ActivatedRoute, useValue: new ActivatedRouteStub() },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
}).overrideComponent(AdminSearchPageComponent, {
|
||||
remove: {
|
||||
imports: [ConfigurationSearchPageComponent]
|
||||
}
|
||||
imports: [ConfigurationSearchPageComponent],
|
||||
},
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
@@ -4,11 +4,11 @@ import { Context } from '../../core/shared/context.model';
|
||||
import { ConfigurationSearchPageComponent } from '../../search-page/configuration-search-page.component';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-admin-search-page',
|
||||
templateUrl: './admin-search-page.component.html',
|
||||
styleUrls: ['./admin-search-page.component.scss'],
|
||||
standalone: true,
|
||||
imports: [ConfigurationSearchPageComponent]
|
||||
selector: 'ds-admin-search-page',
|
||||
templateUrl: './admin-search-page.component.html',
|
||||
styleUrls: ['./admin-search-page.component.scss'],
|
||||
standalone: true,
|
||||
imports: [ConfigurationSearchPageComponent],
|
||||
})
|
||||
|
||||
/**
|
||||
|
@@ -6,7 +6,10 @@ import {
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
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 { 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 { ViewMode } from '../../../../../core/shared/view-mode.model';
|
||||
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 { CollectionElementLinkType } from '../../../../../shared/object-collection/collection-element-link.type';
|
||||
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 { AuthorizationDataServiceStub } from '../../../../../shared/testing/authorization-service.stub';
|
||||
import { FileServiceStub } from '../../../../../shared/testing/file-service.stub';
|
||||
import { ThemeService } from '../../../../../shared/theme-support/theme.service';
|
||||
import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
|
||||
import { CollectionAdminSearchResultGridElementComponent } from './collection-admin-search-result-grid-element.component';
|
||||
import {
|
||||
TruncatableService,
|
||||
TruncatableService,
|
||||
} from '../../../../../shared/truncatable/truncatable.service';
|
||||
import {
|
||||
CollectionAdminSearchResultGridElementComponent,
|
||||
CollectionAdminSearchResultGridElementComponent,
|
||||
} from './collection-admin-search-result-grid-element.component';
|
||||
|
||||
describe('CollectionAdminSearchResultGridElementComponent', () => {
|
||||
let component: CollectionAdminSearchResultGridElementComponent;
|
||||
@@ -51,13 +56,13 @@ describe('CollectionAdminSearchResultGridElementComponent', () => {
|
||||
beforeEach(waitForAsync(() => {
|
||||
init();
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
imports: [
|
||||
NoopAnimationsModule,
|
||||
TranslateModule.forRoot(),
|
||||
RouterTestingModule.withRoutes([]),
|
||||
CollectionAdminSearchResultGridElementComponent
|
||||
],
|
||||
providers: [
|
||||
CollectionAdminSearchResultGridElementComponent,
|
||||
],
|
||||
providers: [
|
||||
{ provide: TruncatableService, useValue: mockTruncatableService },
|
||||
{ provide: BitstreamDataService, useValue: {} },
|
||||
{ provide: LinkService, useValue: linkService },
|
||||
@@ -66,7 +71,7 @@ describe('CollectionAdminSearchResultGridElementComponent', () => {
|
||||
{ provide: AuthorizationDataService, useClass: AuthorizationDataServiceStub },
|
||||
{ provide: ThemeService, useValue: getMockThemeService() },
|
||||
],
|
||||
})
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
|
@@ -1,29 +1,31 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { RouterLink } from '@angular/router';
|
||||
|
||||
import { getCollectionEditRoute } from '../../../../../collection-page/collection-page-routing-paths';
|
||||
import {
|
||||
Collection
|
||||
getCollectionEditRoute,
|
||||
getCollectionEditRoute,
|
||||
} from '../../../../../collection-page/collection-page-routing-paths';
|
||||
import {
|
||||
Collection,
|
||||
Collection,
|
||||
} from '../../../../../core/shared/collection.model';
|
||||
import { Context } from '../../../../../core/shared/context.model';
|
||||
import { ViewMode } from '../../../../../core/shared/view-mode.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 { 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)
|
||||
@Component({
|
||||
selector: 'ds-collection-admin-search-result-list-element',
|
||||
styleUrls: ['./collection-admin-search-result-grid-element.component.scss'],
|
||||
templateUrl: './collection-admin-search-result-grid-element.component.html',
|
||||
standalone: true,
|
||||
imports: [CollectionSearchResultGridElementComponent, RouterLink]
|
||||
selector: 'ds-collection-admin-search-result-list-element',
|
||||
styleUrls: ['./collection-admin-search-result-grid-element.component.scss'],
|
||||
templateUrl: './collection-admin-search-result-grid-element.component.html',
|
||||
standalone: true,
|
||||
imports: [CollectionSearchResultGridElementComponent, RouterLink],
|
||||
})
|
||||
/**
|
||||
* 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 { ViewMode } from '../../../../../core/shared/view-mode.model';
|
||||
import { mockTruncatableService } from '../../../../../shared/mocks/mock-trucatable.service';
|
||||
import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
|
||||
import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock';
|
||||
import { CollectionElementLinkType } from '../../../../../shared/object-collection/collection-element-link.type';
|
||||
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 { AuthorizationDataServiceStub } from '../../../../../shared/testing/authorization-service.stub';
|
||||
import { FileServiceStub } from '../../../../../shared/testing/file-service.stub';
|
||||
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';
|
||||
|
||||
describe('CommunityAdminSearchResultGridElementComponent', () => {
|
||||
@@ -50,13 +51,13 @@ describe('CommunityAdminSearchResultGridElementComponent', () => {
|
||||
beforeEach(waitForAsync(() => {
|
||||
init();
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
imports: [
|
||||
NoopAnimationsModule,
|
||||
TranslateModule.forRoot(),
|
||||
RouterTestingModule.withRoutes([]),
|
||||
CommunityAdminSearchResultGridElementComponent
|
||||
],
|
||||
providers: [
|
||||
CommunityAdminSearchResultGridElementComponent,
|
||||
],
|
||||
providers: [
|
||||
{ provide: TruncatableService, useValue: mockTruncatableService },
|
||||
{ provide: BitstreamDataService, useValue: {} },
|
||||
{ provide: LinkService, useValue: linkService },
|
||||
@@ -64,9 +65,9 @@ describe('CommunityAdminSearchResultGridElementComponent', () => {
|
||||
{ provide: FileService, useClass: FileServiceStub },
|
||||
{ provide: AuthorizationDataService, useClass: AuthorizationDataServiceStub },
|
||||
{ provide: ThemeService, useValue: getMockThemeService() },
|
||||
],
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
})
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
|
@@ -1,29 +1,31 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { RouterLink } from '@angular/router';
|
||||
|
||||
import { getCommunityEditRoute } from '../../../../../community-page/community-page-routing-paths';
|
||||
import {
|
||||
Community
|
||||
getCommunityEditRoute,
|
||||
getCommunityEditRoute,
|
||||
} from '../../../../../community-page/community-page-routing-paths';
|
||||
import {
|
||||
Community,
|
||||
Community,
|
||||
} from '../../../../../core/shared/community.model';
|
||||
import { Context } from '../../../../../core/shared/context.model';
|
||||
import { ViewMode } from '../../../../../core/shared/view-mode.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 { 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)
|
||||
@Component({
|
||||
selector: 'ds-community-admin-search-result-grid-element',
|
||||
styleUrls: ['./community-admin-search-result-grid-element.component.scss'],
|
||||
templateUrl: './community-admin-search-result-grid-element.component.html',
|
||||
standalone: true,
|
||||
imports: [CommunitySearchResultGridElementComponent, RouterLink]
|
||||
selector: 'ds-community-admin-search-result-grid-element',
|
||||
styleUrls: ['./community-admin-search-result-grid-element.component.scss'],
|
||||
templateUrl: './community-admin-search-result-grid-element.component.html',
|
||||
standalone: true,
|
||||
imports: [CommunitySearchResultGridElementComponent, RouterLink],
|
||||
})
|
||||
/**
|
||||
* 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 { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing';
|
||||
import {
|
||||
ComponentFixture,
|
||||
TestBed,
|
||||
waitForAsync,
|
||||
} from '@angular/core/testing';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
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 { FileService } from '../../../../../core/shared/file.service';
|
||||
import { Item } from '../../../../../core/shared/item.model';
|
||||
import { ListableModule } from '../../../../../core/shared/listable.module';
|
||||
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
||||
import { mockTruncatableService } from '../../../../../shared/mocks/mock-trucatable.service';
|
||||
import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
|
||||
import { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock';
|
||||
import { CollectionElementLinkType } from '../../../../../shared/object-collection/collection-element-link.type';
|
||||
import {
|
||||
AccessStatusObject
|
||||
} from '../../../../../shared/object-collection/shared/badges/access-status-badge/access-status.model';
|
||||
import { 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 { createSuccessfulRemoteDataObject$ } from '../../../../../shared/remote-data.utils';
|
||||
import { AuthServiceStub } from '../../../../../shared/testing/auth-service.stub';
|
||||
import { AuthorizationDataServiceStub } from '../../../../../shared/testing/authorization-service.stub';
|
||||
import { FileServiceStub } from '../../../../../shared/testing/file-service.stub';
|
||||
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 { ListableModule } from '../../../../../core/shared/listable.module';
|
||||
|
||||
describe('ItemAdminSearchResultGridElementComponent', () => {
|
||||
let component: ItemAdminSearchResultGridElementComponent;
|
||||
@@ -61,24 +63,24 @@ describe('ItemAdminSearchResultGridElementComponent', () => {
|
||||
init();
|
||||
TestBed.configureTestingModule(
|
||||
{
|
||||
imports: [
|
||||
NoopAnimationsModule,
|
||||
TranslateModule.forRoot(),
|
||||
RouterTestingModule.withRoutes([]),
|
||||
ListableModule,
|
||||
ItemAdminSearchResultGridElementComponent
|
||||
],
|
||||
providers: [
|
||||
{ provide: TruncatableService, useValue: mockTruncatableService },
|
||||
{ provide: BitstreamDataService, useValue: mockBitstreamDataService },
|
||||
{ provide: ThemeService, useValue: mockThemeService },
|
||||
{ provide: AccessStatusDataService, useValue: mockAccessStatusDataService },
|
||||
{ provide: AuthService, useClass: AuthServiceStub },
|
||||
{ provide: FileService, useClass: FileServiceStub },
|
||||
{ provide: AuthorizationDataService, useClass: AuthorizationDataServiceStub },
|
||||
],
|
||||
imports: [
|
||||
NoopAnimationsModule,
|
||||
TranslateModule.forRoot(),
|
||||
RouterTestingModule.withRoutes([]),
|
||||
ListableModule,
|
||||
ItemAdminSearchResultGridElementComponent,
|
||||
],
|
||||
providers: [
|
||||
{ provide: TruncatableService, useValue: mockTruncatableService },
|
||||
{ provide: BitstreamDataService, useValue: mockBitstreamDataService },
|
||||
{ provide: ThemeService, useValue: mockThemeService },
|
||||
{ provide: AccessStatusDataService, useValue: mockAccessStatusDataService },
|
||||
{ provide: AuthService, useClass: AuthServiceStub },
|
||||
{ provide: FileService, useClass: FileServiceStub },
|
||||
{ provide: AuthorizationDataService, useClass: AuthorizationDataServiceStub },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
})
|
||||
})
|
||||
.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 { 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 { Item } from '../../../../../core/shared/item.model';
|
||||
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
||||
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 { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model';
|
||||
import {
|
||||
getListableObjectComponent,
|
||||
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 { SearchResultGridElementComponent } from '../../../../../shared/object-grid/search-result-grid-element/search-result-grid-element.component';
|
||||
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 { ItemAdminSearchResultActionsComponent } from '../../item-admin-search-result-actions.component';
|
||||
|
||||
@listableObjectComponent(ItemSearchResult, ViewMode.GridElement, Context.AdminSearch)
|
||||
@Component({
|
||||
selector: 'ds-item-admin-search-result-grid-element',
|
||||
styleUrls: ['./item-admin-search-result-grid-element.component.scss'],
|
||||
templateUrl: './item-admin-search-result-grid-element.component.html',
|
||||
standalone: true,
|
||||
imports: [ItemAdminSearchResultActionsComponent, DynamicComponentLoaderDirective]
|
||||
selector: 'ds-item-admin-search-result-grid-element',
|
||||
styleUrls: ['./item-admin-search-result-grid-element.component.scss'],
|
||||
templateUrl: './item-admin-search-result-grid-element.component.html',
|
||||
standalone: true,
|
||||
imports: [ItemAdminSearchResultActionsComponent, DynamicComponentLoaderDirective],
|
||||
})
|
||||
/**
|
||||
* 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 {
|
||||
|
||||
ComponentFixture,
|
||||
TestBed,
|
||||
waitForAsync,
|
||||
@@ -16,13 +15,13 @@ import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.service
|
||||
import { Collection } from '../../../../../core/shared/collection.model';
|
||||
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
||||
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 { 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 { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
|
||||
import { CollectionAdminSearchResultListElementComponent } from './collection-admin-search-result-list-element.component';
|
||||
|
||||
describe('CollectionAdminSearchResultListElementComponent', () => {
|
||||
let component: CollectionAdminSearchResultListElementComponent;
|
||||
@@ -40,19 +39,19 @@ describe('CollectionAdminSearchResultListElementComponent', () => {
|
||||
beforeEach(waitForAsync(() => {
|
||||
init();
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
RouterTestingModule.withRoutes([]),
|
||||
CollectionAdminSearchResultListElementComponent
|
||||
],
|
||||
providers: [
|
||||
CollectionAdminSearchResultListElementComponent,
|
||||
],
|
||||
providers: [
|
||||
{ provide: TruncatableService, useValue: mockTruncatableService },
|
||||
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||
{ provide: APP_CONFIG, useValue: environment },
|
||||
{ provide: ThemeService, useValue: getMockThemeService() }
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
})
|
||||
{ provide: ThemeService, useValue: getMockThemeService() },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
|
@@ -1,33 +1,41 @@
|
||||
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 { Collection } from '../../../../../core/shared/collection.model';
|
||||
import { Context } from '../../../../../core/shared/context.model';
|
||||
import {
|
||||
getCollectionEditRoute,
|
||||
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 {
|
||||
listableObjectComponent
|
||||
} from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
|
||||
import { Context } from '../../../../../core/shared/context.model';
|
||||
CollectionSearchResult,
|
||||
CollectionSearchResult,
|
||||
} from '../../../../../shared/object-collection/shared/collection-search-result.model';
|
||||
import {
|
||||
SearchResultListElementComponent
|
||||
} from '../../../../../shared/object-list/search-result-list-element/search-result-list-element.component';
|
||||
import { CollectionSearchResult } from '../../../../../shared/object-collection/shared/collection-search-result.model';
|
||||
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';
|
||||
listableObjectComponent,
|
||||
listableObjectComponent,
|
||||
} from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
|
||||
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 { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
|
||||
import { SearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/search-result-list-element.component';
|
||||
import {
|
||||
SearchResultListElementComponent,
|
||||
SearchResultListElementComponent,
|
||||
} from '../../../../../shared/object-list/search-result-list-element/search-result-list-element.component';
|
||||
|
||||
@listableObjectComponent(CollectionSearchResult, ViewMode.ListElement, Context.AdminSearch)
|
||||
@Component({
|
||||
selector: 'ds-collection-admin-search-result-list-element',
|
||||
styleUrls: ['./collection-admin-search-result-list-element.component.scss'],
|
||||
templateUrl: './collection-admin-search-result-list-element.component.html',
|
||||
standalone: true,
|
||||
imports: [CollectionSearchResultListElementComponent, RouterLink, TranslateModule]
|
||||
selector: 'ds-collection-admin-search-result-list-element',
|
||||
styleUrls: ['./collection-admin-search-result-list-element.component.scss'],
|
||||
templateUrl: './collection-admin-search-result-list-element.component.html',
|
||||
standalone: true,
|
||||
imports: [CollectionSearchResultListElementComponent, RouterLink, TranslateModule],
|
||||
})
|
||||
/**
|
||||
* 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 { ViewMode } from '../../../../../core/shared/view-mode.model';
|
||||
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 { CommunitySearchResult } from '../../../../../shared/object-collection/shared/community-search-result.model';
|
||||
import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
|
||||
import { CommunityAdminSearchResultListElementComponent } from './community-admin-search-result-list-element.component';
|
||||
import { mockTruncatableService } from '../../../../../shared/mocks/mock-trucatable.service';
|
||||
|
||||
describe('CommunityAdminSearchResultListElementComponent', () => {
|
||||
let component: CommunityAdminSearchResultListElementComponent;
|
||||
@@ -37,18 +37,18 @@ describe('CommunityAdminSearchResultListElementComponent', () => {
|
||||
beforeEach(waitForAsync(() => {
|
||||
init();
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
RouterTestingModule.withRoutes([]),
|
||||
CommunityAdminSearchResultListElementComponent
|
||||
],
|
||||
providers: [
|
||||
CommunityAdminSearchResultListElementComponent,
|
||||
],
|
||||
providers: [
|
||||
{ provide: TruncatableService, useValue: mockTruncatableService },
|
||||
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||
{ provide: APP_CONFIG, useValue: environment }
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
})
|
||||
{ provide: APP_CONFIG, useValue: environment },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
|
@@ -1,33 +1,41 @@
|
||||
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 { Community } from '../../../../../core/shared/community.model';
|
||||
import { Context } from '../../../../../core/shared/context.model';
|
||||
import {
|
||||
getCommunityEditRoute,
|
||||
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 {
|
||||
listableObjectComponent
|
||||
} from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
|
||||
import { Context } from '../../../../../core/shared/context.model';
|
||||
CommunitySearchResult,
|
||||
CommunitySearchResult,
|
||||
} from '../../../../../shared/object-collection/shared/community-search-result.model';
|
||||
import {
|
||||
SearchResultListElementComponent
|
||||
} from '../../../../../shared/object-list/search-result-list-element/search-result-list-element.component';
|
||||
import { CommunitySearchResult } from '../../../../../shared/object-collection/shared/community-search-result.model';
|
||||
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';
|
||||
listableObjectComponent,
|
||||
listableObjectComponent,
|
||||
} from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
|
||||
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 { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
|
||||
import { SearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/search-result-list-element.component';
|
||||
import {
|
||||
SearchResultListElementComponent,
|
||||
SearchResultListElementComponent,
|
||||
} from '../../../../../shared/object-list/search-result-list-element/search-result-list-element.component';
|
||||
|
||||
@listableObjectComponent(CommunitySearchResult, ViewMode.ListElement, Context.AdminSearch)
|
||||
@Component({
|
||||
selector: 'ds-community-admin-search-result-list-element',
|
||||
styleUrls: ['./community-admin-search-result-list-element.component.scss'],
|
||||
templateUrl: './community-admin-search-result-list-element.component.html',
|
||||
standalone: true,
|
||||
imports: [CommunitySearchResultListElementComponent, RouterLink, TranslateModule]
|
||||
selector: 'ds-community-admin-search-result-list-element',
|
||||
styleUrls: ['./community-admin-search-result-list-element.component.scss'],
|
||||
templateUrl: './community-admin-search-result-list-element.component.html',
|
||||
standalone: true,
|
||||
imports: [CommunitySearchResultListElementComponent, RouterLink, TranslateModule],
|
||||
})
|
||||
/**
|
||||
* 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 { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing';
|
||||
import {
|
||||
ComponentFixture,
|
||||
TestBed,
|
||||
waitForAsync,
|
||||
} from '@angular/core/testing';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
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 { ViewMode } from '../../../../../core/shared/view-mode.model';
|
||||
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 { 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 { 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 { ItemAdminSearchResultListElementComponent } from './item-admin-search-result-list-element.component';
|
||||
|
||||
describe('ItemAdminSearchResultListElementComponent', () => {
|
||||
let component: ItemAdminSearchResultListElementComponent;
|
||||
@@ -35,20 +37,20 @@ describe('ItemAdminSearchResultListElementComponent', () => {
|
||||
beforeEach(waitForAsync(() => {
|
||||
init();
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
RouterTestingModule.withRoutes([]),
|
||||
ItemAdminSearchResultListElementComponent
|
||||
],
|
||||
providers: [
|
||||
ItemAdminSearchResultListElementComponent,
|
||||
],
|
||||
providers: [
|
||||
{ provide: TruncatableService, useValue: mockTruncatableService },
|
||||
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||
{ provide: APP_CONFIG, useValue: environment }
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
})
|
||||
{ provide: APP_CONFIG, useValue: environment },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
})
|
||||
.overrideComponent(ItemAdminSearchResultListElementComponent, {
|
||||
remove: { imports: [ListableObjectComponentLoaderComponent, ItemAdminSearchResultActionsComponent]}
|
||||
remove: { imports: [ListableObjectComponentLoaderComponent, ItemAdminSearchResultActionsComponent] },
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
@@ -1,27 +1,27 @@
|
||||
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 { 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 { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
|
||||
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,
|
||||
listableObjectComponent,
|
||||
} 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 { 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)
|
||||
@Component({
|
||||
selector: 'ds-item-admin-search-result-list-element',
|
||||
styleUrls: ['./item-admin-search-result-list-element.component.scss'],
|
||||
templateUrl: './item-admin-search-result-list-element.component.html',
|
||||
standalone: true,
|
||||
imports: [ListableObjectComponentLoaderComponent, ItemAdminSearchResultActionsComponent]
|
||||
selector: 'ds-item-admin-search-result-list-element',
|
||||
styleUrls: ['./item-admin-search-result-list-element.component.scss'],
|
||||
templateUrl: './item-admin-search-result-list-element.component.html',
|
||||
standalone: true,
|
||||
imports: [ListableObjectComponentLoaderComponent, ItemAdminSearchResultActionsComponent],
|
||||
})
|
||||
/**
|
||||
* 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(() => {
|
||||
init();
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
RouterTestingModule.withRoutes([]),
|
||||
ItemAdminSearchResultActionsComponent
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
})
|
||||
ItemAdminSearchResultActionsComponent,
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
|
@@ -1,7 +1,13 @@
|
||||
import {
|
||||
NgClass,
|
||||
NgIf,
|
||||
} from '@angular/common';
|
||||
import {
|
||||
Component,
|
||||
Input,
|
||||
} from '@angular/core';
|
||||
import { RouterLink } from '@angular/router';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
import { Item } from '../../../core/shared/item.model';
|
||||
import { URLCombiner } from '../../../core/url-combiner/url-combiner';
|
||||
@@ -13,17 +19,14 @@ import {
|
||||
ITEM_EDIT_REINSTATE_PATH,
|
||||
ITEM_EDIT_WITHDRAW_PATH,
|
||||
} 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';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-item-admin-search-result-actions-element',
|
||||
styleUrls: ['./item-admin-search-result-actions.component.scss'],
|
||||
templateUrl: './item-admin-search-result-actions.component.html',
|
||||
standalone: true,
|
||||
imports: [NgClass, RouterLink, NgIf, TranslateModule]
|
||||
selector: 'ds-item-admin-search-result-actions-element',
|
||||
styleUrls: ['./item-admin-search-result-actions.component.scss'],
|
||||
templateUrl: './item-admin-search-result-actions.component.html',
|
||||
standalone: true,
|
||||
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
|
||||
|
@@ -25,13 +25,13 @@ describe('AdminSidebarSectionComponent', () => {
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [NoopAnimationsModule, RouterTestingModule, TranslateModule.forRoot(), AdminSidebarSectionComponent, TestComponent],
|
||||
providers: [
|
||||
{ provide: 'sectionDataProvider', useValue: { model: { link: 'google.com' }, icon: iconString } },
|
||||
{ provide: MenuService, useValue: menuService },
|
||||
{ provide: CSSVariableService, useClass: CSSVariableServiceStub },
|
||||
imports: [NoopAnimationsModule, RouterTestingModule, TranslateModule.forRoot(), AdminSidebarSectionComponent, TestComponent],
|
||||
providers: [
|
||||
{ provide: 'sectionDataProvider', useValue: { model: { link: 'google.com' }, icon: iconString } },
|
||||
{ provide: MenuService, useValue: menuService },
|
||||
{ provide: CSSVariableService, useClass: CSSVariableServiceStub },
|
||||
],
|
||||
}).overrideComponent(AdminSidebarSectionComponent, {
|
||||
}).overrideComponent(AdminSidebarSectionComponent, {
|
||||
set: {
|
||||
entryComponents: [TestComponent],
|
||||
},
|
||||
@@ -64,13 +64,13 @@ describe('AdminSidebarSectionComponent', () => {
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [NoopAnimationsModule, RouterTestingModule, TranslateModule.forRoot(), AdminSidebarSectionComponent, TestComponent],
|
||||
providers: [
|
||||
{ provide: 'sectionDataProvider', useValue: { model: { link: 'google.com', disabled: true }, icon: iconString } },
|
||||
{ provide: MenuService, useValue: menuService },
|
||||
{ provide: CSSVariableService, useClass: CSSVariableServiceStub },
|
||||
imports: [NoopAnimationsModule, RouterTestingModule, TranslateModule.forRoot(), AdminSidebarSectionComponent, TestComponent],
|
||||
providers: [
|
||||
{ provide: 'sectionDataProvider', useValue: { model: { link: 'google.com', disabled: true }, icon: iconString } },
|
||||
{ provide: MenuService, useValue: menuService },
|
||||
{ provide: CSSVariableService, useClass: CSSVariableServiceStub },
|
||||
],
|
||||
}).overrideComponent(AdminSidebarSectionComponent, {
|
||||
}).overrideComponent(AdminSidebarSectionComponent, {
|
||||
set: {
|
||||
entryComponents: [TestComponent],
|
||||
},
|
||||
@@ -103,10 +103,10 @@ describe('AdminSidebarSectionComponent', () => {
|
||||
|
||||
// declare a test component
|
||||
@Component({
|
||||
selector: 'ds-test-cmp',
|
||||
template: ``,
|
||||
standalone: true,
|
||||
imports: [RouterTestingModule]
|
||||
selector: 'ds-test-cmp',
|
||||
template: ``,
|
||||
standalone: true,
|
||||
imports: [RouterTestingModule],
|
||||
})
|
||||
class TestComponent {
|
||||
}
|
||||
|
@@ -1,21 +1,25 @@
|
||||
import { NgClass } from '@angular/common';
|
||||
import {
|
||||
Component,
|
||||
Inject,
|
||||
Injector,
|
||||
OnInit,
|
||||
} from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
|
||||
import { isEmpty } from '../../../shared/empty.util';
|
||||
import { MenuService } from '../../../shared/menu/menu.service';
|
||||
import { LinkMenuItemModel } from '../../../shared/menu/menu-item/models/link.model';
|
||||
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 {
|
||||
Router,
|
||||
Router,
|
||||
RouterLink,
|
||||
} from '@angular/router';
|
||||
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';
|
||||
|
||||
/**
|
||||
@@ -26,7 +30,7 @@ import { MenuSectionComponent } from '../../../shared/menu/menu-section/menu-sec
|
||||
templateUrl: './admin-sidebar-section.component.html',
|
||||
styleUrls: ['./admin-sidebar-section.component.scss'],
|
||||
standalone: true,
|
||||
imports: [NgClass, RouterLink, TranslateModule]
|
||||
imports: [NgClass, RouterLink, TranslateModule],
|
||||
|
||||
})
|
||||
export class AdminSidebarSectionComponent extends MenuSectionComponent implements OnInit {
|
||||
|
@@ -10,35 +10,56 @@ import {
|
||||
tick,
|
||||
waitForAsync,
|
||||
} 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 { ActivatedRoute } from '@angular/router';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import {
|
||||
ActivatedRoute,
|
||||
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 { of as observableOf } from 'rxjs';
|
||||
import {
|
||||
of as observableOf,
|
||||
of as observableOf,
|
||||
} from 'rxjs';
|
||||
|
||||
import { AuthService } from '../../core/auth/auth.service';
|
||||
import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service';
|
||||
import {
|
||||
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 { Item } from '../../core/shared/item.model';
|
||||
import {
|
||||
Item,
|
||||
Item,
|
||||
} from '../../core/shared/item.model';
|
||||
import { MenuService } from '../../shared/menu/menu.service';
|
||||
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 { 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 { 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 { createSuccessfulRemoteDataObject } from '../../shared/remote-data.utils';
|
||||
import { Item } from '../../core/shared/item.model';
|
||||
import { MenuServiceStub } from '../../shared/testing/menu-service.stub';
|
||||
import { ThemeService } from '../../shared/theme-support/theme.service';
|
||||
import { AdminSidebarComponent } from './admin-sidebar.component';
|
||||
@@ -73,8 +94,8 @@ describe('AdminSidebarComponent', () => {
|
||||
|
||||
const mockNgbModal = {
|
||||
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) });
|
||||
TestBed.configureTestingModule({
|
||||
imports: [TranslateModule.forRoot(), NoopAnimationsModule, RouterTestingModule, AdminSidebarComponent],
|
||||
providers: [
|
||||
imports: [TranslateModule.forRoot(), NoopAnimationsModule, RouterTestingModule, AdminSidebarComponent],
|
||||
providers: [
|
||||
Injector,
|
||||
{ provide: ThemeService, useValue: getMockThemeService() },
|
||||
{ provide: MenuService, useValue: menuService },
|
||||
@@ -95,10 +116,10 @@ describe('AdminSidebarComponent', () => {
|
||||
{ provide: AuthorizationDataService, useValue: authorizationService },
|
||||
{ provide: ScriptDataService, useValue: scriptService },
|
||||
{ provide: ActivatedRoute, useValue: routeStub },
|
||||
{ provide: NgbModal, useValue: mockNgbModal }
|
||||
],
|
||||
{ provide: NgbModal, useValue: mockNgbModal },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
}).overrideComponent(AdminSidebarComponent, {
|
||||
}).overrideComponent(AdminSidebarComponent, {
|
||||
set: {
|
||||
changeDetection: ChangeDetectionStrategy.Default,
|
||||
},
|
||||
|
@@ -1,3 +1,10 @@
|
||||
import {
|
||||
AsyncPipe,
|
||||
NgClass,
|
||||
NgComponentOutlet,
|
||||
NgFor,
|
||||
NgIf,
|
||||
} from '@angular/common';
|
||||
import {
|
||||
Component,
|
||||
HostListener,
|
||||
@@ -6,6 +13,8 @@ import {
|
||||
OnInit,
|
||||
} from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import {
|
||||
BehaviorSubject,
|
||||
combineLatest,
|
||||
@@ -27,20 +36,17 @@ import { MenuService } from '../../shared/menu/menu.service';
|
||||
import { MenuID } from '../../shared/menu/menu-id.model';
|
||||
import { CSSVariableService } from '../../shared/sass-helper/css-variable.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({
|
||||
selector: 'ds-admin-sidebar',
|
||||
templateUrl: './admin-sidebar.component.html',
|
||||
styleUrls: ['./admin-sidebar.component.scss'],
|
||||
animations: [slideSidebar],
|
||||
standalone: true,
|
||||
imports: [NgIf, NgbDropdownModule, NgClass, NgFor, NgComponentOutlet, AsyncPipe, TranslateModule]
|
||||
selector: 'ds-admin-sidebar',
|
||||
templateUrl: './admin-sidebar.component.html',
|
||||
styleUrls: ['./admin-sidebar.component.scss'],
|
||||
animations: [slideSidebar],
|
||||
standalone: true,
|
||||
imports: [NgIf, NgbDropdownModule, NgClass, NgFor, NgComponentOutlet, AsyncPipe, TranslateModule],
|
||||
})
|
||||
export class AdminSidebarComponent extends MenuComponent implements OnInit {
|
||||
/**
|
||||
|
@@ -24,14 +24,14 @@ describe('ExpandableAdminSidebarSectionComponent', () => {
|
||||
const iconString = 'test';
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [NoopAnimationsModule, TranslateModule.forRoot(), ExpandableAdminSidebarSectionComponent, TestComponent],
|
||||
providers: [
|
||||
imports: [NoopAnimationsModule, TranslateModule.forRoot(), ExpandableAdminSidebarSectionComponent, TestComponent],
|
||||
providers: [
|
||||
{ provide: 'sectionDataProvider', useValue: { icon: iconString, model: {} } },
|
||||
{ provide: MenuService, useValue: menuService },
|
||||
{ provide: CSSVariableService, useClass: CSSVariableServiceStub },
|
||||
{ provide: Router, useValue: new RouterStub() },
|
||||
],
|
||||
}).overrideComponent(ExpandableAdminSidebarSectionComponent, {
|
||||
}).overrideComponent(ExpandableAdminSidebarSectionComponent, {
|
||||
set: {
|
||||
entryComponents: [TestComponent],
|
||||
},
|
||||
@@ -74,9 +74,9 @@ describe('ExpandableAdminSidebarSectionComponent', () => {
|
||||
|
||||
// declare a test component
|
||||
@Component({
|
||||
selector: 'ds-test-cmp',
|
||||
template: ``,
|
||||
standalone: true
|
||||
selector: 'ds-test-cmp',
|
||||
template: ``,
|
||||
standalone: true,
|
||||
})
|
||||
class TestComponent {
|
||||
}
|
||||
|
@@ -1,3 +1,10 @@
|
||||
import {
|
||||
AsyncPipe,
|
||||
NgClass,
|
||||
NgComponentOutlet,
|
||||
NgFor,
|
||||
NgIf,
|
||||
} from '@angular/common';
|
||||
import {
|
||||
Component,
|
||||
Inject,
|
||||
@@ -5,24 +12,25 @@ import {
|
||||
OnInit,
|
||||
} from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import {
|
||||
combineLatest as combineLatestObservable,
|
||||
combineLatest as combineLatestObservable,
|
||||
Observable,
|
||||
Observable,
|
||||
} from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
import {
|
||||
map,
|
||||
map,
|
||||
} from 'rxjs/operators';
|
||||
|
||||
import { bgColor } from '../../../shared/animations/bgColor';
|
||||
import { rotate } from '../../../shared/animations/rotate';
|
||||
import { slide } from '../../../shared/animations/slide';
|
||||
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 { rendersSectionForMenu } from '../../../shared/menu/menu-section.decorator';
|
||||
import { CSSVariableService } from '../../../shared/sass-helper/css-variable.service';
|
||||
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
|
||||
@@ -33,7 +41,7 @@ import { AsyncPipe, NgClass, NgComponentOutlet, NgFor, NgIf } from '@angular/com
|
||||
styleUrls: ['./expandable-admin-sidebar-section.component.scss'],
|
||||
animations: [rotate, slide, bgColor],
|
||||
standalone: true,
|
||||
imports: [NgClass, NgComponentOutlet, NgIf, NgFor, AsyncPipe, TranslateModule]
|
||||
imports: [NgClass, NgComponentOutlet, NgIf, NgFor, AsyncPipe, TranslateModule],
|
||||
})
|
||||
|
||||
export class ExpandableAdminSidebarSectionComponent extends AdminSidebarSectionComponent implements OnInit {
|
||||
|
@@ -11,10 +11,10 @@ import { AdminSidebarComponent } from './admin-sidebar.component';
|
||||
* Themed wrapper for AdminSidebarComponent
|
||||
*/
|
||||
@Component({
|
||||
selector: 'ds-themed-admin-sidebar',
|
||||
styleUrls: [],
|
||||
templateUrl: '../../shared/theme-support/themed.component.html',
|
||||
standalone: true
|
||||
selector: 'ds-themed-admin-sidebar',
|
||||
styleUrls: [],
|
||||
templateUrl: '../../shared/theme-support/themed.component.html',
|
||||
standalone: true,
|
||||
})
|
||||
export class ThemedAdminSidebarComponent extends ThemedComponent<AdminSidebarComponent> {
|
||||
|
||||
|
@@ -1,11 +1,11 @@
|
||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { ConfigurationSearchPageComponent } from '../../search-page/configuration-search-page.component';
|
||||
import {
|
||||
ComponentFixture,
|
||||
TestBed,
|
||||
waitForAsync,
|
||||
} from '@angular/core/testing';
|
||||
|
||||
import { ConfigurationSearchPageComponent } from '../../search-page/configuration-search-page.component';
|
||||
import { AdminWorkflowPageComponent } from './admin-workflow-page.component';
|
||||
|
||||
describe('AdminSearchPageComponent', () => {
|
||||
@@ -20,9 +20,9 @@ describe('AdminSearchPageComponent', () => {
|
||||
.overrideComponent(AdminWorkflowPageComponent, {
|
||||
remove: {
|
||||
imports: [
|
||||
ConfigurationSearchPageComponent
|
||||
]
|
||||
}
|
||||
ConfigurationSearchPageComponent,
|
||||
],
|
||||
},
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
@@ -4,11 +4,11 @@ import { Context } from '../../core/shared/context.model';
|
||||
import { ConfigurationSearchPageComponent } from '../../search-page/configuration-search-page.component';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-admin-workflow-page',
|
||||
templateUrl: './admin-workflow-page.component.html',
|
||||
styleUrls: ['./admin-workflow-page.component.scss'],
|
||||
standalone: true,
|
||||
imports: [ConfigurationSearchPageComponent]
|
||||
selector: 'ds-admin-workflow-page',
|
||||
templateUrl: './admin-workflow-page.component.html',
|
||||
styleUrls: ['./admin-workflow-page.component.scss'],
|
||||
standalone: true,
|
||||
imports: [ConfigurationSearchPageComponent],
|
||||
})
|
||||
|
||||
/**
|
||||
|
@@ -1,5 +1,9 @@
|
||||
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 { RouterTestingModule } from '@angular/router/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
@@ -35,13 +39,13 @@ describe('WorkflowItemAdminWorkflowActionsComponent', () => {
|
||||
beforeEach(waitForAsync(() => {
|
||||
init();
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
imports: [
|
||||
TranslateModule.forRoot(),
|
||||
RouterTestingModule.withRoutes([]),
|
||||
WorkflowItemAdminWorkflowActionsComponent
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
})
|
||||
WorkflowItemAdminWorkflowActionsComponent,
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
|
@@ -1,23 +1,26 @@
|
||||
import {
|
||||
NgClass,
|
||||
NgIf,
|
||||
} from '@angular/common';
|
||||
import {
|
||||
Component,
|
||||
Input,
|
||||
} from '@angular/core';
|
||||
import { RouterLink } from '@angular/router';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
import { WorkflowItem } from '../../../../../core/submission/models/workflowitem.model';
|
||||
import {
|
||||
getWorkflowItemDeleteRoute,
|
||||
getWorkflowItemSendBackRoute,
|
||||
} 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({
|
||||
selector: 'ds-workflow-item-admin-workflow-actions-element',
|
||||
styleUrls: ['./workflow-item-admin-workflow-actions.component.scss'],
|
||||
templateUrl: './workflow-item-admin-workflow-actions.component.html',
|
||||
standalone: true,
|
||||
imports: [NgClass, RouterLink, NgIf, TranslateModule]
|
||||
selector: 'ds-workflow-item-admin-workflow-actions-element',
|
||||
styleUrls: ['./workflow-item-admin-workflow-actions.component.scss'],
|
||||
templateUrl: './workflow-item-admin-workflow-actions.component.html',
|
||||
standalone: true,
|
||||
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
|
||||
|
@@ -7,15 +7,19 @@ import {
|
||||
TestBed,
|
||||
waitForAsync,
|
||||
} 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 { of } from 'rxjs';
|
||||
|
||||
import { Group } from '../../../../../../core/eperson/models/group.model';
|
||||
import { SupervisionOrder } from '../../../../../../core/supervision-order/models/supervision-order.model';
|
||||
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 { SupervisionOrderGroupSelectorComponent } from './supervision-order-group-selector.component';
|
||||
import { EpersonGroupListComponent } from '../../../../../../shared/eperson-group-list/eperson-group-list.component';
|
||||
|
||||
describe('SupervisionOrderGroupSelectorComponent', () => {
|
||||
let component: SupervisionOrderGroupSelectorComponent;
|
||||
@@ -39,20 +43,20 @@ describe('SupervisionOrderGroupSelectorComponent', () => {
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
NgbPaginationModule,
|
||||
TranslateModule.forRoot(),
|
||||
SupervisionOrderGroupSelectorComponent
|
||||
],
|
||||
providers: [
|
||||
imports: [
|
||||
NgbPaginationModule,
|
||||
TranslateModule.forRoot(),
|
||||
SupervisionOrderGroupSelectorComponent,
|
||||
],
|
||||
providers: [
|
||||
{ provide: NgbActiveModal, useValue: modalStub },
|
||||
{ provide: SupervisionOrderDataService, useValue: supervisionOrderDataService },
|
||||
{ provide: NotificationsService, useValue: {} },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
})
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
})
|
||||
.overrideComponent(SupervisionOrderGroupSelectorComponent, {
|
||||
remove: { imports: [EpersonGroupListComponent]}
|
||||
remove: { imports: [EpersonGroupListComponent] },
|
||||
})
|
||||
.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 { TranslateModule, TranslateService } from '@ngx-translate/core';
|
||||
import {
|
||||
TranslateModule,
|
||||
TranslateService,
|
||||
} from '@ngx-translate/core';
|
||||
import { getFirstCompletedRemoteData } from 'src/app/core/shared/operators';
|
||||
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 { EpersonGroupListComponent } from '../../../../../../shared/eperson-group-list/eperson-group-list.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 -
|
||||
@@ -22,11 +29,11 @@ import { FormsModule } from '@angular/forms';
|
||||
*/
|
||||
|
||||
@Component({
|
||||
selector: 'ds-supervision-group-selector',
|
||||
styleUrls: ['./supervision-order-group-selector.component.scss'],
|
||||
templateUrl: './supervision-order-group-selector.component.html',
|
||||
standalone: true,
|
||||
imports: [FormsModule, NgIf, ErrorComponent, EpersonGroupListComponent, TranslateModule]
|
||||
selector: 'ds-supervision-group-selector',
|
||||
styleUrls: ['./supervision-order-group-selector.component.scss'],
|
||||
templateUrl: './supervision-order-group-selector.component.html',
|
||||
standalone: true,
|
||||
imports: [FormsModule, NgIf, ErrorComponent, EpersonGroupListComponent, TranslateModule],
|
||||
})
|
||||
export class SupervisionOrderGroupSelectorComponent {
|
||||
|
||||
|
@@ -24,21 +24,21 @@ describe('SupervisionOrderStatusComponent', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [
|
||||
imports: [
|
||||
NgbTooltipModule,
|
||||
TranslateModule.forRoot({
|
||||
loader: {
|
||||
provide: TranslateLoader,
|
||||
useClass: TranslateLoaderMock
|
||||
}
|
||||
loader: {
|
||||
provide: TranslateLoader,
|
||||
useClass: TranslateLoaderMock,
|
||||
},
|
||||
}),
|
||||
SupervisionOrderStatusComponent, VarDirective
|
||||
],
|
||||
schemas: [
|
||||
SupervisionOrderStatusComponent, VarDirective,
|
||||
],
|
||||
schemas: [
|
||||
NO_ERRORS_SCHEMA,
|
||||
],
|
||||
})
|
||||
.compileComponents();
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
|
@@ -1,6 +1,28 @@
|
||||
import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges, } from '@angular/core';
|
||||
import { BehaviorSubject, from, Observable, } from 'rxjs';
|
||||
import { map, mergeMap, reduce, } from 'rxjs/operators';
|
||||
import {
|
||||
AsyncPipe,
|
||||
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 { 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 { SupervisionOrder } from '../../../../../../core/supervision-order/models/supervision-order.model';
|
||||
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';
|
||||
|
||||
export interface SupervisionOrderListEntry {
|
||||
@@ -19,11 +38,11 @@ export interface SupervisionOrderListEntry {
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'ds-supervision-order-status',
|
||||
templateUrl: './supervision-order-status.component.html',
|
||||
styleUrls: ['./supervision-order-status.component.scss'],
|
||||
standalone: true,
|
||||
imports: [VarDirective, NgIf, NgFor, NgbTooltipModule, AsyncPipe, TranslateModule]
|
||||
selector: 'ds-supervision-order-status',
|
||||
templateUrl: './supervision-order-status.component.html',
|
||||
styleUrls: ['./supervision-order-status.component.scss'],
|
||||
standalone: true,
|
||||
imports: [VarDirective, NgIf, NgFor, NgbTooltipModule, AsyncPipe, TranslateModule],
|
||||
})
|
||||
export class SupervisionOrderStatusComponent implements OnChanges {
|
||||
|
||||
|
@@ -52,19 +52,19 @@ describe('WorkspaceItemAdminWorkflowActionsComponent', () => {
|
||||
beforeEach(waitForAsync(() => {
|
||||
init();
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
imports: [
|
||||
NgbModalModule,
|
||||
TranslateModule.forRoot(),
|
||||
RouterTestingModule.withRoutes([]),
|
||||
WorkspaceItemAdminWorkflowActionsComponent
|
||||
],
|
||||
providers: [
|
||||
WorkspaceItemAdminWorkflowActionsComponent,
|
||||
],
|
||||
providers: [
|
||||
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||
{ provide: NotificationsService, useValue: notificationService },
|
||||
{ provide: SupervisionOrderDataService, useValue: supervisionOrderDataService },
|
||||
],
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
})
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
|
@@ -1,3 +1,7 @@
|
||||
import {
|
||||
NgClass,
|
||||
NgIf,
|
||||
} from '@angular/common';
|
||||
import {
|
||||
Component,
|
||||
EventEmitter,
|
||||
@@ -5,11 +9,15 @@ import {
|
||||
OnInit,
|
||||
Output,
|
||||
} from '@angular/core';
|
||||
import { RouterLink } from '@angular/router';
|
||||
import {
|
||||
NgbModal,
|
||||
NgbModalRef,
|
||||
} from '@ng-bootstrap/ng-bootstrap';
|
||||
import { TranslateService, TranslateModule } from '@ngx-translate/core';
|
||||
import {
|
||||
TranslateModule,
|
||||
TranslateService,
|
||||
} from '@ngx-translate/core';
|
||||
import {
|
||||
map,
|
||||
Observable,
|
||||
@@ -26,25 +34,26 @@ import { Item } from '../../../../../core/shared/item.model';
|
||||
import { getFirstSucceededRemoteDataPayload } from '../../../../../core/shared/operators';
|
||||
import { WorkspaceItem } from '../../../../../core/submission/models/workspaceitem.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 { 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 { hasValue } from '../../../../../shared/empty.util';
|
||||
import { NotificationsService } from '../../../../../shared/notifications/notifications.service';
|
||||
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 { 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({
|
||||
selector: 'ds-workspace-item-admin-workflow-actions-element',
|
||||
styleUrls: ['./workspace-item-admin-workflow-actions.component.scss'],
|
||||
templateUrl: './workspace-item-admin-workflow-actions.component.html',
|
||||
standalone: true,
|
||||
imports: [SupervisionOrderStatusComponent, NgClass, RouterLink, NgIf, TranslateModule]
|
||||
selector: 'ds-workspace-item-admin-workflow-actions-element',
|
||||
styleUrls: ['./workspace-item-admin-workflow-actions.component.scss'],
|
||||
templateUrl: './workspace-item-admin-workflow-actions.component.html',
|
||||
standalone: true,
|
||||
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
|
||||
|
@@ -1,39 +1,35 @@
|
||||
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 { RouterTestingModule } from '@angular/router/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { of as observableOf } from 'rxjs';
|
||||
|
||||
import { AuthService } from '../../../../../core/auth/auth.service';
|
||||
import { LinkService } from '../../../../../core/cache/builders/link.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 { ListableModule } from '../../../../../core/shared/listable.module';
|
||||
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
||||
import { WorkflowItem } from '../../../../../core/submission/models/workflowitem.model';
|
||||
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 { getMockThemeService } from '../../../../../shared/mocks/theme-service.mock';
|
||||
import { CollectionElementLinkType } from '../../../../../shared/object-collection/collection-element-link.type';
|
||||
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 { 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 { 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 { 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 { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
|
||||
import { followLink } from '../../../../../shared/utils/follow-link-config.model';
|
||||
import {
|
||||
WorkflowItemSearchResultAdminWorkflowGridElementComponent
|
||||
} from './workflow-item-search-result-admin-workflow-grid-element.component';
|
||||
import { WorkflowItemSearchResultAdminWorkflowGridElementComponent } from './workflow-item-search-result-admin-workflow-grid-element.component';
|
||||
|
||||
describe('WorkflowItemSearchResultAdminWorkflowGridElementComponent', () => {
|
||||
let component: WorkflowItemSearchResultAdminWorkflowGridElementComponent;
|
||||
@@ -60,30 +56,30 @@ describe('WorkflowItemSearchResultAdminWorkflowGridElementComponent', () => {
|
||||
init();
|
||||
TestBed.configureTestingModule(
|
||||
{
|
||||
imports: [
|
||||
WorkflowItemSearchResultAdminWorkflowGridElementComponent,
|
||||
ItemGridElementComponent,
|
||||
DynamicComponentLoaderDirective,
|
||||
NoopAnimationsModule,
|
||||
TranslateModule.forRoot(),
|
||||
RouterTestingModule.withRoutes([]),
|
||||
ListableModule,
|
||||
WorkflowItemSearchResultAdminWorkflowGridElementComponent
|
||||
],
|
||||
providers: [
|
||||
{ provide: LinkService, useValue: linkService },
|
||||
{ provide: ThemeService, useValue: themeService },
|
||||
{
|
||||
imports: [
|
||||
WorkflowItemSearchResultAdminWorkflowGridElementComponent,
|
||||
ItemGridElementComponent,
|
||||
DynamicComponentLoaderDirective,
|
||||
NoopAnimationsModule,
|
||||
TranslateModule.forRoot(),
|
||||
RouterTestingModule.withRoutes([]),
|
||||
ListableModule,
|
||||
WorkflowItemSearchResultAdminWorkflowGridElementComponent,
|
||||
],
|
||||
providers: [
|
||||
{ provide: LinkService, useValue: linkService },
|
||||
{ provide: ThemeService, useValue: themeService },
|
||||
{
|
||||
provide: TruncatableService, useValue: {
|
||||
isCollapsed: () => observableOf(true),
|
||||
isCollapsed: () => observableOf(true),
|
||||
},
|
||||
},
|
||||
{ provide: BitstreamDataService, useValue: {} },
|
||||
{ provide: AuthService, useValue: new AuthServiceMock() },
|
||||
{ provide: AuthorizationDataService, useClass: AuthorizationDataServiceStub },
|
||||
],
|
||||
},
|
||||
{ provide: BitstreamDataService, useValue: {} },
|
||||
{ provide: AuthService, useValue: new AuthServiceMock() },
|
||||
{ provide: AuthorizationDataService, useClass: AuthorizationDataServiceStub },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
})
|
||||
})
|
||||
.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 { take } from 'rxjs/operators';
|
||||
|
||||
@@ -9,39 +18,32 @@ import { RemoteData } from '../../../../../core/data/remote-data';
|
||||
import { Context } from '../../../../../core/shared/context.model';
|
||||
import { GenericConstructor } from '../../../../../core/shared/generic-constructor';
|
||||
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 { WorkflowItem } from '../../../../../core/submission/models/workflowitem.model';
|
||||
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 {
|
||||
getListableObjectComponent,
|
||||
listableObjectComponent,
|
||||
} from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
|
||||
import {
|
||||
WorkflowItemSearchResult
|
||||
} 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 { WorkflowItemSearchResult } 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 { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
|
||||
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 { NgIf } from '@angular/common';
|
||||
import { WorkflowItemAdminWorkflowActionsComponent } from '../../actions/workflow-item/workflow-item-admin-workflow-actions.component';
|
||||
|
||||
@listableObjectComponent(WorkflowItemSearchResult, ViewMode.GridElement, Context.AdminWorkflowSearch)
|
||||
@Component({
|
||||
selector: 'ds-workflow-item-search-result-admin-workflow-grid-element',
|
||||
styleUrls: ['./workflow-item-search-result-admin-workflow-grid-element.component.scss'],
|
||||
templateUrl: './workflow-item-search-result-admin-workflow-grid-element.component.html',
|
||||
standalone: true,
|
||||
imports: [NgIf, WorkflowItemAdminWorkflowActionsComponent, TranslateModule, DynamicComponentLoaderDirective]
|
||||
selector: 'ds-workflow-item-search-result-admin-workflow-grid-element',
|
||||
styleUrls: ['./workflow-item-search-result-admin-workflow-grid-element.component.scss'],
|
||||
templateUrl: './workflow-item-search-result-admin-workflow-grid-element.component.html',
|
||||
standalone: true,
|
||||
imports: [NgIf, WorkflowItemAdminWorkflowActionsComponent, TranslateModule, DynamicComponentLoaderDirective],
|
||||
})
|
||||
/**
|
||||
* 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 { of as observableOf } from 'rxjs';
|
||||
|
||||
import { AuthService } from '../../../../../core/auth/auth.service';
|
||||
import { LinkService } from '../../../../../core/cache/builders/link.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 { ListableModule } from '../../../../../core/shared/listable.module';
|
||||
import { ViewMode } from '../../../../../core/shared/view-mode.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 { AuthServiceMock } from '../../../../../shared/mocks/auth.service.mock';
|
||||
import { getMockLinkService } from '../../../../../shared/mocks/link-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 { 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 { createSuccessfulRemoteDataObject$ } from '../../../../../shared/remote-data.utils';
|
||||
import { NotificationsServiceStub } from '../../../../../shared/testing/notifications-service.stub';
|
||||
import {
|
||||
supervisionOrderPaginatedListRD,
|
||||
supervisionOrderPaginatedListRD$,
|
||||
} 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 { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
|
||||
import { followLink } from '../../../../../shared/utils/follow-link-config.model';
|
||||
@@ -70,32 +74,32 @@ describe('WorkspaceItemSearchResultAdminWorkflowGridElementComponent', () => {
|
||||
init();
|
||||
TestBed.configureTestingModule(
|
||||
{
|
||||
imports: [
|
||||
WorkspaceItemSearchResultAdminWorkflowGridElementComponent,
|
||||
ItemGridElementComponent,
|
||||
DynamicComponentLoaderDirective,
|
||||
NoopAnimationsModule,
|
||||
TranslateModule.forRoot(),
|
||||
RouterTestingModule.withRoutes([]),
|
||||
ListableModule,
|
||||
WorkspaceItemSearchResultAdminWorkflowGridElementComponent
|
||||
],
|
||||
providers: [
|
||||
{ provide: LinkService, useValue: linkService },
|
||||
{ provide: ThemeService, useValue: themeService },
|
||||
{
|
||||
imports: [
|
||||
WorkspaceItemSearchResultAdminWorkflowGridElementComponent,
|
||||
ItemGridElementComponent,
|
||||
DynamicComponentLoaderDirective,
|
||||
NoopAnimationsModule,
|
||||
TranslateModule.forRoot(),
|
||||
RouterTestingModule.withRoutes([]),
|
||||
ListableModule,
|
||||
WorkspaceItemSearchResultAdminWorkflowGridElementComponent,
|
||||
],
|
||||
providers: [
|
||||
{ provide: LinkService, useValue: linkService },
|
||||
{ provide: ThemeService, useValue: themeService },
|
||||
{
|
||||
provide: TruncatableService, useValue: {
|
||||
isCollapsed: () => observableOf(true),
|
||||
isCollapsed: () => observableOf(true),
|
||||
},
|
||||
},
|
||||
{ provide: BitstreamDataService, useValue: {} },
|
||||
{ provide: SupervisionOrderDataService, useValue: supervisionOrderDataService },
|
||||
{ provide: NotificationsService, useValue: new NotificationsServiceStub() },
|
||||
{ provide: AuthService, useValue: new AuthServiceMock() },
|
||||
{ provide: AuthorizationDataService, useValue: {} },
|
||||
],
|
||||
},
|
||||
{ provide: BitstreamDataService, useValue: {} },
|
||||
{ provide: SupervisionOrderDataService, useValue: supervisionOrderDataService },
|
||||
{ provide: NotificationsService, useValue: new NotificationsServiceStub() },
|
||||
{ provide: AuthService, useValue: new AuthServiceMock() },
|
||||
{ provide: AuthorizationDataService, useValue: {} },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
})
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
|
@@ -1,18 +1,27 @@
|
||||
import { Component, ComponentRef, ElementRef, OnDestroy, OnInit, ViewChild } from '@angular/core';
|
||||
|
||||
import { BehaviorSubject, Observable } from 'rxjs';
|
||||
import { map, mergeMap, take, tap } from 'rxjs/operators';
|
||||
|
||||
import { Item } from '../../../../../core/shared/item.model';
|
||||
import { ViewMode } from '../../../../../core/shared/view-mode.model';
|
||||
import { AsyncPipe } from '@angular/common';
|
||||
import {
|
||||
Component,
|
||||
ComponentRef,
|
||||
ElementRef,
|
||||
OnDestroy,
|
||||
OnInit,
|
||||
ViewChild,
|
||||
} from '@angular/core';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import {
|
||||
BehaviorSubject,
|
||||
BehaviorSubject,
|
||||
Observable,
|
||||
Observable,
|
||||
} from 'rxjs';
|
||||
import {
|
||||
map,
|
||||
map,
|
||||
mergeMap,
|
||||
mergeMap,
|
||||
take,
|
||||
take,
|
||||
tap,
|
||||
tap,
|
||||
} from 'rxjs/operators';
|
||||
|
||||
@@ -25,23 +34,23 @@ import { Context } from '../../../../../core/shared/context.model';
|
||||
import { DSpaceObject } from '../../../../../core/shared/dspace-object.model';
|
||||
import { GenericConstructor } from '../../../../../core/shared/generic-constructor';
|
||||
import {
|
||||
Item } from '../../../../../core/shared/item.model';
|
||||
Item,
|
||||
Item,
|
||||
} from '../../../../../core/shared/item.model';
|
||||
import {
|
||||
getAllSucceededRemoteData,
|
||||
getFirstCompletedRemoteData,
|
||||
getRemoteDataPayload,
|
||||
} 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 { SupervisionOrder } from '../../../../../core/supervision-order/models/supervision-order.model';
|
||||
import { SupervisionOrderDataService } from '../../../../../core/supervision-order/supervision-order-data.service';
|
||||
import { DynamicComponentLoaderDirective } from '../../../../../shared/abstract-component-loader/dynamic-component-loader.directive';
|
||||
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 {
|
||||
getListableObjectComponent,
|
||||
listableObjectComponent,
|
||||
@@ -51,14 +60,15 @@ import { SearchResultGridElementComponent } from '../../../../../shared/object-g
|
||||
import { ThemeService } from '../../../../../shared/theme-support/theme.service';
|
||||
import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
|
||||
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)
|
||||
@Component({
|
||||
selector: 'ds-workflow-item-search-result-admin-workflow-grid-element',
|
||||
styleUrls: ['./workspace-item-search-result-admin-workflow-grid-element.component.scss'],
|
||||
templateUrl: './workspace-item-search-result-admin-workflow-grid-element.component.html',
|
||||
standalone: true,
|
||||
imports: [WorkspaceItemAdminWorkflowActionsComponent, AsyncPipe, TranslateModule, DynamicComponentLoaderDirective]
|
||||
selector: 'ds-workflow-item-search-result-admin-workflow-grid-element',
|
||||
styleUrls: ['./workspace-item-search-result-admin-workflow-grid-element.component.scss'],
|
||||
templateUrl: './workspace-item-search-result-admin-workflow-grid-element.component.html',
|
||||
standalone: true,
|
||||
imports: [WorkspaceItemAdminWorkflowActionsComponent, AsyncPipe, TranslateModule, DynamicComponentLoaderDirective],
|
||||
})
|
||||
/**
|
||||
* 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 { ComponentFixture, TestBed, waitForAsync, } from '@angular/core/testing';
|
||||
import {
|
||||
ComponentFixture,
|
||||
TestBed,
|
||||
waitForAsync,
|
||||
} from '@angular/core/testing';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
import { APP_CONFIG } from '../../../../../../config/app-config.interface';
|
||||
import { environment } from '../../../../../../environments/environment';
|
||||
import { AuthService } from '../../../../../core/auth/auth.service';
|
||||
import { DSONameService } from '../../../../../core/breadcrumbs/dso-name.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 { ViewMode } from '../../../../../core/shared/view-mode.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 { getMockLinkService } from '../../../../../shared/mocks/link-service.mock';
|
||||
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 {
|
||||
WorkflowItemSearchResult
|
||||
} from '../../../../../shared/object-collection/shared/workflow-item-search-result.model';
|
||||
import { WorkflowItemSearchResult } from '../../../../../shared/object-collection/shared/workflow-item-search-result.model';
|
||||
import { createSuccessfulRemoteDataObject$ } from '../../../../../shared/remote-data.utils';
|
||||
import { ThemeService } from '../../../../../shared/theme-support/theme.service';
|
||||
import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
|
||||
import { followLink } from '../../../../../shared/utils/follow-link-config.model';
|
||||
import {
|
||||
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';
|
||||
import { WorkflowItemSearchResultAdminWorkflowListElementComponent } from './workflow-item-search-result-admin-workflow-list-element.component';
|
||||
|
||||
describe('WorkflowItemSearchResultAdminWorkflowListElementComponent', () => {
|
||||
let component: WorkflowItemSearchResultAdminWorkflowListElementComponent;
|
||||
@@ -53,23 +53,23 @@ describe('WorkflowItemSearchResultAdminWorkflowListElementComponent', () => {
|
||||
init();
|
||||
TestBed.configureTestingModule(
|
||||
{
|
||||
imports: [
|
||||
NoopAnimationsModule,
|
||||
TranslateModule.forRoot(),
|
||||
RouterTestingModule.withRoutes([]),
|
||||
WorkflowItemSearchResultAdminWorkflowListElementComponent
|
||||
],
|
||||
providers: [
|
||||
{ provide: TruncatableService, useValue: mockTruncatableService },
|
||||
{ provide: LinkService, useValue: linkService },
|
||||
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||
{ provide: APP_CONFIG, useValue: environment },
|
||||
{ provide: ThemeService, useValue: getMockThemeService() },
|
||||
{ provide: AuthService, useValue: new AuthServiceMock() },
|
||||
{ provide: AuthorizationDataService, useValue: {} },
|
||||
],
|
||||
imports: [
|
||||
NoopAnimationsModule,
|
||||
TranslateModule.forRoot(),
|
||||
RouterTestingModule.withRoutes([]),
|
||||
WorkflowItemSearchResultAdminWorkflowListElementComponent,
|
||||
],
|
||||
providers: [
|
||||
{ provide: TruncatableService, useValue: mockTruncatableService },
|
||||
{ provide: LinkService, useValue: linkService },
|
||||
{ provide: DSONameService, useClass: DSONameServiceMock },
|
||||
{ provide: APP_CONFIG, useValue: environment },
|
||||
{ provide: ThemeService, useValue: getMockThemeService() },
|
||||
{ provide: AuthService, useValue: new AuthServiceMock() },
|
||||
{ provide: AuthorizationDataService, useValue: {} },
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA],
|
||||
})
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user