protected function getDefaultOperations(EntityInterface
$entity) { $operations =
[];
if ($entity->
access('update'
) &&
$entity->
hasLinkTemplate('edit-form'
)) { $operations['edit'
] =
[ 'title' =>
$this->
t('Edit'
),
'weight' => 10,
'url' =>
$this->
ensureDestination($entity->
toUrl('edit-form'
)),
];
} if ($entity->
access('delete'
) &&
$entity->
hasLinkTemplate('delete-form'
)) { $operations['delete'
] =
[ 'title' =>
$this->
t('Delete'
),
'weight' => 100,
'attributes' =>
[ 'class' =>
['use-ajax'
],
'data-dialog-type' => 'modal',
'data-dialog-options' => Json::
encode([ 'width' => 880,
]),