ManageIQ/manageiq-ui-classic

View on GitHub
app/presenters/tree_node/miq_ae_domain.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
module TreeNode
  class MiqAeDomain < MiqAeNode
    include MiqAeClassHelper

    def text
      title = super
      editable_domain = editable_domain?(@object)
      enabled_domain  = @object.enabled

      unless editable_domain && enabled_domain
        title = add_read_only_suffix(title, editable_domain, enabled_domain)
      end

      title
    end

    set_attribute(:klass) { @object.enabled? ? nil : 'opacity' }
  end
end