Skip to content

Commit 87fa267

Browse files
committed
fix: record type icon to lowercase
1 parent 1b05bb6 commit 87fa267

File tree

2 files changed

+60
-54
lines changed

2 files changed

+60
-54
lines changed

src/components/RecordTypeIcon/RecordTypeIcon.vue

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<template>
22
<FontAwesomeIcon
3-
v-if="recordTypesToIcons.has(recordType)"
3+
v-if="recordTypesToIcons.has(recordType.toLowerCase())"
44
:icon="
5-
recordTypesToIcons.get(recordType) ?? []
5+
recordTypesToIcons.get(recordType.toLowerCase()) ?? []
66
/* Fallback array is a never case, since TS doesn't infer the typeguard from `v-if` */
77
"
88
/>
@@ -28,69 +28,69 @@ const recordTypesToIcons = ref(
2828
/***************************************************
2929
********* Police and public interactions **********
3030
**************************************************/
31-
['Police & public interactions', faPersonMilitaryToPerson], // Top level with ampersand
32-
['Police and public interactions', faPersonMilitaryToPerson], // Top level with word
33-
['Accident Reports', faPersonMilitaryToPerson],
34-
['Arrest Records', faPersonMilitaryToPerson],
35-
['Calls for Service', faPersonMilitaryToPerson],
36-
['Car GPS', faPersonMilitaryToPerson],
37-
['Citations', faPersonMilitaryToPerson],
38-
['Dispatch Logs', faPersonMilitaryToPerson],
39-
['Dispatch Recordings', faPersonMilitaryToPerson],
40-
['Field Contacts', faPersonMilitaryToPerson],
41-
['Incident Reports', faPersonMilitaryToPerson],
42-
['Misc Police Activity', faPersonMilitaryToPerson],
43-
['Officer Involved Shootings', faPersonMilitaryToPerson],
44-
['Stops', faPersonMilitaryToPerson],
45-
['Surveys', faPersonMilitaryToPerson],
46-
['Use of Force Reports', faPersonMilitaryToPerson],
47-
['Vehicle Pursuits', faPersonMilitaryToPerson],
31+
['police & public interactions', faPersonMilitaryToPerson], // Top level with ampersand
32+
['police and public interactions', faPersonMilitaryToPerson], // Top level with word
33+
['accident reports', faPersonMilitaryToPerson],
34+
['arrest records', faPersonMilitaryToPerson],
35+
['calls for service', faPersonMilitaryToPerson],
36+
['car gps', faPersonMilitaryToPerson],
37+
['citations', faPersonMilitaryToPerson],
38+
['dispatch logs', faPersonMilitaryToPerson],
39+
['dispatch recordings', faPersonMilitaryToPerson],
40+
['field contacts', faPersonMilitaryToPerson],
41+
['incident reports', faPersonMilitaryToPerson],
42+
['misc police activity', faPersonMilitaryToPerson],
43+
['officer involved shootings', faPersonMilitaryToPerson],
44+
['stops', faPersonMilitaryToPerson],
45+
['surveys', faPersonMilitaryToPerson],
46+
['use of force reports', faPersonMilitaryToPerson],
47+
['vehicle pursuits', faPersonMilitaryToPerson],
4848
/***************************************************
4949
************* Info about officers ***************
5050
**************************************************/
51-
['Info about officers', faPersonMilitaryPointing], // Top level
52-
['Complaints & Misconduct', faPersonMilitaryPointing],
53-
['Complaints and Misconduct', faPersonMilitaryPointing],
54-
['Daily Activity Logs', faPersonMilitaryPointing],
55-
['Training & Hiring Info', faPersonMilitaryPointing],
56-
['Training and Hiring Info', faPersonMilitaryPointing],
57-
['Personnel Records', faPersonMilitaryPointing],
51+
['info about officers', faPersonMilitaryPointing], // Top level
52+
['complaints & misconduct', faPersonMilitaryPointing],
53+
['complaints and misconduct', faPersonMilitaryPointing],
54+
['daily activity logs', faPersonMilitaryPointing],
55+
['training & hiring info', faPersonMilitaryPointing],
56+
['training and hiring info', faPersonMilitaryPointing],
57+
['personnel records', faPersonMilitaryPointing],
5858
/***************************************************
5959
************* Info about agencies ***************
6060
**************************************************/
61-
['Info about agencies', faBuildingShield], // Top level
62-
['Annual & Monthly Reports', faBuildingShield],
63-
['Annual and Monthly Reports', faBuildingShield],
64-
['Budgets & Finances', faBuildingShield],
65-
['Budgets and Finances', faBuildingShield],
66-
['Contact Info & Agency Meta', faBuildingShield],
67-
['Contact Info and Agency Meta', faBuildingShield],
68-
['Geographic', faBuildingShield],
69-
['List of Data Sources', faBuildingShield],
70-
['Policies & Contracts', faBuildingShield],
71-
['Policies and Contracts', faBuildingShield],
61+
['info about agencies', faBuildingShield], // Top level
62+
['annual & monthly reports', faBuildingShield],
63+
['annual and monthly reports', faBuildingShield],
64+
['budgets & finances', faBuildingShield],
65+
['budgets and finances', faBuildingShield],
66+
['contact info & agency meta', faBuildingShield],
67+
['contact info and agency meta', faBuildingShield],
68+
['geographic', faBuildingShield],
69+
['list of data sources', faBuildingShield],
70+
['policies & contracts', faBuildingShield],
71+
['policies and contracts', faBuildingShield],
7272
/***************************************************
7373
********* Agency-published resources ************
7474
**************************************************/
75-
['Agency-published resources', faFileShield], // Top level
76-
['Crime Maps & Reports', faFileShield],
77-
['Crime Maps and Reports', faFileShield],
78-
['Crime Statistics', faFileShield],
79-
['Media Bulletins', faFileShield],
80-
['Records Request Info', faFileShield],
81-
['Resources', faFileShield],
82-
['Sex Offender Registry', faFileShield],
83-
['Wanted Persons', faFileShield],
75+
['agency-published resources', faFileShield], // Top level
76+
['crime maps & reports', faFileShield],
77+
['crime maps and reports', faFileShield],
78+
['crime statistics', faFileShield],
79+
['media bulletins', faFileShield],
80+
['records request info', faFileShield],
81+
['resources', faFileShield],
82+
['sex offender registry', faFileShield],
83+
['wanted persons', faFileShield],
8484
/***************************************************
85-
*********** Jails & Courts specific *************
85+
*************** Jails & Courts ******************
8686
**************************************************/
87-
['Jails & courts', faBuildingColumns], // Top level
88-
['Jails and courts', faBuildingColumns], // Top level
89-
['Jails & courts specific', faBuildingColumns], // Top level
90-
['Jails and courts specific', faBuildingColumns], // Top level
91-
['Booking Reports', faBuildingColumns],
92-
['Court Cases', faBuildingColumns],
93-
['Incarceration Records', faBuildingColumns],
87+
['jails & courts', faBuildingColumns], // Top level
88+
['jails and courts', faBuildingColumns], // Top level
89+
['jails & courts specific', faBuildingColumns], // Top level
90+
['jails and courts specific', faBuildingColumns], // Top level
91+
['booking reports', faBuildingColumns],
92+
['court cases', faBuildingColumns],
93+
['incarceration records', faBuildingColumns],
9494
])
9595
);
9696

