Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct Incorrect Text Appearing Due To Lookups #2603

Merged
merged 2 commits into from
Nov 14, 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
2 changes: 1 addition & 1 deletion src/components/ModalViews/IndependentAssessorChange.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
:key="option"
:value="option"
>
{{ $filters.lookup(option) }}
{{ $filters.lookup(option) }} Assessor
</option>
</Select>
<TextField
Expand Down
11 changes: 8 additions & 3 deletions src/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,14 @@ const lookup = (value) => {
lookup[INDEPENDENT_ASSESSMENTS_STATUS.DECLINED] = 'Declined';
lookup[INDEPENDENT_ASSESSMENTS_STATUS.DELETED] = 'Deleted';

lookup[ASSESSOR_TYPES.PROFESSIONAL] = 'Professional assessor';
lookup[ASSESSOR_TYPES.JUDICIAL] = 'Judicial assessor';
lookup[ASSESSOR_TYPES.PERSONAL] = 'Personal assessor';
// Note that when using the assessor lookups below you need to hardcode the word 'assessor' into the template
// as 'professional' is used in other places so cannot be used here to map to 'Profeesional assessor'
// lookup[ASSESSOR_TYPES.PROFESSIONAL] = 'Professional assessor';
// lookup[ASSESSOR_TYPES.JUDICIAL] = 'Judicial assessor';
// lookup[ASSESSOR_TYPES.PERSONAL] = 'Personal assessor';
lookup[ASSESSOR_TYPES.PROFESSIONAL] = 'Professional';
lookup[ASSESSOR_TYPES.JUDICIAL] = 'Judicial';
lookup[ASSESSOR_TYPES.PERSONAL] = 'Personal';

// character issues offence category
lookup[OFFENCE_CATEGORY.SINGLE_MOTORING_OFFENCE] = 'Single motoring offence';
Expand Down
26 changes: 19 additions & 7 deletions src/views/Exercise/Dashboard/OverviewPanels/TypeOfExercise.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,29 @@
<div class="panel govuk-!-margin-bottom-4">
<span class="govuk-caption-m">Type of exercise</span>
<h2 class="govuk-heading-m govuk-!-margin-bottom-0 long-text">
<span class="capitalize">{{ $filters.lookup(exercise.typeOfExercise) }}</span>
<span
<div class="capitalize govuk-!-display-inline-block">
{{ exercise.typeOfExercise }}
</div>
<div
v-if="exercise.appointmentType"
class="capitalize"
>, {{ $filters.lookup(exercise.appointmentType) }}</span>
<span
class="capitalize govuk-!-display-inline-block"
>
, {{ $filters.lookup(exercise.appointmentType) }}
</div>
<div
v-if="exercise.isCourtOrTribunal"
class="capitalize"
>, {{ $filters.lookup(exercise.isCourtOrTribunal) }}</span>
class="capitalize govuk-!-display-inline-block"
>
, {{ $filters.lookup(exercise.isCourtOrTribunal) }}
</div>
</h2>
<span class="govuk-caption-s color-middle">
<span class="vh">&nbsp;</span>
</span>
</div>
</template>
<script>
//import { capitalizeFirstLetter } from '@/helpers/helpers';
export default {
name: 'TypeOfExercise',
computed: {
Expand All @@ -27,3 +34,8 @@ export default {
},
};
</script>
<style>
.capitalize::first-letter {
text-transform: uppercase;
}
</style>
4 changes: 2 additions & 2 deletions src/views/InformationReview/AssessorsSummary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
Type
</dt>
<dd class="govuk-summary-list__value">
{{ $filters.lookup(application.firstAssessorType) }}
{{ $filters.lookup(application.firstAssessorType) }} assessor
</dd>
</div>

Expand Down Expand Up @@ -126,7 +126,7 @@
Type
</dt>
<dd class="govuk-summary-list__value">
{{ $filters.lookup(application.secondAssessorType) }}
{{ $filters.lookup(application.secondAssessorType) }} assessor
</dd>
</div>

Expand Down
Loading