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",
|
"title": "DSpace Angular :: Metadata Schema Registry",
|
||||||
"head": "Metadata Schema",
|
"head": "Metadata Schema",
|
||||||
"description": "This is the metadata schema for \"{{namespace}}\".",
|
"description": "This is the metadata schema for \"{{namespace}}\".",
|
||||||
|
"return": "Return",
|
||||||
"form": {
|
"form": {
|
||||||
"create": "Create metadata field",
|
"create": "Create metadata field",
|
||||||
"edit": "Edit metadata field",
|
"edit": "Edit metadata field",
|
||||||
|
@@ -48,12 +48,12 @@
|
|||||||
|
|
||||||
</ds-pagination>
|
</ds-pagination>
|
||||||
|
|
||||||
<button type="submit" class="btn btn-primary" (click)="deleteSchemas()">{{'admin.registries.metadata.schemas.table.delete' | translate}}
|
<div *ngIf="(metadataSchemas | async)?.payload?.totalElements == 0" class="alert alert-info w-100 mb-2" role="alert">
|
||||||
</button>
|
{{'admin.registries.metadata.schemas.no-items' | translate}}
|
||||||
|
</div>
|
||||||
|
|
||||||
<div *ngIf="(metadataSchemas | async)?.payload?.totalElements == 0" class="alert alert-info"
|
<div>
|
||||||
role="alert">
|
<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>
|
||||||
{{'admin.registries.metadata.schemas.no-items' | translate}}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@@ -34,7 +34,7 @@ export class MetadataRegistryComponent {
|
|||||||
*/
|
*/
|
||||||
config: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), {
|
config: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), {
|
||||||
id: 'registry-metadataschemas-pagination',
|
id: 'registry-metadataschemas-pagination',
|
||||||
pageSize: 2
|
pageSize: 25
|
||||||
});
|
});
|
||||||
|
|
||||||
constructor(private registryService: RegistryService,
|
constructor(private registryService: RegistryService,
|
||||||
@@ -143,6 +143,7 @@ export class MetadataRegistryComponent {
|
|||||||
this.showNotification(false, failedResponses.length);
|
this.showNotification(false, failedResponses.length);
|
||||||
}
|
}
|
||||||
this.registryService.deselectAllMetadataSchema();
|
this.registryService.deselectAllMetadataSchema();
|
||||||
|
this.registryService.cancelEditMetadataSchema();
|
||||||
this.forceUpdateSchemas();
|
this.forceUpdateSchemas();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import {Component, EventEmitter, OnInit, Output} from '@angular/core';
|
import { Component, EventEmitter, OnDestroy, OnInit, Output } from '@angular/core';
|
||||||
import {
|
import {
|
||||||
DynamicFormControlModel,
|
DynamicFormControlModel,
|
||||||
DynamicFormGroupModel,
|
DynamicFormGroupModel,
|
||||||
@@ -20,7 +20,7 @@ import { combineLatest } from 'rxjs/internal/observable/combineLatest';
|
|||||||
/**
|
/**
|
||||||
* A form used for creating and editing metadata schemas
|
* 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
|
* A unique id used for ds-form
|
||||||
@@ -147,7 +147,25 @@ export class MetadataSchemaFormComponent implements OnInit {
|
|||||||
this.submitForm.emit(updatedSchema);
|
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 { MetadataSchema } from '../../../../core/metadata/metadataschema.model';
|
||||||
import {
|
import {
|
||||||
DynamicFormControlModel,
|
DynamicFormControlModel,
|
||||||
@@ -22,7 +22,7 @@ import { combineLatest } from 'rxjs/internal/observable/combineLatest';
|
|||||||
/**
|
/**
|
||||||
* A form used for creating and editing metadata fields
|
* 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
|
* A unique id used for ds-form
|
||||||
@@ -175,7 +175,26 @@ export class MetadataFieldFormComponent implements OnInit {
|
|||||||
this.submitForm.emit(updatedField);
|
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>
|
</div>
|
||||||
</ds-pagination>
|
</ds-pagination>
|
||||||
|
|
||||||
<button type="submit" class="btn btn-primary" (click)="deleteFields()">{{'admin.registries.schema.fields.table.delete' | translate}}
|
<div *ngIf="(metadataFields | async)?.payload?.totalElements == 0" class="alert alert-info w-100 mb-2" role="alert">
|
||||||
</button>
|
|
||||||
|
|
||||||
<div *ngIf="(metadataFields | async)?.payload?.totalElements == 0" class="alert alert-info" role="alert">
|
|
||||||
{{'admin.registries.schema.fields.no-items' | translate}}
|
{{'admin.registries.schema.fields.no-items' | translate}}
|
||||||
</div>
|
</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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -175,6 +175,7 @@ export class MetadataSchemaComponent implements OnInit {
|
|||||||
this.showNotification(false, failedResponses.length);
|
this.showNotification(false, failedResponses.length);
|
||||||
}
|
}
|
||||||
this.registryService.deselectAllMetadataField();
|
this.registryService.deselectAllMetadataField();
|
||||||
|
this.registryService.cancelEditMetadataField();
|
||||||
this.forceUpdateFields();
|
this.forceUpdateFields();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user