ManageIQ/manageiq-ui-classic

View on GitHub
app/views/miq_request/_prov_wf.html.haml

Summary

Maintainability
Test Coverage
-# wf                    The workflow object currently in use
-# dialog            The name (symbol) of the selected dialog
- if (@options && @options[:wf]) || (@edit && @edit[:wf])
  #prov_wf_div.miq_custom_tab_wrapper
    - options = @options || @edit[:new]
    - wf = options[:wf] || @edit[:wf]
    - tabname = (@tabactive || options[:current_tab_key]).to_s
    - prov_tab_labels, prov_tab_keys = provision_tab_configuration(wf)

    .miq_custom_tab_wrapper
      = react('MiqCustomTab', {:containerId => 'request-info-tabs',
                             :tabLabels => prov_tab_labels,
                             :type => 'CATALOG_REQUEST_INFO'})

    #request-info-tabs.miq_custom_tabs_container
      - current_tab = @edit && @edit[:new] ? @edit[:new][:current_tab_key] : @options[:current_tab_key]
      - prov_tab_keys.each do |dialog_name|
        = miq_tab_content(dialog_name, current_tab, :class => 'tab_content') do
          - if dialog_name == current_tab
            - dialog = wf.get_dialog(dialog_name)
            - unless dialog.blank? || dialog[:display] == :ignore
              - partial_locals = {:wf => wf, :dialog => dialog_name}

              - if wf.kind_of?(MiqProvisionWorkflow)
                = render :partial => "/shared/views/prov_dialog", :locals => partial_locals
              - elsif wf.kind_of?(VmMigrateWorkflow)
                = render :partial => "/miq_request/prov_vm_migrate_dialog", :locals => partial_locals