Skip to content

Allow configuration dashboard to display All Features and remove advanced menu. (CFM-347) #148

Merged
merged 1 commit into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@

// This view does currently not support read-only
if($vv_action == 'add' || $vv_action == 'edit') {
// XXX should probably do something better than <b> for section headers...
print "<b>" . __d('api_connector', 'field.ApiSources.push_mode') . "</b>";
print '<li class="info-title"><h3>' . __d('api_connector', 'field.ApiSources.push_mode') . '</h3></li>';

print $this->Field->banner(__d('api_connector', 'information.endpoint.push', [$vv_push_endpoint]));

print $this->Field->control('api_user_id');

}
23 changes: 10 additions & 13 deletions app/resources/locales/en_US/menu.po
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ msgstr "Available {0} Artifacts"
msgid "available.filters"
msgstr "Available Filters"

msgid "co.all"
msgstr "All"

msgid "co.artifacts"
msgstr "Artifacts"

msgid "co.artifacts.char"
msgstr "A"

msgid "co.Attributes"
msgid "co.attributes"
msgstr "Attributes"

msgid "co.configuration"
Expand All @@ -48,9 +48,6 @@ msgstr "Configuration for the current CO"
msgid "co.configuration.short"
msgstr "Config"

msgid "co.configuration.char"
msgstr "C"

msgid "co.configuration.panel.title"
msgstr "Configuration"

Expand Down Expand Up @@ -87,6 +84,12 @@ msgstr "Connect external data to Person records"
msgid "co.connections.provisioning_targets.desc"
msgstr "Create access to applications and services"

msgid "co.features.all"
msgstr "All Features"

msgid "co.groups"
msgstr "Groups"

msgid "co.operations"
msgstr "Operations"

Expand All @@ -102,9 +105,6 @@ msgstr "Manage this CO's asynchronous process queue"
msgid "co.operations.reports.desc"
msgstr "Create, view, and export reports"

msgid "co.groups"
msgstr "Groups"

msgid "co.people"
msgstr "People"

Expand Down Expand Up @@ -135,9 +135,6 @@ msgstr "Review and manage people in your collaboration (CO Person Records)"
msgid "co.registries"
msgstr "Registries"

msgid "co.registries.char"
msgstr "R"

msgid "co.structure"
msgstr "Structure"

Expand Down
2 changes: 1 addition & 1 deletion app/resources/locales/en_US/operation.po
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ msgid "configure.plugin"
msgstr "Configure Plugin"

msgid "dashboard.configuration"
msgstr "Manage {0} Configuration"
msgstr "{0} Configuration"

msgid "deactivate"
msgstr "Deactivate"
Expand Down
111 changes: 37 additions & 74 deletions app/src/Controller/DashboardsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,42 +57,6 @@ public function initialize(): void {
// for configuration, dashboard, and registries actions
$this->Breadcrumb->skipParents(['/^\/dashboards/']);
}

/**
* Render the CO Registries Dashboard.
*
* @since COmanage Registry v5.0.0
*/

public function artifacts() {
$cur_co = $this->getCO();

$this->set('vv_title', __d('menu', 'artifacts', [$cur_co->name]));

// Construct the set of primary registry objects, which
// we want to order by the localized text string.

// We're assuming that the permission for each of these items is the same as for
// registries() itself, ie: CMP or CO Admin. But plausibly some of this stuff
// could be delegated to (eg) a COU Admin at some point...

$artifactMenuItems = [
__d('controller', 'ExtIdentitySourceRecords', [99]) => [
'icon' => 'assignment',
'controller' => 'ext_identity_source_records',
'action' => 'index'
],
__d('controller', 'Jobs', [99]) => [
'icon' => 'assignment',
'controller' => 'jobs',
'action' => 'index'
]
];

ksort($artifactMenuItems);

$this->set('vv_artifacts_menu_items', $artifactMenuItems);
}

/**
* Render the CO Configuration Dashboard.
Expand All @@ -103,7 +67,7 @@ public function artifacts() {
public function configuration() {
$cur_co = $this->getCO();

$this->set('vv_title', __d('operation', 'dashboard.configuration', $cur_co->name));
$this->set('vv_title', __d('menu', 'co.features.all'));

// Construct the set of configuration items. For everything except CO Settings
// we want to order by the localized text string.
Expand Down Expand Up @@ -143,11 +107,12 @@ public function configuration() {
'controller' => 'provisioning_targets',
'action' => 'index'
],
__d('controller', 'Reports', [99]) => [
'icon' => 'summarize',
'controller' => 'reports',
'action' => 'index'
],
// XXX restore when Reports are ready to be exposed.
// __d('controller', 'Reports', [99]) => [
// 'icon' => 'summarize',
// 'controller' => 'reports',
// 'action' => 'index'
// ],
__d('controller', 'Types', [99]) => [
'icon' => 'widgets',
'controller' => 'types',
Expand Down Expand Up @@ -192,37 +157,7 @@ public function configuration() {
ksort($platformMenuItems);

$this->set('vv_platform_menu_items', $platformMenuItems);
}

/**
* Render a Dashboard.
*
* @since COmanage Registry v5.0.0
* @param int $id Dashboard ID
*/

public function dashboard(?int $id=null) {
// XXX placeholder
}

/**
* Render the CO Registries Dashboard.
*
* @since COmanage Registry v5.0.0
*/

