added id attribute to elements

This commit is contained in:
Denis Duliçi
2022-09-06 13:54:56 +03:00
parent 862b905981
commit 7832680208
54 changed files with 278 additions and 153 deletions

View File

@ -70,7 +70,7 @@ class Company extends Eloquent implements Ownable
{
parent::boot();
try {
try {
// TODO will optimize..
static::retrieved(function($model) {
$model->setCommonSettingsAsAttributes();
@ -550,6 +550,9 @@ class Company extends Eloquent implements Ownable
'icon' => 'settings_ethernet',
'url' => route('companies.switch', $this->id),
'permission' => 'read-common-companies',
'attributes' => [
'id' => 'index-line-actions-switch-company-' . $this->id,
],
];
}
@ -558,6 +561,9 @@ class Company extends Eloquent implements Ownable
'icon' => 'edit',
'url' => route('companies.edit', $this->id),
'permission' => 'update-common-companies',
'attributes' => [
'id' => 'index-line-actions-edit-company-' . $this->id,
],
];
$actions[] = [
@ -565,6 +571,9 @@ class Company extends Eloquent implements Ownable
'icon' => 'delete',
'route' => 'companies.destroy',
'permission' => 'delete-common-companies',
'attributes' => [
'id' => 'index-line-actions-delete-company-' . $this->id,
],
'model' => $this,
];

View File

@ -291,6 +291,9 @@ class Contact extends Model
'icon' => 'visibility',
'url' => route($prefix . '.show', $this->id),
'permission' => 'read-' . $group . '-' . $permission_prefix,
'attributes' => [
'id' => 'index-line-actions-show-' . $this->type . '-' . $this->id,
],
];
} catch (\Exception $e) {}
@ -300,6 +303,9 @@ class Contact extends Model
'icon' => 'edit',
'url' => route($prefix . '.edit', $this->id),
'permission' => 'update-' . $group . '-' . $permission_prefix,
'attributes' => [
'id' => 'index-line-actions-edit-' . $this->type . '-' . $this->id,
],
];
} catch (\Exception $e) {}
@ -309,6 +315,9 @@ class Contact extends Model
'icon' => 'file_copy',
'url' => route($prefix . '.duplicate', $this->id),
'permission' => 'create-' . $group . '-' . $permission_prefix,
'attributes' => [
'id' => 'index-line-actions-duplicate-' . $this->type . '-' . $this->id,
],
];
} catch (\Exception $e) {}
@ -319,6 +328,9 @@ class Contact extends Model
'title' => $translation_prefix,
'route' => $prefix . '.destroy',
'permission' => 'delete-' . $group . '-' . $permission_prefix,
'attributes' => [
'id' => 'index-line-actions-delete-' . $this->type . '-' . $this->id,
],
'model' => $this,
];
} catch (\Exception $e) {}

View File

@ -129,6 +129,9 @@ class Dashboard extends Model
'icon' => 'settings_ethernet',
'url' => route('dashboards.switch', $this->id),
'permission' => 'read-common-dashboards',
'attributes' => [
'id' => 'index-line-actions-switch-dashboard-' . $this->id,
],
];
}
@ -137,6 +140,9 @@ class Dashboard extends Model
'icon' => 'edit',
'url' => route('dashboards.edit', $this->id),
'permission' => 'update-common-dashboards',
'attributes' => [
'id' => 'index-line-actions-edit-dashboard-' . $this->id,
],
];
$actions[] = [
@ -144,6 +150,9 @@ class Dashboard extends Model
'icon' => 'delete',
'route' => 'dashboards.destroy',
'permission' => 'delete-common-dashboards',
'attributes' => [
'id' => 'index-line-actions-delete-dashboard-' . $this->id,
],
'model' => $this,
];

View File

@ -174,6 +174,9 @@ class Item extends Model
'icon' => 'edit',
'url' => route('items.edit', $this->id),
'permission' => 'update-common-items',
'attributes' => [
'id' => 'index-line-actions-edit-item-' . $this->id,
],
];
$actions[] = [
@ -181,6 +184,9 @@ class Item extends Model
'icon' => 'file_copy',
'url' => route('items.duplicate', $this->id),
'permission' => 'create-common-items',
'attributes' => [
'id' => 'index-line-actions-duplicate-item-' . $this->id,
],
];
$actions[] = [
@ -188,6 +194,9 @@ class Item extends Model
'icon' => 'delete',
'route' => 'items.destroy',
'permission' => 'delete-common-items',
'attributes' => [
'id' => 'index-line-actions-delete-item-' . $this->id,
],
'model' => $this,
];