Skip to content

Commit

Permalink
Add special "Start" button to Enrollment Flow views (CFM-428) (#251)
Browse files Browse the repository at this point in the history
* Add special "Start" and "Copy" (flow url) buttons to Enrollment Flow configuration views (CFM-428)

* Improve "Cannot copy" message for javascript clipboard (CFM-428)

* Make upper buttons more generic (CFM-428)

* Shorten test block for applying upper buttons (CFM-428)

* De-emphasize "Copy URL" and move it to the left of "Start" (CFM-428)

* Remove "Copy URL" button (CFM-428)

* Trivial clean up to comment (CFM-428)
  • Loading branch information
arlen authored and Ioannis committed Dec 15, 2024
1 parent 7b59fd5 commit 15ff5c9
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ $action_args['vv_attr_id'] = $vv_user['username'];
$action_args['vv_actions_type'] = 'mvea-add-menu';
$action_args['vv_actions_title'] = __d('operation', 'add.attribute');
$action_args['vv_actions_icon'] = 'add_circle';
$action_args['vv_actions_icon_class'] = 'material-symbols-outlined';
$action_args['vv_actions_class'] = 'mvea-add-menu';
$actionOrderDefault = $this->Menu->getMenuOrder('Default');
foreach ($attributes as $attr => $hr_name) {
Expand Down
6 changes: 6 additions & 0 deletions app/resources/locales/en_US/operation.po
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,12 @@ msgstr "Continue"
msgid "copy"
msgstr "Copy"

msgid "copy.flowUrl"
msgstr "Copy Enrollment Flow URL"

msgid "copy.url"
msgstr "Copy URL"

msgid "copy.value"
msgstr "Copy value"

Expand Down
42 changes: 0 additions & 42 deletions app/templates/EnrollmentFlows/fields-nav.inc

This file was deleted.

1 change: 1 addition & 0 deletions app/templates/element/subnavigation/navBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
<?= $this->element('subnavigation/supertitle') ?>
<?= $this->element('subnavigation/statusBadge') ?>
</div>
<?= $this->element('subnavigation/upperButtons') ?>
</div>

<!-- Flash Messages are placed below supertitle when subnavigation exists. -->
Expand Down
58 changes: 58 additions & 0 deletions app/templates/element/subnavigation/upperButtons.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?php
/**
* COmanage Registry Subnavigation Upper Buttons Element
*
* Portions licensed to the University Corporation for Advanced Internet
* Development, Inc. ("UCAID") under one or more contributor license agreements.
* See the NOTICE file distributed with this work for additional information
* regarding copyright ownership.
*
* UCAID licenses this file to you under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @link https://www.internet2.edu/comanage COmanage Project
* @package registry
* @since COmanage Registry v5.0.0
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
*
*
*/

// Special "Start" button for Enrollment Flow configuration views.
// This element can be expanded to other views if needed.
if(
$vv_controller != 'EnrollmentFlows' &&
$vv_controller != 'EnrollmentFlowSteps' &&
$vv_controller != 'Petitions'
) {
return;
}

$enrollmentFlowId = $vv_obj->id;
if($vv_controller != 'EnrollmentFlows') {
$enrollmentFlowId = $vv_primary_link_obj->id;
}

$startButtonUrl = $this->Url->build(
['controller' => 'enrollment_flows',
'action' => 'start',
$enrollmentFlowId
],
['fullBase' => true]
);
?>
<div class="upper-buttons">
<a href="<?= $startButtonUrl ?>" class="btn btn-sm btn-tertiary">
<em class="material-symbols">play_arrow</em>
<?= __d('operation', 'EnrollmentFlows.start') ?>
</a>
</div>
10 changes: 9 additions & 1 deletion app/webroot/css/co-base.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

/* HTML, BODY, HEADINGS, ANCHORS, FONTS */
@import url("fonts/opensans/stylesheet.css");
@import url("fonts.material-symbols.material-symbols.css");
@import url("fonts/material-symbols/stylesheet.css");

html * {
Expand Down Expand Up @@ -1856,6 +1855,15 @@ li[data-pc-section="emptymessage"] {
color: var(--cmg-color-txt-soft);
background-color: unset;
}
/* ENROLLMENT FLOWS */
.upper-buttons {
display: flex;
gap: 0.5em;
font-size: 0.9em;
}
.upper-buttons a {
padding: 0.5em 1em;
}
/* ENROLLMENT FLOWS: ATTRIBUTE COLLECTOR */
body.attributecollectors main,
body.basicattributecollectors main {
Expand Down

0 comments on commit 15ff5c9

Please sign in to comment.