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: implement the existing alteration list and alteration deletion for the applicant (HL-1154) #2925

Merged
merged 8 commits into from
Apr 11, 2024

Conversation

EmiliaMakelaVincit
Copy link
Collaborator

Additional notes πŸ—’οΈ

In this PR, the DELETE REST endpoint is restricted for the use of the applicant only. It will be enabled for handlers later once the handler side progresses to that point.

@terovirtanen
Copy link
Contributor

API branch is deployed to platta: https://kesaseteli-pr2925.api.dev.hel.ninja/healthz πŸš€πŸš€πŸš€

@terovirtanen
Copy link
Contributor

API branch is deployed to platta: https://tet-pr2925.api.dev.hel.ninja/healthz πŸš€πŸš€πŸš€

@terovirtanen
Copy link
Contributor

EMPLOYER branch is deployed to platta: https://kesaseteli-employer-pr2925.dev.hel.ninja πŸš€πŸš€πŸš€

@terovirtanen
Copy link
Contributor

ADMIN branch is deployed to platta: https://tet-admin-ui-pr2925.dev.hel.ninja πŸš€πŸš€πŸš€

@terovirtanen
Copy link
Contributor

APPLICANT branch is deployed to platta: https://helsinkilisa-ui-pr2925.dev.hel.ninja πŸš€πŸš€πŸš€

@terovirtanen
Copy link
Contributor

API branch is deployed to platta: https://helsinkilisa-pr2925.api.dev.hel.ninja/healthz πŸš€πŸš€πŸš€

@terovirtanen
Copy link
Contributor

TestCafe result is success for https://tet-admin-ui-pr2925.dev.hel.ninja πŸ˜†πŸŽ‰πŸŽ‰πŸŽ‰

@terovirtanen
Copy link
Contributor

HANDLER branch is deployed to platta: https://helsinkilisa-ui-handler-pr2925.dev.hel.ninja πŸš€πŸš€πŸš€

@terovirtanen
Copy link
Contributor

TestCafe result is success for https://kesaseteli-employer-pr2925.dev.hel.ninja πŸ˜†πŸŽ‰πŸŽ‰πŸŽ‰

@terovirtanen
Copy link
Contributor

TestCafe result is success for https://helsinkilisa-ui-pr2925.dev.hel.ninja πŸ˜†πŸŽ‰πŸŽ‰πŸŽ‰

@terovirtanen
Copy link
Contributor

TestCafe handler result is failed for https://helsinkilisa-ui-handler-pr2925.dev.hel.ninja πŸ˜ΏπŸ’’πŸ’₯πŸ’₯

@terovirtanen
Copy link
Contributor

HANDLER branch is deployed to platta: https://kesaseteli-handler-pr2925.dev.hel.ninja πŸš€πŸš€πŸš€

@terovirtanen
Copy link
Contributor

TestCafe result is success for https://kesaseteli-handler-pr2925.dev.hel.ninja πŸ˜†πŸŽ‰πŸŽ‰πŸŽ‰

@terovirtanen
Copy link
Contributor

YOUTH branch is deployed to platta: https://tet-youth-ui-pr2925.dev.hel.ninja πŸš€πŸš€πŸš€

@terovirtanen
Copy link
Contributor

TestCafe result is success for https://tet-youth-ui-pr2925.dev.hel.ninja πŸ˜†πŸŽ‰πŸŽ‰πŸŽ‰

@terovirtanen
Copy link
Contributor

YOUTH branch is deployed to platta: https://kesaseteli-youth-pr2925.dev.hel.ninja πŸš€πŸš€πŸš€

@terovirtanen
Copy link
Contributor

TestCafe result is success for https://kesaseteli-youth-pr2925.dev.hel.ninja πŸ˜†πŸŽ‰πŸŽ‰πŸŽ‰

@terovirtanen
Copy link
Contributor

TestCafe handler result is failed for https://helsinkilisa-ui-handler-pr2925.dev.hel.ninja πŸ˜ΏπŸ’’πŸ’₯πŸ’₯

Copy link
Collaborator

@sirtawast sirtawast left a comment

Choose a reason for hiding this comment

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

Other than what's commented, LGTM πŸ‘

if company != alteration.application.company:
raise PermissionDenied(_("You are not allowed to do this action"))

if request.user.is_handler():
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can use rest framework's permission_classes = [BFIsHandler] on the viewset level. Or is the API shared with applicant?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry vice versa so BFIsApplicant in this case.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd say if they're shared, or plan to share then decouple as applicant and handler viewset. Otherwise role checking becomes swiss cheese if permission_class is not used.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Both currently use the same API, yeah. Splitting doesn't sound like a bad idea, so I should do that – I'll do so in the following PRs during the handler side implementation. I'll have to take a closer look at the application list where that already exists but I imagine it should be pretty straightforward.

@@ -48,6 +50,16 @@ const DecisionSummary = ({ application }: Props): JSX.Element => {
alteration.alterationType === ALTERATION_TYPE.TERMINATION
);

