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

Allow user to erase classes from option more easily #341

Merged
merged 3 commits into from
Nov 18, 2024

Conversation

racoelhosilva
Copy link
Contributor

Erase classes easily

Added a button that erases all selected classes in the current option.
Design is based on the button from the CoursePicker modal.

Let me know your thoughts :)

(after approval) closes #319

Copy link

netlify bot commented Nov 17, 2024

Deploy Preview for tts-fe-preview ready!

Name Link
🔨 Latest commit c8cd03b
🔍 Latest deploy log https://app.netlify.com/sites/tts-fe-preview/deploys/673aeb67f7b09c0008b3c902
😎 Deploy Preview https://deploy-preview-341--tts-fe-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@racoelhosilva racoelhosilva self-assigned this Nov 17, 2024
Copy link
Contributor

@jose-carlos-sousa jose-carlos-sousa left a comment

Choose a reason for hiding this comment

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

Nice work :) . I have only one small concern I have noticed that if I choose one option, lock it and then I click the "limpar" button that option will be empty and locked without the possibility of unlocking. Imo one easy solution would be to add "locked: false" to each course option.
Screenshot from 2024-11-17 23-57-10
Screenshot from 2024-11-17 23-57-21

@racoelhosilva
Copy link
Contributor Author

racoelhosilva commented Nov 18, 2024

Nice work :) . I have only one small concern I have noticed that if I choose one option, lock it and then I click the "limpar" button that option will be empty and locked without the possibility of unlocking. Imo one easy solution would be to add "locked: false" to each course option. Screenshot from 2024-11-17 23-57-10 Screenshot from 2024-11-17 23-57-21

First of all, thank you and thanks for the suggestion.
I hadn't tested erasing classes with locked classes, but I think it makes sense to clear and unlock all classes when the button is clicked. I already added that fix.
I also noticed that the filtered teachers are not reset, but I believe the behavior is better like this since there is already a reset teachers button.

If you have have any other suggestions, please share them :)

Copy link
Member

@tomaspalma tomaspalma left a comment

Choose a reason for hiding this comment

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

Great work! 🚀

I just have one small thing to point out. I don't think it makes sense for the "Limpar" button to be visible when there is no class chosen in the current selectedOption entry inside the multipleOptions array.

I believe you just have to check if all of the entries inside multipleOptions[selectedOption].course_options are null and if so don't show the button

image

@tomaspalma
Copy link
Member

I also noticed that the filtered teachers are not reset, but I believe the behavior is better like this since there is already a reset teachers button.

I also agree with that

@jose-carlos-sousa
Copy link
Contributor

Great work! 🚀

I just have one small thing to point out. I don't think it makes sense for the "Limpar" button to be visible when there is no class chosen in the current selectedOption entry inside the multipleOptions array.

I believe you just have to check if all of the entries inside multipleOptions[selectedOption].course_options are null and if so don't show the button

image

To be honest, I don’t see an issue with this approach. It makes the layout more consistent, as it avoids frequently removing and re-adding the "Limpar" button. While clearing all options when none are selected might seem unnecessary, having the option available still makes sense for consistency and usability. Additionally, there are similar examples in tts—for instance, when selecting course units, the "Limpar" button remains visible even if no course units are selected.

@jose-carlos-sousa
Copy link
Contributor

Nice work :) . I have only one small concern I have noticed that if I choose one option, lock it and then I click the "limpar" button that option will be empty and locked without the possibility of unlocking. Imo one easy solution would be to add "locked: false" to each course option. Screenshot from 2024-11-17 23-57-10 Screenshot from 2024-11-17 23-57-21

First of all, thank you and thanks for the suggestion. I hadn't tested erasing classes with locked classes, but I think it makes sense to clear and unlock all classes when the button is clicked. I already added that fix. I also noticed that the filtered teachers are not reset, but I believe the behavior is better like this since there is already a reset teachers button.

If you have have any other suggestions, please share them :)

Thank you for addressing the changes :) Regarding the filtered teachers I also think that the current approach is fine and is consistent with the "remover seleção" option in the dropdown which also doesn't reset the filtered teachers.

@tomaspalma
Copy link
Member

Additionally, there are similar examples in tts—for instance, when selecting course units, the "Limpar" button remains visible even if no course units are selected.

That is no longer the case since PR #336 was merged into develop.

I agree that it is worse for consistency, but I don't think the changes will be that frequent since the "Limpar" button will not be one of the main things the users will be interacting with while choosing classes.

@jose-carlos-sousa
Copy link
Contributor

Additionally, there are similar examples in tts—for instance, when selecting course units, the "Limpar" button remains visible even if no course units are selected.

That is no longer the case since PR #336 was merged into develop.

I agree that it is worse for consistency, but I don't think the changes will be that frequent since the "Limpar" button will not be one of the main things the users will be interacting with while choosing classes.

I wasn’t referring to the "Remover Seleção" button; I was referring to the actual "Limpar" button in the CoursePicker. The "Remover Opção" button is fine because the user doesn’t actively see it disappearing—initially it isn't there, then you select an option and the next time you go there , the button appears.

However, with the "Limpar" button, it would appear and disappear in front of the user. While this might not happen very often and may not be a significant issue, I’m still more inclined to leave it as it is.

@tomaspalma tomaspalma self-requested a review November 18, 2024 15:19
@tomaspalma
Copy link
Member

I've decided to agree wtih you @jose-carlos-sousa

The "remover seleção" were occupying useful space in the dropdown so that's why they were removed.

However, this is not occupying that much space and will not be there for very long as the users will start choosing course units right away

Copy link
Member

@tomaspalma tomaspalma left a comment

Choose a reason for hiding this comment

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

You can merge it when you want to 🚀

Copy link
Contributor

@jose-carlos-sousa jose-carlos-sousa left a comment

Choose a reason for hiding this comment

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

LGTM :) 🚀

@racoelhosilva
Copy link
Contributor Author

I have been closely following this discussion (even mentioning it in person to @jose-carlos-sousa). I tried to apply the same logic used in the CoursePicker modal, and, in my opinion, it makes more sense for the button to always stay visible.
Thank you both for the review and approval :)

@racoelhosilva racoelhosilva merged commit 40c0da4 into develop Nov 18, 2024
5 checks passed
@racoelhosilva racoelhosilva deleted the feature/erase-classes branch November 18, 2024 15:43
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.

Allow user to erase classes from option more easily
3 participants