mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-13 21:13:07 +00:00
Merge branch 'main' into DURACOM-191
# Conflicts: # src/app/shared/form/number-picker/number-picker.component.spec.ts # src/app/shared/form/number-picker/number-picker.component.ts
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
<p>{{'collection.edit.item-mapper.description' | translate}}</p>
|
||||
|
||||
<ul ngbNav (navChange)="tabChange($event)" [destroyOnHide]="true" #tabs="ngbNav" class="nav-tabs">
|
||||
<li [ngbNavItem]="'browseTab'" role="presentation">
|
||||
<li [ngbNavItem]="'browseTab'" role="presentation" data-test="browseTab">
|
||||
<a ngbNavLink>{{'collection.edit.item-mapper.tabs.browse' | translate}}</a>
|
||||
<ng-template ngbNavContent>
|
||||
<div class="mt-2">
|
||||
@@ -23,7 +23,7 @@
|
||||
</div>
|
||||
</ng-template>
|
||||
</li>
|
||||
<li [ngbNavItem]="'mapTab'" role="presentation">
|
||||
<li [ngbNavItem]="'mapTab'" role="presentation" data-test="mapTab">
|
||||
<a ngbNavLink>{{'collection.edit.item-mapper.tabs.map' | translate}}</a>
|
||||
<ng-template ngbNavContent>
|
||||
<div class="row mt-2">
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<div *ngVar="(contentSource$ |async) as contentSource">
|
||||
<div class="container-fluid space-children-mr" *ngIf="shouldShow">
|
||||
<h4>{{ 'collection.source.controls.head' | translate }}</h4>
|
||||
<h3>{{ 'collection.source.controls.head' | translate }}</h3>
|
||||
<div>
|
||||
<span class="font-weight-bold">{{'collection.source.controls.harvest.status' | translate}}</span>
|
||||
<span>{{contentSource?.harvestStatus}}</span>
|
||||
|
@@ -26,7 +26,7 @@
|
||||
for="externalSourceCheck">{{ 'collection.edit.tabs.source.external' | translate }}</label>
|
||||
</div>
|
||||
<ds-themed-loading *ngIf="!contentSource" [message]="'loading.content-source' | translate"></ds-themed-loading>
|
||||
<h4 *ngIf="contentSource && (contentSource?.harvestType !== harvestTypeNone)">{{ 'collection.edit.tabs.source.form.head' | translate }}</h4>
|
||||
<h3 *ngIf="contentSource && (contentSource?.harvestType !== harvestTypeNone)">{{ 'collection.edit.tabs.source.form.head' | translate }}</h3>
|
||||
</div>
|
||||
<div class="row">
|
||||
<ds-form *ngIf="formGroup && contentSource && (contentSource?.harvestType !== harvestTypeNone)"
|
||||
|
@@ -35,9 +35,7 @@
|
||||
</button>
|
||||
<div class="d-flex flex-row">
|
||||
<span class="align-middle pt-2 lead">
|
||||
<a [routerLink]="node.route" class="lead">
|
||||
{{ dsoNameService.getName(node.payload) }}
|
||||
</a>
|
||||
<a [routerLink]="node.route" class="lead">{{ dsoNameService.getName(node.payload) }}</a>
|
||||
<span class="pr-2"> </span>
|
||||
<span *ngIf="node.payload.archivedItemsCount >= 0" class="badge badge-pill badge-secondary align-top archived-items-lead">{{node.payload.archivedItemsCount}}</span>
|
||||
</span>
|
||||
@@ -73,9 +71,7 @@
|
||||
<span class="fa fa-chevron-right invisible" aria-hidden="true"></span>
|
||||
</button>
|
||||
<h6 class="align-middle pt-2">
|
||||
<a [routerLink]="node.route" class="lead">
|
||||
{{ dsoNameService.getName(node.payload) }}
|
||||
</a>
|
||||
<a [routerLink]="node.route" class="lead">{{ dsoNameService.getName(node.payload) }}</a>
|
||||
</h6>
|
||||
</div>
|
||||
<ds-truncatable [id]="node.id">
|
||||
|
@@ -119,7 +119,7 @@ export class AuthService {
|
||||
if (hasValue(rd.payload) && rd.payload.authenticated) {
|
||||
return rd.payload;
|
||||
} else {
|
||||
throw (new Error('Invalid email or password'));
|
||||
throw (new Error('auth.errors.invalid-user'));
|
||||
}
|
||||
}));
|
||||
|
||||
|
@@ -21,25 +21,25 @@
|
||||
<div class="btn-group">
|
||||
<div class="edit-field">
|
||||
<div class="btn-group edit-buttons" [ngbTooltip]="isVirtual ? (dsoType + '.edit.metadata.edit.buttons.virtual' | translate) : null">
|
||||
<button class="btn btn-outline-primary btn-sm ng-star-inserted" id="metadata-edit-btn" *ngIf="!mdValue.editing"
|
||||
<button class="btn btn-outline-primary btn-sm ng-star-inserted" data-test="metadata-edit-btn" *ngIf="!mdValue.editing"
|
||||
[title]="dsoType + '.edit.metadata.edit.buttons.edit' | translate"
|
||||
ngbTooltip="{{ dsoType + '.edit.metadata.edit.buttons.edit' | translate }}"
|
||||
[disabled]="isVirtual || mdValue.change === DsoEditMetadataChangeTypeEnum.REMOVE || (saving$ | async)" (click)="edit.emit()">
|
||||
<i class="fas fa-edit fa-fw"></i>
|
||||
</button>
|
||||
<button class="btn btn-outline-success btn-sm ng-star-inserted" id="metadata-confirm-btn" *ngIf="mdValue.editing"
|
||||
<button class="btn btn-outline-success btn-sm ng-star-inserted" data-test="metadata-confirm-btn" *ngIf="mdValue.editing"
|
||||
[title]="dsoType + '.edit.metadata.edit.buttons.confirm' | translate"
|
||||
ngbTooltip="{{ dsoType + '.edit.metadata.edit.buttons.confirm' | translate }}"
|
||||
[disabled]="isVirtual || (saving$ | async)" (click)="confirm.emit(true)">
|
||||
<i class="fas fa-check fa-fw"></i>
|
||||
</button>
|
||||
<button class="btn btn-outline-danger btn-sm" id="metadata-remove-btn"
|
||||
<button class="btn btn-outline-danger btn-sm" data-test="metadata-remove-btn"
|
||||
[title]="dsoType + '.edit.metadata.edit.buttons.remove' | translate"
|
||||
ngbTooltip="{{ dsoType + '.edit.metadata.edit.buttons.remove' | translate }}"
|
||||
[disabled]="isVirtual || (mdValue.change && mdValue.change !== DsoEditMetadataChangeTypeEnum.ADD) || mdValue.editing || (saving$ | async)" (click)="remove.emit()">
|
||||
<i class="fas fa-trash-alt fa-fw"></i>
|
||||
</button>
|
||||
<button class="btn btn-outline-warning btn-sm" id="metadata-undo-btn"
|
||||
<button class="btn btn-outline-warning btn-sm" data-test="metadata-undo-btn"
|
||||
[title]="dsoType + '.edit.metadata.edit.buttons.undo' | translate"
|
||||
ngbTooltip="{{ dsoType + '.edit.metadata.edit.buttons.undo' | translate }}"
|
||||
[disabled]="isVirtual || (!mdValue.change && mdValue.reordered) || (!mdValue.change && !mdValue.editing) || (saving$ | async)" (click)="undo.emit()">
|
||||
@@ -47,7 +47,7 @@
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<button class="btn btn-outline-secondary ds-drag-handle btn-sm" id="metadata-drag-btn" *ngVar="(isOnlyValue || (saving$ | async)) as disabled"
|
||||
<button class="btn btn-outline-secondary ds-drag-handle btn-sm" data-test="metadata-drag-btn" *ngVar="(isOnlyValue || (saving$ | async)) as disabled"
|
||||
cdkDragHandle [cdkDragHandleDisabled]="disabled" [ngClass]="{'disabled': disabled}" [disabled]="disabled"
|
||||
[title]="dsoType + '.edit.metadata.edit.buttons.drag' | translate"
|
||||
ngbTooltip="{{ dsoType + '.edit.metadata.edit.buttons.drag' | translate }}">
|
||||
|
@@ -176,7 +176,7 @@ describe('DsoEditMetadataValueComponent', () => {
|
||||
let btn: DebugElement;
|
||||
|
||||
beforeEach(() => {
|
||||
btn = fixture.debugElement.query(By.css(`#metadata-${name}-btn`));
|
||||
btn = fixture.debugElement.query(By.css(`button[data-test="metadata-${name}-btn"]`));
|
||||
});
|
||||
|
||||
if (exists) {
|
||||
|
@@ -10,6 +10,7 @@
|
||||
class="nav-link"
|
||||
[ngClass]="{'active' : page.page === currentPage}"
|
||||
[routerLink]="['./' + page.page]"
|
||||
[attr.data-test]="page.page"
|
||||
role="tab">
|
||||
{{'item.edit.tabs.' + page.page + '.head' | translate}}
|
||||
</a>
|
||||
|
@@ -6,7 +6,7 @@
|
||||
<p>{{'item.edit.item-mapper.description' | translate}}</p>
|
||||
|
||||
<ul ngbNav (navChange)="tabChange($event)" [destroyOnHide]="true" #tabs="ngbNav" class="nav-tabs">
|
||||
<li [ngbNavItem]="'browseTab'" role="presentation">
|
||||
<li [ngbNavItem]="'browseTab'" role="presentation" data-test="browseTab">
|
||||
<a ngbNavLink>{{'item.edit.item-mapper.tabs.browse' | translate}}</a>
|
||||
<ng-template ngbNavContent>
|
||||
<div class="mt-2">
|
||||
@@ -22,7 +22,7 @@
|
||||
</div>
|
||||
</ng-template>
|
||||
</li>
|
||||
<li [ngbNavItem]="'mapTab'" role="presentation">
|
||||
<li [ngbNavItem]="'mapTab'" role="presentation" data-test="mapTab">
|
||||
<a ngbNavLink>{{'item.edit.item-mapper.tabs.map' | translate}}</a>
|
||||
<ng-template ngbNavContent>
|
||||
<div class="row mt-2">
|
||||
|
@@ -32,7 +32,5 @@
|
||||
<ng-template #browselink let-value="value">
|
||||
<a class="dont-break-out preserve-line-breaks ds-browse-link"
|
||||
[routerLink]="['/browse', browseDefinition.id]"
|
||||
[queryParams]="getQueryParams(value)">
|
||||
{{value}}
|
||||
</a>
|
||||
[queryParams]="getQueryParams(value)">{{value}}</a>
|
||||
</ng-template>
|
||||
|
@@ -4,7 +4,7 @@
|
||||
}
|
||||
|
||||
.loginDropdownMenu {
|
||||
min-height: 260px;
|
||||
min-height: 75px;
|
||||
}
|
||||
|
||||
.dropdown-item.active, .dropdown-item:active,
|
||||
|
@@ -5,7 +5,8 @@
|
||||
<h1>{{ type + '.edit.head' | translate }}</h1>
|
||||
<div class="my-auto">
|
||||
<a class="btn btn-danger"
|
||||
[routerLink]="((type === 'community') ? '/communities/' : '/collections/') + (dsoRD$ | async)?.payload.uuid + '/delete'">
|
||||
[routerLink]="((type === 'community') ? '/communities/' : '/collections/') + (dsoRD$ | async)?.payload.uuid + '/delete'"
|
||||
data-test="delete-button">
|
||||
<i class="fas fa-trash"></i> {{type + '.edit.delete' | translate}}</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -14,7 +15,8 @@
|
||||
<li *ngFor="let page of pages" class="nav-item">
|
||||
<a class="nav-link"
|
||||
[ngClass]="{'active' : page === currentPage}"
|
||||
[routerLink]="['./' + page]">
|
||||
[routerLink]="['./' + page]"
|
||||
[attr.data-test]="page">
|
||||
{{ type + '.edit.tabs.' + page + '.head' | translate}}
|
||||
</a>
|
||||
</li>
|
||||
|
@@ -45,7 +45,9 @@
|
||||
<button class="btn btn-secondary"
|
||||
type="button"
|
||||
ngbTooltip="{{'form.lookup-help' | translate}}"
|
||||
[attr.aria-label]="'form.lookup-help' | translate"
|
||||
placement="top"
|
||||
data-test="lookup-button"
|
||||
(click)="openLookup(); $event.stopPropagation();"><i class="fa fa-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
@@ -4,7 +4,7 @@
|
||||
{{model.placeholder}} <span *ngIf="model.required">*</span>
|
||||
</legend>
|
||||
<ds-number-picker
|
||||
tabindex="1"
|
||||
tabindex="0"
|
||||
[id]="model.id + '_year'"
|
||||
[disabled]="model.disabled"
|
||||
[min]="minYear"
|
||||
@@ -21,7 +21,7 @@
|
||||
></ds-number-picker>
|
||||
|
||||
<ds-number-picker
|
||||
tabindex="2"
|
||||
tabindex="0"
|
||||
[id]="model.id + '_month'"
|
||||
[min]="minMonth"
|
||||
[max]="maxMonth"
|
||||
@@ -37,7 +37,7 @@
|
||||
></ds-number-picker>
|
||||
|
||||
<ds-number-picker
|
||||
tabindex="3"
|
||||
tabindex="0"
|
||||
[id]="model.id + '_day'"
|
||||
[min]="minDay"
|
||||
[max]="maxDay"
|
||||
|
@@ -2,14 +2,15 @@
|
||||
<div class="position-relative right-addon"
|
||||
role="combobox"
|
||||
[attr.aria-label]="model.label"
|
||||
[attr.aria-owns]="'combobox_' + id + '_listbox'">
|
||||
[attr.aria-owns]="'combobox_' + id + '_listbox'"
|
||||
[attr.aria-expanded]="sdRef.isOpen()"
|
||||
[attr.aria-activedescendant]="(currentValue | async) ? 'combobox_' + id + '_selected' : null">
|
||||
<i *ngIf="!model.readOnly" ngbDropdownToggle class="position-absolute scrollable-dropdown-toggle"
|
||||
aria-hidden="true"></i>
|
||||
<i *ngIf="model.readOnly" class="dropdown-toggle position-absolute toggle-icon"
|
||||
aria-hidden="true"></i>
|
||||
<input class="form-control"
|
||||
[attr.aria-controls]="'combobox_' + id + '_listbox'"
|
||||
[attr.aria-activedescendant]="'combobox_' + id + '_selected'"
|
||||
[attr.aria-label]="model.placeholder"
|
||||
[attr.autoComplete]="model.autoComplete"
|
||||
[class.is-invalid]="showErrorMessages"
|
||||
@@ -28,8 +29,6 @@
|
||||
|
||||
<div ngbDropdownMenu
|
||||
class="dropdown-menu scrollable-dropdown-menu w-100"
|
||||
aria-haspopup="true"
|
||||
aria-expanded="false"
|
||||
[attr.aria-label]="model.placeholder">
|
||||
<div class="scrollable-menu"
|
||||
role="listbox"
|
||||
|
@@ -6,7 +6,7 @@
|
||||
[disabled]="disabled"
|
||||
(click)="toggleUp()">
|
||||
<span class="chevron"></span>
|
||||
<span class="sr-only">Increment</span>
|
||||
<span class="sr-only">{{'form.number-picker.increment' | translate: {field: name} }}</span>
|
||||
</button>
|
||||
<input
|
||||
id="{{id}}"
|
||||
@@ -24,6 +24,7 @@
|
||||
[disabled]="disabled"
|
||||
[ngClass]="{'is-invalid': invalid}"
|
||||
title="{{placeholder}}"
|
||||
[attr.aria-label]="placeholder"
|
||||
>
|
||||
<button
|
||||
class="btn btn-link-focus"
|
||||
@@ -32,6 +33,6 @@
|
||||
[disabled]="disabled"
|
||||
(click)="toggleDown()">
|
||||
<span class="chevron bottom"></span>
|
||||
<span class="sr-only">Decrement</span>
|
||||
<span class="sr-only">{{'form.number-picker.decrement' | translate: {field: name} }}</span>
|
||||
</button>
|
||||
</div>
|
||||
|
@@ -7,6 +7,7 @@ import { By } from '@angular/platform-browser';
|
||||
import { NumberPickerComponent } from './number-picker.component';
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { createTestComponent } from '../../testing/utils.test';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
describe('NumberPickerComponent test suite', () => {
|
||||
|
||||
@@ -24,6 +25,7 @@ describe('NumberPickerComponent test suite', () => {
|
||||
FormsModule,
|
||||
ReactiveFormsModule,
|
||||
NgbModule,
|
||||
TranslateModule.forRoot(),
|
||||
NumberPickerComponent,
|
||||
TestComponent
|
||||
],
|
||||
@@ -40,7 +42,6 @@ describe('NumberPickerComponent test suite', () => {
|
||||
beforeEach(() => {
|
||||
html = `
|
||||
<ds-number-picker
|
||||
tabindex="1"
|
||||
[disabled]="disabled"
|
||||
[min]="min"
|
||||
[max]="max"
|
||||
|
@@ -1,5 +1,6 @@
|
||||
import { ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output, SimpleChanges, } from '@angular/core';
|
||||
import { ControlValueAccessor, UntypedFormBuilder, NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { isEmpty } from '../../empty.util';
|
||||
import { NgClass } from '@angular/common';
|
||||
|
||||
@@ -37,7 +38,9 @@ export class NumberPickerComponent implements OnInit, ControlValueAccessor {
|
||||
|
||||
startValue: number;
|
||||
|
||||
constructor(private fb: UntypedFormBuilder, private cd: ChangeDetectorRef) {
|
||||
constructor(private fb: UntypedFormBuilder,
|
||||
private cd: ChangeDetectorRef,
|
||||
private translate: TranslateService) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
@@ -1770,6 +1770,10 @@
|
||||
|
||||
"form.repeatable.sort.tip": "Drop the item in the new position",
|
||||
|
||||
"form.number-picker.decrement": "Decrement {{field}}",
|
||||
|
||||
"form.number-picker.increment": "Increment {{field}}",
|
||||
|
||||
"grant-deny-request-copy.deny": "Don't send copy",
|
||||
|
||||
"grant-deny-request-copy.email.back": "Back",
|
||||
|
Reference in New Issue
Block a user