src/components/RecordTypeIcon/__snapshots__/recordTypeIcon.spec.ts.snap

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ exports[`RecordTypeIcon > handles top-level record types correctly 4`] = `
3232
</svg>
3333
`;
3434

35+
exports[`RecordTypeIcon > handles top-level record types correctly 5`] = `
36+
<svg aria-hidden="true" class="svg-inline--fa fa-building-columns" data-icon="building-columns" data-prefix="fas" focusable="false" role="img" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
37+
<path class="" d="M243.4 2.6l-224 96c-14 6-21.8 21-18.7 35.8S16.8 160 32 160l0 8c0 13.3 10.7 24 24 24l400 0c13.3 0 24-10.7 24-24l0-8c15.2 0 28.3-10.7 31.3-25.6s-4.8-29.9-18.7-35.8l-224-96c-8-3.4-17.2-3.4-25.2 0zM128 224l-64 0 0 196.3c-.6 .3-1.2 .7-1.8 1.1l-48 32c-11.7 7.8-17 22.4-12.9 35.9S17.9 512 32 512l448 0c14.1 0 26.5-9.2 30.6-22.7s-1.1-28.1-12.9-35.9l-48-32c-.6-.4-1.2-.7-1.8-1.1L448 224l-64 0 0 192-40 0 0-192-64 0 0 192-48 0 0-192-64 0 0 192-40 0 0-192zM256 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64z" fill="currentColor" />
38+
</svg>
39+
`;
40+
3541
exports[`RecordTypeIcon > renders the correct icon for a valid record type 1`] = `
3642
<svg aria-hidden="true" class="svg-inline--fa fa-person-military-to-person" data-icon="person-military-to-person" data-prefix="fas" focusable="false" role="img" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
3743
<path class="" d="M71 12.5c-8.6 1-15 8.2-15 16.8c0 9.3 7.5 16.8 16.7 16.9l111.4 0c8.8-.1 15.9-7.2 15.9-16L200 16c0-9.5-8.3-17-17.8-15.9L71 12.5zM189.5 78.1l-122.9 0C64.9 83.8 64 89.8 64 96c0 35.3 28.7 64 64 64s64-28.7 64-64c0-6.2-.9-12.2-2.5-17.9zM32 256l0 32c0 17.7 14.3 32 32 32l128 0c1.8 0 3.5-.1 5.2-.4L53 208.6C40.1 220.3 32 237.2 32 256zm190.2 42.5c1.1-3.3 1.8-6.8 1.8-10.5l0-32c0-35.3-28.7-64-64-64l-64 0c-3.7 0-7.4 .3-10.9 .9L222.2 298.5zM384 160a64 64 0 1 0 0-128 64 64 0 1 0 0 128zm-32 32c-35.3 0-64 28.7-64 64l0 32c0 17.7 14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-32c0-35.3-28.7-64-64-64l-64 0zM215.8 450.1c5.2-4.6 8.2-11.1 8.2-18.1s-3-13.5-8.2-18.1l-64-56c-7.1-6.2-17.1-7.7-25.7-3.8S112 366.6 112 376l0 32-88 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l88 0 0 32c0 9.4 5.5 18 14.1 21.9s18.6 2.4 25.7-3.8l64-56zM288 431.9c0 6.9 2.9 13.5 8.1 18.1l64 56.4c7.1 6.2 17.1 7.8 25.7 3.9s14.1-12.4 14.1-21.9l0-32.4 88 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-88 0 0-32c0-9.4-5.5-18-14.1-21.9s-18.6-2.4-25.7 3.8l-64 56c-5.2 4.5-8.2 11.1-8.2 18z" fill="currentColor" />

0 commit comments

Comments
 (0)