@pega/angular-sdk-overrides 0.242.4 → 0.242.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/lib/field/dropdown/dropdown.component.ts +29 -15
  2. package/lib/field/user-reference/user-reference.component.html +2 -10
  3. package/lib/field/user-reference/user-reference.component.ts +34 -12
  4. package/lib/infra/Containers/flow-container/flow-container.component.ts +17 -40
  5. package/lib/infra/Containers/flow-container/helpers.ts +1 -1
  6. package/lib/infra/Containers/modal-view-container/modal-view-container.component.ts +0 -6
  7. package/lib/infra/assignment/assignment.component.html +1 -1
  8. package/lib/infra/assignment/assignment.component.ts +84 -39
  9. package/lib/infra/assignment-card/assignment-card.component.html +1 -0
  10. package/lib/infra/assignment-card/assignment-card.component.ts +32 -4
  11. package/lib/infra/root-container/root-container.component.html +2 -15
  12. package/lib/infra/root-container/root-container.component.ts +0 -10
  13. package/lib/infra/view/view.component.ts +15 -1
  14. package/lib/template/base/details-template-base.ts +67 -0
  15. package/lib/template/base/form-template-base.ts +16 -0
  16. package/lib/template/case-view/case-view.component.html +4 -4
  17. package/lib/template/case-view/case-view.component.ts +7 -12
  18. package/lib/template/default-form/default-form.component.ts +40 -5
  19. package/lib/template/details/details.component.ts +5 -39
  20. package/lib/template/details-narrow-wide/details-narrow-wide.component.ts +5 -38
  21. package/lib/template/details-one-column/details-one-column.component.ts +5 -40
  22. package/lib/template/details-sub-tabs/details-sub-tabs.component.html +1 -2
  23. package/lib/template/details-sub-tabs/details-sub-tabs.component.ts +5 -37
  24. package/lib/template/details-three-column/details-three-column.component.ts +5 -41
  25. package/lib/template/details-two-column/details-two-column.component.ts +5 -41
  26. package/lib/template/details-wide-narrow/details-wide-narrow.component.ts +5 -40
  27. package/lib/template/one-column/one-column.component.ts +2 -2
  28. package/lib/template/simple-table-manual/helpers.ts +7 -5
  29. package/lib/template/three-column/three-column.component.ts +2 -2
  30. package/lib/template/two-column/two-column.component.ts +2 -2
  31. package/lib/template/wide-narrow-form/wide-narrow-form.component.ts +2 -2
  32. package/lib/widget/todo/todo.component.html +3 -3
  33. package/lib/widget/todo/todo.component.scss +7 -0
  34. package/package.json +1 -1
  35. package/lib/template/form-template-base/form-template-base.component.ts +0 -10
@@ -1,7 +1,6 @@
1
- import { Component, OnInit, Input, forwardRef, OnDestroy } from '@angular/core';
2
- import { FormGroup } from '@angular/forms';
3
- import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
1
+ import { Component, forwardRef } from '@angular/core';
4
2
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
3
+ import { DetailsTemplateBase } from '@pega/angular-sdk-components';
5
4
 
6
5
  @Component({
7
6
  selector: 'app-details-two-column',
@@ -10,11 +9,8 @@ import { ComponentMapperComponent } from '@pega/angular-sdk-components';
10
9
  standalone: true,
11
10
  imports: [forwardRef(() => ComponentMapperComponent)]
12
11
  })
