-
Notifications
You must be signed in to change notification settings - Fork 897
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
Order custom buttons by array of ids #18060
Order custom buttons by array of ids #18060
Conversation
@simaishi so BZ https://bugzilla.redhat.com/show_bug.cgi?id=1628737 don't have merged last PR yet at this moment. |
end | ||
|
||
context 'by string column' do | ||
it 'orders by memory_shares column' do |
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.
Ordering by name here, right?
app/models/application_record.rb
Outdated
@@ -3,6 +3,11 @@ | |||
class ApplicationRecord < ActiveRecord::Base | |||
self.abstract_class = true | |||
|
|||
scope :with_array_order, lambda { |ids, column = :id, column_type = :bigint| |
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.
Do we need this is ApplicationRecord
?
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.
For this BZ no. Now we need it only for CustomButtonSet
model. But it looks to me as useful functionality so I put it here because we have user defined-order on more places.
What do you think? Where I should put it? Should I put it only to CustomButtonSet
model and then eventually in the future put it to the mixin?
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.
@bdunne Are you ok with leaving this in ApplicationRecord
? Seems like it wouldn't hurt to have it there.
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 guess so
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.
thanks, just small correction for what I wrote - it was about CustomButton
model
30ba222
to
8d1d914
Compare
Checked commits lpichler/manageiq@54de2a3~...8d1d914 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
looks good. Thx for fixing @lpichler |
8d1d914
to
cfb3c21
Compare
done, thanks @gtanzillo @bdunne @h-kataria @miq-bot assign @gtanzillo |
@lpichler unrecognized command 'unassign', ignoring... Accepted commands are: add_label, add_reviewer, assign, close_issue, move_issue, remove_label, rm_label, set_milestone |
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.
👍
@lpichler This causes a travis failure for UI classic:
According to https://www.postgresql.org/docs/9.4/static/functions-array.html vs https://www.postgresql.org/docs/9.5/static/functions-array.html, that function only appeared in postgres 9.5. Can you fix please? :) |
@carbonin Haven't we been running Postgres 9.5 since euwe branch? |
Yeah, I'm not sure why we're testing against 9.4 anywhere at this point. |
OK, so sounds like we can change the ui-classic travis to use 9.5 and close #18087 ? @bdunne Please note that So.. are we sure people know that 9.4 is not supported? :) (Also, we need to know when it was dropped, since this PR is gaprindashvili/yes.) |
Also, the last mention of PostgreSQL in the manageiq CHANGELOG points at #16171. Which is from last year, against gaprindashvili and explicitly states that 9.4 is supported. So far, looks like the only justification for #15994 was "because we can" and not "because we dropped 9.4". (That said, I definitely don't object to dropping 9.4, assuming EDIT for completenes: developer_setup also mentions 9.4, |
@carbonin yes, we would not face performance issues regard to count of custom buttons. So both solutions are usable. |
@himdel The appliance (which is the only way manageiq ships to users) is using 9.5 and has been for at least a year. If this is not what you are testing against then that is a problem and should be changed regardless of what the docs say. If the docs say that 9.4 is supported then maybe that is true for developers, but it is not the version that we are shipping in production so that should be made clear. |
IMO 9.4 is supported only as long as we're testing it. (posted on gitter hoping for stronger anwsers :)) @carbonin And does that mean that even gaprindashvili appliances are always 9.5? |
@himdel I'd say we drop support for a postgresql version the branch "After" we update appliances to use the newer version. Since we're at 9.5 in euwe, fine, gaprindashvili, and hammer, I'm 👍 to dropping 9.4 completely |
I am also 👍 for dropping 9.4. Especially if continuing to test with 9.4 means that we are not testing on 9.5 |
OK, looks like these are all that's needed to get rid of the remaining 9.4- references (except for vcr_cassettes and changelogs and blogposts for older versions):
|
…_of_ids Order custom buttons by array of ids (cherry picked from commit 4995683) https://bugzilla.redhat.com/show_bug.cgi?id=1628737
Hammer backport details:
|
…_of_ids Order custom buttons by array of ids (cherry picked from commit 4995683) https://bugzilla.redhat.com/show_bug.cgi?id=1635759
Gaprindashvili backport details:
|
…by_array_of_ids Order custom buttons by array of ids (cherry picked from commit 4995683) https://bugzilla.redhat.com/show_bug.cgi?id=1635759
This PR updates #18049 and replacing order.
There user defined order for custom buttons so order is determined by set of ids in
custom_button_set.set_data[:button_order]
(not by name)I used PostgreSQL for order.
Links
@miq-bot assign @bdunne
cc @gtanzillo
thanks @h-kataria
@miq-bot add_label hammer/yes, gaprindashvili/yes