Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync repo from v92 to v92 20240523171016 #146

Merged
merged 4 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
f1d5948d892d7b711ece214c0813f59849a9676b
9b6d2afb441f30f1aed1f629e137215516ef22a3
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@

## Change log

### May 24, 2024

The v92 branch has been updated with fixes for the following issues.

- 453132: Attestation Policies: Edit Attestation Policy: Setting Condition: The objects matching the condition are not displayed hierarchically
- 449292: Fixed an issue during creation of a cart item
- 455291: Fixed the output paths for the compodoc files
- 453350: Fixed an issue where the user could not save dynamic role membership changes after adding another condition to a new role
- 455703: Fixed a state issue of the save button during creation of a report

### May 6, 2024

We are integrating [Compodoc](https://compodoc.app/) to provide Angular documentation for our components. Please see the [Documentation](#documentation) section for more information on how to generate documentation.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div eui-sidesheet-content>
<mat-card class="imx-content-card">
<imx-sqlwizard *ngIf="!sqlExpression?.IsUnsupported" [tableName]="'UNSGroup'" (change)="checkChanges($event)" [apiService]="svc" [expression]="sqlExpression?.Expression" [allowEmptyExpression]="true">
<imx-sqlwizard *ngIf="!sqlExpression?.IsUnsupported" [tableName]="'UNSGroup'" (change)="checkChanges()" [apiService]="svc" [expression]="sqlExpression?.Expression" [allowEmptyExpression]="true">
</imx-sqlwizard>
</mat-card>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,8 @@ export class EntitlementEditAutoAddComponent implements OnDestroy {

public sqlExpression: SqlWizardExpression;

public checkChanges(expression: SqlExpression): void {
this.exprHasntChanged = _.isEqual(expression, this.sqlExpression.Expression);
if (!this.exprHasntChanged) {
this.sqlExpression.Expression = expression;
}
public checkChanges(): void {
this.exprHasntChanged = _.isEqual(this.data.sqlExpression, this.sqlExpression);
}

public get controlsInvalid(): boolean {
Expand Down Expand Up @@ -102,8 +99,7 @@ export class EntitlementEditAutoAddComponent implements OnDestroy {
}

const entitlementToAdd = this.entitlementToAddWrapperService.buildTypedEntities(elements);
const saveChanges: { save: boolean; map: boolean } = await this.sidesheet
.open(MappedEntitlementsPreviewComponent, {
const saveChanges: { save: boolean; map: boolean } = await this.sidesheet.open(MappedEntitlementsPreviewComponent, {
title: await this.translateService.get('#LDS#Heading View Matching Application Entitlements').toPromise(),
subTitle: this.data.application.GetEntity().GetDisplay(),
padding: '0px',
Expand Down
2 changes: 1 addition & 1 deletion imxweb/projects/att/.compodocrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "IMX Web - ATT Library",
"output": "../../documentation/v92att",
"output": "../../documentation/v92/att",
"theme": "material",
"assetsFolder": "../../compodoc/assets",
"customLogo": "../../compodoc/assets/images/oneidentity-logo.png",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ export class AttestationCasesTreeDatabaseService extends TreeDatabase {
const navigationState = {
...parameter,
...{
PageSize: this.settingsService.DefaultPageSize,
StartIndex: parameter.StartIndex ? parameter.StartIndex : 0,
PageSize: parameter.PageSize ?? this.settingsService.DefaultPageSize,
StartIndex: parameter.StartIndex ?? 0,
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

<ng-template #customContent>
<mat-card class="imx-content-container mat-elevation-z4">
<imx-sqlwizard [tableName]="data?.settings?.entitySchema?.TypeName" [expression]="sqlExpression?.Expression" (change)="checkChanges($event)" data-imx-identifier="sqlwizard">
<imx-sqlwizard [tableName]="data?.settings?.entitySchema?.TypeName" [expression]="sqlExpression?.Expression" (change)="checkChanges()" data-imx-identifier="sqlwizard">
</imx-sqlwizard>
</mat-card>
</ng-template>
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,8 @@ export class FilterWizardComponent implements OnDestroy {
this.subscriptions.forEach((s) => s.unsubscribe());
}

public checkChanges(expression: SqlExpression): void {
this.expressionDirty = !_.isEqual(expression, this.lastGoodExpression);
if (this.expressionDirty) {
this.sqlExpression.Expression = expression;
}
public checkChanges(): void {
this.expressionDirty = !_.isEqual(this.sqlExpression?.Expression, this.lastGoodExpression);
this.expressionInvalid =
!_.isEqual(this.sqlExpression?.Expression, this.emptyExpression?.Expression) && isExpressionInvalid(this.sqlExpression);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export class DataTreeSearchResultsComponent implements OnChanges {
public paginatorLength: number;

/** @ignore the pagesiuze for the paginator */
public paginatorPageSize = this.settings.DefaultPageSize;
public paginatorPageSize;

public loading = true;
public selectedEntity: IEntity;
Expand All @@ -93,7 +93,9 @@ export class DataTreeSearchResultsComponent implements OnChanges {
/** event, that fires, after the checked nodes list has been updated */
@Output() public checkedNodesChanged = new EventEmitter();

constructor(private readonly logger: ClassloggerService, private readonly settings: SettingsService) {}
constructor(private readonly logger: ClassloggerService, private readonly settings: SettingsService) {
this.paginatorPageSize = this.settings?.DefaultPageSize ?? 25;
}

public async ngOnChanges(changes: SimpleChanges): Promise<void> {
if (changes['navigationState']) {
Expand Down
28 changes: 7 additions & 21 deletions imxweb/projects/qbm/src/lib/sqlwizard/sqlwizard.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,7 @@
*
*/

import {
AfterViewInit,
Component,
ElementRef,
EventEmitter,
Input,
OnChanges,
OnInit,
Output,
QueryList,
SimpleChanges,
ViewChildren,
} from '@angular/core';
import { AfterViewInit, Component, ElementRef, EventEmitter, Input, OnChanges, OnInit, Output, QueryList, SimpleChanges, ViewChildren } from '@angular/core';
import { SqlViewSettings } from './SqlNodeView';
import { LogOp as _logOp, SqlExpression } from 'imx-qbm-dbts';
import { SqlWizardApiService } from './sqlwizard-api.service';
Expand Down Expand Up @@ -67,7 +55,7 @@ export class SqlWizardComponent implements OnInit, OnChanges, AfterViewInit {
/** Alternate API service to use. */
@Input() public apiService: SqlWizardApiService;

@Output() public change = new EventEmitter<SqlExpression>();
@Output() public change = new EventEmitter<any>();

@ViewChildren('expressionItem') public expressionList: QueryList<ElementRef<HTMLLIElement>>;

Expand All @@ -81,14 +69,14 @@ export class SqlWizardComponent implements OnInit, OnChanges, AfterViewInit {
}

public ngAfterViewInit(): void {
setTimeout(() => {
setTimeout( () => {
this.expressionList.changes.subscribe(() => {
if (this.newExpressionAdded) {
this.expressionList?.last?.nativeElement.scrollIntoView(true);
}

this.newExpressionAdded = false;
});
})
});
}

Expand All @@ -115,15 +103,13 @@ export class SqlWizardComponent implements OnInit, OnChanges, AfterViewInit {
}

public async emitChanges(): Promise<void> {
this.change.emit();
await this.addEmptyExpression();
this.change.emit(this.viewSettings.root.Data);
}

public onOperatorChanged(event: MatButtonToggleChange): void {
(event.value as string).toLowerCase() === 'and'
? (this.expression.LogOperator = this.LogOp.AND)
: (this.expression.LogOperator = this.LogOp.OR);
this.change.emit(this.viewSettings.root.Data);
(event.value as string).toLowerCase() === 'and' ? (this.expression.LogOperator = this.LogOp.AND) : (this.expression.LogOperator = this.LogOp.OR);
this.change.emit();
}

public logOpText(): string {
Expand Down
2 changes: 1 addition & 1 deletion imxweb/projects/qer-app-pwdportal/.compodocrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "IMX Web - Password Reset Portal",
"output": "../../documentation/qer-app-pwdportal",
"output": "../../documentation/v92/qer-app-pwdportal",
"theme": "material",
"assetsFolder": "../../compodoc/assets",
"customLogo": "../../compodoc/assets/images/oneidentity-logo.png",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@
<mat-tab label="{{ '#LDS#Heading Details' | translate }}">
<div class="details-container">
<div class="details-text">
<div class="details-item">
<div class="details-item" *ngIf="propertyExists('ServiceCategoryFullPath')">
<div class="details-label">
{{'#LDS#Service category' | translate}}:
</div>
<div class="details-value link">
<ng-template *ngTemplateOutlet="formatValue; context: {$implicit: getValue('ServiceCategoryFullPath')}"></ng-template>
</div>
</div>
<div class="details-item">
<div class="details-item" *ngIf="propertyExists('TableName')">
<div class="details-label">
{{'#LDS#Entitlement type' | translate}}:
</div>
<div class="details-value bold">
<ng-template *ngTemplateOutlet="formatValue; context: {$implicit: getDisplay('TableName')}"></ng-template>
</div>
</div>
<div class="details-item">
<div class="details-item" *ngIf="propertyExists('ArticleCode')">
<div class="details-label">
{{'#LDS#Product code' | translate}}:
</div>
Expand All @@ -40,15 +40,15 @@
<ng-template *ngTemplateOutlet="formatValue; context: {$implicit: getValue('Web')}"></ng-template>
</div>
</div> -->
<div class="details-item">
<div class="details-item" *ngIf="propertyExists('Tags')">
<div class="details-label">
{{'#LDS#Tags' | translate}}:
</div>
<div class="details-value bold">
<ng-template *ngTemplateOutlet="formatValue; context: {$implicit: getValue('Tags')}"></ng-template>
</div>
</div>
<div class="details-item">
<div class="details-item" *ngIf="propertyExists('Description')">
<div class="details-label">
{{'#LDS#Description' | translate}}:
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import { Component, Inject, OnInit } from '@angular/core';
import { MatTabChangeEvent } from '@angular/material/tabs';
import { EUI_SIDESHEET_DATA } from '@elemental-ui/core';
import { PortalServiceitems } from 'imx-api-qer';
import { PortalServiceitems, QerProjectConfig } from 'imx-api-qer';

@Component({
selector: 'imx-product-details-sidesheet',
Expand All @@ -37,6 +37,7 @@ import { PortalServiceitems } from 'imx-api-qer';
export class ProductDetailsSidesheetComponent implements OnInit {
public hasEntitlements: boolean;
public onEntitlements = false;
private properties: string[] = [];

constructor(
@Inject(EUI_SIDESHEET_DATA) public data: {
Expand All @@ -45,12 +46,14 @@ export class ProductDetailsSidesheetComponent implements OnInit {
statusIcon: string,
statusDisplay: string
} | null,
imageUrl: string
imageUrl: string,
projectConfig: QerProjectConfig
},
) { }

public ngOnInit(): void {
this.hasEntitlements = ['ESet', 'QERAssign'].includes(this.getValue('TableName'));
this.hasEntitlements = ['ESet', 'QERAssign'].includes(this.getValue('TableName'));
this.properties = this.data.projectConfig.ITShopConfig.AccProductProperties;
}

public getValue(column: string): string {
Expand All @@ -67,4 +70,19 @@ export class ProductDetailsSidesheetComponent implements OnInit {
this.onEntitlements = change.index === 1;
}


/**
* Returns true, if the given property name was found in the AccProductProperties or in the entity schema.
*/
public propertyExists(name: string): boolean {
let found = this.properties.indexOf(name) > -1;
if (found) {
return true;
}
for (const key in this.data.item.GetEntity().GetSchema().Columns) {
found ||= key === name;
}
return found;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,34 @@ import { SafeUrl } from '@angular/platform-browser';
import { EuiSidesheetService } from '@elemental-ui/core';
import { TranslateService } from '@ngx-translate/core';

import { PortalShopServiceitems } from 'imx-api-qer';
import { PortalShopServiceitems, QerProjectConfig } from 'imx-api-qer';
import { IWriteValue, MultiValue } from 'imx-qbm-dbts';
import { LdsReplacePipe } from 'qbm';
import { ProductDetailsSidesheetComponent } from './product-details-sidesheet.component';
import { ImageService } from '../../../itshop/image.service';
import { ProjectConfigurationService } from '../../../project-configuration/project-configuration.service';

@Injectable({
providedIn: 'root'
})
export class ProductDetailsService {

private projectConfig: QerProjectConfig;

constructor(
private readonly image: ImageService,
private readonly ldsReplace: LdsReplacePipe,
private readonly sidesheetService: EuiSidesheetService,
private readonly translateService: TranslateService,
private readonly translateService: TranslateService,
private readonly projectConfigService: ProjectConfigurationService,
) { }

public async showProductDetails(item: PortalShopServiceitems, recipients: IWriteValue<string>): Promise<void> {

if (!this.projectConfig) {
this.projectConfig = await this.projectConfigService.getConfig();
}

const orderStatus = await this.getOrderStatus(item, recipients);
await this.sidesheetService
.open(ProductDetailsSidesheetComponent, {
Expand All @@ -61,6 +70,7 @@ export class ProductDetailsService {
item,
orderStatus: orderStatus,
imageUrl: this.getProductImage(item),
projectConfig: this.projectConfig
},
})
.afterClosed()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

<div class="imx-main-content">
<mat-card>
<imx-sqlwizard [canEdit]="canEdit" *ngIf="!sqlExpression.IsUnsupported" tableName="Person" [expression]="sqlExpression.Expression" (change)="checkChanges($event)">
<imx-sqlwizard [canEdit]="canEdit" *ngIf="!sqlExpression.IsUnsupported" tableName="Person" [expression]="sqlExpression.Expression" (change)="checkChanges()">
</imx-sqlwizard>

<ng-container *ngIf="cdrList.length > 0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export class DynamicRoleComponent implements OnInit {
e.extendedData = { NewDynamicRole: this.sqlExpression.Expression };
await e.GetEntity().Commit(true);
this.uidDynamicGroup = e.GetEntity().GetColumn('UID_DynamicGroup').GetValue();
await this.loadDynamicRole();
await this.loadDynamicRole(false);
}
} finally {
await this.dataManagementService.setInteractive();
Expand Down Expand Up @@ -160,10 +160,9 @@ export class DynamicRoleComponent implements OnInit {
}
}

public checkChanges(expression: SqlExpression): void {
this.exprHasntChanged = _.isEqual(expression, this.lastSavedExpression);
public checkChanges(): void {
this.exprHasntChanged = _.isEqual(this.sqlExpression?.Expression, this.lastSavedExpression);
if (!this.exprHasntChanged) {
this.sqlExpression.Expression = expression;
this.dataManagementService.autoMembershipDirty(true);
} else if (this.cdrsHaventChanged && this.exprHasntChanged) {
this.dataManagementService.autoMembershipDirty(false);
Expand Down Expand Up @@ -191,23 +190,24 @@ export class DynamicRoleComponent implements OnInit {
);
}

private async loadDynamicRole(): Promise<void> {
private async loadDynamicRole(initialLoading = true): Promise<void> {
try {
this.busy = true;
if (this.uidDynamicGroup) {
const data = await this.apiService.typedClient.PortalDynamicgroupInteractive.Get(this.uidDynamicGroup);

this.dynamicGroup = data.Data[0];
this.sqlExpression = data.extendedData.Expressions[0];
// Set "" to undefined so the cdr and data dirty states make sense
this.sqlExpression?.Expression?.Expressions?.map((exp) => {
if (exp.Value === '') {
exp.Value = undefined;
if (initialLoading) {
this.sqlExpression = data.extendedData.Expressions[0];
// Set "" to undefined so the cdr and data dirty states make sense
this.sqlExpression?.Expression?.Expressions?.map((exp) => {
if (exp.Value === '') {
exp.Value = undefined;
}
});
// Sometimes the logOp is not set. Initalize it here
if (!this.sqlExpression.IsUnsupported && !this.sqlExpression?.Expression?.LogOperator) {
this.sqlExpression.Expression.LogOperator = LogOp.AND;
}
});
// Sometimes the logOp is not set. Initalize it here
if (!this.sqlExpression.IsUnsupported && !this.sqlExpression?.Expression?.LogOperator) {
this.sqlExpression.Expression.LogOperator = LogOp.AND;
}

this.cdrList = this.canEdit
Expand Down
Loading
Loading