Skip to content

Commit

Permalink
Set petition titles (Enrollment Flow name, Flow Step description) in …
Browse files Browse the repository at this point in the history
…dispatch view (CFM-31) (COmanage#227)
  • Loading branch information
arlen committed Oct 14, 2024
1 parent 4c1e331 commit 5dc2e3c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,6 @@ public function dispatch(string $id) {
->find()
->where(['petition_id' => $petition->id])
->all());

// Get the title
// XXX Replace $petition->enrollment_flow_id with the Enrollment Flow "Name" (for now)
// XXX We should have a "Title" for end-users that is different from the Enrollment Flow "Name"
// for start and dispatch.
$this->set('vv_title', $petition->enrollment_flow_id);

$this->render('/Standard/dispatch');
}
Expand Down
6 changes: 4 additions & 2 deletions app/src/Controller/StandardEnrollerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,10 @@ public function calculatePermission(): bool {
$this->llog('error', "Model ID missing from request");
return false;
}

$stepConfig = $this->$modelsName->get($modelId, ['contain' => 'EnrollmentFlowSteps']);

$stepConfig = $this->$modelsName->get($modelId, ['contain' => ['EnrollmentFlowSteps' => ['EnrollmentFlows']]]);
$this->set('vv_step_config', $stepConfig);
$this->set('vv_title', $stepConfig['enrollment_flow_step']['enrollment_flow']['name']);

// Check that the current actor has the role required for this step.
// Note that role validation has already been performed for anonymous access
Expand Down
3 changes: 2 additions & 1 deletion app/templates/Standard/dispatch.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@

<div class="page-title-container">
<div class="page-title">
<h1><?= $vv_title; ?></h1>
<h1 class="flow-name"><?= $vv_title ?></h1>
<h2 class="flow-step-description"><?= $vv_step_config['enrollment_flow_step']['description'] ?></h2>
</div>
<div class="field-actions top-links">
<?= $this->element('menuAction', $action_args) ?>
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 @@ -665,6 +665,9 @@ ul.form-list li.alert-banner .co-alert {
.page-title h2 {
line-height: 1.2em;
}
.page-title h2.flow-step-description {
margin: 0.5em 0 0.25em;
}
.page-title .deleted,
.page-title .archived {
background-color: var(--cmg-color-highlight-013);
Expand Down

0 comments on commit 5dc2e3c

Please sign in to comment.