-
Notifications
You must be signed in to change notification settings - Fork 164
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
PLANNER-1752: Move frontend to Immutable.js #530
PLANNER-1752: Move frontend to Immutable.js #530
Conversation
Jenkins retest this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First round of review. Minor issues detected.
My IDE shows errors on some parts of the code but typecheck passes. I need to investigate this.
Otherwise looks nice. Minimal code changes given the API transition.
optaweb-employee-rostering-frontend/src/store/contract/reducers.ts
Outdated
Show resolved
Hide resolved
}); | ||
it('remove employee', () => { | ||
expect( | ||
reducer(state.employeeList, actions.removeEmployee(deletedEmployee)), | ||
).toEqual({ ...state.employeeList, | ||
employeeMapById: mapWithoutElement(storeState.employeeList.employeeMapById, deletedEmployee) }); | ||
employeeMapById: storeState.employeeList.employeeMapById.delete(deletedEmployee.id as number) }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively, you can say delete(deletedEmployee.id!)
. The exclamation mark is a non-null assertion. It's more concise and maybe a more precise type assertion. But we have an ESLint rule that complains about that. Dunno which of the two is worse.
optaweb-employee-rostering-frontend/src/ui/pages/contract/ContractsPage.test.tsx
Outdated
Show resolved
Hide resolved
5c97f69
to
f8c6cd1
Compare
optaweb-employee-rostering-frontend/src/ui/pages/shift/ExportScheduleModal.tsx
Outdated
Show resolved
Hide resolved
optaweb-employee-rostering-frontend/src/ui/pages/employee/EmployeesPage.tsx
Outdated
Show resolved
Hide resolved
721f00a
to
8544140
Compare
@yurloc thoughts on the current state of the PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for taking so long, I missed the update last week.
LGTM, one small comment.
TODO: - Update tests
Using the ?? operator allows us to throw errors instead of erasing type infomation and sliently ignoring any problem until it is too late.
All usage in the UI already converts the list into a mutable array, and they do not modify the mutable array, so it much more useful for the selector to directly return the mutable array.
8544140
to
57d90b8
Compare
Kudos, SonarCloud Quality Gate passed! |
JIRA
https://issues.redhat.com/browse/PLANNER-1752
Referenced pull requests
How to retest this PR or trigger a specific build: