From f8d3ccefa49c98da276e6bf671e79e0a1ea17d35 Mon Sep 17 00:00:00 2001 From: Eugenio Romano Date: Tue, 22 Feb 2022 12:07:54 +0000 Subject: [PATCH] patch 4.8.1 (#7517) * patch mec * fix cloud vcariables 4.8.1 (#7511) Signed-off-by: eromano --- .travis.yml | 10 ++- demo-shell/package.json | 2 +- lib/cli/package-lock.json | 2 +- lib/cli/package.json | 2 +- lib/content-services/package.json | 4 +- lib/core/package.json | 4 +- lib/extensions/package.json | 2 +- lib/insights/package.json | 4 +- lib/process-services-cloud/package-lock.json | 2 +- lib/process-services-cloud/package.json | 6 +- .../lib/form/services/form-cloud.service.ts | 66 ++++++++++++------- lib/process-services/package.json | 6 +- lib/testing/package.json | 2 +- package-lock.json | 2 +- package.json | 2 +- scripts/travis/release/release-docker.sh | 4 +- 16 files changed, 67 insertions(+), 53 deletions(-) diff --git a/.travis.yml b/.travis.yml index ce038cf30b..f2cc08e1ea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,10 +40,8 @@ env: branches: only: - - master - - develop - - /.*old-env.*/ - - /.*next-release.*/ + - /^master(-patch.*)?$/ + - /^develop(-patch.*)?$/ - /.*beta.*/ stages: @@ -62,9 +60,9 @@ stages: - name: "e2e Test" if: type = pull_request || (type = cron || type = api) - name: "Release tag" - if: branch = master + if: type = push AND branch =~ /^master(-patch.*)?$/ - name: "Deprecate develop builds" - if: branch = master + if: type = push AND branch =~ /^master(-patch.*)?$/ addons: chrome: stable diff --git a/demo-shell/package.json b/demo-shell/package.json index fbcdff8549..ca1211670a 100644 --- a/demo-shell/package.json +++ b/demo-shell/package.json @@ -1,7 +1,7 @@ { "name": "Alfresco-ADF-Angular-Demo", "description": "Demo shell for Alfresco Angular components", - "version": "4.8.0", + "version": "4.8.1", "author": "Alfresco Software, Ltd.", "repository": { "type": "git", diff --git a/lib/cli/package-lock.json b/lib/cli/package-lock.json index 67db103c3d..060a78b40b 100644 --- a/lib/cli/package-lock.json +++ b/lib/cli/package-lock.json @@ -1,6 +1,6 @@ { "name": "@alfresco/adf-cli", - "version": "4.8.0", + "version": "4.8.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/lib/cli/package.json b/lib/cli/package.json index a777e64e7c..599de6c953 100644 --- a/lib/cli/package.json +++ b/lib/cli/package.json @@ -1,7 +1,7 @@ { "name": "@alfresco/adf-cli", "description": "Alfresco ADF cli and utils", - "version": "4.8.0", + "version": "4.8.1", "author": "Alfresco Software, Ltd.", "bin": { "adf-cli": "./bin/adf-cli", diff --git a/lib/content-services/package.json b/lib/content-services/package.json index a0ce7d8a35..0bf1c97a55 100644 --- a/lib/content-services/package.json +++ b/lib/content-services/package.json @@ -1,7 +1,7 @@ { "name": "@alfresco/adf-content-services", "description": "Alfresco ADF content services", - "version": "4.8.0", + "version": "4.8.1", "author": "Alfresco Software, Ltd.", "main": "bundles/adf-content-services.js", "repository": { @@ -21,7 +21,7 @@ "@angular/material": ">=10.0.1", "@angular/router": ">=10.0.2", "@alfresco/js-api": "4.8.0", - "@alfresco/adf-core": "4.8.0", + "@alfresco/adf-core": "4.8.1", "@ngx-translate/core": ">=13.0.0", "moment": ">=2.22.2" }, diff --git a/lib/core/package.json b/lib/core/package.json index c7cf55384e..b9762761e4 100644 --- a/lib/core/package.json +++ b/lib/core/package.json @@ -1,7 +1,7 @@ { "name": "@alfresco/adf-core", "description": "Alfresco ADF core", - "version": "4.8.0", + "version": "4.8.1", "author": "Alfresco Software, Ltd.", "main": "bundles/adf-core.js", "repository": { @@ -27,7 +27,7 @@ "@mat-datetimepicker/core": ">=4.1.0", "@mat-datetimepicker/moment": ">=4.1.0", "@alfresco/js-api": "4.8.0", - "@alfresco/adf-extensions": "4.8.0", + "@alfresco/adf-extensions": "4.8.1", "@ngx-translate/core": ">=13.0.0", "minimatch-browser": ">=1.0.0", "moment": ">=2.22.2", diff --git a/lib/extensions/package.json b/lib/extensions/package.json index e61efee110..3c64cdf188 100644 --- a/lib/extensions/package.json +++ b/lib/extensions/package.json @@ -1,7 +1,7 @@ { "name": "@alfresco/adf-extensions", "description": "Provides extensibility support for ADF applications.", - "version": "4.8.0", + "version": "4.8.1", "license": "Apache-2.0", "author": "Alfresco Software, Ltd.", "main": "bundles/adf-extensions.js", diff --git a/lib/insights/package.json b/lib/insights/package.json index 1ad6553148..7401da146b 100644 --- a/lib/insights/package.json +++ b/lib/insights/package.json @@ -1,7 +1,7 @@ { "name": "@alfresco/adf-insights", "description": "Alfresco ADF insights", - "version": "4.8.0", + "version": "4.8.1", "author": "Alfresco Software, Ltd.", "main": "bundles/adf-insights.js", "repository": { @@ -17,7 +17,7 @@ "@angular/flex-layout": ">=10.0.0-beta.32", "@angular/forms": ">=10.0.2", "@angular/material": ">=10.0.1", - "@alfresco/adf-core": "4.8.0", + "@alfresco/adf-core": "4.8.1", "@ngx-translate/core": ">=13.0.0", "chart.js": ">=2.9.3", "moment": ">=2.22.2", diff --git a/lib/process-services-cloud/package-lock.json b/lib/process-services-cloud/package-lock.json index 204bbc474b..f9a0f85a31 100644 --- a/lib/process-services-cloud/package-lock.json +++ b/lib/process-services-cloud/package-lock.json @@ -1,5 +1,5 @@ { "name": "@alfresco/adf-process-services-cloud", - "version": "4.8.0", + "version": "4.8.1", "lockfileVersion": 1 } diff --git a/lib/process-services-cloud/package.json b/lib/process-services-cloud/package.json index 2d1d3a0821..dc8dde1405 100644 --- a/lib/process-services-cloud/package.json +++ b/lib/process-services-cloud/package.json @@ -1,7 +1,7 @@ { "name": "@alfresco/adf-process-services-cloud", "description": "Alfresco ADF process services cloud", - "version": "4.8.0", + "version": "4.8.1", "author": "Alfresco Software, Ltd.", "main": "bundles/adf-process-services-cloud.js", "repository": { @@ -19,8 +19,8 @@ "@angular/forms": ">=10.0.2", "@angular/material": ">=10.0.1", "@alfresco/js-api": "4.8.0", - "@alfresco/adf-core": "4.8.0", - "@alfresco/adf-content-services": "4.8.0", + "@alfresco/adf-core": "4.8.1", + "@alfresco/adf-content-services": "4.8.1", "@apollo/client": "^3.3.7", "@ngx-translate/core": ">=13.0.0", "apollo-angular": "^2.2.0", diff --git a/lib/process-services-cloud/src/lib/form/services/form-cloud.service.ts b/lib/process-services-cloud/src/lib/form/services/form-cloud.service.ts index 6134ac46f1..bd7144cc26 100644 --- a/lib/process-services-cloud/src/lib/form/services/form-cloud.service.ts +++ b/lib/process-services-cloud/src/lib/form/services/form-cloud.service.ts @@ -24,8 +24,8 @@ import { FormModel, FormFieldOption } from '@alfresco/adf-core'; -import { Observable, from } from 'rxjs'; -import { map, switchMap } from 'rxjs/operators'; +import { Observable, from, EMPTY } from 'rxjs'; +import { expand, map, reduce, switchMap } from 'rxjs/operators'; import { TaskDetailsCloudModel } from '../../task/start-task/models/task-details-cloud.model'; import { CompleteFormRepresentation, UploadApi } from '@alfresco/js-api'; import { TaskVariableCloud } from '../models/task-variable-cloud.model'; @@ -53,6 +53,7 @@ export class FormCloudService extends BaseCloudService implements FormCloudServi /** * Gets the form definition of a task. + * * @param appName Name of the app * @param taskId ID of the target task * @param version Version of the form @@ -60,27 +61,26 @@ export class FormCloudService extends BaseCloudService implements FormCloudServi */ getTaskForm(appName: string, taskId: string, version?: number): Observable { return this.getTask(appName, taskId).pipe( - switchMap(task => { - return this.getForm(appName, task.formKey, version).pipe( - map((form: FormContent) => { - const flattenForm = { - ...form.formRepresentation, - ...form.formRepresentation.formDefinition, - taskId: task.id, - taskName: task.name, - processDefinitionId: task.processDefinitionId, - processInstanceId: task.processInstanceId - }; - delete flattenForm.formDefinition; - return flattenForm; - }) - ); - }) + switchMap(task => this.getForm(appName, task.formKey, version).pipe( + map((form: FormContent) => { + const flattenForm = { + ...form.formRepresentation, + ...form.formRepresentation.formDefinition, + taskId: task.id, + taskName: task.name, + processDefinitionId: task.processDefinitionId, + processInstanceId: task.processInstanceId + }; + delete flattenForm.formDefinition; + return flattenForm; + }) + )) ); } /** * Saves a task form. + * * @param appName Name of the app * @param taskId ID of the target task * @param processInstanceId ID of processInstance @@ -120,6 +120,7 @@ export class FormCloudService extends BaseCloudService implements FormCloudServi /** * Completes a task form. + * * @param appName Name of the app * @param taskId ID of the target task * @param processInstanceId ID of processInstance @@ -131,11 +132,12 @@ export class FormCloudService extends BaseCloudService implements FormCloudServi */ completeTaskForm(appName: string, taskId: string, processInstanceId: string, formId: string, formValues: FormValues, outcome: string, version: number): Observable { const apiUrl = `${this.getBasePath(appName)}/form/v1/forms/${formId}/submit/versions/${version}`; - const completeFormRepresentation = { + const completeFormRepresentation = { values: formValues, - taskId: taskId, - processInstanceId: processInstanceId - }; + taskId, + processInstanceId + } as CompleteFormRepresentation; + if (outcome) { completeFormRepresentation.outcome = outcome; } @@ -147,6 +149,7 @@ export class FormCloudService extends BaseCloudService implements FormCloudServi /** * Gets details of a task + * * @param appName Name of the app * @param taskId ID of the target task * @returns Details of the task @@ -161,22 +164,34 @@ export class FormCloudService extends BaseCloudService implements FormCloudServi /** * Gets the variables of a task. + * * @param appName Name of the app * @param taskId ID of the target task * @returns Task variables */ getTaskVariables(appName: string, taskId: string): Observable { const apiUrl = `${this.getBasePath(appName)}/query/v1/tasks/${taskId}/variables`; + let skipCount = 0; + const maxItems = 1000; - return this.get(apiUrl).pipe( + return this.get(apiUrl, { maxItems, skipCount }).pipe( + expand((res: any) => { + skipCount += maxItems; + return res.list.pagination.hasMoreItems ? this.get(apiUrl, { + maxItems, + skipCount + }) : EMPTY; + }), map((res: any) => { return res.list.entries.map((variable) => new TaskVariableCloud(variable.entry)); - }) + }), + reduce((acc, res) => acc.concat(res), []) ); } /** * Gets a form definition. + * * @param appName Name of the app * @param formKey key of the target task * @param version Version of the form @@ -200,6 +215,7 @@ export class FormCloudService extends BaseCloudService implements FormCloudServi /** * Parses JSON data to create a corresponding form. + * * @param json JSON data to create the form * @param data Values for the form's fields * @param readOnly Toggles whether or not the form should be read-only @@ -221,7 +237,7 @@ export class FormCloudService extends BaseCloudService implements FormCloudServi const form = new FormModel(flattenForm, formValues, readOnly); if (!json.fields) { form.outcomes = [ - new FormOutcomeModel( form, { + new FormOutcomeModel(form, { id: '$save', name: FormOutcomeModel.SAVE_ACTION, isSystem: true diff --git a/lib/process-services/package.json b/lib/process-services/package.json index 5b8dce71f0..73586ab590 100644 --- a/lib/process-services/package.json +++ b/lib/process-services/package.json @@ -1,7 +1,7 @@ { "name": "@alfresco/adf-process-services", "description": "Alfresco ADF process services", - "version": "4.8.0", + "version": "4.8.1", "author": "Alfresco Software, Ltd.", "main": "bundles/adf-process-services.js", "repository": { @@ -20,8 +20,8 @@ "@angular/material": ">=10.0.1", "@angular/router": ">=10.0.2", "@alfresco/js-api": "4.8.0", - "@alfresco/adf-core": "4.8.0", - "@alfresco/adf-content-services": "4.8.0", + "@alfresco/adf-core": "4.8.1", + "@alfresco/adf-content-services": "4.8.1", "@ngx-translate/core": ">=13.0.0", "moment": ">=2.22.2" }, diff --git a/lib/testing/package.json b/lib/testing/package.json index 75c244607d..b5b809e010 100644 --- a/lib/testing/package.json +++ b/lib/testing/package.json @@ -1,7 +1,7 @@ { "name": "@alfresco/adf-testing", "description": "Alfresco ADF testing page and utils", - "version": "4.8.0", + "version": "4.8.1", "author": "Alfresco Software, Ltd.", "repository": { "type": "git", diff --git a/package-lock.json b/package-lock.json index 45a508d284..ecfb506296 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "alfresco-ng2-components", - "version": "4.8.0", + "version": "4.8.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index c9c4735e92..2e842b5eaa 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "alfresco-ng2-components", "commit": "b644b39d17396330d2a67509f58c5b9e890b9b13", "description": "Alfresco Angular components", - "version": "4.8.0", + "version": "4.8.1", "author": "Alfresco Software, Ltd.", "main": "./index.js", "scripts": { diff --git a/scripts/travis/release/release-docker.sh b/scripts/travis/release/release-docker.sh index de4bfad864..c1de92ec3a 100755 --- a/scripts/travis/release/release-docker.sh +++ b/scripts/travis/release/release-docker.sh @@ -14,12 +14,12 @@ echo "ℹ️ Check Docker Image release for $COMMIT_MESSAGE type $TRAVIS_EVENT_T if [[ $TRAVIS_EVENT_TYPE == "push" || $TRAVIS_EVENT_TYPE == "cron" || ( $TRAVIS_EVENT_TYPE == "pull_request" && $COMMIT_MESSAGE == *"[create docker image]"* )]]; then - if [[ $TRAVIS_BRANCH == "develop" || $TRAVIS_BRANCH == "master" ]]; + if [[ $TRAVIS_BRANCH == "develop" || $TRAVIS_BRANCH =~ ^master(-patch.*)?$ ]]; then cd $DIR/../../../ - if [[ $TRAVIS_BRANCH == "master" ]]; then + if [[ $TRAVIS_BRANCH =~ ^master(-patch.*)?$ ]]; then TAGS=$(grep -m1 version package.json | awk '{ print $2 }' | sed 's/[", ]//g') else if [[ "${TRAVIS_PULL_REQUEST_BRANCH}" != "" ]];