Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat] #7118, #7778: add popup, change manager name, provide optional responsible persons #3472

Conversation

yuliiakaras
Copy link
Collaborator

@@ -703,7 +701,7 @@ export class UbsAdminOrderComponent implements OnInit, OnDestroy, AfterContentCh
this.isFormResetted = true;
} else {
exportDetaisFields.forEach((el) => exportDetails.get(el).setValidators([Validators.required]));
responsiblePersonNames.forEach((el) => responsiblePersons.get(el).setValidators([Validators.required]));
responsiblePersons.get('responsibleCaller')?.setValidators([Validators.required]);
}
this.statusCanceledOrDone();
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected 1 arguments, but got 0:
this.destroy$.next();

return false;
}

if (requiredFields.includes(controlName)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'if' statement can be simplified

}
];
}

ngOnDestroy(): void {
this.destroy$.next();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected 1 arguments, but got 0.

this.save();
return;
}
const isCancelOption = ['Canceled', 'Скасовано'].includes(this.newOption);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By using the enums OrderStatusEn and OrderStatusUa and isStatusOption to categorize status options, the logic becomes more scalable and easier to maintain

  private isStatusOption(...options: string[]): boolean {
    return options.includes(this.newOption);
  }

} else if (isCancelOption) {
this.openCancelPopUp();
} else if (this.checkStatus && this.showPopUp) {
this.checkIfStatusConfirmed();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can simplify this condition by not creating checkIfStatusConfirmed.

const isConfirmedOption = this.isStatusOption(OrderStatusEn.CONFIRMED, OrderStatusUa.CONFIRMED);
...

} else if (this.checkStatus && this.showPopUp && !isConfirmedOption) {
    this.openPopUp();
  } else {
    this.save();
  }

@@ -1,6 +1,6 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
Copy link
Contributor

@Lokankara Lokankara Nov 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'async' is deprecated, use waitForAsync()

@hnativlyubomyr hnativlyubomyr merged commit 11e3c84 into prod-branch Dec 2, 2024
@hnativlyubomyr hnativlyubomyr deleted the feat/#7118-add-popup-change-name-change-adjustment-form branch December 2, 2024 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants