mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
* Fixed theaming issue on the filters* Fixed fixed clear action default value. (#4980)
This commit is contained in:
committed by
Eugenio Romano
parent
e4426e61a0
commit
d51e22f9f4
@@ -93,11 +93,6 @@
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.mat-expansion-panel-header.mat-expanded .mat-expansion-panel-header-title {
|
||||
color: mat-color($primary);
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.adf-accordion-title-padding {
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
@@ -107,6 +107,7 @@ describe('CardViewDateItemComponent', () => {
|
||||
format: '',
|
||||
editable: true
|
||||
});
|
||||
component.displayClearAction = false;
|
||||
component.editable = true;
|
||||
fixture.detectChanges();
|
||||
|
||||
@@ -205,7 +206,7 @@ describe('CardViewDateItemComponent', () => {
|
||||
);
|
||||
}));
|
||||
|
||||
it('should render the clear icon in case of editable:true', () => {
|
||||
it('should render the clear icon in case of displayClearAction:true', () => {
|
||||
component.editable = true;
|
||||
component.property.editable = true;
|
||||
component.property.value = 'Jul 10 2017';
|
||||
@@ -225,7 +226,7 @@ describe('CardViewDateItemComponent', () => {
|
||||
expect(datePickerClearToggle).toBeNull('Clean Icon should not be in DOM');
|
||||
});
|
||||
|
||||
it('should not render the clear icon in case displayClearAction is set false', () => {
|
||||
it('should not render the clear icon in case of displayClearAction:false', () => {
|
||||
component.editable = true;
|
||||
component.property.editable = true;
|
||||
component.displayClearAction = false;
|
||||
@@ -250,4 +251,36 @@ describe('CardViewDateItemComponent', () => {
|
||||
}
|
||||
);
|
||||
}));
|
||||
|
||||
it('should remove the property default value after a successful clear attempt', async(() => {
|
||||
component.editable = true;
|
||||
component.property.editable = true;
|
||||
component.property.default = 'Jul 10 2017';
|
||||
fixture.detectChanges();
|
||||
|
||||
component.onDateClear();
|
||||
|
||||
fixture.whenStable().then(
|
||||
(updateNotification) => {
|
||||
expect(component.property.default).toBeNull();
|
||||
}
|
||||
);
|
||||
}));
|
||||
|
||||
it('should remove actual and default value after a successful clear attempt', async(() => {
|
||||
component.editable = true;
|
||||
component.property.editable = true;
|
||||
component.property.default = 'Jul 10 2017';
|
||||
component.property.value = 'Jul 10 2017';
|
||||
fixture.detectChanges();
|
||||
|
||||
component.onDateClear();
|
||||
|
||||
fixture.whenStable().then(
|
||||
(updateNotification) => {
|
||||
expect(component.property.value).toBeNull();
|
||||
expect(component.property.default).toBeNull();
|
||||
}
|
||||
);
|
||||
}));
|
||||
});
|
||||
|
@@ -91,15 +91,15 @@ export class CardViewDateItemComponent implements OnInit, OnDestroy {
|
||||
this.onDestroy$.complete();
|
||||
}
|
||||
|
||||
showProperty() {
|
||||
showProperty(): boolean {
|
||||
return this.displayEmpty || !this.property.isEmpty();
|
||||
}
|
||||
|
||||
showClearAction() {
|
||||
return !this.property.isEmpty() && this.displayClearAction;
|
||||
showClearAction(): boolean {
|
||||
return this.displayClearAction && (!this.property.isEmpty() || !!this.property.default);
|
||||
}
|
||||
|
||||
isEditable() {
|
||||
isEditable(): boolean {
|
||||
return this.editable && this.property.editable;
|
||||
}
|
||||
|
||||
@@ -122,6 +122,7 @@ export class CardViewDateItemComponent implements OnInit, OnDestroy {
|
||||
this.valueDate = null;
|
||||
this.cardViewUpdateService.update(this.property, null);
|
||||
this.property.value = null;
|
||||
this.property.default = null;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user