Skip to content
Snippets Groups Projects
Commit dfd10c86 authored by Andrei Mateescu's avatar Andrei Mateescu
Browse files

Improve the UX of the workspace state selector.

parent e3d1c8ff
No related branches found
No related tags found
No related merge requests found
......@@ -58,10 +58,24 @@ class EntityWorkflowWorkspaceListBuilder extends WseWorkspaceListBuilder {
}
$form['status']['#title'] = $this->t('State');
$form['status']['#options'] = $options;
$form['status']['#empty_option'] = $this->t('- All open -');;
return $form;
}
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
$url = new Url('<current>');
if ($status = $form_state->getValue('status')) {
$url->mergeOptions(['query' => ['status' => $status]]);;
}
$form_state->setRedirectUrl($url);
}
/**
* {@inheritdoc}
*/
......@@ -75,6 +89,9 @@ class EntityWorkflowWorkspaceListBuilder extends WseWorkspaceListBuilder {
return !$state || $state === $status;
});
}
else {
parent::filterByStatus($entities);
}
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment