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
custom profile field: Remove order column in custom-field-choices. #10160
Conversation
Hello @zulip/server-settings members, this pull request was labeled with the "area: settings (admin/org)" label, so you may want to check it out! |
@@ -23,7 +23,7 @@ | |||
</li> | |||
</ul> | |||
|
|||
<table class="table table-condensed table-striped admin_filters_table"> | |||
<table class="table table-condensed admin_filters_table"> |
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.
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, it was overriding style margin-top: 20px
so removed that class.
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.
Cool, a few thoughts on this:
(1) You should read about CSS precedence; there's a better way to ensure the CSS gets used.
(2) Generally, this sort of refactor to another component should go in its own commit, both to make it obvious you're changing another component, and also so there's a place for the explanation for why this is needed (i.e what you just sent).
I posted one comment; also, the dragging to reorder fields in the field-edit UI doesn't work for me (it only works in the "new field" UI). |
OK, I cleaned up that prepartory refactor commit as the 3 commits ending in aa14d24 and merged them, thanks for finding those issues @YJDave! And take a look to see what sort of commit style is best for refactoring; I know it feels laborious, but it's really easy to introduce random bugs in other parts of the UI by accident without either the developer or reviewer noticing without these practices. To save you a bit of potential rebase work, I pushed to this PR the remaining 2 commits; I'm going to wait on further review on them for you to fix the custom profile fields edit UI I mentioned in my last comment. Thanks @YJDave! |
Currently, admin user has to add order of custom-field-choice in input box to create and edit choice-type custom field. Remove this input boxes and add drag-drop list of custom-field-choices using Sortable.js. Fixes zulip#10129
cfc4188
to
990dd5d
Compare
Admin user must enter at least one choice for choice type fields in create new custom field form. Admin can not delete all choice options in form. Reset delete-btn of choice inputs on choice reordering so that admin can delete all choice except first choice input option.
@timabbott Thanks for reviewing and refactoring! Before, our edit-field-choice form in custom profile field settings Fix this issue by re-rendering field choices when admin user clicks |
Currently, our edit-field-choice form in custom profile field settings in admin UI, is rendered when settings modal is loaded not when admin user clicks on edit-btn. Admin user open edit-field-form of choice-type-field, do some changes in choices, discard those changes and close edit-field-form. When admin user again open this edit-field-form, those discarded changes are displayed, instead of original choices data. Fix this issue by re-rendering field choices when admin user clicks on edit-field-btn.
Heads up @YJDave, we just merged some commits that conflict with the changes your made in this pull request! You can review this repository's recent commits to see where the conflicts occur. Please rebase your feature branch against the |
Nice, this looks great, merged after adding a
|
This sounds good to me. |
This is removes order column in choices and add drag & drop type of rows for ordering.
Fixes #10129
GIFs or Screenshots:
Before:
After: