[ACA-3728] Remove the filter name from the custom filter header (#5940)

* [ACA-3728] Remove the filter name from the custom filter header

* Updated docs
This commit is contained in:
Mercy Chrysolite
2020-08-03 16:22:18 +05:30
committed by GitHub
parent 85183ead0d
commit 76e8a5d52d
4 changed files with 18 additions and 1 deletions

View File

@@ -49,6 +49,7 @@ Edits task filter details.
| id | `string` | | (required) ID of the task filter. |
| role | `string` | "" | user role. |
| showFilterActions | `boolean` | true | Toggles the filter actions. |
| showTaskFilterName | `boolean` | true | Toggles display of task filter name |
| showTitle | `boolean` | true | Toggles the title. |
| sortProperties | `string[]` | | List of sort properties to display. |

View File

@@ -2,7 +2,7 @@
<mat-expansion-panel (afterExpand)="onExpand()" (closed)="onClose()">
<mat-expansion-panel-header *ngIf="taskFilter" id="adf-edit-task-filter-expansion-header">
<ng-container *ngIf="!isLoading; else loadingTemplate">
<mat-panel-title fxLayoutAlign="space-between center" id="adf-edit-task-filter-title-id">{{taskFilter.name | translate}}</mat-panel-title>
<mat-panel-title *ngIf="showTaskFilterName" fxLayoutAlign="space-between center" id="adf-edit-task-filter-title-id">{{taskFilter.name | translate}}</mat-panel-title>
<mat-panel-description fxLayoutAlign="space-between center" id="adf-edit-task-filter-sub-title-id">
<span *ngIf="showTitle">{{ 'ADF_CLOUD_EDIT_TASK_FILTER.TITLE' | translate}}</span>
<div *ngIf="showActions()" class="adf-cloud-edit-task-filter-actions">

View File

@@ -99,6 +99,18 @@ describe('EditTaskFilterCloudComponent', () => {
expect(subTitle.innerText.trim()).toEqual('ADF_CLOUD_EDIT_TASK_FILTER.TITLE');
}));
it('should not display filter name if showFilterName is false', async(() => {
const taskFilterIdChange = new SimpleChange(null, 'mock-task-filter-id', true);
component.showTaskFilterName = false;
component.ngOnChanges({ 'id': taskFilterIdChange });
fixture.detectChanges();
const title = fixture.debugElement.nativeElement.querySelector('#adf-edit-task-filter-title-id');
fixture.whenStable().then(() => {
expect(title).toBeNull();
});
}));
it('should not display mat-spinner if isloading set to false', async(() => {
const taskFilterIdChange = new SimpleChange(null, 'mock-task-filter-id', true);
component.ngOnChanges({ 'id': taskFilterIdChange });

View File

@@ -83,6 +83,10 @@ export class EditTaskFilterCloudComponent implements OnInit, OnChanges, OnDestro
@Input()
showTitle = true;
/** Toggles display of task filter name */
@Input()
showTaskFilterName = true;
/** Emitted when a task filter property changes. */
@Output()
filterChange: EventEmitter<TaskFilterCloudModel> = new EventEmitter();