const sortedAlterations = application.alterations?.sort((a, b) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

return new Date(a.endDate) - new Date(b.endDate) is enough in JS πŸ˜‰

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah, right, that's true. I'll simplify it to that.

@terovirtanen
Copy link
Contributor

API branch is deployed to platta: https://kesaseteli-pr2925.api.dev.hel.ninja/healthz πŸš€πŸš€πŸš€

@terovirtanen
Copy link
Contributor

API branch is deployed to platta: https://tet-pr2925.api.dev.hel.ninja/healthz πŸš€πŸš€πŸš€

@terovirtanen
Copy link
Contributor

ADMIN branch is deployed to platta: https://tet-admin-ui-pr2925.dev.hel.ninja πŸš€πŸš€πŸš€

@terovirtanen
Copy link
Contributor

TestCafe admin result is failed for https://tet-admin-ui-pr2925.dev.hel.ninja πŸ˜ΏπŸ’’πŸ’₯πŸ’₯

@terovirtanen
Copy link
Contributor

EMPLOYER branch is deployed to platta: https://kesaseteli-employer-pr2925.dev.hel.ninja πŸš€πŸš€πŸš€

@terovirtanen
Copy link
Contributor

APPLICANT branch is deployed to platta: https://helsinkilisa-ui-pr2925.dev.hel.ninja πŸš€πŸš€πŸš€

@terovirtanen
Copy link
Contributor

API branch is deployed to platta: https://helsinkilisa-pr2925.api.dev.hel.ninja/healthz πŸš€πŸš€πŸš€

@terovirtanen
Copy link
Contributor

HANDLER branch is deployed to platta: https://helsinkilisa-ui-handler-pr2925.dev.hel.ninja πŸš€πŸš€πŸš€

Copy link

sonarcloud bot commented Apr 11, 2024

Quality Gate Passed Quality Gate passed for 'yjdh'

Issues
22 New issues
7 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.4% Duplication on New Code

See analysis details on SonarCloud

Copy link

sonarcloud bot commented Apr 11, 2024

Quality Gate Passed Quality Gate passed for 'yjdh'

Issues
13 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link

sonarcloud bot commented Apr 11, 2024

Copy link

sonarcloud bot commented Apr 11, 2024

Copy link

sonarcloud bot commented Apr 11, 2024

Copy link

sonarcloud bot commented Apr 11, 2024

@terovirtanen
Copy link
Contributor

API branch is deployed to platta: https://kesaseteli-pr2925.api.dev.hel.ninja/healthz πŸš€πŸš€πŸš€

Copy link

sonarcloud bot commented Apr 11, 2024

@terovirtanen
Copy link
Contributor

API branch is deployed to platta: https://tet-pr2925.api.dev.hel.ninja/healthz πŸš€πŸš€πŸš€

Copy link

sonarcloud bot commented Apr 11, 2024

Copy link

sonarcloud bot commented Apr 11, 2024

Quality Gate Failed Quality Gate failed for 'yjdh'

Failed conditions
33.3% Coverage on New Code (required β‰₯ 65%)

See analysis details on SonarCloud

@terovirtanen
Copy link
Contributor

ADMIN branch is deployed to platta: https://tet-admin-ui-pr2925.dev.hel.ninja πŸš€πŸš€πŸš€

@terovirtanen
Copy link
Contributor

APPLICANT branch is deployed to platta: https://helsinkilisa-ui-pr2925.dev.hel.ninja πŸš€πŸš€πŸš€

@terovirtanen
Copy link
Contributor

API branch is deployed to platta: https://helsinkilisa-pr2925.api.dev.hel.ninja/healthz πŸš€πŸš€πŸš€

@terovirtanen
Copy link
Contributor

TestCafe result is success for https://tet-admin-ui-pr2925.dev.hel.ninja πŸ˜†πŸŽ‰πŸŽ‰πŸŽ‰

@terovirtanen
Copy link
Contributor

EMPLOYER branch is deployed to platta: https://kesaseteli-employer-pr2925.dev.hel.ninja πŸš€πŸš€πŸš€

@terovirtanen
Copy link
Contributor

TestCafe result is success for https://helsinkilisa-ui-pr2925.dev.hel.ninja πŸ˜†πŸŽ‰πŸŽ‰πŸŽ‰

@terovirtanen
Copy link
Contributor

HANDLER branch is deployed to platta: https://helsinkilisa-ui-handler-pr2925.dev.hel.ninja πŸš€πŸš€πŸš€

@terovirtanen
Copy link
Contributor

TestCafe result is success for https://kesaseteli-employer-pr2925.dev.hel.ninja πŸ˜†πŸŽ‰πŸŽ‰πŸŽ‰

@terovirtanen
Copy link
Contributor

TestCafe result is success for https://helsinkilisa-ui-handler-pr2925.dev.hel.ninja πŸ˜†πŸŽ‰πŸŽ‰πŸŽ‰

@terovirtanen
Copy link
Contributor

HANDLER branch is deployed to platta: https://kesaseteli-handler-pr2925.dev.hel.ninja πŸš€πŸš€πŸš€

@terovirtanen
Copy link
Contributor

TestCafe result is success for https://kesaseteli-handler-pr2925.dev.hel.ninja πŸ˜†πŸŽ‰πŸŽ‰πŸŽ‰

@terovirtanen
Copy link
Contributor

YOUTH branch is deployed to platta: https://tet-youth-ui-pr2925.dev.hel.ninja πŸš€πŸš€πŸš€

@terovirtanen
Copy link
Contributor

TestCafe result is success for https://tet-youth-ui-pr2925.dev.hel.ninja πŸ˜†πŸŽ‰πŸŽ‰πŸŽ‰

@terovirtanen
Copy link
Contributor

YOUTH branch is deployed to platta: https://kesaseteli-youth-pr2925.dev.hel.ninja πŸš€πŸš€πŸš€

@terovirtanen
Copy link
Contributor

TestCafe result is success for https://kesaseteli-youth-pr2925.dev.hel.ninja πŸ˜†πŸŽ‰πŸŽ‰πŸŽ‰

@EmiliaMakelaVincit EmiliaMakelaVincit merged commit aea007f into main Apr 11, 2024
196 of 197 checks passed
@EmiliaMakelaVincit EmiliaMakelaVincit deleted the HL-1154-submitted-alteration-list branch April 11, 2024 14:27
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.

None yet

3 participants