Skip to content

Commit

Permalink
Sync repo from v91 to v91 20240311084059 (#128)
Browse files Browse the repository at this point in the history
* Automated sync from source branch v91

--------

Co-authored-by: imx-sync-bot <imx-sync-bot@oneidentity>
Co-authored-by: Hanno Bunjes <hanno.bunjes@quest.com>
  • Loading branch information
3 people authored Mar 12, 2024
1 parent 43c3e24 commit 86e283e
Show file tree
Hide file tree
Showing 10 changed files with 59 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
b6c2ba4e3b04607face0f6fe25ca69022731b1a4
b3f764edcbb79ac7e5709cbc606b7549d68ca374
3 changes: 0 additions & 3 deletions .sync-history
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
3a676090b 2023-11-08 Merged PR 60702: Web Portal: Start attestation: Can't select objects to be attested if attestation policy uses sample data
229ea05c7 2023-10-30 Merged PR 60351: Bug 330805: Es werden zu viele Berichte für ein Berichtsabonnement zur Auswahl gestellt
532f06e15 2023-10-20 Merge remote-tracking branch 'origin/v91' into change/v91/433649-cherry-pick
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
# Identity Manager HTML5 applications

## Change log

### March 11, 2024
- 440206: When a request is added to the cart, request properties were sometimes not correctly applied to the shopping cart item.
- 446476: The number of pending requests and shopping cart items were not being updated correctly.
- 440741: Portal: Fixed support for ProductSearchString URL parameter for product selection.

### February 2, 2024
- 433272 Backport dynamic parameter change functionality
- 416558 Data Explorer: Assignment analysis of shops cannot be displayed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<imx-cdr-editor *ngFor="let cdr of bulkItem?.properties; let i = index"
[cdr]="cdr"
(valueChange)="onValueChanged()"
(pendingChanged)="onPendingChanged($event)"
(controlCreated)="addControl(cdr.column.ColumnName + '_' + i, $event)"
[attr.data-imx-identifier]="'bulk-item' + cdr.column.ColumnName + '_' + i">
</imx-cdr-editor>
Expand All @@ -29,7 +30,7 @@
</form>
<div *ngIf="!hideButtons" class="imx-action-container">
<button mat-button (click)="skip()" data-imx-identifier="bulk-item-button-skip">{{'#LDS#Skip' | translate}}</button>
<button mat-raised-button color="primary" [disabled]="!formGroup.valid || formGroup.touched" (click)="save()" data-imx-identifier="bulk-item-button-save">
<button mat-raised-button color="primary" [disabled]="!formGroup.valid || formGroupIsPending" (click)="save()" data-imx-identifier="bulk-item-button-save">
{{ '#LDS#Apply' | translate }}
</button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export class BulkItemComponent implements OnInit {

public readonly formGroup = new FormGroup({});

public formGroupIsPending = false;
private diffData: EntityWriteDataSingle;
private readonly icons: { [key: number]: BulkItemIcon } = {};
@ViewChildren(CdrEditorComponent) private cdrEditors: QueryList<CdrEditorComponent>;
Expand Down Expand Up @@ -114,6 +115,10 @@ export class BulkItemComponent implements OnInit {
this.validate();
}

public onPendingChanged(value: boolean) {
this.formGroupIsPending = value;
}

public onValueChanged(): void {
this.formGroup.updateValueAndValidity();
if (this.bulkItem.status === BulkItemStatus.saved && !this.formGroup.valid) {
Expand Down
5 changes: 5 additions & 0 deletions imxweb/projects/qbm/src/lib/cdr/cdr-editor.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ export interface CdrEditor {
*/
valueHasChanged?: EventEmitter<ValueHasChangedEventArg>;

/**
* An event, that is emmited, if the value of the cdr is pending.
*/
pendingChanged?: EventEmitter<boolean>;

/**
* Binds a column dependent reference to the editor.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export class CdrEditorComponent implements OnChanges {
@Output() public controlCreated = new EventEmitter<AbstractControl>();
@Output() public readonly valueChange = new EventEmitter<any>();
@Output() public readonly readOnlyChanged = new EventEmitter<boolean>();
@Output() public readonly pendingChanged = new EventEmitter<boolean>();

@ViewChild('viewcontainer', { read: ViewContainerRef, static: true }) private viewContainerRef: ViewContainerRef;

Expand Down Expand Up @@ -83,6 +84,11 @@ export class CdrEditorComponent implements OnChanges {
}
});
}
if (ref.instance.pendingChanged) {
ref.instance.pendingChanged.subscribe((value) => {
this.pendingChanged.emit(value);
});
}
this.controlCreated.emit(ref.instance.control);
this.elementRef.nativeElement.setAttribute('data-imx-identifier', `cdr-editor-${this.cdr.column.ColumnName}`);
this.editor = ref.instance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*
*/

import { Component, EventEmitter, OnDestroy } from '@angular/core';
import { ChangeDetectorRef, Component, EventEmitter, OnDestroy } from '@angular/core';
import { FormArray, FormControl } from '@angular/forms';
import { Subject, Subscription } from 'rxjs';
import { debounceTime, distinctUntilChanged, tap } from 'rxjs/operators';
Expand Down Expand Up @@ -52,12 +52,14 @@ export class EditMultiLimitedValueComponent implements CdrEditor, OnDestroy {

public readonly columnContainer = new EntityColumnContainer<string>();
public readonly valueHasChanged = new EventEmitter<ValueHasChangedEventArg>();
public readonly pendingChanged = new EventEmitter<boolean>();

private readonly subscriptions: Subscription[] = [];
private isWriting = false;

constructor(
private readonly logger: ClassloggerService,
private readonly changeDetectorRef: ChangeDetectorRef,
private readonly multiValueProvider: MultiValueService
) { }

Expand All @@ -76,20 +78,20 @@ export class EditMultiLimitedValueComponent implements CdrEditor, OnDestroy {
this.subscriptions.push(
this.control.valueChanges
.pipe(
tap(() => this.control.markAsTouched()),
tap(() => this.pendingChanged.emit(true)),
debounceTime(1400),
distinctUntilChanged(),
)
.subscribe(
async (values) => this.writeValue(values)
)
async (values) => await this.writeValue(values)
)
);
this.subscriptions.push(
this.columnContainer.subscribe(() => {
if (this.isWriting) {
return;
}
if (this.control.value !== this.columnContainer.value) {
if (this.getSelectedNamesMultiValue(this.control.value) !== this.columnContainer.value) {
this.initValues();
}

Expand Down Expand Up @@ -119,8 +121,10 @@ export class EditMultiLimitedValueComponent implements CdrEditor, OnDestroy {
}

public initValues(): void {
if (this.control.controls?.length > 0) {
return;
}
const selectedValues = this.multiValueProvider.getValues(this.columnContainer.value);
this.control = new FormArray([]);
this.columnContainer.limitedValuesContainer.values.forEach(limitedValueData =>
this.control.push(new FormControl(this.isSelected(limitedValueData, selectedValues)))
);
Expand All @@ -145,6 +149,7 @@ export class EditMultiLimitedValueComponent implements CdrEditor, OnDestroy {
const value = this.multiValueProvider.getMultiValue(this.getSelectedNames(values));

if (this.columnContainer.value === value || (!this.columnContainer.value && value === '')) {
this.pendingChanged.emit(false);
return;
}

Expand All @@ -153,15 +158,17 @@ export class EditMultiLimitedValueComponent implements CdrEditor, OnDestroy {
try {
this.logger.debug(this, 'writeValue - updateCdrValue...');
this.isWriting = true;
this.control.disable();
this.control.disable({ emitEvent: false });
this.changeDetectorRef.detectChanges();
await this.columnContainer.updateValue(value);
} catch (e) {
this.logger.error(this, e);
} finally {
this.isWriting = false;
this.control.enable();
this.control.markAsUntouched();
if (this.control.value !== this.columnContainer.value) {
this.control.enable({ emitEvent: false });
this.pendingChanged.emit(false);
this.changeDetectorRef.detectChanges();
if (this.getSelectedNamesMultiValue(this.control.value) !== this.columnContainer.value) {
const selectedValues = this.multiValueProvider.getValues(this.columnContainer.value);
this.control.controls.forEach((checkBox, index) =>
checkBox.setValue(
Expand All @@ -173,14 +180,23 @@ export class EditMultiLimitedValueComponent implements CdrEditor, OnDestroy {
}
}


/**
* Gets the MultiValue of the selected values.
* @param values The array of booleans provided by the checkboxes
*/
private getSelectedNamesMultiValue(values: boolean[]): string {
return this.multiValueProvider.getMultiValue(this.getSelectedNames(values));
}

/**
* Gets the names of the selected values
* Gets the names of the selected values.
* @param values The array of booleans provided by the checkboxes
*/
private getSelectedNames(values: boolean[]): string[] {
const selectedValues: string[] = [];
values.forEach((value, index) => {
if (value) { selectedValues.push(this.columnContainer.limitedValuesContainer.values[index].Value); }
if (value) { selectedValues.push(this.columnContainer.limitedValuesContainer.values[index]?.Value); }
});
return selectedValues;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,12 @@ export class ProductSelectionComponent implements OnInit, OnDestroy {

// TODO activatedRoute parameters may change, must subscribe to changes

this.uidaccproduct = this.activatedRoute.snapshot.paramMap.get('UID_AccProduct');
this.uidaccproduct = this.activatedRoute.snapshot.queryParams.UID_AccProduct;
if (this.uidaccproduct) {
// TODO load all according to this.categoryModel.SelectedCategory
}

this.searchString = this.activatedRoute.snapshot.paramMap.get('ProductSearchString');
this.searchString = this.activatedRoute.snapshot.queryParams.ProductSearchString;

if (this.searchString) {
/* user can pass product search string by URL parameter -> load the data with this search string
Expand Down Expand Up @@ -726,7 +726,8 @@ export class ProductSelectionComponent implements OnInit, OnDestroy {
parameters: [possibleItems - savedItems, possibleItems],
});
}
if (savedItems > 0) {
if (savedItems > 0) {
await this.userModelSvc.reloadPendingItems();
this.router.navigate(['shoppingcart']);
} else {
this.onDeselectAll();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,8 @@ export class RequestActionService {
success = true;
} catch (error) {
this.errorHandler.handleError(error);
} finally {
} finally {
await this.userService.reloadPendingItems();
setTimeout(() => this.busyService.hide(busyIndicator));
}

Expand Down

0 comments on commit 86e283e

Please sign in to comment.