You are here

public function MaestroProcessStatusController::closeDetails in Maestro 3.x

Same name and namespace in other branches
  1. 8.2 src/Controller/MaestroProcessStatusController.php \Drupal\maestro\Controller\MaestroProcessStatusController::closeDetails()

Close Details method.

1 string reference to 'MaestroProcessStatusController::closeDetails'
maestro.routing.yml in ./maestro.routing.yml
maestro.routing.yml

File

src/Controller/MaestroProcessStatusController.php, line 115

Class

MaestroProcessStatusController
Maestro Process Status Controller class.

Namespace

Drupal\maestro\Controller

Code

public function closeDetails($processID) {
  $build = [];

  // We replace the up arrow with the down arrow.
  $build['expand'] = [
    '#attributes' => [
      'class' => [
        'maestro-timeline-status',
        'maestro-status-toggle',
      ],
      'title' => $this
        ->t('Open Details'),
    ],
    '#type' => 'link',
    '#id' => 'maestro-id-ajax-' . $processID,
    '#url' => Url::fromRoute('maestro.process_details_ajax_open', [
      'processID' => $processID,
    ]),
    '#title' => $this
      ->t('Open Details'),
    '#ajax' => [
      'progress' => [
        'type' => 'throbber',
        'message' => NULL,
      ],
    ],
  ];
  $response = new AjaxResponse();
  $response
    ->addCommand(new HtmlCommand('#maestro-ajax-' . $processID, ''));
  $response
    ->addCommand(new HtmlCommand('.maestro-status-toggle-' . $processID, $build['expand']));
  $response
    ->addCommand(new CssCommand('#details_replace_row_' . $processID, [
    'display' => 'none',
  ]));
  return $response;
}