mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-15 14:03:06 +00:00
Applied feedback
This commit is contained in:
@@ -79,5 +79,10 @@ module.exports = {
|
|||||||
code: 'nl',
|
code: 'nl',
|
||||||
label: 'Nederlands',
|
label: 'Nederlands',
|
||||||
active: false,
|
active: false,
|
||||||
}]
|
}],
|
||||||
|
item: {
|
||||||
|
edit: {
|
||||||
|
undoTimeout: 10000 // 10 seconds
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
@@ -1,4 +1,3 @@
|
|||||||
<!--{{metadata?.uuid}}-->
|
|
||||||
<td>
|
<td>
|
||||||
<div class="metadata-field">
|
<div class="metadata-field">
|
||||||
<div *ngIf="!(editable | async)">
|
<div *ngIf="!(editable | async)">
|
||||||
|
@@ -158,7 +158,7 @@ describe('ItemMetadataComponent', () => {
|
|||||||
{ provide: Router, useValue: router },
|
{ provide: Router, useValue: router },
|
||||||
{ provide: ActivatedRoute, useValue: routeStub },
|
{ provide: ActivatedRoute, useValue: routeStub },
|
||||||
{ provide: NotificationsService, useValue: notificationsService },
|
{ provide: NotificationsService, useValue: notificationsService },
|
||||||
{ provide: GLOBAL_CONFIG, useValue: { notifications: { timeOut: 10 } } as any },
|
{ provide: GLOBAL_CONFIG, useValue: { item: { edit: { undoTimeout: 10 } } } as any },
|
||||||
{ provide: RegistryService, useValue: metadataFieldService },
|
{ provide: RegistryService, useValue: metadataFieldService },
|
||||||
], schemas: [
|
], schemas: [
|
||||||
NO_ERRORS_SCHEMA
|
NO_ERRORS_SCHEMA
|
||||||
|
@@ -47,8 +47,10 @@ export class ItemMetadataComponent implements OnInit {
|
|||||||
* The time span for being able to undo discarding changes
|
* The time span for being able to undo discarding changes
|
||||||
*/
|
*/
|
||||||
private discardTimeOut: number;
|
private discardTimeOut: number;
|
||||||
|
/**
|
||||||
private notitifactionPrefix = 'item.edit.metadata.notifications.';
|
* Prefix for this component's notification translate keys
|
||||||
|
*/
|
||||||
|
private notificationsPrefix = 'item.edit.metadata.notifications.';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Observable with a list of strings with all existing metadata field keys
|
* Observable with a list of strings with all existing metadata field keys
|
||||||
@@ -81,7 +83,7 @@ export class ItemMetadataComponent implements OnInit {
|
|||||||
this.item = item;
|
this.item = item;
|
||||||
});
|
});
|
||||||
|
|
||||||
this.discardTimeOut = this.EnvConfig.notifications.timeOut;
|
this.discardTimeOut = this.EnvConfig.item.edit.undoTimeout;
|
||||||
this.url = this.router.url;
|
this.url = this.router.url;
|
||||||
if (this.url.indexOf('?') > 0) {
|
if (this.url.indexOf('?') > 0) {
|
||||||
this.url = this.url.substr(0, this.url.indexOf('?'));
|
this.url = this.url.substr(0, this.url.indexOf('?'));
|
||||||
@@ -207,7 +209,7 @@ export class ItemMetadataComponent implements OnInit {
|
|||||||
* @param key
|
* @param key
|
||||||
*/
|
*/
|
||||||
private getNotificationTitle(key: string) {
|
private getNotificationTitle(key: string) {
|
||||||
return this.translateService.instant(this.notitifactionPrefix + key + '.title');
|
return this.translateService.instant(this.notificationsPrefix + key + '.title');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -215,7 +217,7 @@ export class ItemMetadataComponent implements OnInit {
|
|||||||
* @param key
|
* @param key
|
||||||
*/
|
*/
|
||||||
private getNotificationContent(key: string) {
|
private getNotificationContent(key: string) {
|
||||||
return this.translateService.instant(this.notitifactionPrefix + key + '.content');
|
return this.translateService.instant(this.notificationsPrefix + key + '.content');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -173,6 +173,12 @@ export class RegistryService {
|
|||||||
return this.rdb.toRemoteDataObservable(requestEntryObs, payloadObs);
|
return this.rdb.toRemoteDataObservable(requestEntryObs, payloadObs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve all existing metadata fields as a paginated list
|
||||||
|
* @param pagination Pagination options to determine which page of metadata fields should be requested
|
||||||
|
* When no pagination is provided, all metadata fields are requested in one large page
|
||||||
|
* @returns an observable that emits a remote data object with a page of metadata fields
|
||||||
|
*/
|
||||||
public getAllMetadataFields(pagination?: PaginationComponentOptions): Observable<RemoteData<PaginatedList<MetadataField>>> {
|
public getAllMetadataFields(pagination?: PaginationComponentOptions): Observable<RemoteData<PaginatedList<MetadataField>>> {
|
||||||
if (hasNoValue(pagination)) {
|
if (hasNoValue(pagination)) {
|
||||||
pagination = { currentPage: 1, pageSize: 10000 } as any;
|
pagination = { currentPage: 1, pageSize: 10000 } as any;
|
||||||
@@ -557,10 +563,13 @@ export class RegistryService {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve a filtered paginated list of metadata fields
|
||||||
|
* @param query {string} The query to filter the field names by
|
||||||
|
* @returns an observable that emits a remote data object with a page of metadata fields that match the query
|
||||||
|
*/
|
||||||
queryMetadataFields(query: string): Observable<RemoteData<PaginatedList<MetadataField>>> {
|
queryMetadataFields(query: string): Observable<RemoteData<PaginatedList<MetadataField>>> {
|
||||||
/**
|
/* TODO This should come directly from the server in the future */
|
||||||
* This should come directly from the server in the future
|
|
||||||
*/
|
|
||||||
return this.getAllMetadataFields().pipe(
|
return this.getAllMetadataFields().pipe(
|
||||||
map((rd: RemoteData<PaginatedList<MetadataField>>) => {
|
map((rd: RemoteData<PaginatedList<MetadataField>>) => {
|
||||||
const filteredFields: MetadataField[] = rd.payload.page.filter(
|
const filteredFields: MetadataField[] = rd.payload.page.filter(
|
||||||
|
@@ -1,12 +1,19 @@
|
|||||||
import { Directive, AfterViewInit, ElementRef, Input } from '@angular/core';
|
import { Directive, AfterViewInit, ElementRef, Input } from '@angular/core';
|
||||||
import { isNotEmpty } from '../empty.util';
|
import { isNotEmpty } from '../empty.util';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Directive to set focus on an element when it is rendered
|
||||||
|
*/
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: '[dsAutoFocus]'
|
selector: '[dsAutoFocus]'
|
||||||
})
|
})
|
||||||
export class AutoFocusDirective implements AfterViewInit {
|
export class AutoFocusDirective implements AfterViewInit {
|
||||||
|
|
||||||
@Input() autoFocusSelector: string;
|
/**
|
||||||
|
* Optional input to specify which element in a component should get the focus
|
||||||
|
* If left empty, the component itself will get the focus
|
||||||
|
*/
|
||||||
|
@Input() autoFocusSelector: string = undefined;
|
||||||
|
|
||||||
constructor(private el: ElementRef) {
|
constructor(private el: ElementRef) {
|
||||||
}
|
}
|
||||||
|
@@ -5,6 +5,7 @@ import { UniversalConfig } from './universal-config.interface';
|
|||||||
import { INotificationBoardOptions } from './notifications-config.interfaces';
|
import { INotificationBoardOptions } from './notifications-config.interfaces';
|
||||||
import { FormConfig } from './form-config.interfaces';
|
import { FormConfig } from './form-config.interfaces';
|
||||||
import {LangConfig} from './lang-config.interface';
|
import {LangConfig} from './lang-config.interface';
|
||||||
|
import { ItemPageConfig } from './item-page-config.interface';
|
||||||
|
|
||||||
export interface GlobalConfig extends Config {
|
export interface GlobalConfig extends Config {
|
||||||
ui: ServerConfig;
|
ui: ServerConfig;
|
||||||
@@ -19,4 +20,5 @@ export interface GlobalConfig extends Config {
|
|||||||
debug: boolean;
|
debug: boolean;
|
||||||
defaultLanguage: string;
|
defaultLanguage: string;
|
||||||
languages: LangConfig[];
|
languages: LangConfig[];
|
||||||
|
item: ItemPageConfig;
|
||||||
}
|
}
|
||||||
|
7
src/config/item-page-config.interface.ts
Normal file
7
src/config/item-page-config.interface.ts
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
import { Config } from './config.interface';
|
||||||
|
|
||||||
|
export interface ItemPageConfig extends Config {
|
||||||
|
edit: {
|
||||||
|
undoTimeout: number;
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user