mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-12 04:23:04 +00:00
Merge branch 'main' into feature/CST-9636
# Conflicts: # src/app/item-page/edit-item-page/edit-item-page.module.ts # src/app/item-page/edit-item-page/edit-item-page.routing.module.ts
This commit is contained in:
@@ -413,8 +413,7 @@ dspace-angular
|
|||||||
│ ├── merge-i18n-files.ts *
|
│ ├── merge-i18n-files.ts *
|
||||||
│ ├── serve.ts *
|
│ ├── serve.ts *
|
||||||
│ ├── sync-i18n-files.ts *
|
│ ├── sync-i18n-files.ts *
|
||||||
│ ├── test-rest.ts *
|
│ └── test-rest.ts *
|
||||||
│ └── webpack.js *
|
|
||||||
├── src * The source of the application
|
├── src * The source of the application
|
||||||
│ ├── app * The source code of the application, subdivided by module/page.
|
│ ├── app * The source code of the application, subdivided by module/page.
|
||||||
│ ├── assets * Folder for static resources
|
│ ├── assets * Folder for static resources
|
||||||
|
@@ -1,13 +0,0 @@
|
|||||||
const path = require('path');
|
|
||||||
const child_process = require('child_process');
|
|
||||||
|
|
||||||
const heapSize = 4096;
|
|
||||||
const webpackPath = path.join('node_modules', 'webpack', 'bin', 'webpack.js');
|
|
||||||
|
|
||||||
const params = [
|
|
||||||
'--max_old_space_size=' + heapSize,
|
|
||||||
webpackPath,
|
|
||||||
...process.argv.slice(2)
|
|
||||||
];
|
|
||||||
|
|
||||||
child_process.spawn('node', params, { stdio:'inherit' });
|
|
@@ -1,6 +1,5 @@
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { RouterModule } from '@angular/router';
|
import { RouterModule } from '@angular/router';
|
||||||
import { EditBitstreamPageComponent } from './edit-bitstream-page/edit-bitstream-page.component';
|
|
||||||
import { AuthenticatedGuard } from '../core/auth/authenticated.guard';
|
import { AuthenticatedGuard } from '../core/auth/authenticated.guard';
|
||||||
import { BitstreamPageResolver } from './bitstream-page.resolver';
|
import { BitstreamPageResolver } from './bitstream-page.resolver';
|
||||||
import { BitstreamDownloadPageComponent } from './bitstream-download-page/bitstream-download-page.component';
|
import { BitstreamDownloadPageComponent } from './bitstream-download-page/bitstream-download-page.component';
|
||||||
@@ -13,6 +12,7 @@ import { LegacyBitstreamUrlResolver } from './legacy-bitstream-url.resolver';
|
|||||||
import { BitstreamBreadcrumbResolver } from '../core/breadcrumbs/bitstream-breadcrumb.resolver';
|
import { BitstreamBreadcrumbResolver } from '../core/breadcrumbs/bitstream-breadcrumb.resolver';
|
||||||
import { BitstreamBreadcrumbsService } from '../core/breadcrumbs/bitstream-breadcrumbs.service';
|
import { BitstreamBreadcrumbsService } from '../core/breadcrumbs/bitstream-breadcrumbs.service';
|
||||||
import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver';
|
import { I18nBreadcrumbResolver } from '../core/breadcrumbs/i18n-breadcrumb.resolver';
|
||||||
|
import { ThemedEditBitstreamPageComponent } from './edit-bitstream-page/themed-edit-bitstream-page.component';
|
||||||
|
|
||||||
const EDIT_BITSTREAM_PATH = ':id/edit';
|
const EDIT_BITSTREAM_PATH = ':id/edit';
|
||||||
const EDIT_BITSTREAM_AUTHORIZATIONS_PATH = ':id/authorizations';
|
const EDIT_BITSTREAM_AUTHORIZATIONS_PATH = ':id/authorizations';
|
||||||
@@ -49,7 +49,7 @@ const EDIT_BITSTREAM_AUTHORIZATIONS_PATH = ':id/authorizations';
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: EDIT_BITSTREAM_PATH,
|
path: EDIT_BITSTREAM_PATH,
|
||||||
component: EditBitstreamPageComponent,
|
component: ThemedEditBitstreamPageComponent,
|
||||||
resolve: {
|
resolve: {
|
||||||
bitstream: BitstreamPageResolver,
|
bitstream: BitstreamPageResolver,
|
||||||
breadcrumb: BitstreamBreadcrumbResolver,
|
breadcrumb: BitstreamBreadcrumbResolver,
|
||||||
|
@@ -7,6 +7,7 @@ import { BitstreamAuthorizationsComponent } from './bitstream-authorizations/bit
|
|||||||
import { FormModule } from '../shared/form/form.module';
|
import { FormModule } from '../shared/form/form.module';
|
||||||
import { ResourcePoliciesModule } from '../shared/resource-policies/resource-policies.module';
|
import { ResourcePoliciesModule } from '../shared/resource-policies/resource-policies.module';
|
||||||
import { BitstreamDownloadPageComponent } from './bitstream-download-page/bitstream-download-page.component';
|
import { BitstreamDownloadPageComponent } from './bitstream-download-page/bitstream-download-page.component';
|
||||||
|
import { ThemedEditBitstreamPageComponent } from './edit-bitstream-page/themed-edit-bitstream-page.component';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This module handles all components that are necessary for Bitstream related pages
|
* This module handles all components that are necessary for Bitstream related pages
|
||||||
@@ -22,6 +23,7 @@ import { BitstreamDownloadPageComponent } from './bitstream-download-page/bitstr
|
|||||||
declarations: [
|
declarations: [
|
||||||
BitstreamAuthorizationsComponent,
|
BitstreamAuthorizationsComponent,
|
||||||
EditBitstreamPageComponent,
|
EditBitstreamPageComponent,
|
||||||
|
ThemedEditBitstreamPageComponent,
|
||||||
BitstreamDownloadPageComponent,
|
BitstreamDownloadPageComponent,
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
@@ -0,0 +1,22 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
import { EditBitstreamPageComponent } from './edit-bitstream-page.component';
|
||||||
|
import { ThemedComponent } from '../../shared/theme-support/themed.component';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'ds-themed-edit-bitstream-page',
|
||||||
|
styleUrls: [],
|
||||||
|
templateUrl: '../../shared/theme-support/themed.component.html',
|
||||||
|
})
|
||||||
|
export class ThemedEditBitstreamPageComponent extends ThemedComponent<EditBitstreamPageComponent> {
|
||||||
|
protected getComponentName(): string {
|
||||||
|
return 'EditBitstreamPageComponent';
|
||||||
|
}
|
||||||
|
|
||||||
|
protected importThemedComponent(themeName: string): Promise<any> {
|
||||||
|
return import(`../../../themes/${themeName}/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component`);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected importUnthemedComponent(): Promise<any> {
|
||||||
|
return import('./edit-bitstream-page.component');
|
||||||
|
}
|
||||||
|
}
|
@@ -1,7 +1,7 @@
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
|
|
||||||
import { NgbModule, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbTooltipModule, NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||||
|
|
||||||
import { SharedModule } from '../../shared/shared.module';
|
import { SharedModule } from '../../shared/shared.module';
|
||||||
import { EditItemPageRoutingModule } from './edit-item-page.routing.module';
|
import { EditItemPageRoutingModule } from './edit-item-page.routing.module';
|
||||||
@@ -20,22 +20,14 @@ import { SearchPageModule } from '../../search-page/search-page.module';
|
|||||||
import { ItemCollectionMapperComponent } from './item-collection-mapper/item-collection-mapper.component';
|
import { ItemCollectionMapperComponent } from './item-collection-mapper/item-collection-mapper.component';
|
||||||
import { ItemRelationshipsComponent } from './item-relationships/item-relationships.component';
|
import { ItemRelationshipsComponent } from './item-relationships/item-relationships.component';
|
||||||
import { EditRelationshipComponent } from './item-relationships/edit-relationship/edit-relationship.component';
|
import { EditRelationshipComponent } from './item-relationships/edit-relationship/edit-relationship.component';
|
||||||
import {
|
import { EditRelationshipListComponent } from './item-relationships/edit-relationship-list/edit-relationship-list.component';
|
||||||
EditRelationshipListComponent
|
|
||||||
} from './item-relationships/edit-relationship-list/edit-relationship-list.component';
|
|
||||||
import { AbstractItemUpdateComponent } from './abstract-item-update/abstract-item-update.component';
|
import { AbstractItemUpdateComponent } from './abstract-item-update/abstract-item-update.component';
|
||||||
import { ItemMoveComponent } from './item-move/item-move.component';
|
import { ItemMoveComponent } from './item-move/item-move.component';
|
||||||
import {
|
import { ItemEditBitstreamBundleComponent } from './item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component';
|
||||||
ItemEditBitstreamBundleComponent
|
|
||||||
} from './item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component';
|
|
||||||
import { BundleDataService } from '../../core/data/bundle-data.service';
|
import { BundleDataService } from '../../core/data/bundle-data.service';
|
||||||
import { DragDropModule } from '@angular/cdk/drag-drop';
|
import { DragDropModule } from '@angular/cdk/drag-drop';
|
||||||
import {
|
import { ItemEditBitstreamDragHandleComponent } from './item-bitstreams/item-edit-bitstream-drag-handle/item-edit-bitstream-drag-handle.component';
|
||||||
ItemEditBitstreamDragHandleComponent
|
import { PaginatedDragAndDropBitstreamListComponent } from './item-bitstreams/item-edit-bitstream-bundle/paginated-drag-and-drop-bitstream-list/paginated-drag-and-drop-bitstream-list.component';
|
||||||
} from './item-bitstreams/item-edit-bitstream-drag-handle/item-edit-bitstream-drag-handle.component';
|
|
||||||
import {
|
|
||||||
PaginatedDragAndDropBitstreamListComponent
|
|
||||||
} from './item-bitstreams/item-edit-bitstream-bundle/paginated-drag-and-drop-bitstream-list/paginated-drag-and-drop-bitstream-list.component';
|
|
||||||
import { VirtualMetadataComponent } from './virtual-metadata/virtual-metadata.component';
|
import { VirtualMetadataComponent } from './virtual-metadata/virtual-metadata.component';
|
||||||
import { ItemVersionHistoryComponent } from './item-version-history/item-version-history.component';
|
import { ItemVersionHistoryComponent } from './item-version-history/item-version-history.component';
|
||||||
import { ItemAuthorizationsComponent } from './item-authorizations/item-authorizations.component';
|
import { ItemAuthorizationsComponent } from './item-authorizations/item-authorizations.component';
|
||||||
@@ -47,6 +39,8 @@ import { IdentifierDataComponent } from '../../shared/object-list/identifier-dat
|
|||||||
import { ItemRegisterDoiComponent } from './item-register-doi/item-register-doi.component';
|
import { ItemRegisterDoiComponent } from './item-register-doi/item-register-doi.component';
|
||||||
import { DsoSharedModule } from '../../dso-shared/dso-shared.module';
|
import { DsoSharedModule } from '../../dso-shared/dso-shared.module';
|
||||||
import { ItemCurateComponent } from './item-curate/item-curate.component';
|
import { ItemCurateComponent } from './item-curate/item-curate.component';
|
||||||
|
import { ThemedItemStatusComponent } from './item-status/themed-item-status.component';
|
||||||
|
|
||||||
import { ItemAccessControlComponent } from './item-access-control/item-access-control.component';
|
import { ItemAccessControlComponent } from './item-access-control/item-access-control.component';
|
||||||
import { ResultsBackButtonModule } from '../../shared/results-back-button/results-back-button.module';
|
import { ResultsBackButtonModule } from '../../shared/results-back-button/results-back-button.module';
|
||||||
import {
|
import {
|
||||||
@@ -82,6 +76,7 @@ import {
|
|||||||
ItemPublicComponent,
|
ItemPublicComponent,
|
||||||
ItemDeleteComponent,
|
ItemDeleteComponent,
|
||||||
ItemStatusComponent,
|
ItemStatusComponent,
|
||||||
|
ThemedItemStatusComponent,
|
||||||
ItemRelationshipsComponent,
|
ItemRelationshipsComponent,
|
||||||
ItemBitstreamsComponent,
|
ItemBitstreamsComponent,
|
||||||
ItemVersionHistoryComponent,
|
ItemVersionHistoryComponent,
|
||||||
@@ -105,6 +100,9 @@ import {
|
|||||||
IdentifierDataService,
|
IdentifierDataService,
|
||||||
ObjectValuesPipe
|
ObjectValuesPipe
|
||||||
],
|
],
|
||||||
|
exports: [
|
||||||
|
ItemOperationComponent,
|
||||||
|
]
|
||||||
})
|
})
|
||||||
export class EditItemPageModule {
|
export class EditItemPageModule {
|
||||||
|
|
||||||
|
@@ -6,7 +6,6 @@ import { ItemReinstateComponent } from './item-reinstate/item-reinstate.componen
|
|||||||
import { ItemPrivateComponent } from './item-private/item-private.component';
|
import { ItemPrivateComponent } from './item-private/item-private.component';
|
||||||
import { ItemPublicComponent } from './item-public/item-public.component';
|
import { ItemPublicComponent } from './item-public/item-public.component';
|
||||||
import { ItemDeleteComponent } from './item-delete/item-delete.component';
|
import { ItemDeleteComponent } from './item-delete/item-delete.component';
|
||||||
import { ItemStatusComponent } from './item-status/item-status.component';
|
|
||||||
import { ItemBitstreamsComponent } from './item-bitstreams/item-bitstreams.component';
|
import { ItemBitstreamsComponent } from './item-bitstreams/item-bitstreams.component';
|
||||||
import { ItemCollectionMapperComponent } from './item-collection-mapper/item-collection-mapper.component';
|
import { ItemCollectionMapperComponent } from './item-collection-mapper/item-collection-mapper.component';
|
||||||
import { ItemMoveComponent } from './item-move/item-move.component';
|
import { ItemMoveComponent } from './item-move/item-move.component';
|
||||||
@@ -42,6 +41,7 @@ import { ItemPageCollectionMapperGuard } from './item-page-collection-mapper.gua
|
|||||||
import { ThemedDsoEditMetadataComponent } from '../../dso-shared/dso-edit-metadata/themed-dso-edit-metadata.component';
|
import { ThemedDsoEditMetadataComponent } from '../../dso-shared/dso-edit-metadata/themed-dso-edit-metadata.component';
|
||||||
import { ItemPageRegisterDoiGuard } from './item-page-register-doi.guard';
|
import { ItemPageRegisterDoiGuard } from './item-page-register-doi.guard';
|
||||||
import { ItemCurateComponent } from './item-curate/item-curate.component';
|
import { ItemCurateComponent } from './item-curate/item-curate.component';
|
||||||
|
import { ThemedItemStatusComponent } from './item-status/themed-item-status.component';
|
||||||
import { ItemAccessControlComponent } from './item-access-control/item-access-control.component';
|
import { ItemAccessControlComponent } from './item-access-control/item-access-control.component';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -68,7 +68,7 @@ import { ItemAccessControlComponent } from './item-access-control/item-access-co
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'status',
|
path: 'status',
|
||||||
component: ItemStatusComponent,
|
component: ThemedItemStatusComponent,
|
||||||
data: { title: 'item.edit.tabs.status.title', showBreadcrumbs: true },
|
data: { title: 'item.edit.tabs.status.title', showBreadcrumbs: true },
|
||||||
canActivate: [ItemPageStatusGuard]
|
canActivate: [ItemPageStatusGuard]
|
||||||
},
|
},
|
||||||
|
@@ -0,0 +1,23 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
import { ThemedComponent } from '../../../shared/theme-support/themed.component';
|
||||||
|
import { ItemStatusComponent } from './item-status.component';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'ds-themed-item-status',
|
||||||
|
styleUrls: [],
|
||||||
|
templateUrl: '../../../shared/theme-support/themed.component.html',
|
||||||
|
})
|
||||||
|
export class ThemedItemStatusComponent extends ThemedComponent<ItemStatusComponent> {
|
||||||
|
protected getComponentName(): string {
|
||||||
|
return 'ItemStatusComponent';
|
||||||
|
}
|
||||||
|
|
||||||
|
protected importThemedComponent(themeName: string): Promise<any> {
|
||||||
|
return import(`../../../../themes/${themeName}/app/item-page/edit-item-page/item-status/item-status.component`);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected importUnthemedComponent(): Promise<any> {
|
||||||
|
return import('./item-status.component');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -2,7 +2,7 @@
|
|||||||
<div class="preserve-line-breaks ds-context-help-content">
|
<div class="preserve-line-breaks ds-context-help-content">
|
||||||
<ng-container *ngFor="let elem of (parsedContent$ | async)">
|
<ng-container *ngFor="let elem of (parsedContent$ | async)">
|
||||||
<ng-container *ngIf="elem.href">
|
<ng-container *ngIf="elem.href">
|
||||||
<a href="{{elem.href}}" target="_blank">{{elem.text}}</a>
|
<a href="{{elem.href}}" target="_blank" rel="noopener noreferrer">{{elem.text}}</a>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<ng-container *ngIf="elem.href === undefined">
|
<ng-container *ngIf="elem.href === undefined">
|
||||||
{{ elem }}
|
{{ elem }}
|
||||||
|
@@ -131,7 +131,6 @@ export class StartsWithDateComponent extends StartsWithAbstractComponent {
|
|||||||
} else {
|
} else {
|
||||||
this.startsWithYear = +startsWith;
|
this.startsWithYear = +startsWith;
|
||||||
}
|
}
|
||||||
this.setStartsWithParam(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -70,7 +70,6 @@ export abstract class StartsWithAbstractComponent implements OnInit, OnDestroy {
|
|||||||
*/
|
*/
|
||||||
setStartsWith(startsWith: string) {
|
setStartsWith(startsWith: string) {
|
||||||
this.startsWith = startsWith;
|
this.startsWith = startsWith;
|
||||||
this.setStartsWithParam(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -25,7 +25,7 @@
|
|||||||
class="btn btn-outline-primary"
|
class="btn btn-outline-primary"
|
||||||
(blur)="onClose()"
|
(blur)="onClose()"
|
||||||
(click)="onClose()"
|
(click)="onClose()"
|
||||||
[disabled]="(processingChange$ | async) || collectionModifiable == false"
|
[disabled]="(processingChange$ | async) || collectionModifiable == false || isReadonly"
|
||||||
ngbDropdownToggle>
|
ngbDropdownToggle>
|
||||||
<span *ngIf="(processingChange$ | async)"><i class='fas fa-circle-notch fa-spin'></i></span>
|
<span *ngIf="(processingChange$ | async)"><i class='fas fa-circle-notch fa-spin'></i></span>
|
||||||
<span *ngIf="!(processingChange$ | async)">{{ selectedCollectionName$ | async }}</span>
|
<span *ngIf="!(processingChange$ | async)">{{ selectedCollectionName$ | async }}</span>
|
||||||
|
@@ -252,6 +252,12 @@ describe('SubmissionFormCollectionComponent Component', () => {
|
|||||||
expect(dropDown).toBeFalsy();
|
expect(dropDown).toBeFalsy();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('the dropdown button should be disabled when isReadonly is true', () => {
|
||||||
|
comp.isReadonly = true;
|
||||||
|
fixture.detectChanges();
|
||||||
|
expect(dropdowBtn.nativeNode.attributes.disabled).toBeDefined();
|
||||||
|
});
|
||||||
|
|
||||||
it('should be simulated when the drop-down menu is closed', () => {
|
it('should be simulated when the drop-down menu is closed', () => {
|
||||||
spyOn(comp, 'onClose');
|
spyOn(comp, 'onClose');
|
||||||
comp.onClose();
|
comp.onClose();
|
||||||
|
@@ -65,6 +65,11 @@ export class SubmissionFormCollectionComponent implements OnChanges, OnInit {
|
|||||||
*/
|
*/
|
||||||
@Input() submissionId;
|
@Input() submissionId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Flag to indicate if the submission dropdown is read only
|
||||||
|
*/
|
||||||
|
@Input() isReadonly = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An event fired when a different collection is selected.
|
* An event fired when a different collection is selected.
|
||||||
* Event's payload equals to new SubmissionObject.
|
* Event's payload equals to new SubmissionObject.
|
||||||
|
@@ -8,12 +8,15 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="submission-form-header-item mb-3 mb-sm-0 flex-sm-grow-1 flex-md-grow-0">
|
<div class="submission-form-header-item mb-3 mb-sm-0 flex-sm-grow-1 flex-md-grow-0">
|
||||||
|
<ng-container *ngIf="!isSectionHidden">
|
||||||
<ds-submission-form-collection [currentCollectionId]="collectionId"
|
<ds-submission-form-collection [currentCollectionId]="collectionId"
|
||||||
[currentDefinition]="definitionId"
|
[currentDefinition]="definitionId"
|
||||||
[submissionId]="submissionId"
|
[submissionId]="submissionId"
|
||||||
[collectionModifiable]="collectionModifiable"
|
[collectionModifiable]="collectionModifiable"
|
||||||
|
[isReadonly]="isSectionReadonly"
|
||||||
(collectionChange)="onCollectionChange($event)">
|
(collectionChange)="onCollectionChange($event)">
|
||||||
</ds-submission-form-collection>
|
</ds-submission-form-collection>
|
||||||
|
</ng-container>
|
||||||
</div>
|
</div>
|
||||||
<div class="submission-form-header-item text-right">
|
<div class="submission-form-header-item text-right">
|
||||||
<ds-submission-form-section-add [collectionId]="collectionId"
|
<ds-submission-form-section-add [collectionId]="collectionId"
|
||||||
|
@@ -25,6 +25,7 @@ import { createTestComponent } from '../../shared/testing/utils.test';
|
|||||||
import { Item } from '../../core/shared/item.model';
|
import { Item } from '../../core/shared/item.model';
|
||||||
import { TestScheduler } from 'rxjs/testing';
|
import { TestScheduler } from 'rxjs/testing';
|
||||||
import { SectionsService } from '../sections/sections.service';
|
import { SectionsService } from '../sections/sections.service';
|
||||||
|
import { VisibilityType } from '../sections/visibility-type';
|
||||||
|
|
||||||
describe('SubmissionFormComponent Component', () => {
|
describe('SubmissionFormComponent Component', () => {
|
||||||
|
|
||||||
@@ -156,6 +157,32 @@ describe('SubmissionFormComponent Component', () => {
|
|||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should return the visibility object of the collection section', () => {
|
||||||
|
comp.submissionDefinition = submissionDefinition;
|
||||||
|
fixture.detectChanges();
|
||||||
|
const result = compAsAny.getCollectionVisibility();
|
||||||
|
expect(result).toEqual({
|
||||||
|
main: VisibilityType.HIDDEN,
|
||||||
|
other: VisibilityType.HIDDEN,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return true if collection section visibility is hidden', () => {
|
||||||
|
comp.submissionDefinition = submissionDefinition;
|
||||||
|
fixture.detectChanges();
|
||||||
|
expect(comp.isSectionHidden).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return false for isSectionReadonly when collection section visibility is not READONLY', () => {
|
||||||
|
const visibility = {
|
||||||
|
main: VisibilityType.READONLY,
|
||||||
|
other: VisibilityType.READONLY,
|
||||||
|
};
|
||||||
|
comp.submissionDefinition = Object.assign({}, submissionDefinition, { visibility: visibility });
|
||||||
|
fixture.detectChanges();
|
||||||
|
expect(comp.isSectionReadonly).toBe(false);
|
||||||
|
});
|
||||||
|
|
||||||
it('should update properly on collection change', (done) => {
|
it('should update properly on collection change', (done) => {
|
||||||
comp.collectionId = collectionId;
|
comp.collectionId = collectionId;
|
||||||
comp.submissionId = submissionId;
|
comp.submissionId = submissionId;
|
||||||
|
@@ -9,7 +9,7 @@ import { HALEndpointService } from '../../core/shared/hal-endpoint.service';
|
|||||||
import { SubmissionObject } from '../../core/submission/models/submission-object.model';
|
import { SubmissionObject } from '../../core/submission/models/submission-object.model';
|
||||||
import { WorkspaceitemSectionsObject } from '../../core/submission/models/workspaceitem-sections.model';
|
import { WorkspaceitemSectionsObject } from '../../core/submission/models/workspaceitem-sections.model';
|
||||||
|
|
||||||
import { hasValue, isNotEmpty } from '../../shared/empty.util';
|
import { hasValue, isNotEmpty, isNotUndefined } from '../../shared/empty.util';
|
||||||
import { UploaderOptions } from '../../shared/upload/uploader/uploader-options.model';
|
import { UploaderOptions } from '../../shared/upload/uploader/uploader-options.model';
|
||||||
import { SubmissionObjectEntry } from '../objects/submission-objects.reducer';
|
import { SubmissionObjectEntry } from '../objects/submission-objects.reducer';
|
||||||
import { SectionDataObject } from '../sections/models/section-data.model';
|
import { SectionDataObject } from '../sections/models/section-data.model';
|
||||||
@@ -18,6 +18,10 @@ import { Item } from '../../core/shared/item.model';
|
|||||||
import { SectionsType } from '../sections/sections-type';
|
import { SectionsType } from '../sections/sections-type';
|
||||||
import { SectionsService } from '../sections/sections.service';
|
import { SectionsService } from '../sections/sections.service';
|
||||||
import { SubmissionError } from '../objects/submission-error.model';
|
import { SubmissionError } from '../objects/submission-error.model';
|
||||||
|
import { SubmissionSectionVisibility } from './../../core/config/models/config-submission-section.model';
|
||||||
|
import { SubmissionSectionModel } from './../../core/config/models/config-submission-section.model';
|
||||||
|
import { VisibilityType } from '../sections/visibility-type';
|
||||||
|
import isEqual from 'lodash/isEqual';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This component represents the submission form.
|
* This component represents the submission form.
|
||||||
@@ -188,6 +192,42 @@ export class SubmissionFormComponent implements OnChanges, OnDestroy {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the visibility object of the collection section
|
||||||
|
*/
|
||||||
|
private getCollectionVisibility(): SubmissionSectionVisibility {
|
||||||
|
const submissionSectionModel: SubmissionSectionModel =
|
||||||
|
this.submissionDefinition.sections.page.find(
|
||||||
|
(section) => isEqual(section.sectionType, SectionsType.Collection)
|
||||||
|
);
|
||||||
|
|
||||||
|
return isNotUndefined(submissionSectionModel.visibility) ? submissionSectionModel.visibility : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Getter to see if the collection section visibility is hidden
|
||||||
|
*/
|
||||||
|
get isSectionHidden(): boolean {
|
||||||
|
const visibility = this.getCollectionVisibility();
|
||||||
|
return (
|
||||||
|
hasValue(visibility) &&
|
||||||
|
isEqual(visibility.main, VisibilityType.HIDDEN) &&
|
||||||
|
isEqual(visibility.other, VisibilityType.HIDDEN)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Getter to see if the collection section visibility is readonly
|
||||||
|
*/
|
||||||
|
get isSectionReadonly(): boolean {
|
||||||
|
const visibility = this.getCollectionVisibility();
|
||||||
|
return (
|
||||||
|
hasValue(visibility) &&
|
||||||
|
isEqual(visibility.main, VisibilityType.READONLY) &&
|
||||||
|
isEqual(visibility.other, VisibilityType.READONLY)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unsubscribe from all subscriptions, destroy instance variables
|
* Unsubscribe from all subscriptions, destroy instance variables
|
||||||
* and reset submission state
|
* and reset submission state
|
||||||
@@ -239,6 +279,8 @@ export class SubmissionFormComponent implements OnChanges, OnDestroy {
|
|||||||
protected getSectionsList(): Observable<any> {
|
protected getSectionsList(): Observable<any> {
|
||||||
return this.submissionService.getSubmissionSections(this.submissionId).pipe(
|
return this.submissionService.getSubmissionSections(this.submissionId).pipe(
|
||||||
filter((sections: SectionDataObject[]) => isNotEmpty(sections)),
|
filter((sections: SectionDataObject[]) => isNotEmpty(sections)),
|
||||||
map((sections: SectionDataObject[]) => sections));
|
map((sections: SectionDataObject[]) =>
|
||||||
|
sections.filter((section: SectionDataObject) => !isEqual(section.sectionType,SectionsType.Collection))),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -8,4 +8,5 @@ export enum SectionsType {
|
|||||||
AccessesCondition = 'accessCondition',
|
AccessesCondition = 'accessCondition',
|
||||||
SherpaPolicies = 'sherpaPolicy',
|
SherpaPolicies = 'sherpaPolicy',
|
||||||
Identifiers = 'identifiers',
|
Identifiers = 'identifiers',
|
||||||
|
Collection = 'collection',
|
||||||
}
|
}
|
||||||
|
@@ -23,7 +23,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
<p class="m-1">
|
<p class="m-1">
|
||||||
<a href="{{journal.url}}" target="_blank">
|
<a href="{{journal.url}}" target="_blank" rel="noopener noreferrer">
|
||||||
{{journal.url}}
|
{{journal.url}}
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-4" *ngFor="let publisher of journal.publishers">
|
<div class="col-4" *ngFor="let publisher of journal.publishers">
|
||||||
<p class="m-1">
|
<p class="m-1">
|
||||||
<a href="{{publisher.uri}}" target="_blank">
|
<a href="{{publisher.uri}}" target="_blank" rel="noopener noreferrer">
|
||||||
{{publisher.name}}
|
{{publisher.name}}
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
</p>
|
</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li *ngFor="let url of policy.urls | keyvalue">
|
<li *ngFor="let url of policy.urls | keyvalue">
|
||||||
<a href="{{url.key}}" target="_blank">{{url.value}}</a>
|
<a href="{{url.key}}" target="_blank" rel="noopener noreferrer">{{url.value}}</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
4
src/app/submission/sections/visibility-type.ts
Normal file
4
src/app/submission/sections/visibility-type.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export enum VisibilityType {
|
||||||
|
HIDDEN = 'HIDDEN',
|
||||||
|
READONLY = 'READONLY',
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,13 @@
|
|||||||
|
import { EditBitstreamPageComponent as BaseComponent } from '../../../../../app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component';
|
||||||
|
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'ds-edit-bitstream-page',
|
||||||
|
// styleUrls: ['./edit-bitstream-page.component.scss'],
|
||||||
|
styleUrls: ['../../../../../app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.scss'],
|
||||||
|
// templateUrl: './edit-bitstream-page.component.html',
|
||||||
|
templateUrl: '../../../../../app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.html',
|
||||||
|
changeDetection: ChangeDetectionStrategy.OnPush
|
||||||
|
})
|
||||||
|
export class EditBitstreamPageComponent extends BaseComponent {
|
||||||
|
}
|
@@ -0,0 +1,16 @@
|
|||||||
|
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
||||||
|
import { fadeIn, fadeInOut } from '../../../../../../app/shared/animations/fade';
|
||||||
|
import { ItemStatusComponent as BaseComponent } from '../../../../../../app/item-page/edit-item-page/item-status/item-status.component';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'ds-item-status',
|
||||||
|
// templateUrl: './item-status.component.html',
|
||||||
|
templateUrl: '../../../../../../app/item-page/edit-item-page/item-status/item-status.component.html',
|
||||||
|
changeDetection: ChangeDetectionStrategy.Default,
|
||||||
|
animations: [
|
||||||
|
fadeIn,
|
||||||
|
fadeInOut
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export class ItemStatusComponent extends BaseComponent {
|
||||||
|
}
|
@@ -141,6 +141,9 @@ import {
|
|||||||
import { NgxGalleryModule } from '@kolkov/ngx-gallery';
|
import { NgxGalleryModule } from '@kolkov/ngx-gallery';
|
||||||
import { WorkspaceItemsDeletePageComponent } from './app/workspace-items-delete-page/workspace-items-delete/workspace-items-delete.component';
|
import { WorkspaceItemsDeletePageComponent } from './app/workspace-items-delete-page/workspace-items-delete/workspace-items-delete.component';
|
||||||
import { ThumbnailComponent } from './app/thumbnail/thumbnail.component';
|
import { ThumbnailComponent } from './app/thumbnail/thumbnail.component';
|
||||||
|
import { ItemStatusComponent } from './app/item-page/edit-item-page/item-status/item-status.component';
|
||||||
|
import { EditBitstreamPageComponent } from './app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component';
|
||||||
|
import { FormModule } from '../../app/shared/form/form.module';
|
||||||
|
|
||||||
const DECLARATIONS = [
|
const DECLARATIONS = [
|
||||||
FileSectionComponent,
|
FileSectionComponent,
|
||||||
@@ -217,6 +220,8 @@ const DECLARATIONS = [
|
|||||||
MediaViewerVideoComponent,
|
MediaViewerVideoComponent,
|
||||||
WorkspaceItemsDeletePageComponent,
|
WorkspaceItemsDeletePageComponent,
|
||||||
ThumbnailComponent,
|
ThumbnailComponent,
|
||||||
|
ItemStatusComponent,
|
||||||
|
EditBitstreamPageComponent,
|
||||||
];
|
];
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
@@ -275,6 +280,7 @@ const DECLARATIONS = [
|
|||||||
DsoSharedModule,
|
DsoSharedModule,
|
||||||
SystemWideAlertModule,
|
SystemWideAlertModule,
|
||||||
NgxGalleryModule,
|
NgxGalleryModule,
|
||||||
|
FormModule,
|
||||||
],
|
],
|
||||||
declarations: DECLARATIONS,
|
declarations: DECLARATIONS,
|
||||||
exports: [
|
exports: [
|
||||||
|
Reference in New Issue
Block a user