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

[UI] Add select2 to make select searchable #157

Merged
merged 2 commits into from
Jun 22, 2024

Conversation

anirudhprabhakaran3
Copy link
Member

Description

Make select fields searchable. This will be most useful in the case where we have a lot of options to choose from (e.g. selecting exec members)

Dependencies

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Visual testing!


Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Copy link

render bot commented Jun 11, 2024

@nishant-nayak
Copy link
Member

It looks like we have a grand total of 0 select fields across Corpus today. Do you know of any select fields that I can test this with? If not, I think we should hold onto this PR until we actually need the functionality.

It'll be more annoying if we merge this now and later on want to revert, we'll have to hunt for this PR and make a reverting fix.

@anirudhprabhakaran3
Copy link
Member Author

Yeah so, one place we can use this right now is in Virtual Expo, where reviewers are assigned. Currently on prod, it looks like this:

image

Its nearly impossible to select in this scenario.

Also for the groups dashboard, I am planning to make a UI where you can add members to a group, so that will also need this sort of a selection thing.

Although I agree that maybe this sort of a global change is not required - we just add that snippet in the places that we need it and no where else.

@nishant-nayak
Copy link
Member

nishant-nayak commented Jun 15, 2024

Thanks for the example. I just wanted to see how it looked with the current theming. Looks good to me!

This would be ~38kB of extra data being fetched on every page. While it might not be much, lets try to keep unnecessary fetches to a minimum?

Let's just keep these changes only in the files that need them, in the corresponding Django blocks (style/script)

@anirudhprabhakaran3
Copy link
Member Author

yup, sounds good

Copy link
Member

@nishant-nayak nishant-nayak left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for running linters on the base.html file too!

@anirudhprabhakaran3 anirudhprabhakaran3 merged commit 48d0866 into main Jun 22, 2024
1 check passed
@anirudhprabhakaran3 anirudhprabhakaran3 deleted the make_select_fields_searchable branch June 22, 2024 12:32
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.

2 participants