Skip to content

Set petition titles in dispatch view (CFM-31) #227

Merged
merged 1 commit into from Sep 30, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
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
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
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