Skip to content

Commit

Permalink
Improve row actions for Provisioning Status page (CFM-280) (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
arlen authored Aug 3, 2023
1 parent afd5ab2 commit e892c37
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 35 deletions.
3 changes: 3 additions & 0 deletions app/resources/locales/en_US/operation.po
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ msgstr "Make Primary"
msgid "provision"
msgstr "Provision Now"

msgid "provision.confirm"
msgstr "Are you sure you want to run provisioning?"

msgid "provisioning.status"
msgstr "Provisioning Status"

Expand Down
75 changes: 40 additions & 35 deletions app/templates/ProvisioningTargets/status.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,10 @@

<!-- Our view is similar to index.php -->
<div class="table-container">
<?php
$indexTableClasses = 'index-table list-mode';
if (!empty($rowActions)) {
$indexTableClasses .= ' with-actions';
}
?>
<table id="<?= 'provisioningstatus-table'; ?>" class="<?= $indexTableClasses; ?>">
<table id="provisioningstatus-table" class="index-table list-mode with-actions">
<thead>
<tr>
<th class="actions"></th>
<td class="actions"></td>
<th><?= __d('controller', 'ProvisioningTargets', [1]); ?></th>
<th><?= __d('field', 'status'); ?></th>
<th><?= __d('field', 'comment'); ?></th>
Expand All @@ -74,34 +68,45 @@
</tbody>
<?php foreach($vv_provisioning_statuses as $p): ?>
<tr>
<td>
<!-- JIRA to merge this with menuActions, also to throw up "Are you sure?" -->
<a class="field-actions-menu" href="<?=
$this->Url->build([
'controller' => $vv_primary_link_model,
'action' => 'provision',
$vv_primary_link_obj->id,
'?' => [
'provisioning_target_id' => $p['target']->id
<td class="actions">
<div class="field-actions">
<!-- CFM-305 -- JIRA to throw up "Are you sure?" - also to simplify all the below -->
<?php
// Build the row actions
$action_args = array();
$action_args['vv_attr_id'] = $p['target']->id;
$action_args['vv_actions'] = [
[
'order' => $this->Menu->getMenuOrder('Default'),
'icon' => 'start',
'url' => $this->Url->build([
'controller' => $vv_primary_link_model,
'action' => 'provision',
$vv_primary_link_obj->id,
'?' => [
'provisioning_target_id' => $p['target']->id
]
]),
'label' => __d('operation', 'provision')
],
[
'order' => $this->Menu->getMenuOrder('Default'),
'icon' => 'history',
'url' => $this->Url->build([
'controller' => 'provisioning_history_records',
'action' => 'index',
'?' => [
'provisioning_target_id' => $p['target']->id,
StringUtilities::entityToForeignKey($vv_primary_link_obj) => $vv_primary_link_obj->id
]
]),
'label' => __d('controller', 'ProvisioningHistoryRecords', [99])
]
]);
?>">
<em class="material-icons">start</em>
<?= __d('operation', 'provision'); ?>
</a>
<a class="field-actions-menu" href="<?=
$this->Url->build([
'controller' => 'provisioning_history_records',
'action' => 'index',
'?' => [
'provisioning_target_id' => $p['target']->id,
StringUtilities::entityToForeignKey($vv_primary_link_obj) => $vv_primary_link_obj->id
]
]);
?>">
<em class="material-icons">history</em>
<?= __d('controller', 'ProvisioningHistoryRecords', [99]); ?>
</a>
];

print $this->element('menuAction', $action_args);
?>
</div>
</td>
<td><?= $p['target']->description; ?></td>
<td><?= __d('enumeration', 'ProvisioningStatusEnum.'.$p['status']); ?></td>
Expand Down
3 changes: 3 additions & 0 deletions app/webroot/css/co-base.css
Original file line number Diff line number Diff line change
Expand Up @@ -1550,6 +1550,9 @@ th, td {
th {
background-color: var(--cmg-color-bg-003);
}
thead td.actions {
background-color: var(--cmg-color-bg-003);
}
td {
border-bottom: 1px solid var(--cmg-color-bg-005);
}
Expand Down

0 comments on commit e892c37

Please sign in to comment.