Skip to content

Commit 0adbf4b

Browse files
committed
Merge branch 'dspace-cris-2023_02_x' into task/ux-plus-2023_02_x/UXP-184_fixes
2 parents 6c0054f + e06025f commit 0adbf4b

5 files changed

Lines changed: 20 additions & 12 deletions

File tree

src/app/shared/context-menu/context-menu.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div *ngIf="contextMenuObject">
22
<div class="d-flex space-children-mr justify-content-end" *dsRenderOnlyForBrowser="true">
3-
<ng-container *ngFor="let entry of (getStandAloneMenuEntries() | async)">
3+
<ng-container *ngFor="let entry of (standAloneEntries$ | async)">
44
<ng-container *ngComponentOutlet="entry; injector: objectInjector;"></ng-container>
55
</ng-container>
66
<div ngbDropdown #itemOptions="ngbDropdown" placement="bottom-right"
@@ -10,7 +10,7 @@
1010
</button>
1111
<div id="itemOptionsDropdownMenu" aria-labelledby="context-menu" ngbDropdownMenu>
1212
<h6 class="dropdown-header">{{ 'context-menu.actions.label' | translate }}</h6>
13-
<ng-container *ngFor="let entry of (getContextMenuEntries() | async)">
13+
<ng-container *ngFor="let entry of (contextEntries$ | async)">
1414
<ng-container *ngComponentOutlet="entry; injector: objectInjector;"></ng-container>
1515
</ng-container>
1616
</div>

src/app/shared/context-menu/context-menu.component.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ChangeDetectorRef, Component, Inject, Injector, Input, OnInit } from '@angular/core';
1+
import { AfterViewChecked, ChangeDetectorRef, Component, Inject, Injector, Input, OnInit } from '@angular/core';
22
import { DOCUMENT } from '@angular/common';
33

44
import { from, Observable } from 'rxjs';
@@ -24,7 +24,7 @@ import { GenericConstructor } from '../../core/shared/generic-constructor';
2424
styleUrls: ['./context-menu.component.scss'],
2525
templateUrl: './context-menu.component.html'
2626
})
27-
export class ContextMenuComponent implements OnInit {
27+
export class ContextMenuComponent implements OnInit, AfterViewChecked {
2828

2929
/**
3030
* The related item
@@ -48,6 +48,9 @@ export class ContextMenuComponent implements OnInit {
4848
*/
4949
public optionCount = 0;
5050

51+
public standAloneEntries$: Observable<any>;
52+
public contextEntries$: Observable<any>;
53+
5154
/**
5255
* Initialize instance variables
5356
*
@@ -71,6 +74,9 @@ export class ContextMenuComponent implements OnInit {
7174
],
7275
parent: this.injector
7376
});
77+
78+
this.standAloneEntries$ = this.getStandAloneMenuEntries();
79+
this.contextEntries$ = this.getContextMenuEntries();
7480
}
7581

7682
/**
@@ -118,10 +124,6 @@ export class ContextMenuComponent implements OnInit {
118124
);
119125
}
120126

121-
isItem(): boolean {
122-
return this.contextMenuObjectType === DSpaceObjectType.ITEM;
123-
}
124-
125127
ngAfterViewChecked() {
126128
// To check that Context-menu contains options or not
127129
if (this._document.getElementById('itemOptionsDropdownMenu')) {

src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -588,8 +588,9 @@ export class DsDynamicFormControlContainerComponent extends DynamicFormControlCo
588588

589589
isNotRequiredGroupAndEmpty(): boolean {
590590
const parent = this.model.parent;
591-
592-
if (hasValue(parent) && parent.type === 'GROUP') {
591+
// Check if the model is part of a group, the group needs to be an inner form and be in the submission form not in a nested form.
592+
// The check hasValue(parent.parent) tells if the parent is in the submission or in a modal (nested cases)
593+
if (hasValue(parent) && parent.type === 'GROUP' && this.model.isModelOfInnerForm && hasValue(parent.parent)) {
593594

594595
const groupHasSomeValue = parent.group.some(elem => !!elem.value);
595596

src/app/shared/form/builder/ds-dynamic-form-ui/models/list/dynamic-list.component.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
[attr.aria-labelledby]="'label_' + model.id"
1515
[attr.tabindex]="item.index"
1616
[checked]="item.value"
17+
[class.is-invalid]="showErrorMessages"
1718
[id]="model.id + item.id"
1819
[formControlName]="item.id"
1920
[name]="model.name"
@@ -58,6 +59,7 @@
5859

5960
<input type="radio" class="custom-control-input"
6061
[checked]="item.value"
62+
[class.is-invalid]="showErrorMessages"
6163
[id]="model.id + item.id"
6264
[name]="model.id"
6365
[required]="model.required"

src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ import { TruncatableService } from '../../../../../truncatable/truncatable.servi
1515
import { DSONameService } from '../../../../../../core/breadcrumbs/dso-name.service';
1616
import { APP_CONFIG, AppConfig } from '../../../../../../../config/app-config.interface';
1717
import { getFirstSucceededRemoteListPayload } from '../../../../../../core/shared/operators';
18-
import { map } from 'rxjs/operators';
18+
import { filter, map } from 'rxjs/operators';
19+
import { isNotEmpty } from '../../../../../empty.util';
1920

2021
@listableObjectComponent('PublicationSearchResult', ViewMode.ListElement)
2122
@listableObjectComponent(ItemSearchResult, ViewMode.ListElement)
@@ -80,7 +81,9 @@ export class ItemSearchResultListElementComponent extends SearchResultListElemen
8081
this.klaroService.watchConsentUpdates();
8182

8283
this.hasLoadedThirdPartyMetrics$ = combineLatest([
83-
this.klaroService.consentsUpdates$,
84+
this.klaroService.consentsUpdates$.pipe(
85+
filter(consents => isNotEmpty(consents))
86+
),
8487
this.dso.metrics?.pipe(
8588
getFirstSucceededRemoteListPayload(),
8689
map(metrics => {

0 commit comments

Comments
 (0)