13
- export class DetailsTwoColumnComponent implements OnInit, OnDestroy {
14
- constructor(private angularPConnect: AngularPConnectService) {}
15
-
16
- @Input() pConn$: typeof PConnect;
17
- @Input() formGroup$: FormGroup;
12
+ export class DetailsTwoColumnComponent extends DetailsTemplateBase {
13
+ override pConn$: typeof PConnect;
18
14
 
19
15
  showHighlightedData: boolean;
20
16
  highlightedDataArr: any;
@@ -25,39 +21,7 @@ export class DetailsTwoColumnComponent implements OnInit, OnDestroy {
25
21
 
26
22
  propsToUse: any = {};
27
23
 
28
- // Used with AngularPConnect
29
- angularPConnectData: AngularPConnectData = {};
30
-
31
- ngOnInit(): void {
32
- // First thing in initialization is registering and subscribing to the AngularPConnect service
33
- this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
34
-
35
- // this.updateSelf();
36
- this.checkAndUpdate();
37
- }
38
-
39
- ngOnDestroy() {
40
- if (this.angularPConnectData.unsubscribeFn) {
41
- this.angularPConnectData.unsubscribeFn();
42
- }
43
- }
44
-
45
- onStateChange() {
46
- this.checkAndUpdate();
47
- }
48
-
49
- checkAndUpdate() {
50
- // Should always check the bridge to see if the component should
51
- // update itself (re-render)
52
- const bUpdateSelf = this.angularPConnect.shouldComponentUpdate(this);
53
-
54
- // ONLY call updateSelf when the component should update
55
- if (bUpdateSelf) {
56
- this.updateSelf();
57
- }
58
- }
59
-
60
- updateSelf() {
24
+ override updateSelf() {
61
25
  const rawMetaData: any = this.pConn$.resolveConfigProps(this.pConn$.getRawMetadata()?.config);
62
26
  this.showHighlightedData = rawMetaData?.showHighlightedData;
63
27
 
@@ -1,7 +1,6 @@
1
- import { Component, OnInit, Input, forwardRef, OnDestroy } from '@angular/core';
2
- import { FormGroup } from '@angular/forms';
3
- import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
1
+ import { Component, forwardRef } from '@angular/core';
4
2
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
3
+ import { DetailsTemplateBase } from '@pega/angular-sdk-components';
5
4
 
6
5
  @Component({
7
6
  selector: 'app-details-wide-narrow',
@@ -10,50 +9,16 @@ import { ComponentMapperComponent } from '@pega/angular-sdk-components';
10
9
  standalone: true,
11
10
  imports: [forwardRef(() => ComponentMapperComponent)]
12
11
  })
13
- export class DetailsWideNarrowComponent implements OnInit, OnDestroy {
14
- constructor(private angularPConnect: AngularPConnectService) {}
15
-
16
- @Input() pConn$: typeof PConnect;
17
- @Input() formGroup$: FormGroup;
12
+ export class DetailsWideNarrowComponent extends DetailsTemplateBase {
13
+ override pConn$: typeof PConnect;
18
14
 
19
15
  highlightedDataArr: any[] = [];
20
16
  showHighlightedData: boolean;
21
17
  arFields$: any[] = [];
22
18
  arFields2$: any[] = [];
23
19
  propsToUse: any = {};
24
- // Used with AngularPConnect
25
- angularPConnectData: AngularPConnectData = {};
26
-
27
- ngOnInit(): void {
28
- // First thing in initialization is registering and subscribing to the AngularPConnect service
29
- this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
30
-
31
- // this.updateSelf();
32
- this.checkAndUpdate();
33
- }
34
-
35
- ngOnDestroy() {
36
- if (this.angularPConnectData.unsubscribeFn) {
37
- this.angularPConnectData.unsubscribeFn();
38
- }
39
- }
40
-
41
- onStateChange() {
42
- this.checkAndUpdate();
43
- }
44
-
45
- checkAndUpdate() {
46
- // Should always check the bridge to see if the component should
47
- // update itself (re-render)
48
- const bUpdateSelf = this.angularPConnect.shouldComponentUpdate(this);
49
-
50
- // ONLY call updateSelf when the component should update
51
- if (bUpdateSelf) {
52
- this.updateSelf();
53
- }
54
- }
55
20
 
56
- updateSelf() {
21
+ override updateSelf() {
57
22
  const rawMetaData: any = this.pConn$.resolveConfigProps(this.pConn$.getRawMetadata()?.config);
58
23
  this.showHighlightedData = rawMetaData?.showHighlightedData;
59
24
 
@@ -2,7 +2,7 @@ import { Component, OnInit, Input, forwardRef, OnChanges, SimpleChanges } from '
2
2
  import { CommonModule } from '@angular/common';
3
3
  import { FormGroup } from '@angular/forms';
4
4
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
5
- import { FormTemplateBaseComponent } from '@pega/angular-sdk-components';
5
+ import { FormTemplateBase } from '@pega/angular-sdk-components';
6
6
 
7
7
  @Component({
8
8
  selector: 'app-one-column',
@@ -11,7 +11,7 @@ import { FormTemplateBaseComponent } from '@pega/angular-sdk-components';
11
11
  standalone: true,
12
12
  imports: [CommonModule, forwardRef(() => ComponentMapperComponent)]
13
13
  })
14
- export class OneColumnComponent extends FormTemplateBaseComponent implements OnInit, OnChanges {
14
+ export class OneColumnComponent extends FormTemplateBase implements OnInit, OnChanges {
15
15
  @Input() override pConn$: typeof PConnect;
16
16
  @Input() formGroup$: FormGroup;
17
17
 
@@ -44,18 +44,20 @@ function getFieldWidth(field, label) {
44
44
  export const getContext = thePConn => {
45
45
  const contextName = thePConn.getContextName();
46
46
  const pageReference = thePConn.getPageReference();
47
- // 8.7 change = referenceList may now be in top-level of state props,
48
- // not always in config of state props
49
- let { referenceList } = thePConn.getStateProps()?.config || thePConn.getStateProps();
47
+ const { readonlyContextList, referenceList = readonlyContextList } = thePConn.getStateProps()?.config || thePConn.getStateProps();
48
+
50
49
  const pageReferenceForRows = referenceList.startsWith('.') ? `${pageReference}.${referenceList.substring(1)}` : referenceList;
50
+ const viewName = thePConn.viewName;
51
51
 
52
52
  // removing "caseInfo.content" prefix to avoid setting it as a target while preparing pageInstructions
53
- referenceList = pageReferenceForRows.replace(PCore.getConstants().CASE_INFO.CASE_INFO_CONTENT, '');
53
+ // skipping the removal as StateMachine itself is removing this case info prefix while preparing pageInstructions
54
+ // referenceList = pageReferenceForRows.replace(PCore.getConstants().CASE_INFO.CASE_INFO_CONTENT, '');
54
55
 
55
56
  return {
56
57
  contextName,
57
58
  referenceListStr: referenceList,
58
- pageReferenceForRows
59
+ pageReferenceForRows,
60
+ viewName
59
61
  };
60
62
  };
61
63
 
@@ -2,7 +2,7 @@ import { Component, OnInit, Input, forwardRef, OnChanges, SimpleChanges } from '
2
2
  import { CommonModule } from '@angular/common';
3
3
  import { FormGroup } from '@angular/forms';
4
4
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
5
- import { FormTemplateBaseComponent } from '@pega/angular-sdk-components';
5
+ import { FormTemplateBase } from '@pega/angular-sdk-components';
6
6
 
7
7
  @Component({
8
8
  selector: 'app-three-column',
@@ -11,7 +11,7 @@ import { FormTemplateBaseComponent } from '@pega/angular-sdk-components';
11
11
  standalone: true,
12
12
  imports: [CommonModule, forwardRef(() => ComponentMapperComponent)]
13
13
  })
14
- export class ThreeColumnComponent extends FormTemplateBaseComponent implements OnInit, OnChanges {
14
+ export class ThreeColumnComponent extends FormTemplateBase implements OnInit, OnChanges {
15
15
  @Input() override pConn$: typeof PConnect;
16
16
  @Input() formGroup$: FormGroup;
17
17
 
@@ -2,7 +2,7 @@ import { Component, OnInit, Input, forwardRef, SimpleChanges, OnChanges } from '
2
2
  import { CommonModule } from '@angular/common';
3
3
  import { FormGroup } from '@angular/forms';
4
4
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
5
- import { FormTemplateBaseComponent } from '@pega/angular-sdk-components';
5
+ import { FormTemplateBase } from '@pega/angular-sdk-components';
6
6
 
7
7
  @Component({
8
8
  selector: 'app-two-column',
@@ -11,7 +11,7 @@ import { FormTemplateBaseComponent } from '@pega/angular-sdk-components';
11
11
  standalone: true,
12
12
  imports: [CommonModule, forwardRef(() => ComponentMapperComponent)]
13
13
  })
14
- export class TwoColumnComponent extends FormTemplateBaseComponent implements OnInit, OnChanges {
14
+ export class TwoColumnComponent extends FormTemplateBase implements OnInit, OnChanges {
15
15
  @Input() override pConn$: typeof PConnect;
16
16
  @Input() formGroup$: FormGroup;
17
17
 
@@ -2,7 +2,7 @@ import { Component, OnInit, Input, forwardRef, OnChanges, SimpleChanges } from '
2
2
  import { CommonModule } from '@angular/common';
3
3
  import { FormGroup } from '@angular/forms';
4
4
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
5
- import { FormTemplateBaseComponent } from '@pega/angular-sdk-components';
5
+ import { FormTemplateBase } from '@pega/angular-sdk-components';
6
6
 
7
7
  @Component({
8
8
  selector: 'app-wide-narrow-form',
@@ -11,7 +11,7 @@ import { FormTemplateBaseComponent } from '@pega/angular-sdk-components';
11
11
  standalone: true,
12
12
  imports: [CommonModule, forwardRef(() => ComponentMapperComponent)]
13
13
  })
14
- export class WideNarrowFormComponent extends FormTemplateBaseComponent implements OnInit, OnChanges {
14
+ export class WideNarrowFormComponent extends FormTemplateBase implements OnInit, OnChanges {
15
15
  @Input() override pConn$: typeof PConnect;
16
16
  @Input() formGroup$: FormGroup;
17
17
 
@@ -1,8 +1,8 @@
1
1
  <div class="psdk-todo">
2
- <div class="psdk-todo-header">
3
- <div *ngIf="showTodoList$" class="psdk-avatar">{{ this.currentUserInitials$ }}</div>
2
+ <div *ngIf="showTodoList$" class="psdk-todo-header">
3
+ <div class="psdk-avatar">{{ this.currentUserInitials$ }}</div>
4
4
  <div id="worklist" class="psdk-todo-text">{{ headerText$ }}</div>
5
- <div *ngIf="showTodoList$" class="psdk-assignment-count">{{ count }}</div>
5
+ <div class="psdk-assignment-count">{{ count }}</div>
6
6
  </div>
7
7
  <br /><br />
8
8
  <div *ngIf="showTodoList$" class="psdk-display-divider"></div>
@@ -1,5 +1,12 @@
1
+ .psdk-todo-assignments > *:last-child {
2
+ .psdk-display-divider {
3
+ display: none;
4
+ }
5
+ }
6
+
1
7
  .psdk-display-divider {
2
8
  border-bottom: 0.0625rem solid var(--app-neutral-light-color);
9
+ margin-block: 0.5rem;
3
10
  }
4
11
 
5
12
  .psdk-todo {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/angular-sdk-overrides",
3
- "version": "0.242.4",
3
+ "version": "0.242.6",
4
4
  "description": "Angular SDK - Code for overriding components",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -1,10 +0,0 @@
1
- import { Directive, OnDestroy } from '@angular/core';
2
-
3
- @Directive()
4
- export class FormTemplateBaseComponent implements OnDestroy {
5
- pConn$: any;
6
-
7
- ngOnDestroy(): void {
8
- PCore.getContextTreeManager().removeContextTreeNode(this.pConn$.getContextName());
9
- }
10
- }