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

[AAE-9186] Filter tasks by assignee #7784

Merged
merged 11 commits into from
Aug 26, 2022
Merged

Conversation

tomgny
Copy link
Contributor

@tomgny tomgny commented Aug 24, 2022

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce? (check one with "x")

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation
  • Other... Please describe:

What is the current behaviour? (You can also link to an open issue here)

What is the new behaviour?

Does this PR introduce a breaking change? (check one with "x")

  • Yes
  • No

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...

Other information:

case 'ASSIGNED':
this.assignmentType = AssignmentType.ASSIGNED_TO;
break;
case '':
Copy link
Contributor

Choose a reason for hiding this comment

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

is there such a case or is a typo? If there is do we need a break here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

useless case removed

}
};

export const mockIdentityUsers: IdentityUserModel[] = [{
Copy link
Contributor

Choose a reason for hiding this comment

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

  • You have added mockIdentityUsers obj inside a file that's called edit-task-filter-cloud.mock.ts
  • Have you checked if there are already mocks that you can use? I am pretty sure there are as these are quite common mock objects that we probably have tested elsewhere as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed mock to one from people-cloud mocks

expect(component.assignmentType).toEqual(AssignmentType.ASSIGNED_TO);
});

it('should empty status set assignment type to NONE', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

what's empty status? Something like ALL?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, it's equal ALL in this case. changed to ALL (+ used enum instead of string)

type: 'assignment',
attributes: { assignedUsers: 'assignedUsers', candidateGroups: 'candidateGroups'}
};
component.ngOnInit();
Copy link
Contributor

Choose a reason for hiding this comment

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

is there a way to avoid force calling ngOnInit and do fixture.detectChanges() instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed

expect(component.assignmentType).toEqual(AssignmentType.CANDIDATE_GROUPS);
});

it('should set assignment type to CANDIDATE_GROUPS if initial candidateGroups and assignedUsers exists', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

is that possible from the UI to have both candidate groups and assigned users in this filter?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no, unit test removed

this.assignedUsersChange.emit(users);
}

private changeAssignmentTypeByStatus(status: string) {
Copy link
Contributor

Choose a reason for hiding this comment

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

is there any enum about the status that we could use instead of string?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

used enum instead of string

if (assignmentChange.value === AssignmentType.CURRENT_USER) {
this.assignedUsersChange.emit([this.identityUserService.getCurrentUserInfo()]);
} else if (assignmentChange.value === AssignmentType.NONE) {
this.assignedUsersChange.emit(undefined);
Copy link
Contributor

Choose a reason for hiding this comment

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

could we emit an empty array instead of undefined? Would that be possible?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Copy link
Contributor

@arditdomi arditdomi left a comment

Choose a reason for hiding this comment

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

Good job 👍

@tomgny tomgny force-pushed the dev-tomgny-AAE-9186 branch from 7566dad to 499ed8f Compare August 25, 2022 22:54
@mauriziovitale mauriziovitale merged commit c7d7695 into develop Aug 26, 2022
@mauriziovitale mauriziovitale deleted the dev-tomgny-AAE-9186 branch August 26, 2022 11:53
@pr-triage pr-triage bot added the PR: merged label Aug 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants