AAE-30162 Don't retreive task filter if present (#10575)

This commit is contained in:
Robert Duda 2025-01-24 11:26:28 +01:00 committed by GitHub
parent 51f60535e3
commit dd1bbdffd6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 1 deletions

View File

@ -155,7 +155,13 @@ export abstract class BaseEditTaskFilterCloudComponent<T> implements OnInit, OnC
ngOnChanges(changes: SimpleChanges) {
const { id } = changes;
if (id && id.currentValue !== id.previousValue) {
this.retrieveTaskFilterAndBuildForm();
if (this.taskFilter) {
this.taskFilterProperties = this.createAndFilterProperties();
this.taskFilterActions = this.createAndFilterActions();
this.buildForm(this.taskFilterProperties);
} else {
this.retrieveTaskFilterAndBuildForm();
}
}
}

View File

@ -189,6 +189,7 @@ describe('EditServiceTaskFilterCloudComponent', () => {
describe('Save & Delete buttons', () => {
it('should disable save and delete button for default task filters', async () => {
component.taskFilter = undefined;
getTaskFilterSpy.and.returnValue(
of({
name: 'ADF_CLOUD_SERVICE_TASK_FILTERS.ALL_SERVICE_TASKS',

View File

@ -299,6 +299,7 @@ describe('EditTaskFilterCloudComponent', () => {
describe('Save & Delete buttons', () => {
it('should disable save and delete button for default task filters', async () => {
component.taskFilter = undefined;
getTaskFilterSpy.and.returnValue(of(mockDefaultTaskFilter));
component.ngOnChanges({ id: mockTaskFilterIdChange });