-
Notifications
You must be signed in to change notification settings - Fork 87
Require reference rating #6569
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
Require reference rating #6569
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
valueLabelFormat={(value) => <SliderLabel value={value} />} | ||
valueLabelFormat={() => <SliderLabel value={value} />} |
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.
As this change might be a bit confusing: I added a separate SliderLabel
icon when the value is undefined, however the value passed to the valueLabelFormat
callback is always a number (as a slider can't have an undefined value). So I'm using the value from the props. AFAIU this doesn't change anything, as the slider re-renders on value change anyway
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.
seems to be working as expected! Looks fantastic too! I included my suggestion for the error message text (but I'm not sure which json file the text should be stored in - Nicole would know!)
app/web/features/profile/view/leaveReference/formSteps/PrivateFeedback.tsx
Show resolved
Hide resolved
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.
This is fantastic! Love the new colors too!
LGTM, but have @nabramow take a look before merging
app/web/features/profile/view/leaveReference/formSteps/PrivateFeedback.tsx
Outdated
Show resolved
Hide resolved
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.
Just that one small nit, but I tested it with a real reference and was able to properly leave a review and trigger the error message. This looks great!
@@ -35,6 +35,8 @@ import { | |||
} from "routes"; | |||
import { theme } from "theme"; | |||
|
|||
const ACCEPTABLE_RATING_THRESHOLD = 0.33; |
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.
@nabramow I took a bit of an issue with that magic number so I extracted it into a constant. However I was not sure which case to use, there doesn't seem to be a consistent style for constants like this in the codebase. Lmk if this works for you, maybe ideally we should have a short style guide and/or stricter ESlint rules (e.g. naming-convention)? I personally love not having to think about stuff like that while coding 😄
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.
Yeah I agree building out the eslint rules more has been on my list for awhile! Just has always been more pressing matters ;-). The all caps is good! Feel free to throw that into a small PR for the naming-convention if you want!
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.
LGTM!
Makes the value of the rating slider on the reference page undefined by default and requires the user to change the value to go to the next step.
Also included are styling changes to better communicate the need to change the slider value:
As the rating is now required, the form will display an error message if it isn't set. I defined the key for the translation (profile:leave_reference.rating_required
), but the actual texts are still neededEdit: Text added
closes #6435
I tested this with the local backend by temporarily adding the following code to
LeaveReferencePage.tsx
right under theuseListAvailableReferences
call:Logging in with the Aapeli test account and then going to http://localhost:[port]/leave-reference/friend/2 opens the relevant page.
(There is probably a better way to test this, but this worked for me)
Regarding automated tests: I did not add any, as all of the files I touched up until now either had no tests at all or had no tests that were applicable to the code I changed. If desired, I will add some
Web frontend checklist
yarn format
yarn lint --fix
Other
Untick the following if you'd prefer that maintainers don't push commits/merge your branch.