-
Notifications
You must be signed in to change notification settings - Fork 3
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
Added an option to add color to the learning path #382
Conversation
@@ -4,6 +4,7 @@ def change | |||
t.string :label, null: false | |||
t.string :description, null: false | |||
t.string :badge_id | |||
t.string :color, null: false |
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.
rather than adding this to an old file, we will need to add a new migration to add the new column. check this documentation on creating a new migration here and let me know if you have any questions. It should be pretty simple for adding just one column :)
You will have to remove these changes from this file and the populate_learning_path_data.rb
file as well
backend/db/structure.sql
Outdated
@@ -432,6 +432,7 @@ CREATE TABLE public.learning_paths ( | |||
label character varying NOT NULL, | |||
description character varying NOT NULL, | |||
badge_id character varying, | |||
color character varying NOT NULL, |
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 will get auto generated once you run the new migration file, so remove this
@@ -309,6 +320,41 @@ const LearningPathForm: FC<{ | |||
label='Order' | |||
{...form.getInputProps('order')} | |||
/> | |||
|
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.
One question for @iccgoncalves is will we allow for users to select custom colors as well? or only from this predefined list.
Regardless, mantine has a nifty little color input component that you can disallow input on and just set swatches of colors as the options
We can just use that disallowInput
prop whether or not we want them to have the ability to store custom colors. let me know what you think of this vs the combobox
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.
Thank you for this question @chrisbendel ;)
We do not want to allow for custom color selection - the provided list of colors is associated with the badges color, so we want to keep it within that list. Thanks so much!
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.
@chrisbendel Should I continue with the combobox or use the color input component
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.
@Coder-Srinivas i kinda like the look of the color picker - it looks a little simpler visually. would you be willing to try it out and see how it goes?
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.
Sure, I'll use the color picker
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.
I think the implementation of the component will be a bit simpler too, compared to the combobox
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, Combobox was a little difficult to implement
Looking good - just have to hit a couple of the comments I left! 😄 |
c9c6b83
to
c5583a7
Compare
@chrisbendel can you please review this PR, as this needs to be merged first for the study card redesign to be merged, as the borders for the mutli session cards are based on the color of the learning path |
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.
Looks good - feel free to merge!
Added an option for the admin to add color for a learning path, based on the ticket