Commit d4006a68 authored by xjm's avatar xjm
Browse files

Issue #2917916 by arunkumark, Chi, yoroy: Improve usability of create action dropdown

parent 4d436529
......@@ -108,12 +108,12 @@ public function getDefaultOperations(EntityInterface $entity) {
* {@inheritdoc}
*/
public function render() {
$build['action_admin_manage_form'] = \Drupal::formBuilder()->getForm('Drupal\action\Form\ActionAdminManageForm');
$build['action_header']['#markup'] = '<h3>' . $this->t('Available actions:') . '</h3>';
$build['action_table'] = parent::render();
if (!$this->hasConfigurableActions) {
unset($build['action_table']['table']['#header']['operations']);
}
$build['action_admin_manage_form'] = \Drupal::formBuilder()->getForm('Drupal\action\Form\ActionAdminManageForm');
return $build;
}
......
......@@ -57,6 +57,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
$actions[$id] = $definition['label'];
}
}
asort($actions);
$form['parent'] = [
'#type' => 'details',
'#title' => $this->t('Create an advanced action'),
......@@ -68,7 +69,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
'#title' => $this->t('Action'),
'#title_display' => 'invisible',
'#options' => $actions,
'#empty_option' => $this->t('Choose an advanced action'),
'#empty_option' => $this->t('- Select -'),
];
$form['parent']['actions'] = [
'#type' => 'actions'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment