diff --git a/config/config.development.yaml b/config/config.development.yaml new file mode 100644 index 00000000000..62ba29133fe --- /dev/null +++ b/config/config.development.yaml @@ -0,0 +1,301 @@ +# NOTE: will log all redux actions and transfers in console +debug: false + +# Angular Universal server settings +# NOTE: these settings define where Node.js will start your UI application. Therefore, these +# "ui" settings usually specify a localhost port/URL which is later proxied to a public URL (using Apache or similar) +ui: + ssl: false + host: localhost + port: 4000 + # NOTE: Space is capitalized because 'namespace' is a reserved string in TypeScript + nameSpace: / + # The rateLimiter settings limit each IP to a 'max' of 500 requests per 'windowMs' (1 minute). + rateLimiter: + windowMs: 60000 # 1 minute + max: 500 # limit each IP to 500 requests per windowMs + # Trust X-FORWARDED-* headers from proxies (default = true) + useProxies: true + +# The REST API server settings +# NOTE: these settings define which (publicly available) REST API to use. They are usually +# 'synced' with the 'dspace.server.url' setting in your backend's local.cfg. +rest: + ssl: true + host: openrepositorydev.aut.ac.nz + port: 443 + # NOTE: Space is capitalized because 'namespace' is a reserved string in TypeScript + nameSpace: /server + +# Caching settings +cache: + # NOTE: how long should objects be cached for by default + msToLive: + default: 900000 # 15 minutes + control: max-age=60 # revalidate browser + autoSync: + defaultTime: 0 + maxBufferSize: 100 + timePerMethod: + PATCH: 3 # time in seconds + +# Authentication settings +auth: + # Authentication UI settings + ui: + # the amount of time before the idle warning is shown + timeUntilIdle: 900000 # 15 minutes + # the amount of time the user has to react after the idle warning is shown before they are logged out. + idleGracePeriod: 300000 # 5 minutes + # Authentication REST settings + rest: + # If the rest token expires in less than this amount of time, it will be refreshed automatically. + # This is independent from the idle warning. + timeLeftBeforeTokenRefresh: 120000 # 2 minutes + +# Form settings +form: + # NOTE: Map server-side validators to comparative Angular form validators + validatorMap: + required: required + regex: pattern + +# Notification settings +notifications: + rtl: false + position: + - top + - right + maxStack: 8 + # NOTE: after how many seconds notification is closed automatically. If set to zero notifications are not closed automatically + timeOut: 5000 # 5 second + clickToClose: true + # NOTE: 'fade' | 'fromTop' | 'fromRight' | 'fromBottom' | 'fromLeft' | 'rotate' | 'scale' + animate: scale + +# Submission settings +submission: + autosave: + # NOTE: which metadata trigger an autosave + metadata: [] + # NOTE: after how many time (milliseconds) submission is saved automatically + # eg. timer: 5 * (1000 * 60); // 5 minutes + timer: 0 + icons: + metadata: + # NOTE: example of configuration + # # NOTE: metadata name + # - name: dc.author + # # NOTE: fontawesome (v5.x) icon classes and bootstrap utility classes can be used + # style: fas fa-user + - name: dc.author + style: fas fa-user + # default configuration + - name: default + style: '' + authority: + confidence: + # NOTE: example of configuration + # # NOTE: confidence value + # - name: dc.author + # # NOTE: fontawesome (v5.x) icon classes and bootstrap utility classes can be used + # style: fa-user + - value: 600 + style: text-success + - value: 500 + style: text-info + - value: 400 + style: text-warning + # default configuration + - value: default + style: text-muted + +# Default Language in which the UI will be rendered if the user's browser language is not an active language +defaultLanguage: en + +# Languages. DSpace Angular holds a message catalog for each of the following languages. +# When set to active, users will be able to switch to the use of this language in the user interface. +languages: + - code: en + label: English + active: true + - code: cs + label: Čeština + active: true + - code: de + label: Deutsch + active: true + - code: es + label: Español + active: true + - code: fr + label: Français + active: true + - code: gd + label: Gàidhlig + active: true + - code: lv + label: Latviešu + active: true + - code: hu + label: Magyar + active: true + - code: nl + label: Nederlands + active: true + - code: pt-PT + label: Português + active: true + - code: pt-BR + label: Português do Brasil + active: true + - code: fi + label: Suomi + active: true + - code: sv + label: Svenska + active: true + - code: tr + label: Türkçe + active: true + - code: kk + label: Қазақ + active: true + - code: bn + label: বাংলা + active: true + - code: hi + label: हिंदी + active: true + - code: el + label: Ελληνικά + active: true + +# Browse-By Pages +browseBy: + # Amount of years to display using jumps of one year (current year - oneYearLimit) + oneYearLimit: 10 + # Limit for years to display using jumps of five years (current year - fiveYearLimit) + fiveYearLimit: 30 + # The absolute lowest year to display in the dropdown (only used when no lowest date can be found for all items) + defaultLowerLimit: 1900 + # If true, thumbnail images for items will be added to BOTH search and browse result lists. + showThumbnails: true + # The number of entries in a paginated browse results list. + # Rounded to the nearest size in the list of selectable sizes on the + # settings menu. + pageSize: 20 + +communityList: + # No. of communities to list per expansion (show more) + pageSize: 20 + +homePage: + recentSubmissions: + # The number of item showing in recent submission components + pageSize: 5 + # Sort record of recent submission + sortField: 'dc.date.accessioned' + topLevelCommunityList: + # No. of communities to list per page on the home page + # This will always round to the nearest number from the list of page sizes. e.g. if you set it to 7 it'll use 10 + pageSize: 5 + +# Item Config +item: + edit: + undoTimeout: 10000 # 10 seconds + # Show the item access status label in items lists + showAccessStatuses: false + +# Collection Page Config +collection: + edit: + undoTimeout: 10000 # 10 seconds + +# Theme Config +themes: + # Add additional themes here. In the case where multiple themes match a route, the first one + # in this list will get priority. It is advisable to always have a theme that matches + # every route as the last one + # + # # A theme with a handle property will match the community, collection or item with the given + # # handle, and all collections and/or items within it + # - name: 'custom', + # handle: '10673/1233' + # + # # A theme with a regex property will match the route using a regular expression. If it + # # matches the route for a community or collection it will also apply to all collections + # # and/or items within it + # - name: 'custom', + # regex: 'collections\/e8043bc2.*' + # + # # A theme with a uuid property will match the community, collection or item with the given + # # ID, and all collections and/or items within it + # - name: 'custom', + # uuid: '0958c910-2037-42a9-81c7-dca80e3892b4' + # + # # The extends property specifies an ancestor theme (by name). Whenever a themed component is not found + # # in the current theme, its ancestor theme(s) will be checked recursively before falling back to default. + # - name: 'custom-A', + # extends: 'custom-B', + # # Any of the matching properties above can be used + # handle: '10673/34' + # + # - name: 'custom-B', + # extends: 'custom', + # handle: '10673/12' + # + - name: aut + - name: custom + uuid: 5b7854aa-901e-4c5c-a457-7928503cb23f + # # A theme with only a name will match every route + # name: 'custom' + # + # # This theme will use the default bootstrap styling for DSpace components + # - name: BASE_THEME_NAME + # + # - name: dspace + # headTags: + # - tagName: link + # attributes: + # rel: icon + # href: assets/dspace/images/favicons/favicon.ico + # sizes: any + # - tagName: link + # attributes: + # rel: icon + # href: assets/dspace/images/favicons/favicon.svg + # type: image/svg+xml + # - tagName: link + # attributes: + # rel: apple-touch-icon + # href: assets/dspace/images/favicons/apple-touch-icon.png + # - tagName: link + # attributes: + # rel: manifest + # href: assets/dspace/images/favicons/manifest.webmanifest + +# The default bundles that should always be displayed as suggestions when you upload a new bundle +bundle: + standardBundles: [ ORIGINAL, THUMBNAIL, LICENSE ] + +# Whether to enable media viewer for image and/or video Bitstreams (i.e. Bitstreams whose MIME type starts with 'image' or 'video'). +# For images, this enables a gallery viewer where you can zoom or page through images. +# For videos, this enables embedded video streaming +mediaViewer: + image: false + video: false + +# Whether the end user agreement is required before users use the repository. +# If enabled, the user will be required to accept the agreement before they can use the repository. +# And whether the privacy statement should exist or not. +info: + enableEndUserAgreement: true + enablePrivacyStatement: true + +# Whether to enable Markdown (https://commonmark.org/) and MathJax (https://www.mathjax.org/) +# display in supported metadata fields. By default, only dc.description.abstract is supported. +markdown: + enabled: false + mathjax: false diff --git a/src/app/collection-page/collection-form/collection-form.component.ts b/src/app/collection-page/collection-form/collection-form.component.ts index 23698de84e9..050e1e7423e 100644 --- a/src/app/collection-page/collection-form/collection-form.component.ts +++ b/src/app/collection-page/collection-form/collection-form.component.ts @@ -20,7 +20,7 @@ import { EntityTypeDataService } from '../../core/data/entity-type-data.service' import { ItemType } from '../../core/shared/item-relationships/item-type.model'; import { MetadataValue } from '../../core/shared/metadata.models'; import { getFirstSucceededRemoteListPayload } from '../../core/shared/operators'; -import { collectionFormEntityTypeSelectionConfig, collectionFormModels, } from './collection-form.models'; +import { collectionFormEntityTypeSelectionConfig, collectionFormModels } from './collection-form.models'; import { NONE_ENTITY_TYPE } from '../../core/shared/item-relationships/item-type.resource-type'; /** @@ -92,7 +92,6 @@ export class CollectionFormComponent extends ComColFormComponent imp this.entityTypeSelection.disabled = true; } }); - this.formModel = [...collectionFormModels, this.entityTypeSelection]; super.ngOnInit(); diff --git a/src/app/collection-page/collection-form/collection-form.models.ts b/src/app/collection-page/collection-form/collection-form.models.ts index 6078e886ecf..7cff4adc5a1 100644 --- a/src/app/collection-page/collection-form/collection-form.models.ts +++ b/src/app/collection-page/collection-form/collection-form.models.ts @@ -15,7 +15,6 @@ export const administratorStyleFormModels: DynamicFormControlModel[] = [ new DynamicTextAreaModel({ id: 'css', name: 'dspace.collection.css', - spellCheck: environment.form.spellCheck, }), ]; @@ -54,5 +53,5 @@ export const collectionFormModels: DynamicFormControlModel[] = [ new DynamicTextAreaModel({ id: 'license', name: 'dc.rights.license', - }) + }), ]; diff --git a/src/app/collection-page/collection-form/collection-form.module.ts b/src/app/collection-page/collection-form/collection-form.module.ts index ddf18f05869..d6ccc33b4a3 100644 --- a/src/app/collection-page/collection-form/collection-form.module.ts +++ b/src/app/collection-page/collection-form/collection-form.module.ts @@ -1,6 +1,7 @@ import { NgModule } from '@angular/core'; import { CollectionFormComponent } from './collection-form.component'; +import { CollectionStylesFormComponent } from './collection-form.styles'; import { SharedModule } from '../../shared/shared.module'; import { ComcolModule } from '../../shared/comcol/comcol.module'; import { FormModule } from '../../shared/form/form.module'; @@ -13,9 +14,11 @@ import { FormModule } from '../../shared/form/form.module'; ], declarations: [ CollectionFormComponent, + CollectionStylesFormComponent, ], exports: [ - CollectionFormComponent + CollectionFormComponent, + CollectionStylesFormComponent, ] }) export class CollectionFormModule { diff --git a/src/app/collection-page/collection-form/collection-form.styles.ts b/src/app/collection-page/collection-form/collection-form.styles.ts index e650d4e0f78..32860419f6a 100644 --- a/src/app/collection-page/collection-form/collection-form.styles.ts +++ b/src/app/collection-page/collection-form/collection-form.styles.ts @@ -1,158 +1,94 @@ -import { - AsyncPipe, - NgClass, - NgIf, -} from '@angular/common'; -import { - ChangeDetectorRef, - Component, - Input, - OnChanges, - OnInit, - SimpleChange, - SimpleChanges, -} from '@angular/core'; -import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; +import { Component, Input, OnInit } from '@angular/core'; +import { Observable } from 'rxjs'; +import { TranslateService } from '@ngx-translate/core'; import { DynamicFormControlModel, DynamicFormOptionConfig, DynamicFormService, - DynamicSelectModel, + DynamicSelectModel } from '@ng-dynamic-forms/core'; -import { - TranslateModule, - TranslateService, -} from '@ngx-translate/core'; -import { Observable } from 'rxjs'; -import { - hasNoValue, - isNotNull, -} from 'src/app/shared/empty.util'; - +import { Collection } from '../../core/shared/collection.model'; +import { ComColFormComponent } from '../../shared/comcol/comcol-forms/comcol-form/comcol-form.component'; +import { NotificationsService } from '../../shared/notifications/notifications.service'; +import { CommunityDataService } from '../../core/data/community-data.service'; import { AuthService } from '../../core/auth/auth.service'; +import { RequestService } from '../../core/data/request.service'; import { ObjectCacheService } from '../../core/cache/object-cache.service'; -import { CollectionDataService } from '../../core/data/collection-data.service'; import { EntityTypeDataService } from '../../core/data/entity-type-data.service'; -import { RequestService } from '../../core/data/request.service'; -import { Collection } from '../../core/shared/collection.model'; import { ItemType } from '../../core/shared/item-relationships/item-type.model'; -import { NONE_ENTITY_TYPE } from '../../core/shared/item-relationships/item-type.resource-type'; import { MetadataValue } from '../../core/shared/metadata.models'; import { getFirstSucceededRemoteListPayload } from '../../core/shared/operators'; -import { ComColFormComponent } from '../../shared/comcol/comcol-forms/comcol-form/comcol-form.component'; -import { ComcolPageLogoComponent } from '../../shared/comcol/comcol-page-logo/comcol-page-logo.component'; -import { FormComponent } from '../../shared/form/form.component'; -import { NotificationsService } from '../../shared/notifications/notifications.service'; -import { UploaderComponent } from '../../shared/upload/uploader/uploader.component'; -import { VarDirective } from '../../shared/utils/var.directive'; -import { - administratorStyleFormModels, - collectionFormEntityTypeSelectionConfig, -} from './collection-form.models'; +import { collectionFormEntityTypeSelectionConfig, administratorStyleFormModels, } from './collection-form.models'; +import { NONE_ENTITY_TYPE } from '../../core/shared/item-relationships/item-type.resource-type'; + +import { CollectionDataService } from '../../core/data/collection-data.service'; +import { CollectionFormComponent } from './collection-form.component'; /** * Form used for creating and editing collections */ @Component({ - selector: 'ds-collection-form', + selector: 'ds-collection-styles', styleUrls: ['../../shared/comcol/comcol-forms/comcol-form/comcol-form.component.scss'], templateUrl: '../../shared/comcol/comcol-forms/comcol-form/comcol-form.component.html', - standalone: true, - imports: [ - FormComponent, - TranslateModule, - UploaderComponent, - AsyncPipe, - ComcolPageLogoComponent, - NgIf, - NgClass, - VarDirective, - ], }) -export class CollectionStylesFormComponent extends ComColFormComponent implements OnInit, OnChanges { + +export class CollectionStylesFormComponent extends ComColFormComponent implements OnInit { /** * @type {Collection} A new collection when a collection is being created, an existing Input collection when a collection is being edited */ @Input() dso: Collection = new Collection(); - /** * @type {Collection.type} This is a collection-type form */ type = Collection.type; - /** * The dynamic form field used for entity type selection * @type {DynamicSelectModel} */ entityTypeSelection: DynamicSelectModel = new DynamicSelectModel(collectionFormEntityTypeSelectionConfig); - /** * The dynamic form fields used for creating/editing a collection * @type {DynamicFormControlModel[]} */ formModel: DynamicFormControlModel[]; - public constructor(protected formService: DynamicFormService, protected translate: TranslateService, protected notificationsService: NotificationsService, protected authService: AuthService, - protected dsoService: CollectionDataService, + protected dsoService: CommunityDataService, protected requestService: RequestService, protected objectCache: ObjectCacheService, - protected entityTypeService: EntityTypeDataService, - protected chd: ChangeDetectorRef, - protected modalService: NgbModal) { - super(formService, translate, notificationsService, authService, requestService, objectCache, modalService); - } - - ngOnInit(): void { - if (hasNoValue(this.formModel) && isNotNull(this.dso)) { - this.initializeForm(); - } - } - - /** - * Detect changes to the dso and initialize the form, - * if the dso changes, exists and it is not the first change - */ - ngOnChanges(changes: SimpleChanges) { - const dsoChange: SimpleChange = changes.dso; - if (this.dso && dsoChange && !dsoChange.isFirstChange()) { - this.initializeForm(); - } + protected entityTypeService: EntityTypeDataService) { + super(formService, translate, notificationsService, authService, requestService, objectCache); } - - initializeForm() { + ngOnInit() { let currentRelationshipValue: MetadataValue[]; + if (this.dso && this.dso.metadata) { currentRelationshipValue = this.dso.metadata['dspace.entity.type']; } - const entities$: Observable = this.entityTypeService.findAll({ elementsPerPage: 100, currentPage: 1 }).pipe( - getFirstSucceededRemoteListPayload(), + getFirstSucceededRemoteListPayload() ); - // retrieve all entity types to populate the dropdowns selection entities$.subscribe((entityTypes: ItemType[]) => { + entityTypes + .filter((type: ItemType) => type.label !== NONE_ENTITY_TYPE) + .forEach((type: ItemType, index: number) => { + this.entityTypeSelection.add({ + disabled: false, + label: type.label, + value: type.label + } as DynamicFormOptionConfig); + if (currentRelationshipValue && currentRelationshipValue.length > 0 && currentRelationshipValue[0].value === type.label) { + this.entityTypeSelection.select(index); + this.entityTypeSelection.disabled = true; + } + }); + this.formModel = [...administratorStyleFormModels]; - entityTypes = entityTypes.filter((type: ItemType) => type.label !== NONE_ENTITY_TYPE); - entityTypes.forEach((type: ItemType, index: number) => { - this.entityTypeSelection.add({ - disabled: false, - label: type.label, - value: type.label, - } as DynamicFormOptionConfig); - if (currentRelationshipValue && currentRelationshipValue.length > 0 && currentRelationshipValue[0].value === type.label) { - this.entityTypeSelection.select(index); - this.entityTypeSelection.disabled = true; - } - }); - - this.formModel = entityTypes.length === 0 ? administratorStyleFormModels : [...administratorStyleFormModels, this.entityTypeSelection]; - - super.ngOnInit(); - this.chd.detectChanges(); + super.ngOnInit(); }); - } } diff --git a/src/app/collection-page/edit-collection-page/collection-styles/collection-styles.component.html b/src/app/collection-page/edit-collection-page/collection-styles/collection-styles.component.html index 08da128ecee..60c4ffaa5f4 100644 --- a/src/app/collection-page/edit-collection-page/collection-styles/collection-styles.component.html +++ b/src/app/collection-page/edit-collection-page/collection-styles/collection-styles.component.html @@ -1,5 +1,4 @@ - + (finish)="navigateToHomePage()"> diff --git a/src/app/collection-page/edit-collection-page/collection-styles/collection-styles.component.ts b/src/app/collection-page/edit-collection-page/collection-styles/collection-styles.component.ts index 11f5b913f57..2ce71a14733 100644 --- a/src/app/collection-page/edit-collection-page/collection-styles/collection-styles.component.ts +++ b/src/app/collection-page/edit-collection-page/collection-styles/collection-styles.component.ts @@ -1,55 +1,30 @@ -import { - AsyncPipe, - NgIf, -} from '@angular/common'; -import { - ChangeDetectorRef, - Component, - OnInit, -} from '@angular/core'; -import { - ActivatedRoute, - NavigationEnd, - Router, - RouterLink, - Scroll, -} from '@angular/router'; -import { - TranslateModule, - TranslateService, -} from '@ngx-translate/core'; -import { Observable } from 'rxjs'; -import { switchMap } from 'rxjs/operators'; - +import { Component } from '@angular/core'; +import { ComcolMetadataComponent } from '../../../shared/comcol/comcol-forms/edit-comcol-page/comcol-metadata/comcol-metadata.component'; +import { Collection } from '../../../core/shared/collection.model'; import { CollectionDataService } from '../../../core/data/collection-data.service'; +import { ActivatedRoute, Router } from '@angular/router'; import { ItemTemplateDataService } from '../../../core/data/item-template-data.service'; +import { combineLatest as combineLatestObservable, Observable } from 'rxjs'; import { RemoteData } from '../../../core/data/remote-data'; -import { RequestService } from '../../../core/data/request.service'; -import { Collection } from '../../../core/shared/collection.model'; import { Item } from '../../../core/shared/item.model'; -import { getFirstSucceededRemoteDataPayload } from '../../../core/shared/operators'; -import { ComcolMetadataComponent } from '../../../shared/comcol/comcol-forms/edit-comcol-page/comcol-metadata/comcol-metadata.component'; +import { getFirstCompletedRemoteData, getFirstSucceededRemoteDataPayload } from '../../../core/shared/operators'; +import { map, switchMap } from 'rxjs/operators'; import { NotificationsService } from '../../../shared/notifications/notifications.service'; -import { VarDirective } from '../../../shared/utils/var.directive'; -import { CollectionStylesFormComponent } from '../../collection-form/collection-form.styles'; +import { TranslateService } from '@ngx-translate/core'; +import { RequestService } from '../../../core/data/request.service'; +import { getCollectionItemTemplateRoute } from '../../collection-page-routing-paths'; +import { NoContent } from '../../../core/shared/NoContent.model'; +import { hasValue } from '../../../shared/empty.util'; + /** * Component for editing a collection's metadata */ @Component({ - selector: 'ds-collection-styles', + selector: 'ds-collection-style-form', templateUrl: './collection-styles.component.html', - imports: [ - CollectionStylesFormComponent, - RouterLink, - AsyncPipe, - TranslateModule, - NgIf, - VarDirective, - ], - standalone: true, }) -export class CollectionStylesComponent extends ComcolMetadataComponent implements OnInit { +export class CollectionStylesComponent extends ComcolMetadataComponent { protected frontendURL = '/collections/'; protected type = Collection.type; @@ -66,36 +41,12 @@ export class CollectionStylesComponent extends ComcolMetadataComponent { - if ( - event instanceof NavigationEnd || - (event instanceof Scroll && event.routerEvent instanceof NavigationEnd) - ) { - super.ngOnInit(); - this.initTemplateItem(); - this.chd.detectChanges(); - } - }); + super.ngOnInit(); } - /** - * Initialize the collection's item template - */ - initTemplateItem() { - this.itemTemplateRD$ = this.dsoRD$.pipe( - getFirstSucceededRemoteDataPayload(), - switchMap((collection: Collection) => this.itemTemplateService.findByCollectionID(collection.uuid)), - ); - } } diff --git a/src/app/collection-page/edit-collection-page/edit-collection-page-routes.ts b/src/app/collection-page/edit-collection-page/edit-collection-page-routes.ts deleted file mode 100644 index fc4d0bf6caa..00000000000 --- a/src/app/collection-page/edit-collection-page/edit-collection-page-routes.ts +++ /dev/null @@ -1,108 +0,0 @@ -import { Route } from '@angular/router'; - -import { i18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver'; -import { collectionAdministratorGuard } from '../../core/data/feature-authorization/feature-authorization-guard/collection-administrator.guard'; -import { siteAdministratorGuard } from '../../core/data/feature-authorization/feature-authorization-guard/site-administrator.guard'; -import { ResourcePolicyCreateComponent } from '../../shared/resource-policies/create/resource-policy-create.component'; -import { ResourcePolicyEditComponent } from '../../shared/resource-policies/edit/resource-policy-edit.component'; -import { resourcePolicyResolver } from '../../shared/resource-policies/resolvers/resource-policy.resolver'; -import { resourcePolicyTargetResolver } from '../../shared/resource-policies/resolvers/resource-policy-target.resolver'; -import { CollectionItemMapperComponent } from '../collection-item-mapper/collection-item-mapper.component'; -import { CollectionAccessControlComponent } from './collection-access-control/collection-access-control.component'; -import { CollectionAuthorizationsComponent } from './collection-authorizations/collection-authorizations.component'; -import { CollectionCurateComponent } from './collection-curate/collection-curate.component'; -import { CollectionMetadataComponent } from './collection-metadata/collection-metadata.component'; -import { CollectionRolesComponent } from './collection-roles/collection-roles.component'; -import { CollectionSourceComponent } from './collection-source/collection-source.component'; -import { CollectionStylesComponent } from './collection-styles/collection-styles.component'; -import { EditCollectionPageComponent } from './edit-collection-page.component'; - -/** - * Routing module that handles the routing for the Edit Collection page administrator functionality - */ - -export const ROUTES: Route[] = [ - { - path: '', - resolve: { - breadcrumb: i18nBreadcrumbResolver, - }, - data: { breadcrumbKey: 'collection.edit' }, - component: EditCollectionPageComponent, - canActivate: [collectionAdministratorGuard], - children: [ - { - path: '', - redirectTo: 'metadata', - pathMatch: 'full', - }, - { - path: 'metadata', - component: CollectionMetadataComponent, - data: { - title: 'collection.edit.tabs.metadata.title', - hideReturnButton: true, - showBreadcrumbs: true, - }, - }, - { - path: 'roles', - component: CollectionRolesComponent, - data: { title: 'collection.edit.tabs.roles.title', showBreadcrumbs: true }, - }, - { - path: 'source', - component: CollectionSourceComponent, - data: { title: 'collection.edit.tabs.source.title', showBreadcrumbs: true }, - }, - { - path: 'curate', - component: CollectionCurateComponent, - data: { title: 'collection.edit.tabs.curate.title', showBreadcrumbs: true }, - }, - { - path: 'access-control', - component: CollectionAccessControlComponent, - data: { title: 'collection.edit.tabs.access-control.title', showBreadcrumbs: true }, - }, - { - path: 'authorizations', - data: { showBreadcrumbs: true }, - children: [ - { - path: 'create', - resolve: { - resourcePolicyTarget: resourcePolicyTargetResolver, - }, - component: ResourcePolicyCreateComponent, - data: { title: 'resource-policies.create.page.title' }, - }, - { - path: 'edit', - resolve: { - resourcePolicy: resourcePolicyResolver, - }, - component: ResourcePolicyEditComponent, - data: { title: 'resource-policies.edit.page.title' }, - }, - { - path: '', - component: CollectionAuthorizationsComponent, - data: { title: 'collection.edit.tabs.authorizations.title', showBreadcrumbs: true }, - }, - ], - }, - { - path: 'mapper', - component: CollectionItemMapperComponent, - data: { title: 'collection.edit.tabs.item-mapper.title', hideReturnButton: true, showBreadcrumbs: true }, - }, - { - path: 'styles', - component: CollectionStylesComponent, - data: { title: 'collection.edit.tabs.styles', showBreadcrumbs: true }, - canActivate: [siteAdministratorGuard], - }, - ], - }, -]; diff --git a/src/app/collection-page/edit-collection-page/edit-collection-page.module.ts b/src/app/collection-page/edit-collection-page/edit-collection-page.module.ts index 45612be41a1..1451b58dfe5 100644 --- a/src/app/collection-page/edit-collection-page/edit-collection-page.module.ts +++ b/src/app/collection-page/edit-collection-page/edit-collection-page.module.ts @@ -4,6 +4,7 @@ import { CommonModule } from '@angular/common'; import { SharedModule } from '../../shared/shared.module'; import { EditCollectionPageRoutingModule } from './edit-collection-page.routing.module'; import { CollectionMetadataComponent } from './collection-metadata/collection-metadata.component'; +import { CollectionStylesComponent } from './collection-styles/collection-styles.component'; import { CollectionRolesComponent } from './collection-roles/collection-roles.component'; import { CollectionCurateComponent } from './collection-curate/collection-curate.component'; import { CollectionSourceComponent } from './collection-source/collection-source.component'; @@ -30,6 +31,7 @@ import { ComcolModule } from '../../shared/comcol/comcol.module'; declarations: [ EditCollectionPageComponent, CollectionMetadataComponent, + CollectionStylesComponent, CollectionRolesComponent, CollectionCurateComponent, CollectionSourceComponent, diff --git a/src/app/collection-page/edit-collection-page/edit-collection-page.routing.module.ts b/src/app/collection-page/edit-collection-page/edit-collection-page.routing.module.ts index 92fc6efeff3..679922b47a7 100644 --- a/src/app/collection-page/edit-collection-page/edit-collection-page.routing.module.ts +++ b/src/app/collection-page/edit-collection-page/edit-collection-page.routing.module.ts @@ -6,6 +6,7 @@ import { CollectionMetadataComponent } from './collection-metadata/collection-me import { CollectionRolesComponent } from './collection-roles/collection-roles.component'; import { CollectionSourceComponent } from './collection-source/collection-source.component'; import { CollectionCurateComponent } from './collection-curate/collection-curate.component'; +import { CollectionStylesComponent } from './collection-styles/collection-styles.component'; import { CollectionAuthorizationsComponent } from './collection-authorizations/collection-authorizations.component'; import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver'; import { ResourcePolicyTargetResolver } from '../../shared/resource-policies/resolvers/resource-policy-target.resolver'; @@ -13,6 +14,7 @@ import { ResourcePolicyCreateComponent } from '../../shared/resource-policies/cr import { ResourcePolicyResolver } from '../../shared/resource-policies/resolvers/resource-policy.resolver'; import { ResourcePolicyEditComponent } from '../../shared/resource-policies/edit/resource-policy-edit.component'; import { CollectionAdministratorGuard } from '../../core/data/feature-authorization/feature-authorization-guard/collection-administrator.guard'; +import { SiteAdministratorGuard } from '../../core/data/feature-authorization/feature-authorization-guard/site-administrator.guard'; /** * Routing module that handles the routing for the Edit Collection page administrator functionality @@ -95,6 +97,12 @@ import { CollectionAdministratorGuard } from '../../core/data/feature-authorizat component: CollectionItemMapperComponent, data: { title: 'collection.edit.tabs.item-mapper.title', hideReturnButton: true, showBreadcrumbs: true } }, + { + path: 'styles', + component: CollectionStylesComponent, + data: { title: 'collection.edit.tabs.styles', showBreadcrumbs: true }, + canActivate: [SiteAdministratorGuard], + }, ] } ]) diff --git a/src/app/shared/theme-support/theme.service.ts b/src/app/shared/theme-support/theme.service.ts index f07041044a8..79341467528 100644 --- a/src/app/shared/theme-support/theme.service.ts +++ b/src/app/shared/theme-support/theme.service.ts @@ -27,6 +27,7 @@ import { distinctNext } from 'src/app/core/shared/distinct-next'; import { DOCUMENT } from '@angular/common'; import { getDefaultThemeConfig } from '../../../config/config.util'; import { BASE_THEME_NAME } from './theme.constants'; +import { CollectionDataService } from 'src/app/core/data/collection-data.service'; export const themeStateSelector = createFeatureSelector('theme');