mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-18 15:33:04 +00:00
58789: Feedback 2019-01-24
This commit is contained in:
@@ -181,6 +181,7 @@
|
||||
"title": "DSpace Angular :: Metadata Schema Registry",
|
||||
"head": "Metadata Schema",
|
||||
"description": "This is the metadata schema for \"{{namespace}}\".",
|
||||
"return": "Return",
|
||||
"form": {
|
||||
"create": "Create metadata field",
|
||||
"edit": "Edit metadata field",
|
||||
|
@@ -48,14 +48,14 @@
|
||||
|
||||
</ds-pagination>
|
||||
|
||||
<button type="submit" class="btn btn-primary" (click)="deleteSchemas()">{{'admin.registries.metadata.schemas.table.delete' | translate}}
|
||||
</button>
|
||||
|
||||
<div *ngIf="(metadataSchemas | async)?.payload?.totalElements == 0" class="alert alert-info"
|
||||
role="alert">
|
||||
<div *ngIf="(metadataSchemas | async)?.payload?.totalElements == 0" class="alert alert-info w-100 mb-2" role="alert">
|
||||
{{'admin.registries.metadata.schemas.no-items' | translate}}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<button *ngIf="(metadataSchemas | async)?.payload?.page?.length > 0" type="submit" class="btn btn-danger float-right" (click)="deleteSchemas()">{{'admin.registries.metadata.schemas.table.delete' | translate}}</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -34,7 +34,7 @@ export class MetadataRegistryComponent {
|
||||
*/
|
||||
config: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), {
|
||||
id: 'registry-metadataschemas-pagination',
|
||||
pageSize: 2
|
||||
pageSize: 25
|
||||
});
|
||||
|
||||
constructor(private registryService: RegistryService,
|
||||
@@ -143,6 +143,7 @@ export class MetadataRegistryComponent {
|
||||
this.showNotification(false, failedResponses.length);
|
||||
}
|
||||
this.registryService.deselectAllMetadataSchema();
|
||||
this.registryService.cancelEditMetadataSchema();
|
||||
this.forceUpdateSchemas();
|
||||
});
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import {Component, EventEmitter, OnInit, Output} from '@angular/core';
|
||||
import { Component, EventEmitter, OnDestroy, OnInit, Output } from '@angular/core';
|
||||
import {
|
||||
DynamicFormControlModel,
|
||||
DynamicFormGroupModel,
|
||||
@@ -20,7 +20,7 @@ import { combineLatest } from 'rxjs/internal/observable/combineLatest';
|
||||
/**
|
||||
* A form used for creating and editing metadata schemas
|
||||
*/
|
||||
export class MetadataSchemaFormComponent implements OnInit {
|
||||
export class MetadataSchemaFormComponent implements OnInit, OnDestroy {
|
||||
|
||||
/**
|
||||
* A unique id used for ds-form
|
||||
@@ -147,7 +147,25 @@ export class MetadataSchemaFormComponent implements OnInit {
|
||||
this.submitForm.emit(updatedSchema);
|
||||
});
|
||||
}
|
||||
this.clearFields();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset all input-fields to be empty
|
||||
*/
|
||||
clearFields() {
|
||||
this.formGroup.patchValue({
|
||||
prefix: '',
|
||||
namespace: ''
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancel the current edit when component is destroyed
|
||||
*/
|
||||
ngOnDestroy(): void {
|
||||
this.onCancel();
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||
import { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core';
|
||||
import { MetadataSchema } from '../../../../core/metadata/metadataschema.model';
|
||||
import {
|
||||
DynamicFormControlModel,
|
||||
@@ -22,7 +22,7 @@ import { combineLatest } from 'rxjs/internal/observable/combineLatest';
|
||||
/**
|
||||
* A form used for creating and editing metadata fields
|
||||
*/
|
||||
export class MetadataFieldFormComponent implements OnInit {
|
||||
export class MetadataFieldFormComponent implements OnInit, OnDestroy {
|
||||
|
||||
/**
|
||||
* A unique id used for ds-form
|
||||
@@ -175,7 +175,26 @@ export class MetadataFieldFormComponent implements OnInit {
|
||||
this.submitForm.emit(updatedField);
|
||||
});
|
||||
}
|
||||
this.clearFields();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset all input-fields to be empty
|
||||
*/
|
||||
clearFields() {
|
||||
this.formGroup.patchValue({
|
||||
element: '',
|
||||
qualifier: '',
|
||||
scopeNote: ''
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancel the current edit when component is destroyed
|
||||
*/
|
||||
ngOnDestroy(): void {
|
||||
this.onCancel();
|
||||
}
|
||||
}
|
||||
|
@@ -47,13 +47,15 @@
|
||||
</div>
|
||||
</ds-pagination>
|
||||
|
||||
<button type="submit" class="btn btn-primary" (click)="deleteFields()">{{'admin.registries.schema.fields.table.delete' | translate}}
|
||||
</button>
|
||||
|
||||
<div *ngIf="(metadataFields | async)?.payload?.totalElements == 0" class="alert alert-info" role="alert">
|
||||
<div *ngIf="(metadataFields | async)?.payload?.totalElements == 0" class="alert alert-info w-100 mb-2" role="alert">
|
||||
{{'admin.registries.schema.fields.no-items' | translate}}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<button [routerLink]="['/admin/registries/metadata']" class="btn btn-primary">{{'admin.registries.schema.return' | translate}}</button>
|
||||
<button *ngIf="(metadataFields | async)?.payload?.page?.length > 0" type="submit" class="btn btn-danger float-right" (click)="deleteFields()">{{'admin.registries.schema.fields.table.delete' | translate}}</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -175,6 +175,7 @@ export class MetadataSchemaComponent implements OnInit {
|
||||
this.showNotification(false, failedResponses.length);
|
||||
}
|
||||
this.registryService.deselectAllMetadataField();
|
||||
this.registryService.cancelEditMetadataField();
|
||||
this.forceUpdateFields();
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user