mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-15 22:13:02 +00:00
Merge remote-tracking branch 'origin/main' into feature/CST-9636
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<button (click)="toggle()" (focusin)="focusBox = true" (focusout)="focusBox = false"
|
||||
class="filter-name d-flex" [attr.aria-controls]="regionId" [id]="toggleId"
|
||||
[attr.aria-expanded]="false"
|
||||
[attr.aria-label]="((collapsed$ | async) ? 'search.filters.filter.expand' : 'search.filters.filter.collapse') | translate"
|
||||
[attr.aria-label]="(((collapsed$ | async) ? 'search.filters.filter.expand' : 'search.filters.filter.collapse') | translate) + ' ' + (('search.filters.filter.' + filter.name + '.head') | translate | lowercase)"
|
||||
[attr.data-test]="'filter-toggle' | dsBrowserOnly"
|
||||
>
|
||||
<h5 class="d-inline-block mb-0">
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<form class="w-100" [formGroup]="formData" (ngSubmit)="submitForm(formData.value)">
|
||||
<div class="row">
|
||||
<div class="form-group input-group col-8 col-sm-12 col-md-6">
|
||||
<input class="form-control" placeholder="{{'browse.startsWith.type_text' | translate}}" type="text" name="startsWith" formControlName="startsWith" [value]="getStartsWith()" />
|
||||
<input class="form-control" [attr.aria-label]="'browse.startsWith.input' | translate" placeholder="{{'browse.startsWith.type_text' | translate}}" type="text" name="startsWith" formControlName="startsWith" [value]="getStartsWith()" />
|
||||
<span class="input-group-append">
|
||||
<button class="btn btn-primary" type="submit"><i class="fas fa-book-open"></i> {{'browse.startsWith.submit' | translate}}</button>
|
||||
</span>
|
||||
|
@@ -175,7 +175,7 @@ describe('SubmissionSectionUploadFileComponent test suite', () => {
|
||||
it('should init file data properly', () => {
|
||||
uploadService.getFileData.and.returnValue(observableOf(fileData));
|
||||
|
||||
comp.ngOnChanges();
|
||||
comp.ngOnChanges({});
|
||||
|
||||
expect(comp.fileData).toEqual(fileData);
|
||||
});
|
||||
|
@@ -1,4 +1,13 @@
|
||||
import { ChangeDetectorRef, Component, Input, OnChanges, OnInit, ViewChild } from '@angular/core';
|
||||
import {
|
||||
ChangeDetectorRef,
|
||||
Component,
|
||||
Input,
|
||||
OnChanges,
|
||||
OnDestroy,
|
||||
OnInit,
|
||||
SimpleChanges,
|
||||
ViewChild
|
||||
} from '@angular/core';
|
||||
|
||||
import { BehaviorSubject, Subscription } from 'rxjs';
|
||||
import { filter } from 'rxjs/operators';
|
||||
@@ -27,7 +36,7 @@ import { NgbModalOptions } from '@ng-bootstrap/ng-bootstrap/modal/modal-config';
|
||||
styleUrls: ['./section-upload-file.component.scss'],
|
||||
templateUrl: './section-upload-file.component.html',
|
||||
})
|
||||
export class SubmissionSectionUploadFileComponent implements OnChanges, OnInit {
|
||||
export class SubmissionSectionUploadFileComponent implements OnChanges, OnInit, OnDestroy {
|
||||
|
||||
/**
|
||||
* The list of available access condition
|
||||
@@ -168,13 +177,13 @@ export class SubmissionSectionUploadFileComponent implements OnChanges, OnInit {
|
||||
/**
|
||||
* Retrieve bitstream's metadata
|
||||
*/
|
||||
ngOnChanges() {
|
||||
ngOnChanges(changes: SimpleChanges): void {
|
||||
if (this.availableAccessConditionOptions) {
|
||||
// Retrieve file state
|
||||
this.subscriptions.push(
|
||||
this.uploadService
|
||||
.getFileData(this.submissionId, this.sectionId, this.fileId).pipe(
|
||||
filter((bitstream) => isNotUndefined(bitstream)))
|
||||
.getFileData(this.submissionId, this.sectionId, this.fileId)
|
||||
.pipe(filter((bitstream) => isNotUndefined(bitstream)))
|
||||
.subscribe((bitstream) => {
|
||||
this.fileData = bitstream;
|
||||
}
|
||||
|
@@ -0,0 +1,93 @@
|
||||
import { Component, Input } from '@angular/core';
|
||||
import { SubmissionFormsModel } from 'src/app/core/config/models/config-submission-forms.model';
|
||||
import { ThemedComponent } from 'src/app/shared/theme-support/themed.component';
|
||||
import { SubmissionSectionUploadFileComponent } from './section-upload-file.component';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-themed-submission-upload-section-file',
|
||||
styleUrls: [],
|
||||
templateUrl: '../../../../shared/theme-support/themed.component.html'
|
||||
})
|
||||
export class ThemedSubmissionSectionUploadFileComponent
|
||||
extends ThemedComponent<SubmissionSectionUploadFileComponent> {
|
||||
|
||||
/**
|
||||
* The list of available access condition
|
||||
* @type {Array}
|
||||
*/
|
||||
@Input() availableAccessConditionOptions: any[];
|
||||
|
||||
/**
|
||||
* The submission id
|
||||
* @type {string}
|
||||
*/
|
||||
@Input() collectionId: string;
|
||||
|
||||
/**
|
||||
* Define if collection access conditions policy type :
|
||||
* POLICY_DEFAULT_NO_LIST : is not possible to define additional access group/s for the single file
|
||||
* POLICY_DEFAULT_WITH_LIST : is possible to define additional access group/s for the single file
|
||||
* @type {number}
|
||||
*/
|
||||
@Input() collectionPolicyType: number;
|
||||
|
||||
/**
|
||||
* The configuration for the bitstream's metadata form
|
||||
* @type {SubmissionFormsModel}
|
||||
*/
|
||||
@Input() configMetadataForm: SubmissionFormsModel;
|
||||
|
||||
/**
|
||||
* The bitstream id
|
||||
* @type {string}
|
||||
*/
|
||||
@Input() fileId: string;
|
||||
|
||||
/**
|
||||
* The bitstream array key
|
||||
* @type {string}
|
||||
*/
|
||||
@Input() fileIndex: string;
|
||||
|
||||
/**
|
||||
* The bitstream id
|
||||
* @type {string}
|
||||
*/
|
||||
@Input() fileName: string;
|
||||
|
||||
/**
|
||||
* The section id
|
||||
* @type {string}
|
||||
*/
|
||||
@Input() sectionId: string;
|
||||
|
||||
/**
|
||||
* The submission id
|
||||
* @type {string}
|
||||
*/
|
||||
@Input() submissionId: string;
|
||||
|
||||
protected inAndOutputNames: (keyof SubmissionSectionUploadFileComponent & keyof this)[] = [
|
||||
'availableAccessConditionOptions',
|
||||
'collectionId',
|
||||
'collectionPolicyType',
|
||||
'configMetadataForm',
|
||||
'fileId',
|
||||
'fileIndex',
|
||||
'fileName',
|
||||
'sectionId',
|
||||
'submissionId'
|
||||
];
|
||||
|
||||
protected getComponentName(): string {
|
||||
return 'SubmissionSectionUploadFileComponent';
|
||||
}
|
||||
|
||||
protected importThemedComponent(themeName: string): Promise<any> {
|
||||
return import(`../../../../../themes/${themeName}/app/submission/sections/upload/file/section-upload-file.component`);
|
||||
}
|
||||
|
||||
protected importUnthemedComponent(): Promise<any> {
|
||||
return import(`./section-upload-file.component`);
|
||||
}
|
||||
}
|
@@ -28,7 +28,7 @@
|
||||
</div>
|
||||
|
||||
<ng-container *ngFor="let fileEntry of fileList">
|
||||
<ds-submission-upload-section-file
|
||||
<ds-themed-submission-upload-section-file
|
||||
[availableAccessConditionOptions]="availableAccessConditionOptions"
|
||||
[collectionId]="collectionId"
|
||||
[collectionPolicyType]="collectionPolicyType"
|
||||
@@ -37,7 +37,7 @@
|
||||
[fileIndex]="fileList.indexOf(fileEntry)"
|
||||
[fileName]="fileNames[fileList.indexOf(fileEntry)]"
|
||||
[sectionId]="sectionData.id"
|
||||
[submissionId]="submissionId"></ds-submission-upload-section-file>
|
||||
[submissionId]="submissionId"></ds-themed-submission-upload-section-file>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<hr/>
|
||||
|
@@ -49,6 +49,7 @@ import { ResearchEntitiesModule } from '../entity-groups/research-entities/resea
|
||||
import { ThemedSubmissionEditComponent } from './edit/themed-submission-edit.component';
|
||||
import { ThemedSubmissionSubmitComponent } from './submit/themed-submission-submit.component';
|
||||
import { ThemedSubmissionImportExternalComponent } from './import-external/themed-submission-import-external.component';
|
||||
import { ThemedSubmissionSectionUploadFileComponent } from './sections/upload/file/themed-section-upload-file.component';
|
||||
import { FormModule } from '../shared/form/form.module';
|
||||
import { NgbAccordionModule, NgbCollapseModule, NgbModalModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { SubmissionSectionAccessesComponent } from './sections/accesses/section-accesses.component';
|
||||
@@ -104,6 +105,7 @@ const DECLARATIONS = [
|
||||
PublisherPolicyComponent,
|
||||
PublicationInformationComponent,
|
||||
MetadataInformationComponent,
|
||||
ThemedSubmissionSectionUploadFileComponent,
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
|
@@ -861,6 +861,8 @@
|
||||
|
||||
"browse.startsWith.type_text": "Filter results by typing the first few letters",
|
||||
|
||||
"browse.startsWith.input": "Filter",
|
||||
|
||||
"browse.title": "Browsing {{ collection }} by {{ field }}{{ startsWith }} {{ value }}",
|
||||
|
||||
"browse.title.page": "Browsing {{ collection }} by {{ field }} {{ value }}",
|
||||
@@ -4087,7 +4089,7 @@
|
||||
|
||||
"submission.general.cancel": "Cancel",
|
||||
|
||||
"submission.general.cannot_submit": "You have not the privilege to make a new submission.",
|
||||
"submission.general.cannot_submit": "You don't have permission to make a new submission.",
|
||||
|
||||
"submission.general.deposit": "Deposit",
|
||||
|
||||
|
@@ -0,0 +1,18 @@
|
||||
import { Component } from '@angular/core';
|
||||
import {
|
||||
SubmissionSectionUploadFileComponent as BaseComponent
|
||||
} from 'src/app/submission/sections/upload/file/section-upload-file.component';
|
||||
|
||||
/**
|
||||
* This component represents a single bitstream contained in the submission
|
||||
*/
|
||||
@Component({
|
||||
selector: 'ds-submission-upload-section-file',
|
||||
// styleUrls: ['./section-upload-file.component.scss'],
|
||||
styleUrls: ['../../../../../../../app/submission/sections/upload/file/section-upload-file.component.scss'],
|
||||
// templateUrl: './section-upload-file.component.html'
|
||||
templateUrl: '../../../../../../../app/submission/sections/upload/file/section-upload-file.component.html'
|
||||
})
|
||||
export class SubmissionSectionUploadFileComponent
|
||||
extends BaseComponent {
|
||||
}
|
@@ -141,6 +141,7 @@ import {
|
||||
import { NgxGalleryModule } from '@kolkov/ngx-gallery';
|
||||
import { WorkspaceItemsDeletePageComponent } from './app/workspace-items-delete-page/workspace-items-delete/workspace-items-delete.component';
|
||||
import { ThumbnailComponent } from './app/thumbnail/thumbnail.component';
|
||||
import { SubmissionSectionUploadFileComponent } from './app/submission/sections/upload/file/section-upload-file.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';
|
||||
@@ -220,6 +221,7 @@ const DECLARATIONS = [
|
||||
MediaViewerVideoComponent,
|
||||
WorkspaceItemsDeletePageComponent,
|
||||
ThumbnailComponent,
|
||||
SubmissionSectionUploadFileComponent,
|
||||
ItemStatusComponent,
|
||||
EditBitstreamPageComponent,
|
||||
];
|
||||
|
Reference in New Issue
Block a user