Skip to content

Commit

Permalink
fix: record type icon to lowercase
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuagraber committed Nov 22, 2024
1 parent 1b05bb6 commit 87fa267
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 54 deletions.
108 changes: 54 additions & 54 deletions src/components/RecordTypeIcon/RecordTypeIcon.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<FontAwesomeIcon
v-if="recordTypesToIcons.has(recordType)"
v-if="recordTypesToIcons.has(recordType.toLowerCase())"
:icon="
recordTypesToIcons.get(recordType) ?? []
recordTypesToIcons.get(recordType.toLowerCase()) ?? []
/* Fallback array is a never case, since TS doesn't infer the typeguard from `v-if` */
"
/>
Expand All @@ -28,69 +28,69 @@ const recordTypesToIcons = ref(
/***************************************************
********* Police and public interactions **********
**************************************************/
['Police & public interactions', faPersonMilitaryToPerson], // Top level with ampersand
['Police and public interactions', faPersonMilitaryToPerson], // Top level with word
['Accident Reports', faPersonMilitaryToPerson],
['Arrest Records', faPersonMilitaryToPerson],
['Calls for Service', faPersonMilitaryToPerson],
['Car GPS', faPersonMilitaryToPerson],
['Citations', faPersonMilitaryToPerson],
['Dispatch Logs', faPersonMilitaryToPerson],
['Dispatch Recordings', faPersonMilitaryToPerson],
['Field Contacts', faPersonMilitaryToPerson],
['Incident Reports', faPersonMilitaryToPerson],
['Misc Police Activity', faPersonMilitaryToPerson],
['Officer Involved Shootings', faPersonMilitaryToPerson],
['Stops', faPersonMilitaryToPerson],
['Surveys', faPersonMilitaryToPerson],
['Use of Force Reports', faPersonMilitaryToPerson],
['Vehicle Pursuits', faPersonMilitaryToPerson],
['police & public interactions', faPersonMilitaryToPerson], // Top level with ampersand
['police and public interactions', faPersonMilitaryToPerson], // Top level with word
['accident reports', faPersonMilitaryToPerson],
['arrest records', faPersonMilitaryToPerson],
['calls for service', faPersonMilitaryToPerson],
['car gps', faPersonMilitaryToPerson],
['citations', faPersonMilitaryToPerson],
['dispatch logs', faPersonMilitaryToPerson],
['dispatch recordings', faPersonMilitaryToPerson],
['field contacts', faPersonMilitaryToPerson],
['incident reports', faPersonMilitaryToPerson],
['misc police activity', faPersonMilitaryToPerson],
['officer involved shootings', faPersonMilitaryToPerson],
['stops', faPersonMilitaryToPerson],
['surveys', faPersonMilitaryToPerson],
['use of force reports', faPersonMilitaryToPerson],
['vehicle pursuits', faPersonMilitaryToPerson],
/***************************************************
************* Info about officers ***************
**************************************************/
['Info about officers', faPersonMilitaryPointing], // Top level
['Complaints & Misconduct', faPersonMilitaryPointing],
['Complaints and Misconduct', faPersonMilitaryPointing],
['Daily Activity Logs', faPersonMilitaryPointing],
['Training & Hiring Info', faPersonMilitaryPointing],
['Training and Hiring Info', faPersonMilitaryPointing],
['Personnel Records', faPersonMilitaryPointing],
['info about officers', faPersonMilitaryPointing], // Top level
['complaints & misconduct', faPersonMilitaryPointing],
['complaints and misconduct', faPersonMilitaryPointing],
['daily activity logs', faPersonMilitaryPointing],
['training & hiring info', faPersonMilitaryPointing],
['training and hiring info', faPersonMilitaryPointing],
['personnel records', faPersonMilitaryPointing],
/***************************************************
************* Info about agencies ***************
**************************************************/
['Info about agencies', faBuildingShield], // Top level
['Annual & Monthly Reports', faBuildingShield],
['Annual and Monthly Reports', faBuildingShield],
['Budgets & Finances', faBuildingShield],
['Budgets and Finances', faBuildingShield],
['Contact Info & Agency Meta', faBuildingShield],
['Contact Info and Agency Meta', faBuildingShield],
['Geographic', faBuildingShield],
['List of Data Sources', faBuildingShield],
['Policies & Contracts', faBuildingShield],
['Policies and Contracts', faBuildingShield],
['info about agencies', faBuildingShield], // Top level
['annual & monthly reports', faBuildingShield],
['annual and monthly reports', faBuildingShield],
['budgets & finances', faBuildingShield],
['budgets and finances', faBuildingShield],
['contact info & agency meta', faBuildingShield],
['contact info and agency meta', faBuildingShield],
['geographic', faBuildingShield],
['list of data sources', faBuildingShield],
['policies & contracts', faBuildingShield],
['policies and contracts', faBuildingShield],
/***************************************************
********* Agency-published resources ************
**************************************************/
['Agency-published resources', faFileShield], // Top level
['Crime Maps & Reports', faFileShield],
['Crime Maps and Reports', faFileShield],
['Crime Statistics', faFileShield],
['Media Bulletins', faFileShield],
['Records Request Info', faFileShield],
['Resources', faFileShield],
['Sex Offender Registry', faFileShield],
['Wanted Persons', faFileShield],
['agency-published resources', faFileShield], // Top level
['crime maps & reports', faFileShield],
['crime maps and reports', faFileShield],
['crime statistics', faFileShield],
['media bulletins', faFileShield],
['records request info', faFileShield],
['resources', faFileShield],
['sex offender registry', faFileShield],
['wanted persons', faFileShield],
/***************************************************
*********** Jails & Courts specific *************
*************** Jails & Courts ******************
**************************************************/
['Jails & courts', faBuildingColumns], // Top level
['Jails and courts', faBuildingColumns], // Top level
['Jails & courts specific', faBuildingColumns], // Top level
['Jails and courts specific', faBuildingColumns], // Top level
['Booking Reports', faBuildingColumns],
['Court Cases', faBuildingColumns],
['Incarceration Records', faBuildingColumns],
['jails & courts', faBuildingColumns], // Top level
['jails and courts', faBuildingColumns], // Top level
['jails & courts specific', faBuildingColumns], // Top level
['jails and courts specific', faBuildingColumns], // Top level
['booking reports', faBuildingColumns],
['court cases', faBuildingColumns],
['incarceration records', faBuildingColumns],
])
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ exports[`RecordTypeIcon > handles top-level record types correctly 4`] = `
</svg>
`;

exports[`RecordTypeIcon > handles top-level record types correctly 5`] = `
<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">
<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" />
</svg>
`;

exports[`RecordTypeIcon > renders the correct icon for a valid record type 1`] = `
<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">
<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" />
Expand Down

0 comments on commit 87fa267

Please sign in to comment.