mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-26 17:24:56 +00:00
[ADF-4797] - fix null value for display text when the field it's not visible (#4987)
* fix reset display text value when it's not visible * change invalid unit test * change unit test * use alpha to test
This commit is contained in:
parent
a8ef686cdd
commit
f9a8d3a4bf
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "Alfresco-ADF-Angular-Demo",
|
"name": "Alfresco-ADF-Angular-Demo",
|
||||||
"description": "Demo shell for Alfresco Angular components",
|
"description": "Demo shell for Alfresco Angular components",
|
||||||
"version": "3.4.0",
|
"version": "3.4.0-a8ef686cddc5364975fbddba68e6683305f47d42",
|
||||||
"author": "Alfresco Software, Ltd.",
|
"author": "Alfresco Software, Ltd.",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@alfresco/adf-cli",
|
"name": "@alfresco/adf-cli",
|
||||||
"description": "Alfresco ADF cli and utils",
|
"description": "Alfresco ADF cli and utils",
|
||||||
"version": "3.4.0",
|
"version": "3.4.0-a8ef686cddc5364975fbddba68e6683305f47d42",
|
||||||
"author": "Alfresco Software, Ltd.",
|
"author": "Alfresco Software, Ltd.",
|
||||||
"bin": {
|
"bin": {
|
||||||
"adf-license": "./bin/doc/licenseList.js",
|
"adf-license": "./bin/doc/licenseList.js",
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@alfresco/adf-content-services",
|
"name": "@alfresco/adf-content-services",
|
||||||
"description": "Alfresco ADF content services",
|
"description": "Alfresco ADF content services",
|
||||||
"version": "3.4.0",
|
"version": "3.4.0-a8ef686cddc5364975fbddba68e6683305f47d42",
|
||||||
"author": "Alfresco Software, Ltd.",
|
"author": "Alfresco Software, Ltd.",
|
||||||
"main": "bundles/adf-content-services.js",
|
"main": "bundles/adf-content-services.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
@ -27,7 +27,7 @@
|
|||||||
"@angular/router": ">=7.0.3",
|
"@angular/router": ">=7.0.3",
|
||||||
"@alfresco/js-api": "3.4.0",
|
"@alfresco/js-api": "3.4.0",
|
||||||
"rxjs": ">=6.2.2",
|
"rxjs": ">=6.2.2",
|
||||||
"@alfresco/adf-core": "3.4.0",
|
"@alfresco/adf-core": "3.4.0-a8ef686cddc5364975fbddba68e6683305f47d42",
|
||||||
"@ngx-translate/core": ">=11.0.0",
|
"@ngx-translate/core": ">=11.0.0",
|
||||||
"hammerjs": ">=2.0.8",
|
"hammerjs": ">=2.0.8",
|
||||||
"moment": ">=2.22.2",
|
"moment": ">=2.22.2",
|
||||||
|
@ -530,7 +530,7 @@ describe('WidgetVisibilityCloudService', () => {
|
|||||||
expect(fakeFormField.isVisible).toBeFalsy();
|
expect(fakeFormField.isVisible).toBeFalsy();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should reset value when the field is not visibile', () => {
|
it('should notreset value when the field is not visibile', () => {
|
||||||
visibilityObjTest.leftValue = 'test_1';
|
visibilityObjTest.leftValue = 'test_1';
|
||||||
visibilityObjTest.operator = '==';
|
visibilityObjTest.operator = '==';
|
||||||
visibilityObjTest.rightType = WidgetTypeEnum.field;
|
visibilityObjTest.rightType = WidgetTypeEnum.field;
|
||||||
@ -539,7 +539,7 @@ describe('WidgetVisibilityCloudService', () => {
|
|||||||
|
|
||||||
service.refreshEntityVisibility(fakeFormField);
|
service.refreshEntityVisibility(fakeFormField);
|
||||||
expect(fakeFormField.isVisible).toBeFalsy();
|
expect(fakeFormField.isVisible).toBeFalsy();
|
||||||
expect(fakeFormField.value).toEqual(null);
|
expect(fakeFormField.value).toEqual('FAKE_FORM_FIELD_VALUE');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return true when the visibility condition is not valid', () => {
|
it('should return true when the visibility condition is not valid', () => {
|
||||||
|
@ -914,7 +914,7 @@ describe('WidgetVisibilityService', () => {
|
|||||||
expect(contModel.isVisible).toBeFalsy();
|
expect(contModel.isVisible).toBeFalsy();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should set null value when the field is not visibile', () => {
|
it('should not set null value when the field is not visibile', () => {
|
||||||
visibilityObjTest.leftFormFieldId = 'test_4';
|
visibilityObjTest.leftFormFieldId = 'test_4';
|
||||||
visibilityObjTest.operator = '!=';
|
visibilityObjTest.operator = '!=';
|
||||||
visibilityObjTest.rightFormFieldId = 'dropdown';
|
visibilityObjTest.rightFormFieldId = 'dropdown';
|
||||||
@ -922,7 +922,7 @@ describe('WidgetVisibilityService', () => {
|
|||||||
|
|
||||||
service.refreshEntityVisibility(fakeFormField);
|
service.refreshEntityVisibility(fakeFormField);
|
||||||
expect(fakeFormField.isVisible).toBeFalsy();
|
expect(fakeFormField.isVisible).toBeFalsy();
|
||||||
expect(fakeFormField.value).toEqual(null);
|
expect(fakeFormField.value).toEqual('FAKE_FORM_FIELD_VALUE');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -48,9 +48,6 @@ export class WidgetVisibilityService {
|
|||||||
|
|
||||||
refreshEntityVisibility(element: FormFieldModel | TabModel) {
|
refreshEntityVisibility(element: FormFieldModel | TabModel) {
|
||||||
const visible = this.evaluateVisibility(element.form, element.visibilityCondition);
|
const visible = this.evaluateVisibility(element.form, element.visibilityCondition);
|
||||||
if (!visible && element instanceof FormFieldModel) {
|
|
||||||
element.value = null;
|
|
||||||
}
|
|
||||||
element.isVisible = visible;
|
element.isVisible = visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@alfresco/adf-core",
|
"name": "@alfresco/adf-core",
|
||||||
"description": "Alfresco ADF core",
|
"description": "Alfresco ADF core",
|
||||||
"version": "3.4.0",
|
"version": "3.4.0-a8ef686cddc5364975fbddba68e6683305f47d42",
|
||||||
"author": "Alfresco Software, Ltd.",
|
"author": "Alfresco Software, Ltd.",
|
||||||
"main": "bundles/adf-core.js",
|
"main": "bundles/adf-core.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@alfresco/adf-extensions",
|
"name": "@alfresco/adf-extensions",
|
||||||
"description": "Provides extensibility support for ADF applications.",
|
"description": "Provides extensibility support for ADF applications.",
|
||||||
"version": "3.4.0",
|
"version": "3.4.0-a8ef686cddc5364975fbddba68e6683305f47d42",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"author": "Alfresco Software, Ltd.",
|
"author": "Alfresco Software, Ltd.",
|
||||||
"main": "bundles/adf-extensions.js",
|
"main": "bundles/adf-extensions.js",
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@alfresco/adf-insights",
|
"name": "@alfresco/adf-insights",
|
||||||
"description": "Alfresco ADF insights",
|
"description": "Alfresco ADF insights",
|
||||||
"version": "3.4.0",
|
"version": "3.4.0-a8ef686cddc5364975fbddba68e6683305f47d42",
|
||||||
"author": "Alfresco Software, Ltd.",
|
"author": "Alfresco Software, Ltd.",
|
||||||
"main": "bundles/adf-insights.js",
|
"main": "bundles/adf-insights.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
@ -27,8 +27,8 @@
|
|||||||
"@angular/router": ">=7.0.3",
|
"@angular/router": ">=7.0.3",
|
||||||
"@alfresco/js-api": "3.4.0",
|
"@alfresco/js-api": "3.4.0",
|
||||||
"rxjs": ">=6.2.2",
|
"rxjs": ">=6.2.2",
|
||||||
"@alfresco/adf-core": "3.4.0",
|
"@alfresco/adf-core": "3.4.0-a8ef686cddc5364975fbddba68e6683305f47d42",
|
||||||
"@alfresco/adf-content-services": "3.4.0",
|
"@alfresco/adf-content-services": "3.4.0-a8ef686cddc5364975fbddba68e6683305f47d42",
|
||||||
"@ngx-translate/core": ">=11.0.0",
|
"@ngx-translate/core": ">=11.0.0",
|
||||||
"chart.js": ">=2.5.0",
|
"chart.js": ">=2.5.0",
|
||||||
"core-js": ">=2.5.4",
|
"core-js": ">=2.5.4",
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@alfresco/adf-process-services-cloud",
|
"name": "@alfresco/adf-process-services-cloud",
|
||||||
"description": "Alfresco ADF process services cloud",
|
"description": "Alfresco ADF process services cloud",
|
||||||
"version": "3.4.0",
|
"version": "3.4.0-a8ef686cddc5364975fbddba68e6683305f47d42",
|
||||||
"author": "Alfresco Software, Ltd.",
|
"author": "Alfresco Software, Ltd.",
|
||||||
"main": "bundles/adf-process-services-cloud.js",
|
"main": "bundles/adf-process-services-cloud.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
@ -27,8 +27,8 @@
|
|||||||
"@angular/router": ">=7.0.3",
|
"@angular/router": ">=7.0.3",
|
||||||
"@alfresco/js-api": "3.4.0",
|
"@alfresco/js-api": "3.4.0",
|
||||||
"rxjs": ">=6.2.2",
|
"rxjs": ">=6.2.2",
|
||||||
"@alfresco/adf-core": "3.4.0",
|
"@alfresco/adf-core": "3.4.0-a8ef686cddc5364975fbddba68e6683305f47d42",
|
||||||
"@alfresco/adf-content-services": "3.4.0",
|
"@alfresco/adf-content-services": "3.4.0-a8ef686cddc5364975fbddba68e6683305f47d42",
|
||||||
"@ngx-translate/core": ">=11.0.0",
|
"@ngx-translate/core": ">=11.0.0",
|
||||||
"hammerjs": ">=2.0.8",
|
"hammerjs": ">=2.0.8",
|
||||||
"moment": ">=2.22.2",
|
"moment": ">=2.22.2",
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@alfresco/adf-process-services",
|
"name": "@alfresco/adf-process-services",
|
||||||
"description": "Alfresco ADF process services",
|
"description": "Alfresco ADF process services",
|
||||||
"version": "3.4.0",
|
"version": "3.4.0-a8ef686cddc5364975fbddba68e6683305f47d42",
|
||||||
"author": "Alfresco Software, Ltd.",
|
"author": "Alfresco Software, Ltd.",
|
||||||
"main": "bundles/adf-process-services.js",
|
"main": "bundles/adf-process-services.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
@ -27,8 +27,8 @@
|
|||||||
"@angular/router": ">=7.0.3",
|
"@angular/router": ">=7.0.3",
|
||||||
"@alfresco/js-api": "3.4.0",
|
"@alfresco/js-api": "3.4.0",
|
||||||
"rxjs": ">=6.2.2",
|
"rxjs": ">=6.2.2",
|
||||||
"@alfresco/adf-core": "3.4.0",
|
"@alfresco/adf-core": "3.4.0-a8ef686cddc5364975fbddba68e6683305f47d42",
|
||||||
"@alfresco/adf-content-services": "3.4.0",
|
"@alfresco/adf-content-services": "3.4.0-a8ef686cddc5364975fbddba68e6683305f47d42",
|
||||||
"@ngx-translate/core": ">=11.0.0",
|
"@ngx-translate/core": ">=11.0.0",
|
||||||
"core-js": ">=2.5.4",
|
"core-js": ">=2.5.4",
|
||||||
"hammerjs": ">=2.0.8",
|
"hammerjs": ">=2.0.8",
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@alfresco/adf-testing",
|
"name": "@alfresco/adf-testing",
|
||||||
"description": "Alfresco ADF testing page and utils",
|
"description": "Alfresco ADF testing page and utils",
|
||||||
"version": "3.4.0",
|
"version": "3.4.0-a8ef686cddc5364975fbddba68e6683305f47d42",
|
||||||
"author": "Alfresco Software, Ltd.",
|
"author": "Alfresco Software, Ltd.",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
16
package.json
16
package.json
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "alfresco-components",
|
"name": "alfresco-components",
|
||||||
"description": "Alfresco Angular components",
|
"description": "Alfresco Angular components",
|
||||||
"version": "3.4.0",
|
"version": "3.4.0-a8ef686cddc5364975fbddba68e6683305f47d42",
|
||||||
"author": "Alfresco Software, Ltd.",
|
"author": "Alfresco Software, Ltd.",
|
||||||
"main": "./index.js",
|
"main": "./index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@ -73,13 +73,13 @@
|
|||||||
"process services-cloud"
|
"process services-cloud"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@alfresco/adf-content-services": "3.4.0",
|
"@alfresco/adf-content-services": "3.4.0-a8ef686cddc5364975fbddba68e6683305f47d42",
|
||||||
"@alfresco/adf-core": "3.4.0",
|
"@alfresco/adf-core": "3.4.0-a8ef686cddc5364975fbddba68e6683305f47d42",
|
||||||
"@alfresco/adf-extensions": "3.4.0",
|
"@alfresco/adf-extensions": "3.4.0-a8ef686cddc5364975fbddba68e6683305f47d42",
|
||||||
"@alfresco/adf-insights": "3.4.0",
|
"@alfresco/adf-insights": "3.4.0-a8ef686cddc5364975fbddba68e6683305f47d42",
|
||||||
"@alfresco/adf-process-services": "3.4.0",
|
"@alfresco/adf-process-services": "3.4.0-a8ef686cddc5364975fbddba68e6683305f47d42",
|
||||||
"@alfresco/adf-process-services-cloud": "3.4.0",
|
"@alfresco/adf-process-services-cloud": "3.4.0-a8ef686cddc5364975fbddba68e6683305f47d42",
|
||||||
"@alfresco/adf-testing": "3.4.0",
|
"@alfresco/adf-testing": "3.4.0-a8ef686cddc5364975fbddba68e6683305f47d42",
|
||||||
"@alfresco/js-api": "3.4.0",
|
"@alfresco/js-api": "3.4.0",
|
||||||
"@angular/animations": "^7.2.15",
|
"@angular/animations": "^7.2.15",
|
||||||
"@angular/cdk": "7.3.7",
|
"@angular/cdk": "7.3.7",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user