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

Add columns enablement_expression and disabled_text to CustomButtons #29

Merged

Conversation

lpichler
Copy link
Contributor

@lpichler lpichler commented Jul 3, 2017

enablement_expression - it is for MiqExpression, which after
evaluation will say whether the button will be enabled or disabled

disabled_text - is for text which will be displayed when the
button will be disabled.

Links

https://www.pivotaltracker.com/n/projects/1608513/stories/147780727
Serialization is added here ManageIQ/manageiq#15502

@miq-bot add_label gaprindashvili

cc @gtanzillo
@miq-bot assign @Fryguy

@miq-bot
Copy link
Member

miq-bot commented Jul 3, 2017

@lpichler Cannot apply the following label because they are not recognized: gaprindashvili

@Fryguy
Copy link
Member

Fryguy commented Jul 3, 2017

it is for MiqExpression, which after evaluation will say whether the button will be enabled or disabled

As in it will contain a serialized MiqExpression?

class AddMiqExpressionEnableAndTextDisable < ActiveRecord::Migration[5.0]
def change
add_column :custom_buttons, :miq_expression_enable, :text
add_column :custom_buttons, :text_disable, :text
Copy link
Member

Choose a reason for hiding this comment

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

I'm thinking disabled_text sounds a little better. Otherwise it reads to me like "whether or not to disable the text portion of the button".

@@ -0,0 +1,6 @@
class AddMiqExpressionEnableAndTextDisable < ActiveRecord::Migration[5.0]
def change
add_column :custom_buttons, :miq_expression_enable, :text
Copy link
Member

Choose a reason for hiding this comment

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

I'm thinking enablement_expression or enablement_miq_expression. The word enable is a verb, so it feels weird to me when it's used as a noun/adjective.

Copy link
Contributor

Choose a reason for hiding this comment

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

We've been quite inconsistent with naming (thinking condition, filter, expression), but I think enablement_<one of those three> sounds good to me

Copy link
Member

Choose a reason for hiding this comment

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

Cool, now to decide which one of the 3 😆 ... I'm fine with just _expression

Copy link
Contributor

Choose a reason for hiding this comment

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

That sounds good to me!

@Fryguy
Copy link
Member

Fryguy commented Jul 3, 2017

@imtayadeway Thoughts on my comments above?

miq_expression_enable - it is for MiqExpression, which after
evaluation will say whether the button will be enabled or disabled

text_disabled - is for text which will be displayed when the
button will be disabled.
@lpichler lpichler force-pushed the AddMiqExpressionEnableAndTextDisabled branch from 7de8953 to 5b31b3b Compare July 13, 2017 09:02
@lpichler lpichler changed the title Add columns miq_expression_enable and text_disable to CustomButtons Add columns enablement_expression and disabled_text to CustomButtons Jul 13, 2017
@miq-bot
Copy link
Member

miq-bot commented Jul 13, 2017

Checked commit lpichler@5b31b3b with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
1 file checked, 0 offenses detected
Everything looks fine. 🍰

@lpichler
Copy link
Contributor Author

used disabled_text and enablement_expression @Fryguy @imtayadeway , thanks

@lpichler
Copy link
Contributor Author

it is for MiqExpression, which after evaluation will say whether the button will be enabled or disabled

As in it will contain a serialized MiqExpression?

@Fryguy yes, e.g.(like MiqReport#conditions):

 --- !ruby/object:MiqExpression  
 exp:                            
   and:                          
   - REGULAR EXPRESSION MATCHES: 
       field: VmCloud-vendor     
       value: "/amazon/i"        
   - "=":                        
       field: VmCloud-power_state
       value: 'on'

and serialization is added here ManageIQ/manageiq#15502

@Fryguy Fryguy merged commit f2065ca into ManageIQ:master Jul 17, 2017
@Fryguy Fryguy added this to the Sprint 65 Ending Jul 24, 2017 milestone Jul 17, 2017
@lpichler lpichler deleted the AddMiqExpressionEnableAndTextDisabled branch July 17, 2017 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants