Merge pull request #850 from atmire/remove-cirular-dependencies

Remove circular dependencies
This commit is contained in:
Tim Donohue
2020-08-31 15:14:06 -05:00
committed by GitHub
84 changed files with 406 additions and 374 deletions

View File

@@ -0,0 +1,8 @@
import { URLCombiner } from '../../core/url-combiner/url-combiner';
import { getAccessControlModuleRoute } from '../admin-routing-paths';
export const GROUP_EDIT_PATH = 'groups';
export function getGroupEditRoute(id: string) {
return new URLCombiner(getAccessControlModuleRoute(), GROUP_EDIT_PATH, id).toString();
}

View File

@@ -3,14 +3,7 @@ import { RouterModule } from '@angular/router';
import { EPeopleRegistryComponent } from './epeople-registry/epeople-registry.component'; import { EPeopleRegistryComponent } from './epeople-registry/epeople-registry.component';
import { GroupFormComponent } from './group-registry/group-form/group-form.component'; import { GroupFormComponent } from './group-registry/group-form/group-form.component';
import { GroupsRegistryComponent } from './group-registry/groups-registry.component'; import { GroupsRegistryComponent } from './group-registry/groups-registry.component';
import { URLCombiner } from '../../core/url-combiner/url-combiner'; import { GROUP_EDIT_PATH } from './admin-access-control-routing-paths';
import { getAccessControlModulePath } from '../admin-routing.module';
export const GROUP_EDIT_PATH = 'groups';
export function getGroupEditPath(id: string) {
return new URLCombiner(getAccessControlModulePath(), GROUP_EDIT_PATH, id).toString();
}
@NgModule({ @NgModule({
imports: [ imports: [

View File

@@ -0,0 +1,8 @@
import { URLCombiner } from '../../core/url-combiner/url-combiner';
import { getRegistriesModuleRoute } from '../admin-routing-paths';
export const BITSTREAMFORMATS_MODULE_PATH = 'bitstream-formats';
export function getBitstreamFormatsModuleRoute() {
return new URLCombiner(getRegistriesModuleRoute(), BITSTREAMFORMATS_MODULE_PATH).toString();
}

View File

@@ -2,15 +2,8 @@ import { MetadataRegistryComponent } from './metadata-registry/metadata-registry
import { RouterModule } from '@angular/router'; import { RouterModule } from '@angular/router';
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { MetadataSchemaComponent } from './metadata-schema/metadata-schema.component'; import { MetadataSchemaComponent } from './metadata-schema/metadata-schema.component';
import { URLCombiner } from '../../core/url-combiner/url-combiner';
import { getRegistriesModulePath } from '../admin-routing.module';
import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver'; import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver';
import { BITSTREAMFORMATS_MODULE_PATH } from './admin-registries-routing-paths';
const BITSTREAMFORMATS_MODULE_PATH = 'bitstream-formats';
export function getBitstreamFormatsModulePath() {
return new URLCombiner(getRegistriesModulePath(), BITSTREAMFORMATS_MODULE_PATH).toString();
}
@NgModule({ @NgModule({
imports: [ imports: [

View File

@@ -5,8 +5,8 @@ import { BitstreamFormat } from '../../../../core/shared/bitstream-format.model'
import { BitstreamFormatDataService } from '../../../../core/data/bitstream-format-data.service'; import { BitstreamFormatDataService } from '../../../../core/data/bitstream-format-data.service';
import { RestResponse } from '../../../../core/cache/response.models'; import { RestResponse } from '../../../../core/cache/response.models';
import { NotificationsService } from '../../../../shared/notifications/notifications.service'; import { NotificationsService } from '../../../../shared/notifications/notifications.service';
import { getBitstreamFormatsModulePath } from '../../admin-registries-routing.module';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
import { getBitstreamFormatsModuleRoute } from '../../admin-registries-routing-paths';
/** /**
* This component renders the page to create a new bitstream format. * This component renders the page to create a new bitstream format.
@@ -37,7 +37,7 @@ export class AddBitstreamFormatComponent {
if (response.isSuccessful) { if (response.isSuccessful) {
this.notificationService.success(this.translateService.get('admin.registries.bitstream-formats.create.success.head'), this.notificationService.success(this.translateService.get('admin.registries.bitstream-formats.create.success.head'),
this.translateService.get('admin.registries.bitstream-formats.create.success.content')); this.translateService.get('admin.registries.bitstream-formats.create.success.content'));
this.router.navigate([getBitstreamFormatsModulePath()]); this.router.navigate([getBitstreamFormatsModuleRoute()]);
this.bitstreamFormatDataService.clearBitStreamFormatRequests().subscribe(); this.bitstreamFormatDataService.clearBitStreamFormatRequests().subscribe();
} else { } else {
this.notificationService.error(this.translateService.get('admin.registries.bitstream-formats.create.failure.head'), this.notificationService.error(this.translateService.get('admin.registries.bitstream-formats.create.failure.head'),

View File

@@ -7,8 +7,8 @@ import { BitstreamFormat } from '../../../../core/shared/bitstream-format.model'
import { BitstreamFormatDataService } from '../../../../core/data/bitstream-format-data.service'; import { BitstreamFormatDataService } from '../../../../core/data/bitstream-format-data.service';
import { RestResponse } from '../../../../core/cache/response.models'; import { RestResponse } from '../../../../core/cache/response.models';
import { NotificationsService } from '../../../../shared/notifications/notifications.service'; import { NotificationsService } from '../../../../shared/notifications/notifications.service';
import { getBitstreamFormatsModulePath } from '../../admin-registries-routing.module';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
import { getBitstreamFormatsModuleRoute } from '../../admin-registries-routing-paths';
/** /**
* This component renders the edit page of a bitstream format. * This component renders the edit page of a bitstream format.
@@ -51,7 +51,7 @@ export class EditBitstreamFormatComponent implements OnInit {
if (response.isSuccessful) { if (response.isSuccessful) {
this.notificationService.success(this.translateService.get('admin.registries.bitstream-formats.edit.success.head'), this.notificationService.success(this.translateService.get('admin.registries.bitstream-formats.edit.success.head'),
this.translateService.get('admin.registries.bitstream-formats.edit.success.content')); this.translateService.get('admin.registries.bitstream-formats.edit.success.content'));
this.router.navigate([getBitstreamFormatsModulePath()]); this.router.navigate([getBitstreamFormatsModuleRoute()]);
} else { } else {
this.notificationService.error('admin.registries.bitstream-formats.edit.failure.head', this.notificationService.error('admin.registries.bitstream-formats.edit.failure.head',
'admin.registries.bitstream-formats.create.edit.content'); 'admin.registries.bitstream-formats.create.edit.content');

View File

@@ -12,9 +12,9 @@ import {
DynamicTextAreaModel DynamicTextAreaModel
} from '@ng-dynamic-forms/core'; } from '@ng-dynamic-forms/core';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { getBitstreamFormatsModulePath } from '../../admin-registries-routing.module';
import { hasValue, isEmpty } from '../../../../shared/empty.util'; import { hasValue, isEmpty } from '../../../../shared/empty.util';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
import { getBitstreamFormatsModuleRoute } from '../../admin-registries-routing-paths';
/** /**
* The component responsible for rendering the form to create/edit a bitstream format * The component responsible for rendering the form to create/edit a bitstream format
@@ -189,6 +189,6 @@ export class FormatFormComponent implements OnInit {
* Cancels the edit/create action of the bitstream format and navigates back to the bitstream format registry * Cancels the edit/create action of the bitstream format and navigates back to the bitstream format registry
*/ */
onCancel() { onCancel() {
this.router.navigate([getBitstreamFormatsModulePath()]); this.router.navigate([getBitstreamFormatsModuleRoute()]);
} }
} }

View File

@@ -0,0 +1,13 @@
import { URLCombiner } from '../core/url-combiner/url-combiner';
import { getAdminModuleRoute } from '../app-routing-paths';
export const REGISTRIES_MODULE_PATH = 'registries';
export const ACCESS_CONTROL_MODULE_PATH = 'access-control';
export function getRegistriesModuleRoute() {
return new URLCombiner(getAdminModuleRoute(), REGISTRIES_MODULE_PATH).toString();
}
export function getAccessControlModuleRoute() {
return new URLCombiner(getAdminModuleRoute(), ACCESS_CONTROL_MODULE_PATH).toString();
}

View File

@@ -1,24 +1,12 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router'; import { RouterModule } from '@angular/router';
import { getAdminModulePath } from '../app-routing.module';
import { MetadataImportPageComponent } from './admin-import-metadata-page/metadata-import-page.component'; import { MetadataImportPageComponent } from './admin-import-metadata-page/metadata-import-page.component';
import { AdminSearchPageComponent } from './admin-search-page/admin-search-page.component'; import { AdminSearchPageComponent } from './admin-search-page/admin-search-page.component';
import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver'; import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver';
import { AdminWorkflowPageComponent } from './admin-workflow-page/admin-workflow-page.component'; import { AdminWorkflowPageComponent } from './admin-workflow-page/admin-workflow-page.component';
import { I18nBreadcrumbsService } from '../core/breadcrumbs/i18n-breadcrumbs.service'; import { I18nBreadcrumbsService } from '../core/breadcrumbs/i18n-breadcrumbs.service';
import { URLCombiner } from '../core/url-combiner/url-combiner';
import { AdminCurationTasksComponent } from './admin-curation-tasks/admin-curation-tasks.component'; import { AdminCurationTasksComponent } from './admin-curation-tasks/admin-curation-tasks.component';
import { ACCESS_CONTROL_MODULE_PATH, REGISTRIES_MODULE_PATH } from './admin-routing-paths';
const REGISTRIES_MODULE_PATH = 'registries';
export const ACCESS_CONTROL_MODULE_PATH = 'access-control';
export function getRegistriesModulePath() {
return new URLCombiner(getAdminModulePath(), REGISTRIES_MODULE_PATH).toString();
}
export function getAccessControlModulePath() {
return new URLCombiner(getAdminModulePath(), ACCESS_CONTROL_MODULE_PATH).toString();
}
@NgModule({ @NgModule({
imports: [ imports: [

View File

@@ -12,7 +12,7 @@ import { CollectionSearchResult } from '../../../../../shared/object-collection/
import { Collection } from '../../../../../core/shared/collection.model'; import { Collection } from '../../../../../core/shared/collection.model';
import { By } from '@angular/platform-browser'; import { By } from '@angular/platform-browser';
import { RouterTestingModule } from '@angular/router/testing'; import { RouterTestingModule } from '@angular/router/testing';
import { getCollectionEditPath } from '../../../../../+collection-page/collection-page-routing.module'; import { getCollectionEditRoute } from '../../../../../+collection-page/collection-page-routing-paths';
describe('CollectionAdminSearchResultGridElementComponent', () => { describe('CollectionAdminSearchResultGridElementComponent', () => {
let component: CollectionAdminSearchResultGridElementComponent; let component: CollectionAdminSearchResultGridElementComponent;
@@ -61,6 +61,6 @@ describe('CollectionAdminSearchResultGridElementComponent', () => {
it('should render an edit button with the correct link', () => { it('should render an edit button with the correct link', () => {
const a = fixture.debugElement.query(By.css('a.edit-link')); const a = fixture.debugElement.query(By.css('a.edit-link'));
const link = a.nativeElement.href; const link = a.nativeElement.href;
expect(link).toContain(getCollectionEditPath(id)); expect(link).toContain(getCollectionEditRoute(id));
}) })
}); });

View File

@@ -4,8 +4,8 @@ import { listableObjectComponent } from '../../../../../shared/object-collection
import { Context } from '../../../../../core/shared/context.model'; import { Context } from '../../../../../core/shared/context.model';
import { CollectionSearchResult } from '../../../../../shared/object-collection/shared/collection-search-result.model'; import { CollectionSearchResult } from '../../../../../shared/object-collection/shared/collection-search-result.model';
import { Collection } from '../../../../../core/shared/collection.model'; import { Collection } from '../../../../../core/shared/collection.model';
import { getCollectionEditPath } from '../../../../../+collection-page/collection-page-routing.module';
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 { getCollectionEditRoute } from '../../../../../+collection-page/collection-page-routing-paths';
@listableObjectComponent(CollectionSearchResult, ViewMode.GridElement, Context.AdminSearch) @listableObjectComponent(CollectionSearchResult, ViewMode.GridElement, Context.AdminSearch)
@Component({ @Component({
@@ -21,6 +21,6 @@ export class CollectionAdminSearchResultGridElementComponent extends SearchResul
ngOnInit() { ngOnInit() {
super.ngOnInit(); super.ngOnInit();
this.editPath = getCollectionEditPath(this.dso.uuid); this.editPath = getCollectionEditRoute(this.dso.uuid);
} }
} }

View File

@@ -13,9 +13,9 @@ import { By } from '@angular/platform-browser';
import { RouterTestingModule } from '@angular/router/testing'; import { RouterTestingModule } from '@angular/router/testing';
import { CommunityAdminSearchResultGridElementComponent } from './community-admin-search-result-grid-element.component'; import { CommunityAdminSearchResultGridElementComponent } from './community-admin-search-result-grid-element.component';
import { CommunitySearchResult } from '../../../../../shared/object-collection/shared/community-search-result.model'; import { CommunitySearchResult } from '../../../../../shared/object-collection/shared/community-search-result.model';
import { getCommunityEditPath } from '../../../../../+community-page/community-page-routing.module';
import { Community } from '../../../../../core/shared/community.model'; import { Community } from '../../../../../core/shared/community.model';
import { CommunityAdminSearchResultListElementComponent } from '../../admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component'; import { CommunityAdminSearchResultListElementComponent } from '../../admin-search-result-list-element/community-search-result/community-admin-search-result-list-element.component';
import { getCommunityEditRoute } from '../../../../../+community-page/community-page-routing-paths';
describe('CommunityAdminSearchResultGridElementComponent', () => { describe('CommunityAdminSearchResultGridElementComponent', () => {
let component: CommunityAdminSearchResultGridElementComponent; let component: CommunityAdminSearchResultGridElementComponent;
@@ -65,6 +65,6 @@ describe('CommunityAdminSearchResultGridElementComponent', () => {
it('should render an edit button with the correct link', () => { it('should render an edit button with the correct link', () => {
const a = fixture.debugElement.query(By.css('a.edit-link')); const a = fixture.debugElement.query(By.css('a.edit-link'));
const link = a.nativeElement.href; const link = a.nativeElement.href;
expect(link).toContain(getCommunityEditPath(id)); expect(link).toContain(getCommunityEditRoute(id));
}) })
}); });

View File

@@ -4,8 +4,8 @@ import { listableObjectComponent } from '../../../../../shared/object-collection
import { Context } from '../../../../../core/shared/context.model'; import { Context } from '../../../../../core/shared/context.model';
import { CommunitySearchResult } from '../../../../../shared/object-collection/shared/community-search-result.model'; import { CommunitySearchResult } from '../../../../../shared/object-collection/shared/community-search-result.model';
import { Community } from '../../../../../core/shared/community.model'; import { Community } from '../../../../../core/shared/community.model';
import { getCommunityEditPath } from '../../../../../+community-page/community-page-routing.module';
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 { getCommunityEditRoute } from '../../../../../+community-page/community-page-routing-paths';
@listableObjectComponent(CommunitySearchResult, ViewMode.GridElement, Context.AdminSearch) @listableObjectComponent(CommunitySearchResult, ViewMode.GridElement, Context.AdminSearch)
@Component({ @Component({
@@ -21,6 +21,6 @@ export class CommunityAdminSearchResultGridElementComponent extends SearchResult
ngOnInit() { ngOnInit() {
super.ngOnInit(); super.ngOnInit();
this.editPath = getCommunityEditPath(this.dso.uuid); this.editPath = getCommunityEditRoute(this.dso.uuid);
} }
} }

View File

@@ -4,16 +4,6 @@ import { ViewMode } from '../../../../../core/shared/view-mode.model';
import { getListableObjectComponent, listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator'; import { getListableObjectComponent, listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
import { Context } from '../../../../../core/shared/context.model'; import { Context } from '../../../../../core/shared/context.model';
import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model'; import { ItemSearchResult } from '../../../../../shared/object-collection/shared/item-search-result.model';
import { getItemEditPath } from '../../../../../+item-page/item-page-routing.module';
import { URLCombiner } from '../../../../../core/url-combiner/url-combiner';
import {
ITEM_EDIT_DELETE_PATH,
ITEM_EDIT_MOVE_PATH,
ITEM_EDIT_PRIVATE_PATH,
ITEM_EDIT_PUBLIC_PATH,
ITEM_EDIT_REINSTATE_PATH,
ITEM_EDIT_WITHDRAW_PATH
} from '../../../../../+item-page/edit-item-page/edit-item-page.routing.module';
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 { TruncatableService } from '../../../../../shared/truncatable/truncatable.service'; import { TruncatableService } from '../../../../../shared/truncatable/truncatable.service';
import { BitstreamDataService } from '../../../../../core/data/bitstream-data.service'; import { BitstreamDataService } from '../../../../../core/data/bitstream-data.service';

View File

@@ -10,7 +10,7 @@ import { CollectionSearchResult } from '../../../../../shared/object-collection/
import { Collection } from '../../../../../core/shared/collection.model'; import { Collection } from '../../../../../core/shared/collection.model';
import { By } from '@angular/platform-browser'; import { By } from '@angular/platform-browser';
import { RouterTestingModule } from '@angular/router/testing'; import { RouterTestingModule } from '@angular/router/testing';
import { getCollectionEditPath } from '../../../../../+collection-page/collection-page-routing.module'; import { getCollectionEditRoute } from '../../../../../+collection-page/collection-page-routing-paths';
describe('CollectionAdminSearchResultListElementComponent', () => { describe('CollectionAdminSearchResultListElementComponent', () => {
let component: CollectionAdminSearchResultListElementComponent; let component: CollectionAdminSearchResultListElementComponent;
@@ -55,6 +55,6 @@ describe('CollectionAdminSearchResultListElementComponent', () => {
it('should render an edit button with the correct link', () => { it('should render an edit button with the correct link', () => {
const a = fixture.debugElement.query(By.css('a')); const a = fixture.debugElement.query(By.css('a'));
const link = a.nativeElement.href; const link = a.nativeElement.href;
expect(link).toContain(getCollectionEditPath(id)); expect(link).toContain(getCollectionEditRoute(id));
}) })
}); });

View File

@@ -5,7 +5,7 @@ import { Context } from '../../../../../core/shared/context.model';
import { SearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/search-result-list-element.component'; 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 { CollectionSearchResult } from '../../../../../shared/object-collection/shared/collection-search-result.model';
import { Collection } from '../../../../../core/shared/collection.model'; import { Collection } from '../../../../../core/shared/collection.model';
import { getCollectionEditPath } from '../../../../../+collection-page/collection-page-routing.module'; import { getCollectionEditRoute } from '../../../../../+collection-page/collection-page-routing-paths';
@listableObjectComponent(CollectionSearchResult, ViewMode.ListElement, Context.AdminSearch) @listableObjectComponent(CollectionSearchResult, ViewMode.ListElement, Context.AdminSearch)
@Component({ @Component({
@@ -21,6 +21,6 @@ export class CollectionAdminSearchResultListElementComponent extends SearchResul
ngOnInit() { ngOnInit() {
super.ngOnInit(); super.ngOnInit();
this.editPath = getCollectionEditPath(this.dso.uuid); this.editPath = getCollectionEditRoute(this.dso.uuid);
} }
} }

View File

@@ -9,8 +9,8 @@ import { By } from '@angular/platform-browser';
import { RouterTestingModule } from '@angular/router/testing'; import { RouterTestingModule } from '@angular/router/testing';
import { CommunityAdminSearchResultListElementComponent } from './community-admin-search-result-list-element.component'; import { CommunityAdminSearchResultListElementComponent } from './community-admin-search-result-list-element.component';
import { CommunitySearchResult } from '../../../../../shared/object-collection/shared/community-search-result.model'; import { CommunitySearchResult } from '../../../../../shared/object-collection/shared/community-search-result.model';
import { getCommunityEditPath } from '../../../../../+community-page/community-page-routing.module';
import { Community } from '../../../../../core/shared/community.model'; import { Community } from '../../../../../core/shared/community.model';
import { getCommunityEditRoute } from '../../../../../+community-page/community-page-routing-paths';
describe('CommunityAdminSearchResultListElementComponent', () => { describe('CommunityAdminSearchResultListElementComponent', () => {
let component: CommunityAdminSearchResultListElementComponent; let component: CommunityAdminSearchResultListElementComponent;
@@ -55,6 +55,6 @@ describe('CommunityAdminSearchResultListElementComponent', () => {
it('should render an edit button with the correct link', () => { it('should render an edit button with the correct link', () => {
const a = fixture.debugElement.query(By.css('a')); const a = fixture.debugElement.query(By.css('a'));
const link = a.nativeElement.href; const link = a.nativeElement.href;
expect(link).toContain(getCommunityEditPath(id)); expect(link).toContain(getCommunityEditRoute(id));
}) })
}); });

View File

@@ -5,7 +5,7 @@ import { Context } from '../../../../../core/shared/context.model';
import { SearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/search-result-list-element.component'; 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 { CommunitySearchResult } from '../../../../../shared/object-collection/shared/community-search-result.model';
import { Community } from '../../../../../core/shared/community.model'; import { Community } from '../../../../../core/shared/community.model';
import { getCommunityEditPath } from '../../../../../+community-page/community-page-routing.module'; import { getCommunityEditRoute } from '../../../../../+community-page/community-page-routing-paths';
@listableObjectComponent(CommunitySearchResult, ViewMode.ListElement, Context.AdminSearch) @listableObjectComponent(CommunitySearchResult, ViewMode.ListElement, Context.AdminSearch)
@Component({ @Component({
@@ -21,6 +21,6 @@ export class CommunityAdminSearchResultListElementComponent extends SearchResult
ngOnInit() { ngOnInit() {
super.ngOnInit(); super.ngOnInit();
this.editPath = getCommunityEditPath(this.dso.uuid); this.editPath = getCommunityEditRoute(this.dso.uuid);
} }
} }

View File

@@ -1,27 +1,27 @@
<a [ngClass]="{'btn-sm': small}" class="btn btn-light my-1 edit-link" [routerLink]="[getEditPath()]" [title]="'admin.search.item.edit' | translate"> <a [ngClass]="{'btn-sm': small}" class="btn btn-light my-1 edit-link" [routerLink]="[getEditRoute()]" [title]="'admin.search.item.edit' | translate">
<i class="fa fa-edit"></i><span *ngIf="!small" class="d-none d-sm-inline"> {{"admin.search.item.edit" | translate}}</span> <i class="fa fa-edit"></i><span *ngIf="!small" class="d-none d-sm-inline"> {{"admin.search.item.edit" | translate}}</span>
</a> </a>
<a [ngClass]="{'btn-sm': small}" *ngIf="item && !item.isWithdrawn" class="btn btn-light my-1 withdraw-link" [routerLink]="[getWithdrawPath()]" [title]="'admin.search.item.withdraw' | translate"> <a [ngClass]="{'btn-sm': small}" *ngIf="item && !item.isWithdrawn" class="btn btn-light my-1 withdraw-link" [routerLink]="[getWithdrawRoute()]" [title]="'admin.search.item.withdraw' | translate">
<i class="fa fa-ban"></i><span *ngIf="!small" class="d-none d-sm-inline"> {{"admin.search.item.withdraw" | translate}}</span> <i class="fa fa-ban"></i><span *ngIf="!small" class="d-none d-sm-inline"> {{"admin.search.item.withdraw" | translate}}</span>
</a> </a>
<a [ngClass]="{'btn-sm': small}" *ngIf="item && item.isWithdrawn" class="btn btn-light my-1 reinstate-link" [routerLink]="[getReinstatePath()]" [title]="'admin.search.item.reinstate' | translate"> <a [ngClass]="{'btn-sm': small}" *ngIf="item && item.isWithdrawn" class="btn btn-light my-1 reinstate-link" [routerLink]="[getReinstateRoute()]" [title]="'admin.search.item.reinstate' | translate">
<i class="fa fa-undo"></i><span *ngIf="!small" class="d-none d-sm-inline"> {{"admin.search.item.reinstate" | translate}}</span> <i class="fa fa-undo"></i><span *ngIf="!small" class="d-none d-sm-inline"> {{"admin.search.item.reinstate" | translate}}</span>
</a> </a>
<a [ngClass]="{'btn-sm': small}" *ngIf="item && item.isDiscoverable" class="btn btn-light my-1 private-link" [routerLink]="[getPrivatePath()]" [title]="'admin.search.item.make-private' | translate"> <a [ngClass]="{'btn-sm': small}" *ngIf="item && item.isDiscoverable" class="btn btn-light my-1 private-link" [routerLink]="[getPrivateRoute()]" [title]="'admin.search.item.make-private' | translate">
<i class="fa fa-eye-slash"></i><span *ngIf="!small" class="d-none d-sm-inline"> {{"admin.search.item.make-private" | translate}}</span> <i class="fa fa-eye-slash"></i><span *ngIf="!small" class="d-none d-sm-inline"> {{"admin.search.item.make-private" | translate}}</span>
</a> </a>
<a [ngClass]="{'btn-sm': small}" *ngIf="item && !item.isDiscoverable" class="btn btn-light my-1 public-link" [routerLink]="[getPublicPath()]" [title]="'admin.search.item.make-public' | translate"> <a [ngClass]="{'btn-sm': small}" *ngIf="item && !item.isDiscoverable" class="btn btn-light my-1 public-link" [routerLink]="[getPublicRoute()]" [title]="'admin.search.item.make-public' | translate">
<i class="fa fa-eye"></i><span *ngIf="!small" class="d-none d-sm-inline"> {{"admin.search.item.make-public" | translate}}</span> <i class="fa fa-eye"></i><span *ngIf="!small" class="d-none d-sm-inline"> {{"admin.search.item.make-public" | translate}}</span>
</a> </a>
<a [ngClass]="{'btn-sm': small}" class="btn btn-light my-1 delete-link" [routerLink]="[getDeletePath()]" [title]="'admin.search.item.delete' | translate"> <a [ngClass]="{'btn-sm': small}" class="btn btn-light my-1 delete-link" [routerLink]="[getDeleteRoute()]" [title]="'admin.search.item.delete' | translate">
<i class="fa fa-trash"></i><span *ngIf="!small" class="d-none d-sm-inline"> {{"admin.search.item.delete" | translate}}</span> <i class="fa fa-trash"></i><span *ngIf="!small" class="d-none d-sm-inline"> {{"admin.search.item.delete" | translate}}</span>
</a> </a>
<a [ngClass]="{'btn-sm': small}" class="btn btn-light my-1 move-link" [routerLink]="[getMovePath()]" [title]="'admin.search.item.move' | translate"> <a [ngClass]="{'btn-sm': small}" class="btn btn-light my-1 move-link" [routerLink]="[getMoveRoute()]" [title]="'admin.search.item.move' | translate">
<i class="fa fa-arrow-circle-right"></i><span *ngIf="!small" class="d-none d-sm-inline"> {{"admin.search.item.move" | translate}}</span> <i class="fa fa-arrow-circle-right"></i><span *ngIf="!small" class="d-none d-sm-inline"> {{"admin.search.item.move" | translate}}</span>
</a> </a>

View File

@@ -6,16 +6,16 @@ import { By } from '@angular/platform-browser';
import { RouterTestingModule } from '@angular/router/testing'; import { RouterTestingModule } from '@angular/router/testing';
import { ItemAdminSearchResultActionsComponent } from './item-admin-search-result-actions.component'; import { ItemAdminSearchResultActionsComponent } from './item-admin-search-result-actions.component';
import { Item } from '../../../core/shared/item.model'; import { Item } from '../../../core/shared/item.model';
import { URLCombiner } from '../../../core/url-combiner/url-combiner';
import { getItemEditRoute } from '../../../+item-page/item-page-routing-paths';
import { import {
ITEM_EDIT_DELETE_PATH,
ITEM_EDIT_MOVE_PATH, ITEM_EDIT_MOVE_PATH,
ITEM_EDIT_PRIVATE_PATH, ITEM_EDIT_DELETE_PATH,
ITEM_EDIT_PUBLIC_PATH, ITEM_EDIT_PUBLIC_PATH,
ITEM_EDIT_PRIVATE_PATH,
ITEM_EDIT_REINSTATE_PATH, ITEM_EDIT_REINSTATE_PATH,
ITEM_EDIT_WITHDRAW_PATH ITEM_EDIT_WITHDRAW_PATH
} from '../../../+item-page/edit-item-page/edit-item-page.routing.module'; } from '../../../+item-page/edit-item-page/edit-item-page.routing-paths';
import { getItemEditPath } from '../../../+item-page/item-page-routing.module';
import { URLCombiner } from '../../../core/url-combiner/url-combiner';
describe('ItemAdminSearchResultActionsComponent', () => { describe('ItemAdminSearchResultActionsComponent', () => {
let component: ItemAdminSearchResultActionsComponent; let component: ItemAdminSearchResultActionsComponent;
@@ -55,19 +55,19 @@ describe('ItemAdminSearchResultActionsComponent', () => {
it('should render an edit button with the correct link', () => { it('should render an edit button with the correct link', () => {
const button = fixture.debugElement.query(By.css('a.edit-link')); const button = fixture.debugElement.query(By.css('a.edit-link'));
const link = button.nativeElement.href; const link = button.nativeElement.href;
expect(link).toContain(getItemEditPath(id)); expect(link).toContain(getItemEditRoute(id));
}); });
it('should render a delete button with the correct link', () => { it('should render a delete button with the correct link', () => {
const button = fixture.debugElement.query(By.css('a.delete-link')); const button = fixture.debugElement.query(By.css('a.delete-link'));
const link = button.nativeElement.href; const link = button.nativeElement.href;
expect(link).toContain(new URLCombiner(getItemEditPath(id), ITEM_EDIT_DELETE_PATH).toString()); expect(link).toContain(new URLCombiner(getItemEditRoute(id), ITEM_EDIT_DELETE_PATH).toString());
}); });
it('should render a move button with the correct link', () => { it('should render a move button with the correct link', () => {
const a = fixture.debugElement.query(By.css('a.move-link')); const a = fixture.debugElement.query(By.css('a.move-link'));
const link = a.nativeElement.href; const link = a.nativeElement.href;
expect(link).toContain(new URLCombiner(getItemEditPath(id), ITEM_EDIT_MOVE_PATH).toString()); expect(link).toContain(new URLCombiner(getItemEditRoute(id), ITEM_EDIT_MOVE_PATH).toString());
}); });
describe('when the item is not withdrawn', () => { describe('when the item is not withdrawn', () => {
@@ -79,7 +79,7 @@ describe('ItemAdminSearchResultActionsComponent', () => {
it('should render a withdraw button with the correct link', () => { it('should render a withdraw button with the correct link', () => {
const a = fixture.debugElement.query(By.css('a.withdraw-link')); const a = fixture.debugElement.query(By.css('a.withdraw-link'));
const link = a.nativeElement.href; const link = a.nativeElement.href;
expect(link).toContain(new URLCombiner(getItemEditPath(id), ITEM_EDIT_WITHDRAW_PATH).toString()); expect(link).toContain(new URLCombiner(getItemEditRoute(id), ITEM_EDIT_WITHDRAW_PATH).toString());
}); });
it('should not render a reinstate button with the correct link', () => { it('should not render a reinstate button with the correct link', () => {
@@ -102,7 +102,7 @@ describe('ItemAdminSearchResultActionsComponent', () => {
it('should render a reinstate button with the correct link', () => { it('should render a reinstate button with the correct link', () => {
const a = fixture.debugElement.query(By.css('a.reinstate-link')); const a = fixture.debugElement.query(By.css('a.reinstate-link'));
const link = a.nativeElement.href; const link = a.nativeElement.href;
expect(link).toContain(new URLCombiner(getItemEditPath(id), ITEM_EDIT_REINSTATE_PATH).toString()); expect(link).toContain(new URLCombiner(getItemEditRoute(id), ITEM_EDIT_REINSTATE_PATH).toString());
}); });
}); });
@@ -115,7 +115,7 @@ describe('ItemAdminSearchResultActionsComponent', () => {
it('should render a make private button with the correct link', () => { it('should render a make private button with the correct link', () => {
const a = fixture.debugElement.query(By.css('a.private-link')); const a = fixture.debugElement.query(By.css('a.private-link'));
const link = a.nativeElement.href; const link = a.nativeElement.href;
expect(link).toContain(new URLCombiner(getItemEditPath(id), ITEM_EDIT_PRIVATE_PATH).toString()); expect(link).toContain(new URLCombiner(getItemEditRoute(id), ITEM_EDIT_PRIVATE_PATH).toString());
}); });
it('should not render a make public button with the correct link', () => { it('should not render a make public button with the correct link', () => {
@@ -138,7 +138,7 @@ describe('ItemAdminSearchResultActionsComponent', () => {
it('should render a make private button with the correct link', () => { it('should render a make private button with the correct link', () => {
const a = fixture.debugElement.query(By.css('a.public-link')); const a = fixture.debugElement.query(By.css('a.public-link'));
const link = a.nativeElement.href; const link = a.nativeElement.href;
expect(link).toContain(new URLCombiner(getItemEditPath(id), ITEM_EDIT_PUBLIC_PATH).toString()); expect(link).toContain(new URLCombiner(getItemEditRoute(id), ITEM_EDIT_PUBLIC_PATH).toString());
}); });
}) })
}); });

View File

@@ -1,15 +1,15 @@
import { Component, Input } from '@angular/core'; import { Component, Input } from '@angular/core';
import { Item } from '../../../core/shared/item.model'; import { Item } from '../../../core/shared/item.model';
import { getItemEditPath } from '../../../+item-page/item-page-routing.module';
import { URLCombiner } from '../../../core/url-combiner/url-combiner'; import { URLCombiner } from '../../../core/url-combiner/url-combiner';
import { getItemEditRoute } from '../../../+item-page/item-page-routing-paths';
import { import {
ITEM_EDIT_DELETE_PATH,
ITEM_EDIT_MOVE_PATH, ITEM_EDIT_MOVE_PATH,
ITEM_EDIT_PRIVATE_PATH, ITEM_EDIT_DELETE_PATH,
ITEM_EDIT_PUBLIC_PATH, ITEM_EDIT_PUBLIC_PATH,
ITEM_EDIT_PRIVATE_PATH,
ITEM_EDIT_REINSTATE_PATH, ITEM_EDIT_REINSTATE_PATH,
ITEM_EDIT_WITHDRAW_PATH ITEM_EDIT_WITHDRAW_PATH
} from '../../../+item-page/edit-item-page/edit-item-page.routing.module'; } from '../../../+item-page/edit-item-page/edit-item-page.routing-paths';
@Component({ @Component({
selector: 'ds-item-admin-search-result-actions-element', selector: 'ds-item-admin-search-result-actions-element',
@@ -33,49 +33,49 @@ export class ItemAdminSearchResultActionsComponent {
/** /**
* Returns the path to the edit page of this item * Returns the path to the edit page of this item
*/ */
getEditPath(): string { getEditRoute(): string {
return getItemEditPath(this.item.uuid) return getItemEditRoute(this.item.uuid)
} }
/** /**
* Returns the path to the move page of this item * Returns the path to the move page of this item
*/ */
getMovePath(): string { getMoveRoute(): string {
return new URLCombiner(this.getEditPath(), ITEM_EDIT_MOVE_PATH).toString(); return new URLCombiner(this.getEditRoute(), ITEM_EDIT_MOVE_PATH).toString();
} }
/** /**
* Returns the path to the delete page of this item * Returns the path to the delete page of this item
*/ */
getDeletePath(): string { getDeleteRoute(): string {
return new URLCombiner(this.getEditPath(), ITEM_EDIT_DELETE_PATH).toString(); return new URLCombiner(this.getEditRoute(), ITEM_EDIT_DELETE_PATH).toString();
} }
/** /**
* Returns the path to the withdraw page of this item * Returns the path to the withdraw page of this item
*/ */
getWithdrawPath(): string { getWithdrawRoute(): string {
return new URLCombiner(this.getEditPath(), ITEM_EDIT_WITHDRAW_PATH).toString(); return new URLCombiner(this.getEditRoute(), ITEM_EDIT_WITHDRAW_PATH).toString();
} }
/** /**
* Returns the path to the reinstate page of this item * Returns the path to the reinstate page of this item
*/ */
getReinstatePath(): string { getReinstateRoute(): string {
return new URLCombiner(this.getEditPath(), ITEM_EDIT_REINSTATE_PATH).toString(); return new URLCombiner(this.getEditRoute(), ITEM_EDIT_REINSTATE_PATH).toString();
} }
/** /**
* Returns the path to the page where the user can make this item private * Returns the path to the page where the user can make this item private
*/ */
getPrivatePath(): string { getPrivateRoute(): string {
return new URLCombiner(this.getEditPath(), ITEM_EDIT_PRIVATE_PATH).toString(); return new URLCombiner(this.getEditRoute(), ITEM_EDIT_PRIVATE_PATH).toString();
} }
/** /**
* Returns the path to the page where the user can make this item public * Returns the path to the page where the user can make this item public
*/ */
getPublicPath(): string { getPublicRoute(): string {
return new URLCombiner(this.getEditPath(), ITEM_EDIT_PUBLIC_PATH).toString(); return new URLCombiner(this.getEditRoute(), ITEM_EDIT_PUBLIC_PATH).toString();
} }
} }

View File

@@ -1,7 +1,7 @@
<a [ngClass]="{'btn-sm': small}" class="btn btn-light my-1 delete-link" [routerLink]="[getDeletePath()]" [title]="'admin.workflow.item.delete' | translate"> <a [ngClass]="{'btn-sm': small}" class="btn btn-light my-1 delete-link" [routerLink]="[getDeleteRoute()]" [title]="'admin.workflow.item.delete' | translate">
<i class="fa fa-trash"></i><span *ngIf="!small" class="d-none d-sm-inline"> {{"admin.workflow.item.delete" | translate}}</span> <i class="fa fa-trash"></i><span *ngIf="!small" class="d-none d-sm-inline"> {{"admin.workflow.item.delete" | translate}}</span>
</a> </a>
<a [ngClass]="{'btn-sm': small}" class="btn btn-light my-1 send-back-link" [routerLink]="[getSendBackPath()]" [title]="'admin.workflow.item.send-back' | translate"> <a [ngClass]="{'btn-sm': small}" class="btn btn-light my-1 send-back-link" [routerLink]="[getSendBackRoute()]" [title]="'admin.workflow.item.send-back' | translate">
<i class="fa fa-hand-point-left"></i><span *ngIf="!small" class="d-none d-sm-inline"> {{"admin.workflow.item.send-back" | translate}}</span> <i class="fa fa-hand-point-left"></i><span *ngIf="!small" class="d-none d-sm-inline"> {{"admin.workflow.item.send-back" | translate}}</span>
</a> </a>

View File

@@ -5,19 +5,22 @@ import { TranslateModule } from '@ngx-translate/core';
import { By } from '@angular/platform-browser'; import { By } from '@angular/platform-browser';
import { RouterTestingModule } from '@angular/router/testing'; import { RouterTestingModule } from '@angular/router/testing';
import { Item } from '../../../core/shared/item.model'; import { Item } from '../../../core/shared/item.model';
import {
ITEM_EDIT_DELETE_PATH,
ITEM_EDIT_MOVE_PATH,
ITEM_EDIT_PRIVATE_PATH,
ITEM_EDIT_PUBLIC_PATH,
ITEM_EDIT_REINSTATE_PATH,
ITEM_EDIT_WITHDRAW_PATH
} from '../../../+item-page/edit-item-page/edit-item-page.routing.module';
import { getItemEditPath } from '../../../+item-page/item-page-routing.module';
import { URLCombiner } from '../../../core/url-combiner/url-combiner'; import { URLCombiner } from '../../../core/url-combiner/url-combiner';
import { WorkflowItemAdminWorkflowActionsComponent } from './workflow-item-admin-workflow-actions.component'; import { WorkflowItemAdminWorkflowActionsComponent } from './workflow-item-admin-workflow-actions.component';
import { WorkflowItem } from '../../../core/submission/models/workflowitem.model'; import { WorkflowItem } from '../../../core/submission/models/workflowitem.model';
import { getWorkflowItemDeletePath, getWorkflowItemSendBackPath } from '../../../+workflowitems-edit-page/workflowitems-edit-page-routing.module'; import {
getWorkflowItemSendBackRoute,
getWorkflowItemDeleteRoute
} from '../../../+workflowitems-edit-page/workflowitems-edit-page-routing-paths';
import { getItemEditRoute } from '../../../+item-page/item-page-routing-paths';
import {
ITEM_EDIT_MOVE_PATH,
ITEM_EDIT_DELETE_PATH,
ITEM_EDIT_PUBLIC_PATH,
ITEM_EDIT_PRIVATE_PATH,
ITEM_EDIT_REINSTATE_PATH,
ITEM_EDIT_WITHDRAW_PATH
} from '../../../+item-page/edit-item-page/edit-item-page.routing-paths';
describe('WorkflowItemAdminWorkflowActionsComponent', () => { describe('WorkflowItemAdminWorkflowActionsComponent', () => {
let component: WorkflowItemAdminWorkflowActionsComponent; let component: WorkflowItemAdminWorkflowActionsComponent;
@@ -57,12 +60,12 @@ describe('WorkflowItemAdminWorkflowActionsComponent', () => {
it('should render a delete button with the correct link', () => { it('should render a delete button with the correct link', () => {
const button = fixture.debugElement.query(By.css('a.delete-link')); const button = fixture.debugElement.query(By.css('a.delete-link'));
const link = button.nativeElement.href; const link = button.nativeElement.href;
expect(link).toContain(new URLCombiner(getWorkflowItemDeletePath(wfi.id)).toString()); expect(link).toContain(new URLCombiner(getWorkflowItemDeleteRoute(wfi.id)).toString());
}); });
it('should render a move button with the correct link', () => { it('should render a move button with the correct link', () => {
const a = fixture.debugElement.query(By.css('a.send-back-link')); const a = fixture.debugElement.query(By.css('a.send-back-link'));
const link = a.nativeElement.href; const link = a.nativeElement.href;
expect(link).toContain(new URLCombiner(getWorkflowItemSendBackPath(wfi.id)).toString()); expect(link).toContain(new URLCombiner(getWorkflowItemSendBackRoute(wfi.id)).toString());
}); });
}); });

View File

@@ -1,6 +1,9 @@
import { Component, Input } from '@angular/core'; import { Component, Input } from '@angular/core';
import { WorkflowItem } from '../../../core/submission/models/workflowitem.model'; import { WorkflowItem } from '../../../core/submission/models/workflowitem.model';
import { getWorkflowItemDeletePath, getWorkflowItemSendBackPath } from '../../../+workflowitems-edit-page/workflowitems-edit-page-routing.module'; import {
getWorkflowItemSendBackRoute,
getWorkflowItemDeleteRoute
} from '../../../+workflowitems-edit-page/workflowitems-edit-page-routing-paths';
@Component({ @Component({
selector: 'ds-workflow-item-admin-workflow-actions-element', selector: 'ds-workflow-item-admin-workflow-actions-element',
@@ -25,15 +28,15 @@ export class WorkflowItemAdminWorkflowActionsComponent {
/** /**
* Returns the path to the delete page of this workflow item * Returns the path to the delete page of this workflow item
*/ */
getDeletePath(): string { getDeleteRoute(): string {
return getWorkflowItemDeletePath(this.wfi.id) return getWorkflowItemDeleteRoute(this.wfi.id)
} }
/** /**
* Returns the path to the send back page of this workflow item * Returns the path to the send back page of this workflow item
*/ */
getSendBackPath(): string { getSendBackRoute(): string {
return getWorkflowItemSendBackPath(this.wfi.id); return getWorkflowItemSendBackRoute(this.wfi.id);
} }
} }

View File

@@ -36,7 +36,7 @@ import { Observable } from 'rxjs/internal/Observable';
import { RemoteData } from '../../core/data/remote-data'; import { RemoteData } from '../../core/data/remote-data';
import { PaginatedList } from '../../core/data/paginated-list'; import { PaginatedList } from '../../core/data/paginated-list';
import { followLink } from '../../shared/utils/follow-link-config.model'; import { followLink } from '../../shared/utils/follow-link-config.model';
import { getItemEditPath } from '../../+item-page/item-page-routing.module'; import { getItemEditRoute } from '../../+item-page/item-page-routing-paths';
@Component({ @Component({
selector: 'ds-edit-bitstream-page', selector: 'ds-edit-bitstream-page',
@@ -506,7 +506,7 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy {
*/ */
navigateToItemEditBitstreams() { navigateToItemEditBitstreams() {
if (hasValue(this.itemId)) { if (hasValue(this.itemId)) {
this.router.navigate([getItemEditPath(this.itemId), 'bitstreams']); this.router.navigate([getItemEditRoute(this.itemId), 'bitstreams']);
} else { } else {
this.location.back(); this.location.back();
} }

View File

@@ -9,7 +9,7 @@ import { Observable } from 'rxjs';
import { getRemoteDataPayload, getSucceededRemoteData } from '../core/shared/operators'; import { getRemoteDataPayload, getSucceededRemoteData } from '../core/shared/operators';
import { map } from 'rxjs/operators'; import { map } from 'rxjs/operators';
import { hasValue } from '../shared/empty.util'; import { hasValue } from '../shared/empty.util';
import { getDSOPath } from '../app-routing.module'; import { getDSORoute } from '../app-routing-paths';
/** /**
* The class that resolves the BreadcrumbConfig object for a DSpaceObject on a browse by page * The class that resolves the BreadcrumbConfig object for a DSpaceObject on a browse by page
@@ -32,7 +32,7 @@ export class BrowseByDSOBreadcrumbResolver {
getSucceededRemoteData(), getSucceededRemoteData(),
getRemoteDataPayload(), getRemoteDataPayload(),
map((object: Community | Collection) => { map((object: Community | Collection) => {
return { provider: this.breadcrumbService, key: object, url: getDSOPath(object) }; return { provider: this.breadcrumbService, key: object, url: getDSORoute(object) };
}) })
); );
} }

View File

@@ -0,0 +1,25 @@
import { URLCombiner } from '../core/url-combiner/url-combiner';
export const COLLECTION_PARENT_PARAMETER = 'parent';
export const COLLECTION_MODULE_PATH = 'collections';
export function getCollectionModuleRoute() {
return `/${COLLECTION_MODULE_PATH}`;
}
export function getCollectionPageRoute(collectionId: string) {
return new URLCombiner(getCollectionModuleRoute(), collectionId).toString();
}
export function getCollectionEditRoute(id: string) {
return new URLCombiner(getCollectionModuleRoute(), id, COLLECTION_EDIT_PATH).toString()
}
export function getCollectionCreateRoute() {
return new URLCombiner(getCollectionModuleRoute(), COLLECTION_CREATE_PATH).toString()
}
export const COLLECTION_CREATE_PATH = 'create';
export const COLLECTION_EDIT_PATH = 'edit';
export const ITEMTEMPLATE_PATH = 'itemtemplate';

View File

@@ -7,8 +7,6 @@ import { CreateCollectionPageComponent } from './create-collection-page/create-c
import { AuthenticatedGuard } from '../core/auth/authenticated.guard'; import { AuthenticatedGuard } from '../core/auth/authenticated.guard';
import { CreateCollectionPageGuard } from './create-collection-page/create-collection-page.guard'; import { CreateCollectionPageGuard } from './create-collection-page/create-collection-page.guard';
import { DeleteCollectionPageComponent } from './delete-collection-page/delete-collection-page.component'; import { DeleteCollectionPageComponent } from './delete-collection-page/delete-collection-page.component';
import { URLCombiner } from '../core/url-combiner/url-combiner';
import { getCollectionModulePath } from '../app-routing.module';
import { EditItemTemplatePageComponent } from './edit-item-template-page/edit-item-template-page.component'; import { EditItemTemplatePageComponent } from './edit-item-template-page/edit-item-template-page.component';
import { ItemTemplatePageResolver } from './edit-item-template-page/item-template-page.resolver'; import { ItemTemplatePageResolver } from './edit-item-template-page/item-template-page.resolver';
import { CollectionItemMapperComponent } from './collection-item-mapper/collection-item-mapper.component'; import { CollectionItemMapperComponent } from './collection-item-mapper/collection-item-mapper.component';
@@ -16,24 +14,11 @@ import { CollectionBreadcrumbResolver } from '../core/breadcrumbs/collection-bre
import { DSOBreadcrumbsService } from '../core/breadcrumbs/dso-breadcrumbs.service'; import { DSOBreadcrumbsService } from '../core/breadcrumbs/dso-breadcrumbs.service';
import { LinkService } from '../core/cache/builders/link.service'; import { LinkService } from '../core/cache/builders/link.service';
import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver'; import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver';
import {
export const COLLECTION_PARENT_PARAMETER = 'parent'; ITEMTEMPLATE_PATH,
COLLECTION_EDIT_PATH,
export function getCollectionPageRoute(collectionId: string) { COLLECTION_CREATE_PATH
return new URLCombiner(getCollectionModulePath(), collectionId).toString(); } from './collection-page-routing-paths';
}
export function getCollectionEditPath(id: string) {
return new URLCombiner(getCollectionModulePath(), id, COLLECTION_EDIT_PATH).toString()
}
export function getCollectionCreatePath() {
return new URLCombiner(getCollectionModulePath(), COLLECTION_CREATE_PATH).toString()
}
const COLLECTION_CREATE_PATH = 'create';
const COLLECTION_EDIT_PATH = 'edit';
const ITEMTEMPLATE_PATH = 'itemtemplate';
@NgModule({ @NgModule({
imports: [ imports: [

View File

@@ -2,7 +2,7 @@ import { Component } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRoute, Router } from '@angular/router';
import { EditComColPageComponent } from '../../shared/comcol-forms/edit-comcol-page/edit-comcol-page.component'; import { EditComColPageComponent } from '../../shared/comcol-forms/edit-comcol-page/edit-comcol-page.component';
import { Collection } from '../../core/shared/collection.model'; import { Collection } from '../../core/shared/collection.model';
import { getCollectionPageRoute } from '../collection-page-routing.module'; import { getCollectionPageRoute } from '../collection-page-routing-paths';
/** /**
* Component that represents the page where a user can edit an existing Collection * Component that represents the page where a user can edit an existing Collection

View File

@@ -9,8 +9,8 @@ import { ActivatedRoute } from '@angular/router';
import { of as observableOf } from 'rxjs/internal/observable/of'; import { of as observableOf } from 'rxjs/internal/observable/of';
import { Collection } from '../../core/shared/collection.model'; import { Collection } from '../../core/shared/collection.model';
import { NO_ERRORS_SCHEMA } from '@angular/core'; import { NO_ERRORS_SCHEMA } from '@angular/core';
import { getCollectionEditPath } from '../collection-page-routing.module';
import { createSuccessfulRemoteDataObject } from '../../shared/remote-data.utils'; import { createSuccessfulRemoteDataObject } from '../../shared/remote-data.utils';
import { getCollectionEditRoute } from '../collection-page-routing-paths';
describe('EditItemTemplatePageComponent', () => { describe('EditItemTemplatePageComponent', () => {
let comp: EditItemTemplatePageComponent; let comp: EditItemTemplatePageComponent;
@@ -45,7 +45,7 @@ describe('EditItemTemplatePageComponent', () => {
describe('getCollectionEditUrl', () => { describe('getCollectionEditUrl', () => {
it('should return the collection\'s edit url', () => { it('should return the collection\'s edit url', () => {
const url = comp.getCollectionEditUrl(collection); const url = comp.getCollectionEditUrl(collection);
expect(url).toEqual(getCollectionEditPath(collection.uuid)); expect(url).toEqual(getCollectionEditRoute(collection.uuid));
}); });
}); });
}); });

View File

@@ -5,7 +5,7 @@ import { Collection } from '../../core/shared/collection.model';
import { ActivatedRoute } from '@angular/router'; import { ActivatedRoute } from '@angular/router';
import { first, map } from 'rxjs/operators'; import { first, map } from 'rxjs/operators';
import { ItemTemplateDataService } from '../../core/data/item-template-data.service'; import { ItemTemplateDataService } from '../../core/data/item-template-data.service';
import { getCollectionEditPath } from '../collection-page-routing.module'; import { getCollectionEditRoute } from '../collection-page-routing-paths';
@Component({ @Component({
selector: 'ds-edit-item-template-page', selector: 'ds-edit-item-template-page',
@@ -35,7 +35,7 @@ export class EditItemTemplatePageComponent implements OnInit {
*/ */
getCollectionEditUrl(collection: Collection): string { getCollectionEditUrl(collection: Collection): string {
if (collection) { if (collection) {
return getCollectionEditPath(collection.uuid); return getCollectionEditRoute(collection.uuid);
} else { } else {
return ''; return '';
} }

View File

@@ -0,0 +1,24 @@
import { URLCombiner } from '../core/url-combiner/url-combiner';
export const COMMUNITY_PARENT_PARAMETER = 'parent';
export const COMMUNITY_MODULE_PATH = 'communities';
export function getCommunityModuleRoute() {
return `/${COMMUNITY_MODULE_PATH}`;
}
export function getCommunityPageRoute(communityId: string) {
return new URLCombiner(getCommunityModuleRoute(), communityId).toString();
}
export function getCommunityEditRoute(id: string) {
return new URLCombiner(getCommunityModuleRoute(), id, COMMUNITY_EDIT_PATH).toString()
}
export function getCommunityCreateRoute() {
return new URLCombiner(getCommunityModuleRoute(), COMMUNITY_CREATE_PATH).toString()
}
export const COMMUNITY_CREATE_PATH = 'create';
export const COMMUNITY_EDIT_PATH = 'edit';

View File

@@ -7,28 +7,10 @@ import { CreateCommunityPageComponent } from './create-community-page/create-com
import { AuthenticatedGuard } from '../core/auth/authenticated.guard'; import { AuthenticatedGuard } from '../core/auth/authenticated.guard';
import { CreateCommunityPageGuard } from './create-community-page/create-community-page.guard'; import { CreateCommunityPageGuard } from './create-community-page/create-community-page.guard';
import { DeleteCommunityPageComponent } from './delete-community-page/delete-community-page.component'; import { DeleteCommunityPageComponent } from './delete-community-page/delete-community-page.component';
import { URLCombiner } from '../core/url-combiner/url-combiner';
import { getCommunityModulePath } from '../app-routing.module';
import { CommunityBreadcrumbResolver } from '../core/breadcrumbs/community-breadcrumb.resolver'; import { CommunityBreadcrumbResolver } from '../core/breadcrumbs/community-breadcrumb.resolver';
import { DSOBreadcrumbsService } from '../core/breadcrumbs/dso-breadcrumbs.service'; import { DSOBreadcrumbsService } from '../core/breadcrumbs/dso-breadcrumbs.service';
import { LinkService } from '../core/cache/builders/link.service'; import { LinkService } from '../core/cache/builders/link.service';
import { COMMUNITY_EDIT_PATH, COMMUNITY_CREATE_PATH } from './community-page-routing-paths';
export const COMMUNITY_PARENT_PARAMETER = 'parent';
export function getCommunityPageRoute(communityId: string) {
return new URLCombiner(getCommunityModulePath(), communityId).toString();
}
export function getCommunityEditPath(id: string) {
return new URLCombiner(getCommunityModulePath(), id, COMMUNITY_EDIT_PATH).toString()
}
export function getCommunityCreatePath() {
return new URLCombiner(getCommunityModulePath(), COMMUNITY_CREATE_PATH).toString()
}
const COMMUNITY_CREATE_PATH = 'create';
const COMMUNITY_EDIT_PATH = 'edit';
@NgModule({ @NgModule({
imports: [ imports: [

View File

@@ -2,7 +2,7 @@ import { Component } from '@angular/core';
import { Community } from '../../core/shared/community.model'; import { Community } from '../../core/shared/community.model';
import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRoute, Router } from '@angular/router';
import { EditComColPageComponent } from '../../shared/comcol-forms/edit-comcol-page/edit-comcol-page.component'; import { EditComColPageComponent } from '../../shared/comcol-forms/edit-comcol-page/edit-comcol-page.component';
import { getCommunityPageRoute } from '../community-page-routing.module'; import { getCommunityPageRoute } from '../community-page-routing-paths';
/** /**
* Component that represents the page where a user can edit an existing Community * Component that represents the page where a user can edit an existing Community

View File

@@ -11,7 +11,6 @@ import { ItemDataService } from '../../../core/data/item-data.service';
import { AuthService } from '../../../core/auth/auth.service'; import { AuthService } from '../../../core/auth/auth.service';
import { NotificationsService } from '../../../shared/notifications/notifications.service'; import { NotificationsService } from '../../../shared/notifications/notifications.service';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
import { getBitstreamModulePath } from '../../../app-routing.module';
import { PaginatedList } from '../../../core/data/paginated-list'; import { PaginatedList } from '../../../core/data/paginated-list';
import { Bundle } from '../../../core/shared/bundle.model'; import { Bundle } from '../../../core/shared/bundle.model';
import { BundleDataService } from '../../../core/data/bundle-data.service'; import { BundleDataService } from '../../../core/data/bundle-data.service';
@@ -19,8 +18,9 @@ import {
getFirstSucceededRemoteDataPayload getFirstSucceededRemoteDataPayload
} from '../../../core/shared/operators'; } from '../../../core/shared/operators';
import { UploaderComponent } from '../../../shared/uploader/uploader.component'; import { UploaderComponent } from '../../../shared/uploader/uploader.component';
import { getItemEditPath } from '../../item-page-routing.module';
import { RequestService } from '../../../core/data/request.service'; import { RequestService } from '../../../core/data/request.service';
import { getBitstreamModuleRoute } from '../../../app-routing-paths';
import { getItemEditRoute } from '../../item-page-routing-paths';
@Component({ @Component({
selector: 'ds-upload-bitstream', selector: 'ds-upload-bitstream',
@@ -171,7 +171,7 @@ export class UploadBitstreamComponent implements OnInit, OnDestroy {
// Bring over the item ID as a query parameter // Bring over the item ID as a query parameter
const queryParams = { itemId: this.itemId }; const queryParams = { itemId: this.itemId };
this.router.navigate([getBitstreamModulePath(), bitstream.id, 'edit'], { queryParams: queryParams }); this.router.navigate([getBitstreamModuleRoute(), bitstream.id, 'edit'], { queryParams: queryParams });
} }
/** /**
@@ -196,7 +196,7 @@ export class UploadBitstreamComponent implements OnInit, OnDestroy {
* When cancel is clicked, navigate back to the item's edit bitstreams page * When cancel is clicked, navigate back to the item's edit bitstreams page
*/ */
onCancel() { onCancel() {
this.router.navigate([getItemEditPath(this.itemId), 'bitstreams']); this.router.navigate([getItemEditRoute(this.itemId), 'bitstreams']);
} }
/** /**

View File

@@ -6,7 +6,7 @@ import { Item } from '../../core/shared/item.model';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { map } from 'rxjs/operators'; import { map } from 'rxjs/operators';
import { isNotEmpty } from '../../shared/empty.util'; import { isNotEmpty } from '../../shared/empty.util';
import { getItemPageRoute } from '../item-page-routing.module'; import { getItemPageRoute } from '../item-page-routing-paths';
@Component({ @Component({
selector: 'ds-edit-item-page', selector: 'ds-edit-item-page',

View File

@@ -0,0 +1,7 @@
export const ITEM_EDIT_WITHDRAW_PATH = 'withdraw';
export const ITEM_EDIT_REINSTATE_PATH = 'reinstate';
export const ITEM_EDIT_PRIVATE_PATH = 'private';
export const ITEM_EDIT_PUBLIC_PATH = 'public';
export const ITEM_EDIT_DELETE_PATH = 'delete';
export const ITEM_EDIT_MOVE_PATH = 'move';
export const ITEM_EDIT_AUTHORIZATIONS_PATH = 'authorizations';

View File

@@ -20,14 +20,15 @@ import { ResourcePolicyResolver } from '../../shared/resource-policies/resolvers
import { ResourcePolicyCreateComponent } from '../../shared/resource-policies/create/resource-policy-create.component'; import { ResourcePolicyCreateComponent } from '../../shared/resource-policies/create/resource-policy-create.component';
import { ResourcePolicyEditComponent } from '../../shared/resource-policies/edit/resource-policy-edit.component'; import { ResourcePolicyEditComponent } from '../../shared/resource-policies/edit/resource-policy-edit.component';
import { I18nBreadcrumbsService } from '../../core/breadcrumbs/i18n-breadcrumbs.service'; import { I18nBreadcrumbsService } from '../../core/breadcrumbs/i18n-breadcrumbs.service';
import {
export const ITEM_EDIT_WITHDRAW_PATH = 'withdraw'; ITEM_EDIT_AUTHORIZATIONS_PATH,
export const ITEM_EDIT_REINSTATE_PATH = 'reinstate'; ITEM_EDIT_MOVE_PATH,
export const ITEM_EDIT_PRIVATE_PATH = 'private'; ITEM_EDIT_DELETE_PATH,
export const ITEM_EDIT_PUBLIC_PATH = 'public'; ITEM_EDIT_PUBLIC_PATH,
export const ITEM_EDIT_DELETE_PATH = 'delete'; ITEM_EDIT_PRIVATE_PATH,
export const ITEM_EDIT_MOVE_PATH = 'move'; ITEM_EDIT_REINSTATE_PATH,
export const ITEM_EDIT_AUTHORIZATIONS_PATH = 'authorizations'; ITEM_EDIT_WITHDRAW_PATH
} from './edit-item-page.routing-paths';
/** /**
* Routing module that handles the routing for the Edit Item page administrator functionality * Routing module that handles the routing for the Edit Item page administrator functionality

View File

@@ -16,7 +16,6 @@ import { NotificationsService } from '../../../shared/notifications/notification
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { By } from '@angular/platform-browser'; import { By } from '@angular/platform-browser';
import { ItemDeleteComponent } from './item-delete.component'; import { ItemDeleteComponent } from './item-delete.component';
import { getItemEditPath } from '../../item-page-routing.module';
import { createSuccessfulRemoteDataObject } from '../../../shared/remote-data.utils'; import { createSuccessfulRemoteDataObject } from '../../../shared/remote-data.utils';
import { VarDirective } from '../../../shared/utils/var.directive'; import { VarDirective } from '../../../shared/utils/var.directive';
import { ObjectUpdatesService } from '../../../core/data/object-updates/object-updates.service'; import { ObjectUpdatesService } from '../../../core/data/object-updates/object-updates.service';
@@ -26,6 +25,7 @@ import { RemoteData } from '../../../core/data/remote-data';
import { PaginatedList } from '../../../core/data/paginated-list'; import { PaginatedList } from '../../../core/data/paginated-list';
import { PageInfo } from '../../../core/shared/page-info.model'; import { PageInfo } from '../../../core/shared/page-info.model';
import { EntityTypeService } from '../../../core/data/entity-type.service'; import { EntityTypeService } from '../../../core/data/entity-type.service';
import { getItemEditRoute } from '../../item-page-routing-paths';
let comp: ItemDeleteComponent; let comp: ItemDeleteComponent;
let fixture: ComponentFixture<ItemDeleteComponent>; let fixture: ComponentFixture<ItemDeleteComponent>;
@@ -233,7 +233,7 @@ describe('ItemDeleteComponent', () => {
describe('notify', () => { describe('notify', () => {
it('should navigate to the item edit page on failed deletion of the item', () => { it('should navigate to the item edit page on failed deletion of the item', () => {
comp.notify(false); comp.notify(false);
expect(routerStub.navigate).toHaveBeenCalledWith([getItemEditPath('fake-id')]); expect(routerStub.navigate).toHaveBeenCalledWith([getItemEditRoute('fake-id')]);
}); });
}); });
}) })

View File

@@ -1,7 +1,6 @@
import { Component, Input, OnInit } from '@angular/core'; import { Component, Input, OnInit } from '@angular/core';
import { defaultIfEmpty, filter, first, map, switchMap, take } from 'rxjs/operators'; import { defaultIfEmpty, filter, first, map, switchMap, take } from 'rxjs/operators';
import { AbstractSimpleItemActionComponent } from '../simple-item-action/abstract-simple-item-action.component'; import { AbstractSimpleItemActionComponent } from '../simple-item-action/abstract-simple-item-action.component';
import { getItemEditPath } from '../../item-page-routing.module';
import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
import { combineLatest as observableCombineLatest, combineLatest, Observable, of as observableOf } from 'rxjs'; import { combineLatest as observableCombineLatest, combineLatest, Observable, of as observableOf } from 'rxjs';
import { RelationshipType } from '../../../core/shared/item-relationships/relationship-type.model'; import { RelationshipType } from '../../../core/shared/item-relationships/relationship-type.model';
@@ -22,6 +21,7 @@ import { EntityTypeService } from '../../../core/data/entity-type.service';
import { LinkService } from '../../../core/cache/builders/link.service'; import { LinkService } from '../../../core/cache/builders/link.service';
import { followLink } from '../../../shared/utils/follow-link-config.model'; import { followLink } from '../../../shared/utils/follow-link-config.model';
import { RestResponse } from '../../../core/cache/response.models'; import { RestResponse } from '../../../core/cache/response.models';
import { getItemEditRoute } from '../../item-page-routing-paths';
@Component({ @Component({
selector: 'ds-item-delete', selector: 'ds-item-delete',
@@ -345,7 +345,7 @@ export class ItemDeleteComponent
this.router.navigate(['']); this.router.navigate(['']);
} else { } else {
this.notificationsService.error(this.translateService.get('item.edit.' + this.messageKey + '.error')); this.notificationsService.error(this.translateService.get('item.edit.' + this.messageKey + '.error'));
this.router.navigate([getItemEditPath(this.item.id)]); this.router.navigate([getItemEditRoute(this.item.id)]);
} }
} }
} }

View File

@@ -10,7 +10,6 @@ import { NotificationsService } from '../../../shared/notifications/notification
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
import { getSucceededRemoteData } from '../../../core/shared/operators'; import { getSucceededRemoteData } from '../../../core/shared/operators';
import { ItemDataService } from '../../../core/data/item-data.service'; import { ItemDataService } from '../../../core/data/item-data.service';
import { getItemEditPath } from '../../item-page-routing.module';
import { Observable, of as observableOf } from 'rxjs'; import { Observable, of as observableOf } from 'rxjs';
import { RestResponse } from '../../../core/cache/response.models'; import { RestResponse } from '../../../core/cache/response.models';
import { Collection } from '../../../core/shared/collection.model'; import { Collection } from '../../../core/shared/collection.model';
@@ -18,6 +17,7 @@ import { PaginationComponentOptions } from '../../../shared/pagination/paginatio
import { SearchService } from '../../../core/shared/search/search.service'; import { SearchService } from '../../../core/shared/search/search.service';
import { PaginatedSearchOptions } from '../../../shared/search/paginated-search-options.model'; import { PaginatedSearchOptions } from '../../../shared/search/paginated-search-options.model';
import { SearchResult } from '../../../shared/search/search-result.model'; import { SearchResult } from '../../../shared/search/search-result.model';
import { getItemEditRoute } from '../../item-page-routing-paths';
@Component({ @Component({
selector: 'ds-item-move', selector: 'ds-item-move',
@@ -116,7 +116,7 @@ export class ItemMoveComponent implements OnInit {
this.processing = true; this.processing = true;
this.itemDataService.moveToCollection(this.itemId, this.selectedCollection).pipe(first()).subscribe( this.itemDataService.moveToCollection(this.itemId, this.selectedCollection).pipe(first()).subscribe(
(response: RestResponse) => { (response: RestResponse) => {
this.router.navigate([getItemEditPath(this.itemId)]); this.router.navigate([getItemEditRoute(this.itemId)]);
if (response.isSuccessful) { if (response.isSuccessful) {
this.notificationsService.success(this.translateService.get('item.edit.move.success')); this.notificationsService.success(this.translateService.get('item.edit.move.success'));
} else { } else {

View File

@@ -6,7 +6,7 @@ import { ItemOperation } from '../item-operation/itemOperation.model';
import { first, map } from 'rxjs/operators'; import { first, map } from 'rxjs/operators';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { RemoteData } from '../../../core/data/remote-data'; import { RemoteData } from '../../../core/data/remote-data';
import { getItemEditPath, getItemPageRoute } from '../../item-page-routing.module'; import { getItemEditRoute, getItemPageRoute } from '../../item-page-routing-paths';
@Component({ @Component({
selector: 'ds-item-status', selector: 'ds-item-status',
@@ -99,7 +99,7 @@ export class ItemStatusComponent implements OnInit {
* @returns {string} url * @returns {string} url
*/ */
getCurrentUrl(item: Item): string { getCurrentUrl(item: Item): string {
return getItemEditPath(item.id); return getItemEditRoute(item.id);
} }
} }

View File

@@ -15,12 +15,12 @@ import { RemoteData } from '../../../core/data/remote-data';
import { AbstractSimpleItemActionComponent } from './abstract-simple-item-action.component'; import { AbstractSimpleItemActionComponent } from './abstract-simple-item-action.component';
import { By } from '@angular/platform-browser'; import { By } from '@angular/platform-browser';
import { of as observableOf } from 'rxjs'; import { of as observableOf } from 'rxjs';
import { getItemEditPath } from '../../item-page-routing.module';
import { RestResponse } from '../../../core/cache/response.models'; import { RestResponse } from '../../../core/cache/response.models';
import { import {
createSuccessfulRemoteDataObject, createSuccessfulRemoteDataObject,
createSuccessfulRemoteDataObject$ createSuccessfulRemoteDataObject$
} from '../../../shared/remote-data.utils'; } from '../../../shared/remote-data.utils';
import { getItemEditRoute } from '../../item-page-routing-paths';
/** /**
* Test component that implements the AbstractSimpleItemActionComponent used to test the * Test component that implements the AbstractSimpleItemActionComponent used to test the
@@ -136,14 +136,14 @@ describe('AbstractSimpleItemActionComponent', () => {
comp.processRestResponse(successfulRestResponse); comp.processRestResponse(successfulRestResponse);
expect(notificationsServiceStub.success).toHaveBeenCalled(); expect(notificationsServiceStub.success).toHaveBeenCalled();
expect(routerStub.navigate).toHaveBeenCalledWith([getItemEditPath(mockItem.id)]); expect(routerStub.navigate).toHaveBeenCalledWith([getItemEditRoute(mockItem.id)]);
}); });
it('should process a RestResponse to navigate and display success notification', () => { it('should process a RestResponse to navigate and display success notification', () => {
comp.processRestResponse(failRestResponse); comp.processRestResponse(failRestResponse);
expect(notificationsServiceStub.error).toHaveBeenCalled(); expect(notificationsServiceStub.error).toHaveBeenCalled();
expect(routerStub.navigate).toHaveBeenCalledWith([getItemEditPath(mockItem.id)]); expect(routerStub.navigate).toHaveBeenCalledWith([getItemEditRoute(mockItem.id)]);
}); });
}); });

View File

@@ -9,8 +9,8 @@ import {Observable} from 'rxjs';
import {getSucceededRemoteData} from '../../../core/shared/operators'; import {getSucceededRemoteData} from '../../../core/shared/operators';
import {first, map} from 'rxjs/operators'; import {first, map} from 'rxjs/operators';
import {findSuccessfulAccordingTo} from '../edit-item-operators'; import {findSuccessfulAccordingTo} from '../edit-item-operators';
import {getItemEditPath} from '../../item-page-routing.module';
import { RestResponse } from '../../../core/cache/response.models'; import { RestResponse } from '../../../core/cache/response.models';
import { getItemEditRoute } from '../../item-page-routing-paths';
/** /**
* Component to render and handle simple item edit actions such as withdrawal and reinstatement. * Component to render and handle simple item edit actions such as withdrawal and reinstatement.
@@ -73,11 +73,11 @@ export class AbstractSimpleItemActionComponent implements OnInit {
this.itemDataService.findById(this.item.id).pipe( this.itemDataService.findById(this.item.id).pipe(
findSuccessfulAccordingTo(this.predicate)).subscribe(() => { findSuccessfulAccordingTo(this.predicate)).subscribe(() => {
this.notificationsService.success(this.translateService.get('item.edit.' + this.messageKey + '.success')); this.notificationsService.success(this.translateService.get('item.edit.' + this.messageKey + '.success'));
this.router.navigate([getItemEditPath(this.item.id)]); this.router.navigate([getItemEditRoute(this.item.id)]);
}); });
} else { } else {
this.notificationsService.error(this.translateService.get('item.edit.' + this.messageKey + '.error')); this.notificationsService.error(this.translateService.get('item.edit.' + this.messageKey + '.error'));
this.router.navigate([getItemEditPath(this.item.id)]); this.router.navigate([getItemEditRoute(this.item.id)]);
} }
} }

View File

@@ -0,0 +1,18 @@
import { URLCombiner } from '../core/url-combiner/url-combiner';
export const ITEM_MODULE_PATH = 'items';
export function getItemModuleRoute() {
return `/${ITEM_MODULE_PATH}`;
}
export function getItemPageRoute(itemId: string) {
return new URLCombiner(getItemModuleRoute(), itemId).toString();
}
export function getItemEditRoute(id: string) {
return new URLCombiner(getItemModuleRoute(), id, ITEM_EDIT_PATH).toString()
}
export const ITEM_EDIT_PATH = 'edit';
export const UPLOAD_BITSTREAM_PATH = 'bitstreams/new';

View File

@@ -4,24 +4,12 @@ import { RouterModule } from '@angular/router';
import { ItemPageComponent } from './simple/item-page.component'; import { ItemPageComponent } from './simple/item-page.component';
import { FullItemPageComponent } from './full/full-item-page.component'; import { FullItemPageComponent } from './full/full-item-page.component';
import { ItemPageResolver } from './item-page.resolver'; import { ItemPageResolver } from './item-page.resolver';
import { URLCombiner } from '../core/url-combiner/url-combiner';
import { getItemModulePath } from '../app-routing.module';
import { AuthenticatedGuard } from '../core/auth/authenticated.guard'; import { AuthenticatedGuard } from '../core/auth/authenticated.guard';
import { ItemBreadcrumbResolver } from '../core/breadcrumbs/item-breadcrumb.resolver'; import { ItemBreadcrumbResolver } from '../core/breadcrumbs/item-breadcrumb.resolver';
import { DSOBreadcrumbsService } from '../core/breadcrumbs/dso-breadcrumbs.service'; import { DSOBreadcrumbsService } from '../core/breadcrumbs/dso-breadcrumbs.service';
import { LinkService } from '../core/cache/builders/link.service'; import { LinkService } from '../core/cache/builders/link.service';
import { UploadBitstreamComponent } from './bitstreams/upload/upload-bitstream.component'; import { UploadBitstreamComponent } from './bitstreams/upload/upload-bitstream.component';
import { UPLOAD_BITSTREAM_PATH, ITEM_EDIT_PATH } from './item-page-routing-paths';
export function getItemPageRoute(itemId: string) {
return new URLCombiner(getItemModulePath(), itemId).toString();
}
export function getItemEditPath(id: string) {
return new URLCombiner(getItemModulePath(), id, ITEM_EDIT_PATH).toString()
}
const ITEM_EDIT_PATH = 'edit';
const UPLOAD_BITSTREAM_PATH = 'bitstreams/new';
@NgModule({ @NgModule({
imports: [ imports: [

View File

@@ -0,0 +1,22 @@
import { URLCombiner } from '../core/url-combiner/url-combiner';
import { getWorkflowItemModuleRoute } from '../app-routing-paths';
export function getWorkflowItemPageRoute(wfiId: string) {
return new URLCombiner(getWorkflowItemModuleRoute(), wfiId).toString();
}
export function getWorkflowItemEditRoute(wfiId: string) {
return new URLCombiner(getWorkflowItemModuleRoute(), wfiId, WORKFLOW_ITEM_EDIT_PATH).toString()
}
export function getWorkflowItemDeleteRoute(wfiId: string) {
return new URLCombiner(getWorkflowItemModuleRoute(), wfiId, WORKFLOW_ITEM_DELETE_PATH).toString()
}
export function getWorkflowItemSendBackRoute(wfiId: string) {
return new URLCombiner(getWorkflowItemModuleRoute(), wfiId, WORKFLOW_ITEM_SEND_BACK_PATH).toString()
}
export const WORKFLOW_ITEM_EDIT_PATH = 'edit';
export const WORKFLOW_ITEM_DELETE_PATH = 'delete';
export const WORKFLOW_ITEM_SEND_BACK_PATH = 'sendback';

View File

@@ -3,31 +3,14 @@ import { RouterModule } from '@angular/router';
import { AuthenticatedGuard } from '../core/auth/authenticated.guard'; import { AuthenticatedGuard } from '../core/auth/authenticated.guard';
import { SubmissionEditComponent } from '../submission/edit/submission-edit.component'; import { SubmissionEditComponent } from '../submission/edit/submission-edit.component';
import { URLCombiner } from '../core/url-combiner/url-combiner';
import { getWorkflowItemModulePath } from '../app-routing.module';
import { WorkflowItemDeleteComponent } from './workflow-item-delete/workflow-item-delete.component'; import { WorkflowItemDeleteComponent } from './workflow-item-delete/workflow-item-delete.component';
import { WorkflowItemPageResolver } from './workflow-item-page.resolver'; import { WorkflowItemPageResolver } from './workflow-item-page.resolver';
import { WorkflowItemSendBackComponent } from './workflow-item-send-back/workflow-item-send-back.component'; import { WorkflowItemSendBackComponent } from './workflow-item-send-back/workflow-item-send-back.component';
import {
export function getWorkflowItemPageRoute(wfiId: string) { WORKFLOW_ITEM_SEND_BACK_PATH,
return new URLCombiner(getWorkflowItemModulePath(), wfiId).toString(); WORKFLOW_ITEM_DELETE_PATH,
} WORKFLOW_ITEM_EDIT_PATH
} from './workflowitems-edit-page-routing-paths';
export function getWorkflowItemEditPath(wfiId: string) {
return new URLCombiner(getWorkflowItemModulePath(), wfiId, WORKFLOW_ITEM_EDIT_PATH).toString()
}
export function getWorkflowItemDeletePath(wfiId: string) {
return new URLCombiner(getWorkflowItemModulePath(), wfiId, WORKFLOW_ITEM_DELETE_PATH).toString()
}
export function getWorkflowItemSendBackPath(wfiId: string) {
return new URLCombiner(getWorkflowItemModulePath(), wfiId, WORKFLOW_ITEM_SEND_BACK_PATH).toString()
}
const WORKFLOW_ITEM_EDIT_PATH = 'edit';
const WORKFLOW_ITEM_DELETE_PATH = 'delete';
const WORKFLOW_ITEM_SEND_BACK_PATH = 'sendback';
@NgModule({ @NgModule({
imports: [ imports: [

View File

@@ -0,0 +1,62 @@
import { DSpaceObject } from './core/shared/dspace-object.model';
import { Community } from './core/shared/community.model';
import { Collection } from './core/shared/collection.model';
import { Item } from './core/shared/item.model';
import { getCommunityPageRoute } from './+community-page/community-page-routing-paths';
import { getCollectionPageRoute } from './+collection-page/collection-page-routing-paths';
import { getItemPageRoute } from './+item-page/item-page-routing-paths';
export const BITSTREAM_MODULE_PATH = 'bitstreams';
export function getBitstreamModuleRoute() {
return `/${BITSTREAM_MODULE_PATH}`;
}
export const ADMIN_MODULE_PATH = 'admin';
export function getAdminModuleRoute() {
return `/${ADMIN_MODULE_PATH}`;
}
export const PROFILE_MODULE_PATH = 'profile';
export function getProfileModuleRoute() {
return `/${PROFILE_MODULE_PATH}`;
}
export const REGISTER_PATH = 'register';
export function getRegisterRoute() {
return `/${REGISTER_PATH}`;
}
export const FORGOT_PASSWORD_PATH = 'forgot';
export function getForgotPasswordRoute() {
return `/${FORGOT_PASSWORD_PATH}`;
}
export const WORKFLOW_ITEM_MODULE_PATH = 'workflowitems';
export function getWorkflowItemModuleRoute() {
return `/${WORKFLOW_ITEM_MODULE_PATH}`;
}
export function getDSORoute(dso: DSpaceObject): string {
switch ((dso as any).type) {
case Community.type.value:
return getCommunityPageRoute(dso.uuid);
case Collection.type.value:
return getCollectionPageRoute(dso.uuid);
case Item.type.value:
return getItemPageRoute(dso.uuid);
}
}
export const UNAUTHORIZED_PATH = 'unauthorized';
export function getUnauthorizedRoute() {
return `/${UNAUTHORIZED_PATH}`;
}

View File

@@ -3,86 +3,20 @@ import { RouterModule } from '@angular/router';
import { PageNotFoundComponent } from './pagenotfound/pagenotfound.component'; import { PageNotFoundComponent } from './pagenotfound/pagenotfound.component';
import { AuthenticatedGuard } from './core/auth/authenticated.guard'; import { AuthenticatedGuard } from './core/auth/authenticated.guard';
import { DSpaceObject } from './core/shared/dspace-object.model';
import { Community } from './core/shared/community.model';
import { getCommunityPageRoute } from './+community-page/community-page-routing.module';
import { Collection } from './core/shared/collection.model';
import { Item } from './core/shared/item.model';
import { getItemPageRoute } from './+item-page/item-page-routing.module';
import { getCollectionPageRoute } from './+collection-page/collection-page-routing.module';
import { SiteAdministratorGuard } from './core/data/feature-authorization/feature-authorization-guard/site-administrator.guard'; import { SiteAdministratorGuard } from './core/data/feature-authorization/feature-authorization-guard/site-administrator.guard';
import { UnauthorizedComponent } from './unauthorized/unauthorized.component'; import { UnauthorizedComponent } from './unauthorized/unauthorized.component';
import {
const ITEM_MODULE_PATH = 'items'; UNAUTHORIZED_PATH,
WORKFLOW_ITEM_MODULE_PATH,
export function getItemModulePath() { FORGOT_PASSWORD_PATH,
return `/${ITEM_MODULE_PATH}`; REGISTER_PATH,
} PROFILE_MODULE_PATH,
ADMIN_MODULE_PATH,
const COLLECTION_MODULE_PATH = 'collections'; BITSTREAM_MODULE_PATH
} from './app-routing-paths';
export function getCollectionModulePath() { import { COLLECTION_MODULE_PATH } from './+collection-page/collection-page-routing-paths';
return `/${COLLECTION_MODULE_PATH}`; import { COMMUNITY_MODULE_PATH } from './+community-page/community-page-routing-paths';
} import { ITEM_MODULE_PATH } from './+item-page/item-page-routing-paths';
const COMMUNITY_MODULE_PATH = 'communities';
export function getCommunityModulePath() {
return `/${COMMUNITY_MODULE_PATH}`;
}
const BITSTREAM_MODULE_PATH = 'bitstreams';
export function getBitstreamModulePath() {
return `/${BITSTREAM_MODULE_PATH}`;
}
export const ADMIN_MODULE_PATH = 'admin';
export function getAdminModulePath() {
return `/${ADMIN_MODULE_PATH}`;
}
const PROFILE_MODULE_PATH = 'profile';
export function getProfileModulePath() {
return `/${PROFILE_MODULE_PATH}`;
}
const REGISTER_PATH = 'register';
export function getRegisterPath() {
return `/${REGISTER_PATH}`;
}
const FORGOT_PASSWORD_PATH = 'forgot';
export function getForgotPasswordPath() {
return `/${FORGOT_PASSWORD_PATH}`;
}
const WORKFLOW_ITEM_MODULE_PATH = 'workflowitems';
export function getWorkflowItemModulePath() {
return `/${WORKFLOW_ITEM_MODULE_PATH}`;
}
export function getDSOPath(dso: DSpaceObject): string {
switch ((dso as any).type) {
case Community.type.value:
return getCommunityPageRoute(dso.uuid);
case Collection.type.value:
return getCollectionPageRoute(dso.uuid);
case Item.type.value:
return getItemPageRoute(dso.uuid);
}
}
const UNAUTHORIZED_PATH = 'unauthorized';
export function getUnauthorizedPath() {
return `/${UNAUTHORIZED_PATH}`;
}
@NgModule({ @NgModule({
imports: [ imports: [

View File

@@ -13,11 +13,11 @@ import { PageInfo } from '../core/shared/page-info.model';
import { hasValue, isNotEmpty } from '../shared/empty.util'; import { hasValue, isNotEmpty } from '../shared/empty.util';
import { RemoteData } from '../core/data/remote-data'; import { RemoteData } from '../core/data/remote-data';
import { PaginatedList } from '../core/data/paginated-list'; import { PaginatedList } from '../core/data/paginated-list';
import { getCommunityPageRoute } from '../+community-page/community-page-routing.module';
import { getCollectionPageRoute } from '../+collection-page/collection-page-routing.module';
import { CollectionDataService } from '../core/data/collection-data.service'; import { CollectionDataService } from '../core/data/collection-data.service';
import { CommunityListSaveAction } from './community-list.actions'; import { CommunityListSaveAction } from './community-list.actions';
import { CommunityListState } from './community-list.reducer'; import { CommunityListState } from './community-list.reducer';
import { getCommunityPageRoute } from '../+community-page/community-page-routing-paths';
import { getCollectionPageRoute } from '../+collection-page/collection-page-routing-paths';
/** /**
* Each node in the tree is represented by a flatNode which contains info about the node itself and its position and * Each node in the tree is represented by a flatNode which contains info about the node itself and its position and

View File

@@ -10,8 +10,8 @@ import { Community } from '../shared/community.model';
import { Collection } from '../shared/collection.model'; import { Collection } from '../shared/collection.model';
import { Breadcrumb } from '../../breadcrumbs/breadcrumb/breadcrumb.model'; import { Breadcrumb } from '../../breadcrumbs/breadcrumb/breadcrumb.model';
import { getTestScheduler } from 'jasmine-marbles'; import { getTestScheduler } from 'jasmine-marbles';
import { getDSOPath } from '../../app-routing.module';
import { DSONameService } from './dso-name.service'; import { DSONameService } from './dso-name.service';
import { getDSORoute } from '../../app-routing-paths';
describe('DSOBreadcrumbsService', () => { describe('DSOBreadcrumbsService', () => {
let service: DSOBreadcrumbsService; let service: DSOBreadcrumbsService;
@@ -108,9 +108,9 @@ describe('DSOBreadcrumbsService', () => {
it('should return the breadcrumbs based on an Item', () => { it('should return the breadcrumbs based on an Item', () => {
const breadcrumbs = service.getBreadcrumbs(testItem, testItem._links.self); const breadcrumbs = service.getBreadcrumbs(testItem, testItem._links.self);
const expectedCrumbs = [ const expectedCrumbs = [
new Breadcrumb(getName(testCommunity), getDSOPath(testCommunity)), new Breadcrumb(getName(testCommunity), getDSORoute(testCommunity)),
new Breadcrumb(getName(testCollection), getDSOPath(testCollection)), new Breadcrumb(getName(testCollection), getDSORoute(testCollection)),
new Breadcrumb(getName(testItem), getDSOPath(testItem)), new Breadcrumb(getName(testItem), getDSORoute(testItem)),
]; ];
getTestScheduler().expectObservable(breadcrumbs).toBe('(a|)', { a: expectedCrumbs }); getTestScheduler().expectObservable(breadcrumbs).toBe('(a|)', { a: expectedCrumbs });
}) })

View File

@@ -7,10 +7,10 @@ import { LinkService } from '../cache/builders/link.service';
import { DSpaceObject } from '../shared/dspace-object.model'; import { DSpaceObject } from '../shared/dspace-object.model';
import { followLink } from '../../shared/utils/follow-link-config.model'; import { followLink } from '../../shared/utils/follow-link-config.model';
import { find, map, switchMap } from 'rxjs/operators'; import { find, map, switchMap } from 'rxjs/operators';
import { getDSOPath } from '../../app-routing.module';
import { RemoteData } from '../data/remote-data'; import { RemoteData } from '../data/remote-data';
import { hasValue } from '../../shared/empty.util'; import { hasValue } from '../../shared/empty.util';
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { getDSORoute } from '../../app-routing-paths';
/** /**
* Service to calculate DSpaceObject breadcrumbs for a single part of the route * Service to calculate DSpaceObject breadcrumbs for a single part of the route
@@ -41,7 +41,7 @@ export class DSOBreadcrumbsService implements BreadcrumbsService<ChildHALResourc
switchMap((parentRD: RemoteData<ChildHALResource & DSpaceObject>) => { switchMap((parentRD: RemoteData<ChildHALResource & DSpaceObject>) => {
if (hasValue(parentRD.payload)) { if (hasValue(parentRD.payload)) {
const parent = parentRD.payload; const parent = parentRD.payload;
return this.getBreadcrumbs(parent, getDSOPath(parent)) return this.getBreadcrumbs(parent, getDSORoute(parent))
} }
return observableOf([]); return observableOf([]);

View File

@@ -1,12 +1,12 @@
import { autoserialize, deserialize, inheritSerialization } from 'cerialize'; import { autoserialize, deserialize, inheritSerialization } from 'cerialize';
import { isNotEmpty } from '../../../shared/empty.util'; import { isNotEmpty } from '../../../shared/empty.util';
import { PLACEHOLDER_PARENT_METADATA } from '../../../shared/form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.model';
import { OtherInformation } from '../../../shared/form/builder/models/form-field-metadata-value.model'; import { OtherInformation } from '../../../shared/form/builder/models/form-field-metadata-value.model';
import { typedObject } from '../../cache/builders/build-decorators'; import { typedObject } from '../../cache/builders/build-decorators';
import { HALLink } from '../../shared/hal-link.model'; import { HALLink } from '../../shared/hal-link.model';
import { MetadataValueInterface } from '../../shared/metadata.models'; import { MetadataValueInterface } from '../../shared/metadata.models';
import { AUTHORITY_VALUE } from './authority.resource-type'; import { AUTHORITY_VALUE } from './authority.resource-type';
import { IntegrationModel } from './integration.model'; import { IntegrationModel } from './integration.model';
import { PLACEHOLDER_PARENT_METADATA } from '../../../shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-constants';
/** /**
* Class representing an authority object * Class representing an authority object

View File

@@ -11,7 +11,7 @@ import { RequestEntry } from '../data/request.reducer';
import { RequestService } from '../data/request.service'; import { RequestService } from '../data/request.service';
import { BrowseDefinition } from './browse-definition.model'; import { BrowseDefinition } from './browse-definition.model';
import { DSpaceObject } from './dspace-object.model'; import { DSpaceObject } from './dspace-object.model';
import { getUnauthorizedPath } from '../../app-routing.module'; import { getUnauthorizedRoute } from '../../app-routing-paths';
/** /**
* This file contains custom RxJS operators that can be used in multiple places * This file contains custom RxJS operators that can be used in multiple places
@@ -189,7 +189,7 @@ export const returnUnauthorizedUrlTreeOnFalse = (router: Router) =>
(source: Observable<boolean>): Observable<boolean | UrlTree> => (source: Observable<boolean>): Observable<boolean | UrlTree> =>
source.pipe( source.pipe(
map((authorized: boolean) => { map((authorized: boolean) => {
return authorized ? authorized : router.parseUrl(getUnauthorizedPath()) return authorized ? authorized : router.parseUrl(getUnauthorizedRoute())
})); }));
export const getFinishedRemoteData = () => export const getFinishedRemoteData = () =>

View File

@@ -7,8 +7,8 @@ import { EPerson } from '../../../core/eperson/models/eperson.model';
import { AppState } from '../../../app.reducer'; import { AppState } from '../../../app.reducer';
import { isAuthenticationLoading } from '../../../core/auth/selectors'; import { isAuthenticationLoading } from '../../../core/auth/selectors';
import { MYDSPACE_ROUTE } from '../../../+my-dspace-page/my-dspace-page.component'; import { MYDSPACE_ROUTE } from '../../../+my-dspace-page/my-dspace-page.component';
import { getProfileModulePath } from '../../../app-routing.module';
import { AuthService } from '../../../core/auth/auth.service'; import { AuthService } from '../../../core/auth/auth.service';
import { getProfileModuleRoute } from '../../../app-routing-paths';
/** /**
* This component represents the user nav menu. * This component represents the user nav menu.
@@ -41,7 +41,7 @@ export class UserMenuComponent implements OnInit {
/** /**
* The profile page route * The profile page route
*/ */
public profileRoute = getProfileModulePath(); public profileRoute = getProfileModuleRoute();
constructor(private store: Store<AppState>, constructor(private store: Store<AppState>,
private authService: AuthService) { private authService: AuthService) {

View File

@@ -2,7 +2,7 @@ import { isObject, uniqueId } from 'lodash';
import { hasValue, isNotEmpty } from '../../empty.util'; import { hasValue, isNotEmpty } from '../../empty.util';
import { FormFieldMetadataValueObject } from '../../form/builder/models/form-field-metadata-value.model'; import { FormFieldMetadataValueObject } from '../../form/builder/models/form-field-metadata-value.model';
import { ConfidenceType } from '../../../core/integration/models/confidence-type'; import { ConfidenceType } from '../../../core/integration/models/confidence-type';
import { PLACEHOLDER_PARENT_METADATA } from '../../form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.model'; import { PLACEHOLDER_PARENT_METADATA } from '../../form/builder/ds-dynamic-form-ui/ds-dynamic-form-constants';
export interface ChipsItemIcon { export interface ChipsItemIcon {
metadata: string; metadata: string;

View File

@@ -2,10 +2,10 @@ import { findIndex, isEqual, isObject } from 'lodash';
import { BehaviorSubject } from 'rxjs'; import { BehaviorSubject } from 'rxjs';
import { ChipsItem, ChipsItemIcon } from './chips-item.model'; import { ChipsItem, ChipsItemIcon } from './chips-item.model';
import { hasValue, isNotEmpty } from '../../empty.util'; import { hasValue, isNotEmpty } from '../../empty.util';
import { PLACEHOLDER_PARENT_METADATA } from '../../form/builder/ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.model';
import { MetadataIconConfig } from '../../../../config/submission-config.interface'; import { MetadataIconConfig } from '../../../../config/submission-config.interface';
import { FormFieldMetadataValueObject } from '../../form/builder/models/form-field-metadata-value.model'; import { FormFieldMetadataValueObject } from '../../form/builder/models/form-field-metadata-value.model';
import { AuthorityValue } from '../../../core/integration/models/authority.value'; import { AuthorityValue } from '../../../core/integration/models/authority.value';
import { PLACEHOLDER_PARENT_METADATA } from '../../form/builder/ds-dynamic-form-ui/ds-dynamic-form-constants';
export class Chips { export class Chips {
chipsItems: BehaviorSubject<ChipsItem[]>; chipsItems: BehaviorSubject<ChipsItem[]>;

View File

@@ -2,7 +2,6 @@ import { Component, Input, OnInit } from '@angular/core';
import { Group } from '../../../../core/eperson/models/group.model'; import { Group } from '../../../../core/eperson/models/group.model';
import { Community } from '../../../../core/shared/community.model'; import { Community } from '../../../../core/shared/community.model';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { getGroupEditPath } from '../../../../+admin/admin-access-control/admin-access-control-routing.module';
import { GroupDataService } from '../../../../core/eperson/group-data.service'; import { GroupDataService } from '../../../../core/eperson/group-data.service';
import { Collection } from '../../../../core/shared/collection.model'; import { Collection } from '../../../../core/shared/collection.model';
import { filter, map } from 'rxjs/operators'; import { filter, map } from 'rxjs/operators';
@@ -10,6 +9,7 @@ import { getRemoteDataPayload, getSucceededRemoteData } from '../../../../core/s
import { RequestService } from '../../../../core/data/request.service'; import { RequestService } from '../../../../core/data/request.service';
import { RemoteData } from '../../../../core/data/remote-data'; import { RemoteData } from '../../../../core/data/remote-data';
import { HALLink } from '../../../../core/shared/hal-link.model'; import { HALLink } from '../../../../core/shared/hal-link.model';
import { getGroupEditRoute } from '../../../../+admin/admin-access-control/admin-access-control-routing-paths';
/** /**
* Component for managing a community or collection role. * Component for managing a community or collection role.
@@ -71,7 +71,7 @@ export class ComcolRoleComponent implements OnInit {
*/ */
get editGroupLink$(): Observable<string> { get editGroupLink$(): Observable<string> {
return this.group$.pipe( return this.group$.pipe(
map((group) => getGroupEditPath(group.id)), map((group) => getGroupEditRoute(group.id)),
); );
} }

View File

@@ -1,11 +1,11 @@
import { Component, Inject, Input, OnInit } from '@angular/core'; import { Component, Inject, Input, OnInit } from '@angular/core';
import { Observable } from 'rxjs/internal/Observable'; import { Observable } from 'rxjs/internal/Observable';
import { map } from 'rxjs/operators'; import { map } from 'rxjs/operators';
import { getCollectionPageRoute } from '../../+collection-page/collection-page-routing.module';
import { getCommunityPageRoute } from '../../+community-page/community-page-routing.module';
import { ActivatedRoute, Params, Router } from '@angular/router'; import { ActivatedRoute, Params, Router } from '@angular/router';
import { BrowseByTypeConfig } from '../../../config/browse-by-type-config.interface'; import { BrowseByTypeConfig } from '../../../config/browse-by-type-config.interface';
import { environment } from '../../../environments/environment'; import { environment } from '../../../environments/environment';
import { getCommunityPageRoute } from '../../+community-page/community-page-routing-paths';
import { getCollectionPageRoute } from '../../+collection-page/collection-page-routing-paths';
export interface ComColPageNavOption { export interface ComColPageNavOption {
id: string; id: string;

View File

@@ -6,7 +6,7 @@ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRoute, Router } from '@angular/router';
import { RemoteData } from '../../../../core/data/remote-data'; import { RemoteData } from '../../../../core/data/remote-data';
import { RouterStub } from '../../../testing/router.stub'; import { RouterStub } from '../../../testing/router.stub';
import * as collectionRouter from '../../../../+collection-page/collection-page-routing.module'; import * as collectionRouterPaths from '../../../../+collection-page/collection-page-routing-paths';
import { Community } from '../../../../core/shared/community.model'; import { Community } from '../../../../core/shared/community.model';
import { CreateCollectionParentSelectorComponent } from './create-collection-parent-selector.component'; import { CreateCollectionParentSelectorComponent } from './create-collection-parent-selector.component';
import { MetadataValue } from '../../../../core/shared/metadata.models'; import { MetadataValue } from '../../../../core/shared/metadata.models';
@@ -59,7 +59,7 @@ describe('CreateCollectionParentSelectorComponent', () => {
})); }));
beforeEach(() => { beforeEach(() => {
spyOnProperty(collectionRouter, 'getCollectionCreatePath').and.callFake(() => { spyOnProperty(collectionRouterPaths, 'getCollectionCreateRoute').and.callFake(() => {
return () => createPath; return () => createPath;
}); });

View File

@@ -3,11 +3,11 @@ import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
import { DSpaceObjectType } from '../../../../core/shared/dspace-object-type.model'; import { DSpaceObjectType } from '../../../../core/shared/dspace-object-type.model';
import { DSpaceObject } from '../../../../core/shared/dspace-object.model'; import { DSpaceObject } from '../../../../core/shared/dspace-object.model';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import {
COLLECTION_PARENT_PARAMETER,
getCollectionCreatePath
} from '../../../../+collection-page/collection-page-routing.module';
import { DSOSelectorModalWrapperComponent, SelectorActionType } from '../dso-selector-modal-wrapper.component'; import { DSOSelectorModalWrapperComponent, SelectorActionType } from '../dso-selector-modal-wrapper.component';
import {
getCollectionCreateRoute,
COLLECTION_PARENT_PARAMETER
} from '../../../../+collection-page/collection-page-routing-paths';
/** /**
* Component to wrap a list of existing communities inside a modal * Component to wrap a list of existing communities inside a modal
@@ -36,6 +36,6 @@ export class CreateCollectionParentSelectorComponent extends DSOSelectorModalWra
[COLLECTION_PARENT_PARAMETER]: dso.uuid, [COLLECTION_PARENT_PARAMETER]: dso.uuid,
} }
}; };
this.router.navigate([getCollectionCreatePath()], navigationExtras); this.router.navigate([getCollectionCreateRoute()], navigationExtras);
} }
} }

View File

@@ -6,7 +6,7 @@ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRoute, Router } from '@angular/router';
import { RemoteData } from '../../../../core/data/remote-data'; import { RemoteData } from '../../../../core/data/remote-data';
import { RouterStub } from '../../../testing/router.stub'; import { RouterStub } from '../../../testing/router.stub';
import * as communityRouter from '../../../../+community-page/community-page-routing.module'; import * as communityRouterPaths from '../../../../+community-page/community-page-routing-paths';
import { Community } from '../../../../core/shared/community.model'; import { Community } from '../../../../core/shared/community.model';
import { CreateCommunityParentSelectorComponent } from './create-community-parent-selector.component'; import { CreateCommunityParentSelectorComponent } from './create-community-parent-selector.component';
import { MetadataValue } from '../../../../core/shared/metadata.models'; import { MetadataValue } from '../../../../core/shared/metadata.models';
@@ -53,7 +53,7 @@ describe('CreateCommunityParentSelectorComponent', () => {
})); }));
beforeEach(() => { beforeEach(() => {
spyOnProperty(communityRouter, 'getCommunityCreatePath').and.callFake(() => { spyOnProperty(communityRouterPaths, 'getCommunityCreateRoute').and.callFake(() => {
return () => createPath; return () => createPath;
}); });

View File

@@ -4,14 +4,14 @@ import { DSpaceObjectType } from '../../../../core/shared/dspace-object-type.mod
import { DSpaceObject } from '../../../../core/shared/dspace-object.model'; import { DSpaceObject } from '../../../../core/shared/dspace-object.model';
import { hasValue } from '../../../empty.util'; import { hasValue } from '../../../empty.util';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import {
COMMUNITY_PARENT_PARAMETER,
getCommunityCreatePath
} from '../../../../+community-page/community-page-routing.module';
import { import {
DSOSelectorModalWrapperComponent, DSOSelectorModalWrapperComponent,
SelectorActionType SelectorActionType
} from '../dso-selector-modal-wrapper.component'; } from '../dso-selector-modal-wrapper.component';
import {
getCommunityCreateRoute,
COMMUNITY_PARENT_PARAMETER
} from '../../../../+community-page/community-page-routing-paths';
/** /**
* Component to wrap a button - for top communities - * Component to wrap a button - for top communities -
@@ -46,6 +46,6 @@ export class CreateCommunityParentSelectorComponent extends DSOSelectorModalWrap
} }
}; };
} }
this.router.navigate([getCommunityCreatePath()], navigationExtras); this.router.navigate([getCommunityCreateRoute()], navigationExtras);
} }
} }

View File

@@ -6,7 +6,7 @@ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRoute, Router } from '@angular/router';
import { RemoteData } from '../../../../core/data/remote-data'; import { RemoteData } from '../../../../core/data/remote-data';
import { RouterStub } from '../../../testing/router.stub'; import { RouterStub } from '../../../testing/router.stub';
import * as collectionRouter from '../../../../+collection-page/collection-page-routing.module'; import * as collectionRouterPaths from '../../../../+collection-page/collection-page-routing-paths';
import { EditCollectionSelectorComponent } from './edit-collection-selector.component'; import { EditCollectionSelectorComponent } from './edit-collection-selector.component';
import { Collection } from '../../../../core/shared/collection.model'; import { Collection } from '../../../../core/shared/collection.model';
import { MetadataValue } from '../../../../core/shared/metadata.models'; import { MetadataValue } from '../../../../core/shared/metadata.models';
@@ -53,7 +53,7 @@ describe('EditCollectionSelectorComponent', () => {
})); }));
beforeEach(() => { beforeEach(() => {
spyOnProperty(collectionRouter, 'getCollectionEditPath').and.callFake(() => { spyOnProperty(collectionRouterPaths, 'getCollectionEditRoute').and.callFake(() => {
return () => editPath; return () => editPath;
}); });

View File

@@ -3,11 +3,11 @@ import { ActivatedRoute, Router } from '@angular/router';
import { DSpaceObjectType } from '../../../../core/shared/dspace-object-type.model'; import { DSpaceObjectType } from '../../../../core/shared/dspace-object-type.model';
import { DSpaceObject } from '../../../../core/shared/dspace-object.model'; import { DSpaceObject } from '../../../../core/shared/dspace-object.model';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import { getCollectionEditPath } from '../../../../+collection-page/collection-page-routing.module';
import { import {
DSOSelectorModalWrapperComponent, DSOSelectorModalWrapperComponent,
SelectorActionType SelectorActionType
} from '../dso-selector-modal-wrapper.component'; } from '../dso-selector-modal-wrapper.component';
import { getCollectionEditRoute } from '../../../../+collection-page/collection-page-routing-paths';
/** /**
* Component to wrap a list of existing collections inside a modal * Component to wrap a list of existing collections inside a modal
@@ -31,6 +31,6 @@ export class EditCollectionSelectorComponent extends DSOSelectorModalWrapperComp
* Navigate to the collection edit page * Navigate to the collection edit page
*/ */
navigate(dso: DSpaceObject) { navigate(dso: DSpaceObject) {
this.router.navigate([getCollectionEditPath(dso.uuid)]); this.router.navigate([getCollectionEditRoute(dso.uuid)]);
} }
} }

View File

@@ -6,7 +6,7 @@ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRoute, Router } from '@angular/router';
import { RemoteData } from '../../../../core/data/remote-data'; import { RemoteData } from '../../../../core/data/remote-data';
import { RouterStub } from '../../../testing/router.stub'; import { RouterStub } from '../../../testing/router.stub';
import * as communityRouter from '../../../../+community-page/community-page-routing.module'; import * as communityRouterPaths from '../../../../+community-page/community-page-routing-paths';
import { EditCommunitySelectorComponent } from './edit-community-selector.component'; import { EditCommunitySelectorComponent } from './edit-community-selector.component';
import { Community } from '../../../../core/shared/community.model'; import { Community } from '../../../../core/shared/community.model';
import { MetadataValue } from '../../../../core/shared/metadata.models'; import { MetadataValue } from '../../../../core/shared/metadata.models';
@@ -53,7 +53,7 @@ describe('EditCommunitySelectorComponent', () => {
})); }));
beforeEach(() => { beforeEach(() => {
spyOnProperty(communityRouter, 'getCommunityEditPath').and.callFake(() => { spyOnProperty(communityRouterPaths, 'getCommunityEditRoute').and.callFake(() => {
return () => editPath; return () => editPath;
}); });

View File

@@ -3,11 +3,11 @@ import { ActivatedRoute, Router } from '@angular/router';
import { DSpaceObjectType } from '../../../../core/shared/dspace-object-type.model'; import { DSpaceObjectType } from '../../../../core/shared/dspace-object-type.model';
import { DSpaceObject } from '../../../../core/shared/dspace-object.model'; import { DSpaceObject } from '../../../../core/shared/dspace-object.model';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import { getCommunityEditPath } from '../../../../+community-page/community-page-routing.module';
import { import {
DSOSelectorModalWrapperComponent, DSOSelectorModalWrapperComponent,
SelectorActionType SelectorActionType
} from '../dso-selector-modal-wrapper.component'; } from '../dso-selector-modal-wrapper.component';
import { getCommunityEditRoute } from '../../../../+community-page/community-page-routing-paths';
/** /**
* Component to wrap a list of existing communities inside a modal * Component to wrap a list of existing communities inside a modal
@@ -32,6 +32,6 @@ export class EditCommunitySelectorComponent extends DSOSelectorModalWrapperCompo
* Navigate to the community edit page * Navigate to the community edit page
*/ */
navigate(dso: DSpaceObject) { navigate(dso: DSpaceObject) {
this.router.navigate([getCommunityEditPath(dso.uuid)]); this.router.navigate([getCommunityEditRoute(dso.uuid)]);
} }
} }

View File

@@ -6,7 +6,7 @@ import { ActivatedRoute, Router } from '@angular/router';
import { EditItemSelectorComponent } from './edit-item-selector.component'; import { EditItemSelectorComponent } from './edit-item-selector.component';
import { Item } from '../../../../core/shared/item.model'; import { Item } from '../../../../core/shared/item.model';
import { RouterStub } from '../../../testing/router.stub'; import { RouterStub } from '../../../testing/router.stub';
import * as itemRouter from '../../../../+item-page/item-page-routing.module'; import * as itemRouterPaths from '../../../../+item-page/item-page-routing-paths';
import { MetadataValue } from '../../../../core/shared/metadata.models'; import { MetadataValue } from '../../../../core/shared/metadata.models';
import { createSuccessfulRemoteDataObject } from '../../../remote-data.utils'; import { createSuccessfulRemoteDataObject } from '../../../remote-data.utils';
@@ -51,7 +51,7 @@ describe('EditItemSelectorComponent', () => {
})); }));
beforeEach(() => { beforeEach(() => {
spyOnProperty(itemRouter, 'getItemEditPath').and.callFake(() => { spyOnProperty(itemRouterPaths, 'getItemEditRoute').and.callFake(() => {
return () => editPath; return () => editPath;
}); });

View File

@@ -3,8 +3,8 @@ import { ActivatedRoute, Router } from '@angular/router';
import { DSpaceObjectType } from '../../../../core/shared/dspace-object-type.model'; import { DSpaceObjectType } from '../../../../core/shared/dspace-object-type.model';
import { DSpaceObject } from '../../../../core/shared/dspace-object.model'; import { DSpaceObject } from '../../../../core/shared/dspace-object.model';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import { getItemEditPath } from '../../../../+item-page/item-page-routing.module';
import { DSOSelectorModalWrapperComponent, SelectorActionType } from '../dso-selector-modal-wrapper.component'; import { DSOSelectorModalWrapperComponent, SelectorActionType } from '../dso-selector-modal-wrapper.component';
import { getItemEditRoute } from '../../../../+item-page/item-page-routing-paths';
/** /**
* Component to wrap a list of existing items inside a modal * Component to wrap a list of existing items inside a modal
@@ -28,6 +28,6 @@ export class EditItemSelectorComponent extends DSOSelectorModalWrapperComponent
* Navigate to the item edit page * Navigate to the item edit page
*/ */
navigate(dso: DSpaceObject) { navigate(dso: DSpaceObject) {
this.router.navigate([getItemEditPath(dso.uuid)]); this.router.navigate([getItemEditRoute(dso.uuid)]);
} }
} }

View File

@@ -0,0 +1,2 @@
export const DYNAMIC_FORM_CONTROL_TYPE_RELATION_GROUP = 'RELATION';
export const PLACEHOLDER_PARENT_METADATA = '#PLACEHOLDER_PARENT_METADATA_VALUE#';

View File

@@ -76,7 +76,6 @@ import { DsDynamicLookupComponent } from './models/lookup/dynamic-lookup.compone
import { DsDynamicFormGroupComponent } from './models/form-group/dynamic-form-group.component'; import { DsDynamicFormGroupComponent } from './models/form-group/dynamic-form-group.component';
import { DsDynamicFormArrayComponent } from './models/array-group/dynamic-form-array.component'; import { DsDynamicFormArrayComponent } from './models/array-group/dynamic-form-array.component';
import { DsDynamicRelationGroupComponent } from './models/relation-group/dynamic-relation-group.components'; import { DsDynamicRelationGroupComponent } from './models/relation-group/dynamic-relation-group.components';
import { DYNAMIC_FORM_CONTROL_TYPE_RELATION_GROUP } from './models/relation-group/dynamic-relation-group.model';
import { DsDatePickerInlineComponent } from './models/date-picker-inline/dynamic-date-picker-inline.component'; import { DsDatePickerInlineComponent } from './models/date-picker-inline/dynamic-date-picker-inline.component';
import { DYNAMIC_FORM_CONTROL_TYPE_CUSTOM_SWITCH } from './models/custom-switch/custom-switch.model'; import { DYNAMIC_FORM_CONTROL_TYPE_CUSTOM_SWITCH } from './models/custom-switch/custom-switch.model';
import { CustomSwitchComponent } from './models/custom-switch/custom-switch.component'; import { CustomSwitchComponent } from './models/custom-switch/custom-switch.component';
@@ -110,6 +109,7 @@ import { followLink } from '../../../utils/follow-link-config.model';
import { paginatedRelationsToItems } from '../../../../+item-page/simple/item-types/shared/item-relationships-utils'; import { paginatedRelationsToItems } from '../../../../+item-page/simple/item-types/shared/item-relationships-utils';
import { RelationshipOptions } from '../models/relationship-options.model'; import { RelationshipOptions } from '../models/relationship-options.model';
import { FormBuilderService } from '../form-builder.service'; import { FormBuilderService } from '../form-builder.service';
import { DYNAMIC_FORM_CONTROL_TYPE_RELATION_GROUP } from './ds-dynamic-form-constants';
export function dsDynamicFormControlMapFn(model: DynamicFormControlModel): Type<DynamicFormControl> | null { export function dsDynamicFormControlMapFn(model: DynamicFormControlModel): Type<DynamicFormControl> | null {
switch (model.type) { switch (model.type) {

View File

@@ -23,7 +23,7 @@ import {
} from '@ng-dynamic-forms/core'; } from '@ng-dynamic-forms/core';
import { isEqual, isObject } from 'lodash'; import { isEqual, isObject } from 'lodash';
import { DynamicRelationGroupModel, PLACEHOLDER_PARENT_METADATA } from './dynamic-relation-group.model'; import { DynamicRelationGroupModel} from './dynamic-relation-group.model';
import { FormBuilderService } from '../../../form-builder.service'; import { FormBuilderService } from '../../../form-builder.service';
import { SubmissionFormsModel } from '../../../../../../core/config/models/config-submission-forms.model'; import { SubmissionFormsModel } from '../../../../../../core/config/models/config-submission-forms.model';
import { FormService } from '../../../../form.service'; import { FormService } from '../../../../form.service';
@@ -39,6 +39,7 @@ import { IntegrationData } from '../../../../../../core/integration/integration-
import { FormFieldMetadataValueObject } from '../../../models/form-field-metadata-value.model'; import { FormFieldMetadataValueObject } from '../../../models/form-field-metadata-value.model';
import { AuthorityValue } from '../../../../../../core/integration/models/authority.value'; import { AuthorityValue } from '../../../../../../core/integration/models/authority.value';
import { environment } from '../../../../../../../environments/environment'; import { environment } from '../../../../../../../environments/environment';
import { PLACEHOLDER_PARENT_METADATA } from '../../ds-dynamic-form-constants';
@Component({ @Component({
selector: 'ds-dynamic-relation-group', selector: 'ds-dynamic-relation-group',

View File

@@ -2,9 +2,7 @@ import { DynamicFormControlLayout, serializable } from '@ng-dynamic-forms/core';
import { DsDynamicInputModel, DsDynamicInputModelConfig } from '../ds-dynamic-input.model'; import { DsDynamicInputModel, DsDynamicInputModelConfig } from '../ds-dynamic-input.model';
import { isEmpty, isNull } from '../../../../../empty.util'; import { isEmpty, isNull } from '../../../../../empty.util';
import { FormRowModel } from '../../../../../../core/config/models/config-submission-form.model'; import { FormRowModel } from '../../../../../../core/config/models/config-submission-form.model';
import { DYNAMIC_FORM_CONTROL_TYPE_RELATION_GROUP } from '../../ds-dynamic-form-constants';
export const DYNAMIC_FORM_CONTROL_TYPE_RELATION_GROUP = 'RELATION';
export const PLACEHOLDER_PARENT_METADATA = '#PLACEHOLDER_PARENT_METADATA_VALUE#';
/** /**
* Dynamic Group Model configuration interface * Dynamic Group Model configuration interface

View File

@@ -20,11 +20,12 @@ import { DynamicQualdropModel } from './ds-dynamic-form-ui/models/ds-dynamic-qua
import { SubmissionFormsModel } from '../../../core/config/models/config-submission-forms.model'; import { SubmissionFormsModel } from '../../../core/config/models/config-submission-forms.model';
import { DYNAMIC_FORM_CONTROL_TYPE_TAG } from './ds-dynamic-form-ui/models/tag/dynamic-tag.model'; import { DYNAMIC_FORM_CONTROL_TYPE_TAG } from './ds-dynamic-form-ui/models/tag/dynamic-tag.model';
import { RowParser } from './parsers/row-parser'; import { RowParser } from './parsers/row-parser';
import { DYNAMIC_FORM_CONTROL_TYPE_RELATION_GROUP, DynamicRelationGroupModel } from './ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.model'; import { DynamicRelationGroupModel } from './ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.model';
import { DynamicRowArrayModel } from './ds-dynamic-form-ui/models/ds-dynamic-row-array-model'; import { DynamicRowArrayModel } from './ds-dynamic-form-ui/models/ds-dynamic-row-array-model';
import { DsDynamicInputModel } from './ds-dynamic-form-ui/models/ds-dynamic-input.model'; import { DsDynamicInputModel } from './ds-dynamic-form-ui/models/ds-dynamic-input.model';
import { FormFieldMetadataValueObject } from './models/form-field-metadata-value.model'; import { FormFieldMetadataValueObject } from './models/form-field-metadata-value.model';
import { isNgbDateStruct } from '../../date.util'; import { isNgbDateStruct } from '../../date.util';
import { DYNAMIC_FORM_CONTROL_TYPE_RELATION_GROUP } from './ds-dynamic-form-ui/ds-dynamic-form-constants';
@Injectable() @Injectable()
export class FormBuilderService extends DynamicFormService { export class FormBuilderService extends DynamicFormService {

View File

@@ -1,7 +1,7 @@
import { hasValue, isEmpty, isNotEmpty, isNotNull } from '../../../empty.util'; import { hasValue, isEmpty, isNotEmpty, isNotNull } from '../../../empty.util';
import { ConfidenceType } from '../../../../core/integration/models/confidence-type'; import { ConfidenceType } from '../../../../core/integration/models/confidence-type';
import { PLACEHOLDER_PARENT_METADATA } from '../ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.model';
import { MetadataValueInterface, VIRTUAL_METADATA_PREFIX } from '../../../../core/shared/metadata.models'; import { MetadataValueInterface, VIRTUAL_METADATA_PREFIX } from '../../../../core/shared/metadata.models';
import { PLACEHOLDER_PARENT_METADATA } from '../ds-dynamic-form-ui/ds-dynamic-form-constants';
export interface OtherInformation { export interface OtherInformation {
[name: string]: string [name: string]: string

View File

@@ -5,10 +5,10 @@ import { FormFieldModel } from '../models/form-field.model';
import { isNotEmpty } from '../../../empty.util'; import { isNotEmpty } from '../../../empty.util';
import { import {
DynamicRelationGroupModel, DynamicRelationGroupModel,
DynamicRelationGroupModelConfig, DynamicRelationGroupModelConfig
PLACEHOLDER_PARENT_METADATA
} from '../ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.model'; } from '../ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.model';
import { FormRowModel } from '../../../../core/config/models/config-submission-form.model'; import { FormRowModel } from '../../../../core/config/models/config-submission-form.model';
import { PLACEHOLDER_PARENT_METADATA } from '../ds-dynamic-form-ui/ds-dynamic-form-constants';
export class RelationGroupFieldParser extends FieldParser { export class RelationGroupFieldParser extends FieldParser {

View File

@@ -8,7 +8,6 @@ import { uniqueId } from 'lodash';
import { IntegrationSearchOptions } from '../../../../core/integration/models/integration-options.model'; import { IntegrationSearchOptions } from '../../../../core/integration/models/integration-options.model';
import { isEmpty } from '../../../empty.util'; import { isEmpty } from '../../../empty.util';
import { DynamicRowGroupModel } from '../ds-dynamic-form-ui/models/ds-dynamic-row-group-model'; import { DynamicRowGroupModel } from '../ds-dynamic-form-ui/models/ds-dynamic-row-group-model';
import { DYNAMIC_FORM_CONTROL_TYPE_RELATION_GROUP } from '../ds-dynamic-form-ui/models/relation-group/dynamic-relation-group.model';
import { FormFieldModel } from '../models/form-field.model'; import { FormFieldModel } from '../models/form-field.model';
import { import {
CONFIG_DATA, CONFIG_DATA,
@@ -21,6 +20,7 @@ import { ParserFactory } from './parser-factory';
import { ParserOptions } from './parser-options'; import { ParserOptions } from './parser-options';
import { ParserType } from './parser-type'; import { ParserType } from './parser-type';
import { setLayout } from './parser.utils'; import { setLayout } from './parser.utils';
import { DYNAMIC_FORM_CONTROL_TYPE_RELATION_GROUP } from '../ds-dynamic-form-ui/ds-dynamic-form-constants';
export const ROW_ID_PREFIX = 'df-row-group-config-'; export const ROW_ID_PREFIX = 'df-row-group-config-';

View File

@@ -13,7 +13,7 @@ import { followLink } from '../../../utils/follow-link-config.model';
import { VersionHistoryDataService } from '../../../../core/data/version-history-data.service'; import { VersionHistoryDataService } from '../../../../core/data/version-history-data.service';
import { AlertType } from '../../../alert/aletr-type'; import { AlertType } from '../../../alert/aletr-type';
import { combineLatest as observableCombineLatest } from 'rxjs'; import { combineLatest as observableCombineLatest } from 'rxjs';
import { getItemPageRoute } from '../../../../+item-page/item-page-routing.module'; import { getItemPageRoute } from '../../../../+item-page/item-page-routing-paths';
@Component({ @Component({
selector: 'ds-item-versions-notice', selector: 'ds-item-versions-notice',

View File

@@ -8,6 +8,6 @@
</ng-container> </ng-container>
<div class="dropdown-divider"></div> <div class="dropdown-divider"></div>
<a class="dropdown-item" [routerLink]="[getRegisterPath()]">{{"login.form.new-user" | translate}}</a> <a class="dropdown-item" [routerLink]="[getRegisterRoute()]">{{"login.form.new-user" | translate}}</a>
<a class="dropdown-item" [routerLink]="[getForgotPath()]">{{"login.form.forgot-password" | translate}}</a> <a class="dropdown-item" [routerLink]="[getForgotRoute()]">{{"login.form.forgot-password" | translate}}</a>
</div> </div>

View File

@@ -8,7 +8,7 @@ import { AuthMethod } from '../../core/auth/models/auth.method';
import { getAuthenticationMethods, isAuthenticated, isAuthenticationLoading } from '../../core/auth/selectors'; import { getAuthenticationMethods, isAuthenticated, isAuthenticationLoading } from '../../core/auth/selectors';
import { CoreState } from '../../core/core.reducers'; import { CoreState } from '../../core/core.reducers';
import { AuthService } from '../../core/auth/auth.service'; import { AuthService } from '../../core/auth/auth.service';
import { getForgotPasswordPath, getRegisterPath } from '../../app-routing.module'; import { getForgotPasswordRoute, getRegisterRoute } from '../../app-routing-paths';
/** /**
* /users/sign-in * /users/sign-in
@@ -83,11 +83,11 @@ export class LogInComponent implements OnInit, OnDestroy {
this.alive = false; this.alive = false;
} }
getRegisterPath() { getRegisterRoute() {
return getRegisterPath(); return getRegisterRoute();
} }
getForgotPath() { getForgotRoute() {
return getForgotPasswordPath(); return getForgotPasswordRoute();
} }
} }

View File

@@ -11,8 +11,8 @@ import { NotificationsService } from '../../notifications/notifications.service'
import { RemoteData } from '../../../core/data/remote-data'; import { RemoteData } from '../../../core/data/remote-data';
import { ResourcePolicy } from '../../../core/resource-policy/models/resource-policy.model'; import { ResourcePolicy } from '../../../core/resource-policy/models/resource-policy.model';
import { ResourcePolicyEvent } from '../form/resource-policy-form.component'; import { ResourcePolicyEvent } from '../form/resource-policy-form.component';
import { ITEM_EDIT_AUTHORIZATIONS_PATH } from '../../../+item-page/edit-item-page/edit-item-page.routing.module';
import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service';
import { ITEM_EDIT_AUTHORIZATIONS_PATH } from '../../../+item-page/edit-item-page/edit-item-page.routing-paths';
@Component({ @Component({
selector: 'ds-resource-policy-create', selector: 'ds-resource-policy-create',

View File

@@ -10,8 +10,8 @@ import { NotificationsService } from '../../notifications/notifications.service'
import { RemoteData } from '../../../core/data/remote-data'; import { RemoteData } from '../../../core/data/remote-data';
import { ResourcePolicy } from '../../../core/resource-policy/models/resource-policy.model'; import { ResourcePolicy } from '../../../core/resource-policy/models/resource-policy.model';
import { ResourcePolicyEvent } from '../form/resource-policy-form.component'; import { ResourcePolicyEvent } from '../form/resource-policy-form.component';
import { ITEM_EDIT_AUTHORIZATIONS_PATH } from '../../../+item-page/edit-item-page/edit-item-page.routing.module';
import { RESOURCE_POLICY } from '../../../core/resource-policy/models/resource-policy.resource-type'; import { RESOURCE_POLICY } from '../../../core/resource-policy/models/resource-policy.resource-type';
import { ITEM_EDIT_AUTHORIZATIONS_PATH } from '../../../+item-page/edit-item-page/edit-item-page.routing-paths';
@Component({ @Component({
selector: 'ds-resource-policy-edit', selector: 'ds-resource-policy-edit',

View File

@@ -22,9 +22,9 @@ import { RequestService } from '../../core/data/request.service';
import { NotificationsService } from '../notifications/notifications.service'; import { NotificationsService } from '../notifications/notifications.service';
import { dateToString, stringToNgbDateStruct } from '../date.util'; import { dateToString, stringToNgbDateStruct } from '../date.util';
import { followLink } from '../utils/follow-link-config.model'; import { followLink } from '../utils/follow-link-config.model';
import { ADMIN_MODULE_PATH } from '../../app-routing.module'; import { ADMIN_MODULE_PATH } from '../../app-routing-paths';
import { ACCESS_CONTROL_MODULE_PATH } from '../../+admin/admin-routing.module'; import { GROUP_EDIT_PATH } from '../../+admin/admin-access-control/admin-access-control-routing-paths';
import { GROUP_EDIT_PATH } from '../../+admin/admin-access-control/admin-access-control-routing.module'; import { ACCESS_CONTROL_MODULE_PATH } from '../../+admin/admin-routing-paths';
interface ResourcePolicyCheckboxEntry { interface ResourcePolicyCheckboxEntry {
id: string; id: string;