From ca1d4b12d112f516a9e28442ff9ed4a59aaf9816 Mon Sep 17 00:00:00 2001 From: VitoAlbano Date: Fri, 31 May 2024 12:28:58 +0100 Subject: [PATCH] Fixed package and e2e with tabs that now are capital letters? --- .../visibility-condition-tabs.e2e.ts | 27 +- .../forms/tab-visibility-conditions.ts | 262 ++++++++++-------- .../resources/resources.ts | 6 +- package-lock.json | 56 +--- package.json | 2 +- 5 files changed, 174 insertions(+), 179 deletions(-) diff --git a/e2e/process-services-cloud/form-field/visibility-condition-tabs.e2e.ts b/e2e/process-services-cloud/form-field/visibility-condition-tabs.e2e.ts index 2898638ac6e..3026e40e1bf 100644 --- a/e2e/process-services-cloud/form-field/visibility-condition-tabs.e2e.ts +++ b/e2e/process-services-cloud/form-field/visibility-condition-tabs.e2e.ts @@ -18,12 +18,17 @@ import { FormCloudComponentPage, LoginPage, ProcessCloudWidgetPage } from '@alfresco/adf-testing'; import { NavigationBarPage } from '../../core/pages/navigation-bar.page'; -import { tabFieldValueVisibilityJson, tabVarValueVisibilityJson, tabVarFieldVisibilityJson, - tabFieldFieldVisibilityJson, tabFieldVarVisibilityJson, tabVarVarVisibilityJson, - tabNextOperatorsVisibilityJson } from '../../resources/forms/tab-visibility-conditions'; +import { + tabFieldValueVisibilityJson, + tabVarValueVisibilityJson, + tabVarFieldVisibilityJson, + tabFieldFieldVisibilityJson, + tabFieldVarVisibilityJson, + tabVarVarVisibilityJson, + tabNextOperatorsVisibilityJson +} from '../../resources/forms/tab-visibility-conditions'; describe('Visibility conditions on tabs - cloud', () => { - const loginSSOPage = new LoginPage(); const navigationBarPage = new NavigationBarPage(); const formCloudDemoPage = new FormCloudComponentPage(); @@ -41,13 +46,13 @@ describe('Visibility conditions on tabs - cloud', () => { }; const tab = { - tabWithFields: 'tabWithFields', - tabFieldValue: 'tabBasicFieldValue', - tabVarValue: 'tabBasicVarValue', - tabVarField: 'tabBasicVarField', - tabFieldField: 'tabBasicFieldField', - tabVarVar: 'tabBasicVarVar', - tabNextOperators: 'tabNextOperators' + tabWithFields: 'TABWITHFIELDS', + tabFieldValue: 'TABBASICFIELDVALUE', + tabVarValue: 'TABBASICVARVALUE', + tabVarField: 'TABBASICVARFIELD', + tabFieldField: 'TABBASICFIELDFIELD', + tabVarVar: 'TABBASICVARVAR', + tabNextOperators: 'TABNEXTOPERATORS' }; beforeAll(async () => { diff --git a/e2e/resources/forms/tab-visibility-conditions.ts b/e2e/resources/forms/tab-visibility-conditions.ts index bc8173a0cfc..035ca697214 100644 --- a/e2e/resources/forms/tab-visibility-conditions.ts +++ b/e2e/resources/forms/tab-visibility-conditions.ts @@ -32,10 +32,14 @@ const createField = (id = 'TextTwo', name = 'TextTwo') => ({ } }); -const createFieldDefinition = (id = 'dcde7e13-2444-48bc-ab30-32902cea549e', tabName = '71da814d-5580-4f1f-972a-8089253aeded', fields = { - 1: [createField()], - 2: [] -}) => ({ +const createFieldDefinition = ( + id = 'dcde7e13-2444-48bc-ab30-32902cea549e', + tabName = '71da814d-5580-4f1f-972a-8089253aeded', + fields = { + 1: [createField()], + 2: [] + } +) => ({ id, name: 'Label', type: 'container', @@ -57,7 +61,14 @@ const fieldDefinition3 = createFieldDefinition('df452297-d0e8-4406-b9d3-10842033 const fieldsDefinitions1 = [fieldDefinition1, fieldDefinition2]; const fieldsDefinitions2 = [fieldDefinition1, fieldDefinition3]; -const createVisibilityCondition = (leftType = 'field', leftValue = 'TextOne', nextCondition?: any, rightValue = 'showTab', rightType = 'value', operator = '==') => ({ +const createVisibilityCondition = ( + leftType = 'field', + leftValue = 'TextOne', + nextCondition?: any, + rightValue = 'showTab', + rightType = 'value', + operator = '==' +) => ({ leftType, leftValue, operator, @@ -67,39 +78,44 @@ const createVisibilityCondition = (leftType = 'field', leftValue = 'TextOne', ne nextCondition }); -const createTab = (id = '71da814d-5580-4f1f-972a-8089253aeded', title = 'tabBasicFieldValue', visibilityCondition = createVisibilityCondition('field', 'TextOne', null)) => ({ +const createTab = ( + id = '71da814d-5580-4f1f-972a-8089253aeded', + title = 'TABBASICFIELDVALUE', + visibilityCondition = createVisibilityCondition('field', 'TextOne', null) +) => ({ id, title, visibilityCondition }); -const createTabVisibilityJson = (tabs = [ - createTab(), - createTab('442eea0b-65f9-484e-b37f-f5a91d5e1f21', 'tabWithFields', null) -], fields = [ - createFieldDefinition(), - createFieldDefinition('df452297-d0e8-4406-b9d3-10842033549d', '442eea0b-65f9-484e-b37f-f5a91d5e1f21', { - 1: [ - { - id: 'TextOne', - name: 'TextOne', - type: 'text', - required: false, - colspan: 1, - placeholder: null, - minLength: 0, - maxLength: 0, - regexPattern: null, - visibilityCondition: null, - params: { - existingColspan: 1, - maxColspan: 2 +const createTabVisibilityJson = ( + tabs = [createTab(), createTab('442eea0b-65f9-484e-b37f-f5a91d5e1f21', 'TABWITHFIELDS', null)], + fields = [ + createFieldDefinition(), + createFieldDefinition('df452297-d0e8-4406-b9d3-10842033549d', '442eea0b-65f9-484e-b37f-f5a91d5e1f21', { + 1: [ + { + id: 'TextOne', + name: 'TextOne', + type: 'text', + required: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + regexPattern: null, + visibilityCondition: null, + params: { + existingColspan: 1, + maxColspan: 2 + } } - } - ], - 2: [] - }) -], variables = []) => ({ + ], + 2: [] + }) + ], + variables = [] +) => ({ formRepresentation: { id: 'form-3aff57d3-62af-4adf-9b14-1d8f44a28077', name: 'tabvisibility', @@ -118,89 +134,109 @@ const createTabVisibilityJson = (tabs = [ export const tabFieldValueVisibilityJson = createTabVisibilityJson(); -export const tabVarValueVisibilityJson = createTabVisibilityJson([ - createTab('71da814d-5580-4f1f-972a-8089253aeded', 'tabBasicVarValue', createVisibilityCondition('variable', 'stringVar')) -], [fieldDefinition1], [ - { - id: '803269e6-a568-40e2-aec3-75ad2f411688', - name: 'stringVar', - type: 'string', - value: 'showTab' - } -]); +export const tabVarValueVisibilityJson = createTabVisibilityJson( + [createTab('71da814d-5580-4f1f-972a-8089253aeded', 'TABBASICVARVALUE', createVisibilityCondition('variable', 'stringVar'))], + [fieldDefinition1], + [ + { + id: '803269e6-a568-40e2-aec3-75ad2f411688', + name: 'stringVar', + type: 'string', + value: 'showTab' + } + ] +); -export const tabVarFieldVisibilityJson = createTabVisibilityJson([ - createTab( - '71da814d-5580-4f1f-972a-8089253aeded', - 'tabBasicVarField', - createVisibilityCondition('variable', 'stringVar', undefined, 'TextOne', 'field') - ), - createTab('0e538a28-f8d6-4cb8-ae93-dbfb2efdf3b1', 'tabWithFields', null) -], fieldsDefinitions1, [ - { - id: '803269e6-a568-40e2-aec3-75ad2f411688', - name: 'stringVar', - type: 'string', - value: 'showTab' - } -]); +export const tabVarFieldVisibilityJson = createTabVisibilityJson( + [ + createTab( + '71da814d-5580-4f1f-972a-8089253aeded', + 'TABBASICVARFIELD', + createVisibilityCondition('variable', 'stringVar', undefined, 'TextOne', 'field') + ), + createTab('0e538a28-f8d6-4cb8-ae93-dbfb2efdf3b1', 'TABWITHFIELDS', null) + ], + fieldsDefinitions1, + [ + { + id: '803269e6-a568-40e2-aec3-75ad2f411688', + name: 'stringVar', + type: 'string', + value: 'showTab' + } + ] +); -export const tabFieldFieldVisibilityJson = createTabVisibilityJson([ - createTab( - '71da814d-5580-4f1f-972a-8089253aeded', - 'tabBasicFieldField', - createVisibilityCondition('field', 'TextThree', undefined, 'TextOne', 'field') - ), - createTab('442eea0b-65f9-484e-b37f-f5a91d5e1f21', 'tabWithFields', null) -], fieldsDefinitions2); +export const tabFieldFieldVisibilityJson = createTabVisibilityJson( + [ + createTab( + '71da814d-5580-4f1f-972a-8089253aeded', + 'TABBASICFIELDFIELD', + createVisibilityCondition('field', 'TextThree', undefined, 'TextOne', 'field') + ), + createTab('442eea0b-65f9-484e-b37f-f5a91d5e1f21', 'TABWITHFIELDS', null) + ], + fieldsDefinitions2 +); -export const tabFieldVarVisibilityJson = createTabVisibilityJson([ - createTab( - '71da814d-5580-4f1f-972a-8089253aeded', - 'tabBasicVarField', - createVisibilityCondition('field', 'TextOne', undefined, 'stringVar', 'variable') - ), - createTab('0e538a28-f8d6-4cb8-ae93-dbfb2efdf3b1', 'tabWithFields', null) -], fieldsDefinitions1, [ - { - id: '803269e6-a568-40e2-aec3-75ad2f411688', - name: 'stringVar', - type: 'string', - value: 'showTab' - } -]); +export const tabFieldVarVisibilityJson = createTabVisibilityJson( + [ + createTab( + '71da814d-5580-4f1f-972a-8089253aeded', + 'TABBASICVARFIELD', + createVisibilityCondition('field', 'TextOne', undefined, 'stringVar', 'variable') + ), + createTab('0e538a28-f8d6-4cb8-ae93-dbfb2efdf3b1', 'TABWITHFIELDS', null) + ], + fieldsDefinitions1, + [ + { + id: '803269e6-a568-40e2-aec3-75ad2f411688', + name: 'stringVar', + type: 'string', + value: 'showTab' + } + ] +); -export const tabVarVarVisibilityJson = createTabVisibilityJson([ - createTab( - 'ef512cb3-0c41-4d12-84ef-a7ef8f0b111a', - 'tabBasicVarVar', - createVisibilityCondition('variable', 'showTabOne', undefined, 'showTabTwo', 'variable') - ) -], [ - createFieldDefinition('6eeb9e54-e51d-44f3-9557-503308f07361', 'ef512cb3-0c41-4d12-84ef-a7ef8f0b111a', { - 1: [createField('TextOne', 'TextOne')], - 2: [] - }) -], [ - { - id: 'b116df99-f6b5-45f8-b48c-15b74f7f1c92', - name: 'showTabOne', - type: 'string', - value: 'showTab' - }, - { - id: '6e3e88ab-848c-4f48-8326-a404d1427f60', - name: 'showTabTwo', - type: 'string', - value: 'showTab' - } -]); +export const tabVarVarVisibilityJson = createTabVisibilityJson( + [ + createTab( + 'ef512cb3-0c41-4d12-84ef-a7ef8f0b111a', + 'TABBASICVARVAR', + createVisibilityCondition('variable', 'showTabOne', undefined, 'showTabTwo', 'variable') + ) + ], + [ + createFieldDefinition('6eeb9e54-e51d-44f3-9557-503308f07361', 'ef512cb3-0c41-4d12-84ef-a7ef8f0b111a', { + 1: [createField('TextOne', 'TextOne')], + 2: [] + }) + ], + [ + { + id: 'b116df99-f6b5-45f8-b48c-15b74f7f1c92', + name: 'showTabOne', + type: 'string', + value: 'showTab' + }, + { + id: '6e3e88ab-848c-4f48-8326-a404d1427f60', + name: 'showTabTwo', + type: 'string', + value: 'showTab' + } + ] +); -export const tabNextOperatorsVisibilityJson = createTabVisibilityJson([ - createTab( - '71da814d-5580-4f1f-972a-8089253aeded', - 'tabNextOperators', - createVisibilityCondition('field', 'TextOne', createVisibilityCondition('field', 'TextThree', null, 'showTab', 'value', '!=')) - ), - createTab('442eea0b-65f9-484e-b37f-f5a91d5e1f21', 'tabWithFields', null) -], fieldsDefinitions2); +export const tabNextOperatorsVisibilityJson = createTabVisibilityJson( + [ + createTab( + '71da814d-5580-4f1f-972a-8089253aeded', + 'TABNEXTOPERATORS', + createVisibilityCondition('field', 'TextOne', createVisibilityCondition('field', 'TextThree', null, 'showTab', 'value', '!=')) + ), + createTab('442eea0b-65f9-484e-b37f-f5a91d5e1f21', 'TABWITHFIELDS', null) + ], + fieldsDefinitions2 +); diff --git a/lib/testing/src/lib/protractor/process-services-cloud/resources/resources.ts b/lib/testing/src/lib/protractor/process-services-cloud/resources/resources.ts index c14990ac83c..96748ec9867 100644 --- a/lib/testing/src/lib/protractor/process-services-cloud/resources/resources.ts +++ b/lib/testing/src/lib/protractor/process-services-cloud/resources/resources.ts @@ -201,9 +201,9 @@ export const ACTIVITI_CLOUD_APPS = { tabVisibilityVars: { name: 'tabvisibilitywithvars', tabs: { - tabWithFields: 'tabWithFields', - tabVarVar: 'tabBasicVarVar', - tabBasicVarField: 'tabBasicVarField' + tabWithFields: 'TABWITHFIELDS', + tabVarVar: 'TABBASICVARVAR', + tabBasicVarField: 'TABBASICVARFIELD' }, widgets: { textOneId: 'TextOne', diff --git a/package-lock.json b/package-lock.json index 3927c4ade6a..2b51cf57372 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "@alfresco/js-api": ">=7.5.0", + "@alfresco/js-api": ">=7.8.0", "@angular/animations": "15.2.10", "@angular/cdk": "15.2.9", "@angular/common": "15.2.10", @@ -189,61 +189,15 @@ "link": true }, "node_modules/@alfresco/js-api": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@alfresco/js-api/-/js-api-7.7.0.tgz", - "integrity": "sha512-qD88MfQ+7fBv3vFi0Ju1oEaDAE9L+VxISlmpXZq1HYkBCNcSrqbFwi8ZCBPb3gZPnKG88edebTTqC6MYsusFmQ==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@alfresco/js-api/-/js-api-7.8.0.tgz", + "integrity": "sha512-3y5WwtvsEkwAB3WaFC9Ec+QMzvPmZccJ7Em06lVBDwxtFgZ1F2CisVNepWgZLoCSkCH8Lgm6e4Tr0L93S3AmoQ==", "dependencies": { "event-emitter": "^0.3.5", - "superagent": "^8.0.9", + "superagent": "^9.0.1", "tslib": "^2.6.1" } }, - "node_modules/@alfresco/js-api/node_modules/formidable": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/formidable/-/formidable-2.1.2.tgz", - "integrity": "sha512-CM3GuJ57US06mlpQ47YcunuUZ9jpm8Vx+P2CGt2j7HpgkKZO/DJYQ0Bobim8G6PFQmK5lOqOOdUXboU+h73A4g==", - "dependencies": { - "dezalgo": "^1.0.4", - "hexoid": "^1.0.0", - "once": "^1.4.0", - "qs": "^6.11.0" - }, - "funding": { - "url": "https://ko-fi.com/tunnckoCore/commissions" - } - }, - "node_modules/@alfresco/js-api/node_modules/mime": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz", - "integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==", - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/@alfresco/js-api/node_modules/superagent": { - "version": "8.1.2", - "resolved": "https://registry.npmjs.org/superagent/-/superagent-8.1.2.tgz", - "integrity": "sha512-6WTxW1EB6yCxV5VFOIPQruWGHqc3yI7hEmZK6h+pyk69Lk/Ut7rLUY6W/ONF2MjBuGjvmMiIpsrVJ2vjrHlslA==", - "deprecated": "Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net", - "dependencies": { - "component-emitter": "^1.3.0", - "cookiejar": "^2.1.4", - "debug": "^4.3.4", - "fast-safe-stringify": "^2.1.1", - "form-data": "^4.0.0", - "formidable": "^2.1.2", - "methods": "^1.1.2", - "mime": "2.6.0", - "qs": "^6.11.0", - "semver": "^7.3.8" - }, - "engines": { - "node": ">=6.4.0 <13 || >=14" - } - }, "node_modules/@ampproject/remapping": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz", diff --git a/package.json b/package.json index 03da2211dc3..1e6926ceeba 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "process services-cloud" ], "dependencies": { - "@alfresco/js-api": ">=7.5.0", + "@alfresco/js-api": ">=7.8.0", "@angular/animations": "15.2.10", "@angular/cdk": "15.2.9", "@angular/common": "15.2.10",