psi_mmobile

Untitled

Aug 26th, 2025
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. this.subscription.add(this.userRoles.subscribe((roles) => {
  2. this.allRoles = roles;
  3. }))
  4.  
  5. const filteredWBSRoles = this.allRoles.filter((role) =>
  6. role.wbs_ids?.includes(record.wbs_id)
  7. );
  8.  
  9. if (filteredWBSRoles.length > 0) {
  10. this.role = this.allRoles.reduce((returnedEntry, arrayItem) => {
  11. return (returnedEntry && returnedEntry.validation_status_id < arrayItem.validation_status_id &&
  12. arrayItem.wbs_ids.find((wbsId) => wbsId === record.wbs_id)
  13. ? arrayItem
  14. : returnedEntry;
  15. }, null);
  16.  
  17. const finalValidationStatusId = this.role ? this.role.validation_status_id : this.userValidationStatusId;
  18.  
  19. if (finalValidationStatusId === 80) {
  20. record.validated_by_val_op1_person_id === this.userDataService.profiled_person_id;
  21. }
  22. if (finalValidationStatusId === 81) {
  23. record.validated_by_val_op2_person_id === this.userDataService.profiled_person_id;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment