-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Bug/57508 custom fields with format string text bool link and date dont forbid multi select internally and have handling in ordering #16570
Merged
toy
merged 9 commits into
dev
from
bug/57508-custom-fields-with-format-string-text-bool-link-and-date-dont-forbid-multi-select-internally-and-have-handling-in-ordering
Sep 12, 2024
Merged
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
bb4f6b3
[#57508] Custom fields with format string, text, bool, link and date …
toy 960741b
it shouldn't be possible to order by text (long text) custom fields
toy f2d4d99
don't handle ordering of multi value custom fields with formats strin…
toy d89f3bd
no need to explicitly define accessors for multi_value? and allow_non…
toy 9382b12
simplify condition which uses CustomField#multi_value_possible?, as i…
toy 6badbd8
simplify condition which uses CustomField#allow_non_open_versions_pos…
toy e0c43c4
validate that multi_value is not set unless multi_value_possible? and…
toy 72bff94
remove custom field class check for multi_value and allow_non_open_ve…
toy 0b859db
use separate accessors instead of checking field_format against list …
toy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,7 +85,7 @@ See COPYRIGHT and LICENSE files for more details. | |
</span> | ||
</div> | ||
|
||
<% if @custom_field.new_record? || @custom_field.list? || @custom_field.multi_value_possible? %> | ||
<% if @custom_field.new_record? || @custom_field.multi_value_possible? %> | ||
<div class="form--field" <%= format_dependent.attributes(:multiSelect) %>> | ||
<%= f.check_box :multi_value, | ||
data: { action: 'admin--custom-fields#checkOnlyOne' } %> | ||
|
@@ -118,7 +118,7 @@ See COPYRIGHT and LICENSE files for more details. | |
</fieldset> | ||
<% end %> | ||
|
||
<% if @custom_field.new_record? || @custom_field.version? || @custom_field.allow_non_open_versions_possible? %> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the cleanup in here. It was confusing before. |
||
<% if @custom_field.new_record? || @custom_field.allow_non_open_versions_possible? %> | ||
<div class="form--field" <%= format_dependent.attributes(:allowNonOpenVersions) %>> | ||
<%= f.check_box :allow_non_open_versions %> | ||
</div> | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
You could also write it like this:
which would be more in line with the implemenation of
allow_non_open_versions_possible?
. But that is just an idea and not a necessity.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 also noticed it, but too quickly ignored probably thinking about efficiency, but
version? || user? || list?
is also more explicitThere 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.
Made me wonder, also not important in this case, but it is not even slower:
gives