From d889b7895087e45de0ecc1e3107558c11962e2b2 Mon Sep 17 00:00:00 2001 From: Rafal Gamon Date: Sun, 13 Jun 2021 20:37:34 +0200 Subject: [PATCH 1/6] TASK #2075 | Add user settings placeholder --- .../client-support-angular/package-lock.json | 5 ----- core/src/UserSettingsEditor.html | 2 ++ .../externalMf/package-lock.json | 5 ----- test/e2e-test-application/package-lock.json | 20 ------------------- .../src/luigi-config/extended/userSettings.js | 8 +++++--- website/fiddle/package-lock.json | 20 ------------------- 6 files changed, 7 insertions(+), 53 deletions(-) diff --git a/client-frameworks-support/client-support-angular/package-lock.json b/client-frameworks-support/client-support-angular/package-lock.json index c03840c903..e1e7ab5db6 100644 --- a/client-frameworks-support/client-support-angular/package-lock.json +++ b/client-frameworks-support/client-support-angular/package-lock.json @@ -1529,11 +1529,6 @@ "schema-utils": "^2.7.0" } }, - "@luigi-project/client": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@luigi-project/client/-/client-1.6.0.tgz", - "integrity": "sha512-AmE9uMVtvTw+FbVFUTV70F5OzwJ6G1JzKRf3W+t+84JbeC0rQXtefK0+KWdeiTksSWDgCsF9qgGspdLgJtixVg==" - }, "@ngtools/webpack": { "version": "11.0.1", "resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-11.0.1.tgz", diff --git a/core/src/UserSettingsEditor.html b/core/src/UserSettingsEditor.html index f68ebab05a..b178df7fbc 100644 --- a/core/src/UserSettingsEditor.html +++ b/core/src/UserSettingsEditor.html @@ -155,6 +155,7 @@ class="fd-input" type="text" aria-label="Image label" + placeholder="{schemaItem.placeholder && schemaItem.placeholder}" data-testid="lui-us-input{i}" bind:value="{storedUserSettingData[userSettingGroup[0]][key]}" disabled="{schemaItem.isEditable===undefined || schemaItem.isEditable?false:true}" @@ -180,6 +181,7 @@ Date: Thu, 17 Jun 2021 10:29:22 +0200 Subject: [PATCH 2/6] 2075 | Add tests and translations --- core/src/UserSettingsEditor.html | 4 +- .../1-angular/user_settings_dialog.spec.js | 71 ++++++++++++++++++- 2 files changed, 70 insertions(+), 5 deletions(-) diff --git a/core/src/UserSettingsEditor.html b/core/src/UserSettingsEditor.html index b178df7fbc..722747e0a2 100644 --- a/core/src/UserSettingsEditor.html +++ b/core/src/UserSettingsEditor.html @@ -155,7 +155,7 @@ class="fd-input" type="text" aria-label="Image label" - placeholder="{schemaItem.placeholder && schemaItem.placeholder}" + placeholder="{schemaItem.placeholder && $getTranslation(schemaItem.placeholder)}" data-testid="lui-us-input{i}" bind:value="{storedUserSettingData[userSettingGroup[0]][key]}" disabled="{schemaItem.isEditable===undefined || schemaItem.isEditable?false:true}" @@ -181,7 +181,7 @@ { const setting_date_format = 'df_' + new Date().getTime(); const setting_privacy_policy = 'privacy_policy_' + new Date().getTime(); + it('Fill Account, Language and Reason, Privacy, should have placeholder', () => { + //Click on User Account + cy.get('[data-testid="us-navigation-item"]') + .eq(0) + .click(); + + //Check User Account is selected + cy.get('[data-testid="us-navigation-item"]') + .eq(0) + .should('have.class', 'is-selected'); + + //Check Name Input exist + cy.get('[data-testid="lui-us-input0"]').should('exist'); + + //Check Name Input has placeholder + cy.get('[data-testid="lui-us-input0"]') + .invoke('attr', 'placeholder') + .should('contain', 'Name'); + + //Click on Language & Region + cy.get('[data-testid="us-navigation-item"]') + .eq(1) + .click(); + + //Check Language & Region is selected + cy.get('[data-testid="us-navigation-item"]') + .eq(1) + .should('have.class', 'is-selected'); + + //Check Language and Region Input exist + cy.get('[data-testid="lui-us-input0"]').should('exist'); + + //Check Language and Region Input has placeholder + cy.get('[data-testid="lui-us-input0"]') + .invoke('attr', 'placeholder') + .should('contain', 'Language and Region'); + + //Check Date Format Input exist + cy.get('[data-testid="lui-us-input1"]').should('exist'); + + //Check Date Format Input has placeholder + cy.get('[data-testid="lui-us-input1"]') + .invoke('attr', 'placeholder') + .should('contain', 'DD-MM-YYYY'); + + //Click on Privacy + cy.get('[data-testid="us-navigation-item"]') + .eq(2) + .click(); + + //Click on Privacy + cy.get('[data-testid="us-navigation-item"]') + .eq(2) + .should('have.class', 'is-selected'); + + //Check Private Policy Input exist + cy.get('[data-testid="lui-us-input0"]').should('exist'); + + //Check Private Policy Input has placeholder + cy.get('[data-testid="lui-us-input0"]') + .invoke('attr', 'placeholder') + .should('contain', '...'); + + //Close settings + closeSettings(); + }); + it('Fill Account and save; reopen and check saved value', () => { //Click on User Account cy.get('[data-testid="us-navigation-item"]') @@ -169,9 +236,7 @@ describe('Navigation', () => { .click(); // //Check Private Policy Input field exist and placeholder is - cy.get('[data-testid="lui-us-input0"]') - .should('exist'); - + cy.get('[data-testid="lui-us-input0"]').should('exist'); //Check Private Policy Input field exist and placeholder is cy.get('[data-testid="lui-us-input0"]').type(setting_privacy_policy); From fb77d737f961c57c64862798bfa68c8c998ca455 Mon Sep 17 00:00:00 2001 From: Rafal Gamon Date: Thu, 17 Jun 2021 11:07:16 +0200 Subject: [PATCH 3/6] 2075 | Remove contructuion which check is value exist or not --- core/src/UserSettingsEditor.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/UserSettingsEditor.html b/core/src/UserSettingsEditor.html index 722747e0a2..3eae18f48a 100644 --- a/core/src/UserSettingsEditor.html +++ b/core/src/UserSettingsEditor.html @@ -155,7 +155,7 @@ class="fd-input" type="text" aria-label="Image label" - placeholder="{schemaItem.placeholder && $getTranslation(schemaItem.placeholder)}" + placeholder="{$getTranslation(schemaItem.placeholder)}" data-testid="lui-us-input{i}" bind:value="{storedUserSettingData[userSettingGroup[0]][key]}" disabled="{schemaItem.isEditable===undefined || schemaItem.isEditable?false:true}" @@ -181,7 +181,7 @@ Date: Fri, 18 Jun 2021 08:19:12 +0200 Subject: [PATCH 4/6] 2075 | Add placeholder to docs --- docs/user-settings.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/user-settings.md b/docs/user-settings.md index 040ef96a68..6ca2f28628 100644 --- a/docs/user-settings.md +++ b/docs/user-settings.md @@ -125,6 +125,7 @@ These parameters used in the example above allow you to configure the items in t - **label** (optional) is a string and the label of the setting. - **isEditable** (optional) is a boolean and by default `true`. If it is set to `false` the setting is not editable. + - *placeholder** (optional) is a string and by default `null`. If it is set to `Value` the placeholder is displaing `Value` the other hend notdsda. - **style** (optional) is a string and can be defined for the data types `boolean` and `enum`. Boolean will be rendered as switcher by default and it can be changed to `checkbox`. Enum will be rendered as dropdown by default and it can be changed to `button`, which means it will be rendered as a `segmented button`. - **options** is an array of options. It is mandatory and necessary if the data type is `enum`. It can be entries of primitive data types like string or integer or entries of objects. In this case the objects need `value` and `label` as key. From d0d278b914fe96822febf899db099812a8c1677b Mon Sep 17 00:00:00 2001 From: rafalgamon <85629258+rafalgamon@users.noreply.github.com> Date: Fri, 18 Jun 2021 10:23:16 +0200 Subject: [PATCH 5/6] Update docs/user-settings.md Co-authored-by: JohannesDoberer --- docs/user-settings.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-settings.md b/docs/user-settings.md index 6ca2f28628..cf6aed4d75 100644 --- a/docs/user-settings.md +++ b/docs/user-settings.md @@ -125,7 +125,7 @@ These parameters used in the example above allow you to configure the items in t - **label** (optional) is a string and the label of the setting. - **isEditable** (optional) is a boolean and by default `true`. If it is set to `false` the setting is not editable. - - *placeholder** (optional) is a string and by default `null`. If it is set to `Value` the placeholder is displaing `Value` the other hend notdsda. + - **placeholder** (optional) is a string and by default `null`. If it is set to `value` the placeholder is displaying the `value` the other hend notdsda. - **style** (optional) is a string and can be defined for the data types `boolean` and `enum`. Boolean will be rendered as switcher by default and it can be changed to `checkbox`. Enum will be rendered as dropdown by default and it can be changed to `button`, which means it will be rendered as a `segmented button`. - **options** is an array of options. It is mandatory and necessary if the data type is `enum`. It can be entries of primitive data types like string or integer or entries of objects. In this case the objects need `value` and `label` as key. From 635500754c6b9c03861be027e8e2c7caf097fe96 Mon Sep 17 00:00:00 2001 From: Rafal Gamon Date: Fri, 18 Jun 2021 10:37:57 +0200 Subject: [PATCH 6/6] 2075 | Fixed typo in user-settings --- docs/user-settings.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-settings.md b/docs/user-settings.md index cf6aed4d75..01f2a77864 100644 --- a/docs/user-settings.md +++ b/docs/user-settings.md @@ -125,7 +125,7 @@ These parameters used in the example above allow you to configure the items in t - **label** (optional) is a string and the label of the setting. - **isEditable** (optional) is a boolean and by default `true`. If it is set to `false` the setting is not editable. - - **placeholder** (optional) is a string and by default `null`. If it is set to `value` the placeholder is displaying the `value` the other hend notdsda. + - **placeholder** (optional) is a string and by default `null`. If it is set to `value` the placeholder is displaying the `value` the other hand no data. - **style** (optional) is a string and can be defined for the data types `boolean` and `enum`. Boolean will be rendered as switcher by default and it can be changed to `checkbox`. Enum will be rendered as dropdown by default and it can be changed to `button`, which means it will be rendered as a `segmented button`. - **options** is an array of options. It is mandatory and necessary if the data type is `enum`. It can be entries of primitive data types like string or integer or entries of objects. In this case the objects need `value` and `label` as key.