public function registries() {
$cur_co = $this->getCO();

$this->set('vv_title', __d('menu', 'registries', [$cur_co->name]));

// Construct the set of primary registry objects, which
// we want to order by the localized text string.

// We're assuming that the permission for each of these items is the same as for
// registries() itself, ie: CMP or CO Admin. But plausibly some of this stuff
// could be delegated to (eg) a COU Admin at some point...

$registryMenuItems = [
__d('controller', 'Groups', [99]) => [
'icon' => 'people',
Expand All @@ -240,10 +175,38 @@ public function registries() {
'action' => 'index'
]
];

ksort($registryMenuItems);

$this->set('vv_registries_menu_items', $registryMenuItems);

$artifactMenuItems = [
__d('controller', 'ExtIdentitySourceRecords', [99]) => [
'icon' => 'assignment',
'controller' => 'ext_identity_source_records',
'action' => 'index'
],
__d('controller', 'Jobs', [99]) => [
'icon' => 'assignment',
'controller' => 'jobs',
'action' => 'index'
]
];

ksort($artifactMenuItems);

$this->set('vv_artifacts_menu_items', $artifactMenuItems);
}

/**
* Render a Dashboard.
*
* @since COmanage Registry v5.0.0
* @param int $id Dashboard ID
*/

public function dashboard(?int $id=null) {
// XXX placeholder
}

/**
Expand Down
4 changes: 2 additions & 2 deletions app/templates/Cos/select.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
// XXX See registry/app/View/Pages/home.ctp for various error messages we should
// render based on the user's state, include op.home.no.collabs if empty
?>
<div class="titleNavContainer">
<div class="pageTitle">
<div id="select-co" class="page-title-container">
<div class="page-title">
<h1><?= __('registry.home.collab'); ?></h1>
</div>
</div>
Expand Down
54 changes: 0 additions & 54 deletions app/templates/Dashboards/artifacts.php

This file was deleted.

63 changes: 54 additions & 9 deletions app/templates/Dashboards/configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@
*/
?>

<div class="pageTitleContainer">
<div class="pageTitle">
<h1><?= $vv_title; ?></h1>
<div class="page-title-container">
<div class="page-title page-title-features">
<h1><?= $vv_title ?></h1>
<div class="comanage-version">
<?php print __('registry.version', chop(file_get_contents(CONFIG . "VERSION"))); ?>
</div>
</div>
</div>

Expand All @@ -53,9 +56,15 @@
</li>
<?php endforeach; // $vv_configuration_menu_items ?>
</ul>
<h2 class="config-subtitle mb-2"><?= __d('menu','co.configuration.title') ?></h2>

<h2 class="config-subtitle mb-2"><?= __d('menu','co.configuration') ?></h2>
<p class="menu-panel-links-desc"><?= __d('menu','co.configuration.desc') ?></p>
<?php endif; // $vv_platform_menu_items ?>

<?php if(empty($vv_platform_menu_items)): ?>
<h2 class="config-subtitle mb-2"><?= __d('menu','co.configuration') ?></h2>
<?php endif; ?>

<ul id="configuration-menu" class="config-menu">
<?php foreach($vv_configuration_menu_items as $label => $cfg): ?>
<li>
Expand All @@ -74,6 +83,46 @@
</li>
<?php endforeach; // $vv_configuration_menu_items ?>
</ul>

<h2 class="config-subtitle mb-2"><?= __d('menu','co.registries') ?></h2>
<ul id="registries-menu" class="config-menu">
<?php foreach($vv_registries_menu_items as $label => $cfg): ?>
<li>
<?php
$linkContent = '<em class="material-icons" aria-hidden="true">' . $cfg['icon'] . '</em>'
. '<span class="menu-title">' . $label . '</span>';
print $this->Html->link(
$linkContent,
['plugin' => null,
'controller' => $cfg['controller'],
'action' => $cfg['action'],
'?' => ['co_id' => $vv_cur_co->id]],
['escape' => false]
);
?>
</li>
<?php endforeach; // $vv_registries_menu_items ?>
</ul>

<h2 class="config-subtitle mb-2"><?= __d('menu','co.artifacts') ?></h2>
<ul id="artifacts-menu" class="config-menu">
<?php foreach($vv_artifacts_menu_items as $label => $cfg): ?>
<li>
<?php
$linkContent = '<em class="material-icons" aria-hidden="true">' . $cfg['icon'] . '</em>'
. '<span class="menu-title">' . $label . '</span>';
print $this->Html->link(
$linkContent,
['plugin' => null,
'controller' => $cfg['controller'],
'action' => $cfg['action'],
'?' => ['co_id' => $vv_cur_co->id]],
['escape' => false]
);
?>
</li>
<?php endforeach; // $vv_artifacts_menu_items ?>
</ul>
</section>

<?php if(empty($vv_platform_menu_items) && $vv_user_roles['platform']): ?>
Expand All @@ -98,8 +147,4 @@
<div class="config-platform-notice">
<?= $this->Alert->alert(__d('information','cmp.config.notice', $noticeUrls), 'information', true) ?>
</div>
<?php endif; ?>

<div class="comanage-version">
<?php print __('registry.version', chop(file_get_contents(CONFIG . "VERSION"))); ?>
</div>
<?php endif; ?>
Loading