@pega/angular-sdk-overrides 0.23.2 → 0.23.3

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.
package/README.md CHANGED
@@ -1,3 +1,17 @@
1
1
  # @pega/angular-sdk-overrides
2
2
 
3
- This Node package comprises templates for standalone Angular components that are designed to be overridden by the Angular SDK.
3
+ This Node package comprises standalone Angular components that are designed to be overridden by the Angular SDK.
4
+
5
+ To create a project to use the Constellation Angular SDK, please use the **Angular SDK**. You can get started
6
+ with the Angular SDK using the information (including pointers to online documentation) at
7
+ [**Pega Community**](https://community.pega.com/marketplace/component/angular-sdk) and the Angular SDK code
8
+ on [**GitHub**](https://github.com/pegasystems/angular-sdk).
9
+
10
+ ## Additional Resources
11
+
12
+ * [Constellaton Angular SDK on Pega Community](https://community.pega.com/marketplace/component/angular-sdk)
13
+ * [Constellation Angular SDK code](https://github.com/pegasystems/angular-sdk)
14
+ * [Constellation SDKs Documentation](https://docs.pega.com/bundle/constellation-sdk/page/constellation-sdks/sdks/constellation-sdks.html)
15
+ * [Troubleshooting Constellation SDKs](https://docs.pega.com/bundle/constellation-sdk/page/constellation-sdks/sdks/troubleshooting-constellation-sdks.html)
16
+ * [MediaCo sample application](https://docs.pega.com/bundle/constellation-sdk/page/constellation-sdks/sdks/mediaco-sample-application.html)
17
+ * [Angular Material](https://v16.material.angular.io/)
@@ -4,7 +4,7 @@ import { FormGroup, ReactiveFormsModule } from '@angular/forms';
4
4
  import { AngularPConnectData, AngularPConnectService } from '@pega/angular-sdk-components';
5
5
  import { Utils } from '@pega/angular-sdk-components';
6
6
  import { ComponentMapperComponent } from '@pega/angular-sdk-components';
7
- import handleEvent from '@pega/angular-sdk-components';
7
+ import { handleEvent } from '@pega/angular-sdk-components';
8
8
  import { PConnFieldProps } from '@pega/angular-sdk-components';
9
9
 
10
10
  interface RichTextProps extends PConnFieldProps {
@@ -149,24 +149,30 @@ export class FileUtilityComponent implements OnInit, OnDestroy {
149
149
  this.lu_bLoading$ = true;
150
150
  }
151
151
 
152
- // const uploadedFiles = [];
153
-
154
- for (const file of files) {
155
- attachmentUtils
156
- .uploadAttachment(file, this.onUploadProgress, this.errorHandler, this.pConn$.getContextName())
157
- .then((fileResponse: any) => {
158
- if (fileResponse.type === 'File') {
159
- (attachmentUtils.linkAttachmentsToCase(caseID, [fileResponse], 'File', this.pConn$.getContextName()) as Promise<any>)
160
- .then(() => {
161
- this.refreshAttachments();
162
- })
163
- .catch(console.error);
152
+ const arFiles: any = Array.from(files);
153
+
154
+ Promise.allSettled(
155
+ arFiles.map(file => attachmentUtils.uploadAttachment(file, this.onUploadProgress, this.errorHandler, this.pConn$.getContextName()))
156
+ )
157
+ .then((fileResponses: any) => {
158
+ const uploadedFiles: any = [];
159
+ fileResponses.forEach(fileResponse => {
160
+ if (fileResponse.status === 'fulfilled') {
161
+ uploadedFiles.push(fileResponse.value);
164
162
  }
165
- })
166
- .catch(console.error);
167
- }
163
+ });
164
+ if (uploadedFiles.length > 0) {
165
+ (attachmentUtils.linkAttachmentsToCase(caseID, uploadedFiles, 'File', this.pConn$.getContextName()) as Promise<any>)
166
+ .then(() => {
167
+ this.refreshAttachments();
168
+ })
169
+ .catch();
170
+ }
171
+ })
172
+ .catch();
168
173
 
169
174
  this.arFileList$ = [];
175
+ this.lu_bLoading$ = false;
170
176
  }
171
177
 
172
178
  refreshAttachments() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/angular-sdk-overrides",
3
- "version": "0.23.2",
3
+ "version": "0.23.3",
4
4
  "description": "Angular SDK - Code for overriding components",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"