Skip to content

Commit 891bd7f

Browse files
Add edit button to admin lists (#904)
1 parent 339b20a commit 891bd7f

4 files changed

Lines changed: 26 additions & 2 deletions

File tree

src/Admin/CategoryAdmin.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@ protected function configureListFields(ListMapper $list): void
100100
->add('position')
101101
->add('parent', null, [
102102
'sortable' => 'parent.name',
103+
])
104+
->add(ListMapper::NAME_ACTIONS, ListMapper::TYPE_ACTIONS, [
105+
'translation_domain' => 'SonataAdminBundle',
106+
'actions' => [
107+
'edit' => [],
108+
],
103109
]);
104110
}
105111
}

src/Admin/CollectionAdmin.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ protected function configureListFields(ListMapper $list): void
6565
])
6666
->add('enabled', null, [
6767
'editable' => true,
68+
])
69+
->add(ListMapper::NAME_ACTIONS, ListMapper::TYPE_ACTIONS, [
70+
'translation_domain' => 'SonataAdminBundle',
71+
'actions' => [
72+
'edit' => [],
73+
],
6874
]);
6975
}
7076
}

src/Admin/ContextAdmin.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ protected function configureListFields(ListMapper $list): void
5656
'editable' => true,
5757
])
5858
->add('createdAt')
59-
->add('updatedAt');
59+
->add('updatedAt')
60+
->add(ListMapper::NAME_ACTIONS, ListMapper::TYPE_ACTIONS, [
61+
'translation_domain' => 'SonataAdminBundle',
62+
'actions' => [
63+
'edit' => [],
64+
],
65+
]);
6066
}
6167
}

src/Admin/TagAdmin.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ protected function configureListFields(ListMapper $list): void
6060
])
6161
->add('enabled', null, ['editable' => true])
6262
->add('createdAt')
63-
->add('updatedAt');
63+
->add('updatedAt')
64+
->add(ListMapper::NAME_ACTIONS, ListMapper::TYPE_ACTIONS, [
65+
'translation_domain' => 'SonataAdminBundle',
66+
'actions' => [
67+
'edit' => [],
68+
],
69+
]);
6470
}
6571
}

0 commit comments

Comments
 (0)