-
Notifications
You must be signed in to change notification settings - Fork 358
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8844 from jeffibm/dialog-workflow-options
Introducing embedded_workflow to dynamic select box in service dialogs
- Loading branch information
Showing
8 changed files
with
124 additions
and
10 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
module Mixins | ||
module AutomationMixin | ||
# Returns an object to be reused for passing down to service catalogs(rails) and dialog(angular) form. | ||
# used in catalogs_helper, miq_ae_customization_helper, catalog_controller, editor.html.haml | ||
AUTOMATION_TYPES = { | ||
:automate => { | ||
:key => 'embedded_automate', | ||
:label => _('Embedded Automate'), | ||
:fields => ['ae_namespace', 'ae_class', 'ae_instance', 'ae_message', 'ae_attributes'], | ||
}, | ||
:workflow => { | ||
:key => 'embedded_workflow', | ||
:label => _('Embedded Workflow'), | ||
:fields => ['configuration_script_id', 'workflow_name'], | ||
}, | ||
}.freeze | ||
|
||
# Returns an array of entry point options. | ||
# used in provision_entry_points, retirement_entry_points, reconfigure_entry_points html files | ||
def automation_type_options | ||
options = [["<#{_('No Entry Point')}>", nil]] | ||
options + AUTOMATION_TYPES.values.map do |item| | ||
[item[:label], item[:key]] | ||
end | ||
end | ||
|
||
# Returns true if the field holds value 'embedded_automate' | ||
def embedded_automate(field) | ||
field == AUTOMATION_TYPES[:automate][:key] | ||
end | ||
|
||
# Returns true if the field holds value 'embedded_workflow' | ||
def embedded_workflow(field) | ||
field == AUTOMATION_TYPES[:workflow][:key] | ||
end | ||
|
||
# Returns the default automation type 'embedded_automate' | ||
def default_automation_type | ||
AUTOMATION_TYPES[:automate][:key] | ||
end | ||
end | ||
end |
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
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