-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(admin/datatable): use correct translation keys and crud overview #962
refactor(admin/datatable): use correct translation keys and crud overview #962
Conversation
@@ -32,7 +33,9 @@ public function index(Request $request): Response | |||
{ | |||
$table = $this->dataTableFactory->create(ChannelDataTableType::class); | |||
|
|||
$form = $this->createForm(TableType::class, $table); | |||
$form = $this->createForm(TableType::class, $table, [ | |||
'reorder_label' => t('type.reorder', ['type' => 'channel'],'emsco-core') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then the pattern 'channel' is not translatable ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
channel is just the type for the translation key and is translated
type:
reorder: |-
{type, select,
channel {Reorder channels}
other {Reorder}
}
More info about this format https://symfony.com/doc/current/reference/formats/message_format.html#selecting-different-messages-based-on-a-condition
); | ||
$table->addItemPostAction( | ||
route: 'ems_core_channel_delete', | ||
labelKey: t('action.delete', [], 'emsco-core'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is a constant for 'emsco-core'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the t() function with a constant makes that the crawler will not detect the key. To make our translations automatically build with php build/translations en EMSCoreBundle --write --format=yml -d emsco-core
we can not use constants as translation domain.
Toolbar can now be defined in the dataTableType
8b57c32
to
ae853cf
Compare
cdc1a45
to
aed4e07
Compare
2d068c4
to
903246e
Compare
b2fa6ff
to
9ab745f
Compare
It is the overview of the uploaded asset for publishers
Use UploadedAssetDataTableType for: - pick file from server (file field) - browser file (from wysiwyg ckeditor modal) - publisher overview. Because the uploadedAsset query should be same, grouped by hash.
- Improved routing actions and using constants. - /publisher checked by security.yaml - Renamed UploadedAssetLogDatatable to UploadedAssetAdminDataTableType.php
Remove unneeded nesting
level_name should be entity property levelName
and remove index.html.twig for crud/index.html.twig
Replaced the index templates for the following:
Extra:
Toolbar actions can now be defined in the dataTableType.
For the uploaded asset/file controller, I refactored the route naming using constants. The publisher and admin route actions are in the same controller, but now the action name is prefix (publisherOverview, adminOverview)
Reused the uploadedFileDataTable for wysiwyg modals, file pick modal and publisher overview. On all 3 places we a group by sha1. Only on the admin datatable (Uploaded file logs) we do not group by sha1.
Added a new DashboardDefinition enum