Class: Hyrax::Admin::WorkflowRolePresenter

Inherits:
Object
  • Object
show all
Defined in:
app/presenters/hyrax/admin/workflow_role_presenter.rb

Overview

Displays a single workflow role

Instance Method Summary collapse

Constructor Details

#initialize(workflow_role) ⇒ WorkflowRolePresenter

Returns a new instance of WorkflowRolePresenter.



5
6
7
8
9
# File 'app/presenters/hyrax/admin/workflow_role_presenter.rb', line 5

def initialize(workflow_role)
  @workflow = workflow_role.workflow
  @role = workflow_role.role
  @admin_set_id = workflow.permission_template.admin_set_id
end

Instance Method Details

#labelString

TODO:

This is a hack; I don’t want to include reference to the admin set; However based on the current UI, in which we list all workflows (spanning all admin sets) this is required.

Returns A meaningful label for the given WorkflowRole.

Returns:

  • (String)

    A meaningful label for the given WorkflowRole



14
15
16
# File 'app/presenters/hyrax/admin/workflow_role_presenter.rb', line 14

def label
  "#{admin_set_label(admin_set_id)} - #{role.name} (#{workflow.name})"
end