NIAEFEUP / nijobs-fe

[FRONTEND] A platform for companies to advertise their job opportunities to students
GNU General Public License v3.0
23 stars 3 forks source link

Quick offer edit actions collapsable in company offers management widget #315

Closed tomaspalma closed 5 months ago

tomaspalma commented 1 year ago

Closes #305

What was done

The only thing different than in the video is the fact that now instead of the text saying there is an error or "sucessfully updated", there is a snackbar.

Desktop View

https://user-images.githubusercontent.com/59887569/235507613-c4ccad5d-8fc1-436f-a3cc-485b36a00fd7.mp4

Mobile View

https://github.com/NIAEFEUP/nijobs-fe/assets/59887569/4b3a7a65-0114-43b1-97bc-87f9ea6008b3

Explanations

There was a lot of difficulty on establishing a direct relationship between the offer row and the collapsed quick edit because of the way the code is structured.

How is the offer publish end date being updated?

The CompanyOffersManagementWidget component has a local state called offers.

That state and its setter are passed to the newly created CollapsedQuickOfferEdit component.

When the publish end date is altered in the CollapsedQuickOfferEdit, this component changes the offer object pointing to the respective id of the offer, changes the value of the publishEndDate and it re-renders the component.

codecov-commenter commented 1 year ago

Codecov Report

Attention: Patch coverage is 91.17647% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 89.18%. Comparing base (afc9b67) to head (cb8f75d).

Files Patch % Lines
...onents/Company/Offers/Manage/QuickOfferEditForm.js 90.00% 3 Missing :warning:
...any/Offers/Manage/CompanyOffersManagementWidget.js 77.77% 2 Missing :warning:
...s/Company/Offers/Manage/CollapsedQuickOfferEdit.js 87.50% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #315 +/- ## =========================================== + Coverage 89.15% 89.18% +0.03% =========================================== Files 177 179 +2 Lines 3438 3485 +47 Branches 869 883 +14 =========================================== + Hits 3065 3108 +43 - Misses 373 377 +4 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.