You are here

public function MaestroTaskConsoleController::closeStatus in Maestro 8.2

Same name and namespace in other branches
  1. 3.x modules/maestro_taskconsole/src/Controller/MaestroTaskConsoleController.php \Drupal\maestro_taskconsole\Controller\MaestroTaskConsoleController::closeStatus()

Internal method to close the project status.

1 string reference to 'MaestroTaskConsoleController::closeStatus'
maestro_taskconsole.routing.yml in modules/maestro_taskconsole/maestro_taskconsole.routing.yml
modules/maestro_taskconsole/maestro_taskconsole.routing.yml

File

modules/maestro_taskconsole/src/Controller/MaestroTaskConsoleController.php, line 366

Class

MaestroTaskConsoleController
Maestro Task Console Controller.

Namespace

Drupal\maestro_taskconsole\Controller

Code

public function closeStatus($processID, $queueID) {
  $build = [];
  $build['expand'] = [
    '#attributes' => [
      'class' => [
        'maestro-timeline-status',
        'maestro-status-toggle',
      ],
      'title' => $this
        ->t('Open Details'),
    ],
    '#type' => 'link',
    '#id' => 'maestro-id-ajax-' . $queueID,
    '#url' => Url::fromRoute('maestro_taskconsole.status_ajax_open', [
      'processID' => $processID,
      'queueID' => $queueID,
    ]),
    '#title' => $this
      ->t('Open Details'),
    '#ajax' => [
      'progress' => [
        'type' => 'throbber',
        'message' => NULL,
      ],
    ],
  ];
  $response = new AjaxResponse();
  $response
    ->addCommand(new HtmlCommand('#maestro-ajax-' . $queueID, ''));
  $response
    ->addCommand(new HtmlCommand('.maestro-status-toggle-' . $queueID, $build['expand']));
  $response
    ->addCommand(new CssCommand('#' . $queueID . '_ajax', [
    'display' => 'none',
  ]));
  return $response;
}