From bf99e4962c0f04f07c2898ffa1b42777b47d42cb Mon Sep 17 00:00:00 2001 From: Joshua Toliver Date: Wed, 4 Dec 2024 11:38:38 -0500 Subject: [PATCH] R2-3131: PCM - Fixing Users with multiple modules do not see gender column translated, gender/sex filter not working and displaying incorrect options --- app/javascript/components/index-filters/constants.js | 9 +-------- app/models/filter.rb | 4 ++-- app/models/header.rb | 2 +- config/locales/en.yml | 2 +- 4 files changed, 5 insertions(+), 12 deletions(-) diff --git a/app/javascript/components/index-filters/constants.js b/app/javascript/components/index-filters/constants.js index 8db83adc10..80624793c3 100644 --- a/app/javascript/components/index-filters/constants.js +++ b/app/javascript/components/index-filters/constants.js @@ -50,14 +50,7 @@ export const VIOLATIONS_FILTER_NAMES = Object.freeze([ "types_of_aid_disrupted_denial" ]); -export const PRIMARY_FILTERS = [ - "sex", - "gender_identity", - "age", - "risk_level", - "approval_status_case_plan", - "last_updated_at" -]; +export const PRIMARY_FILTERS = ["sex", "gender", "age", "risk_level", "approval_status_case_plan", "last_updated_at"]; export const DEFAULT_FILTERS = ["fields", "status", "record_state", ID_SEARCH]; diff --git a/app/models/filter.rb b/app/models/filter.rb index 861661fe74..5c519249d8 100644 --- a/app/models/filter.rb +++ b/app/models/filter.rb @@ -65,9 +65,9 @@ def initialize(args = {}) option_strings_source: 'lookup-gender' ) GENDER_IDENTITY = Filter.new( - unique_id: 'gender_identity', + unique_id: 'gender', name: 'cases.filter_by.gender', - field_name: 'gender_identity', + field_name: 'gender', option_strings_source: 'lookup-gender-identity' ) PROTECTION_CONCERNS = Filter.new( diff --git a/app/models/header.rb b/app/models/header.rb index e69aafafb3..c49b21e5d7 100644 --- a/app/models/header.rb +++ b/app/models/header.rb @@ -14,7 +14,7 @@ class Header < ValueObject SURVIVOR_CODE_INCIDENT = Header.new(name: 'survivor_code', field_name: 'survivor_code') AGE = Header.new(name: 'age', field_name: 'age', id_search: true) SEX = Header.new(name: 'sex', field_name: 'sex', id_search: true) - GENDER = Header.new(name: 'gender_identity', field_name: 'gender', id_search: true) + GENDER = Header.new(name: 'gender', field_name: 'gender', id_search: true) REGISTRATION_DATE = Header.new(name: 'registration_date', field_name: 'registration_date') CASE_OPENING_DATE = Header.new(name: 'case_opening_date', field_name: 'created_at') PHOTO = Header.new(name: 'photo', field_name: 'photo') diff --git a/config/locales/en.yml b/config/locales/en.yml index d9e93ad4ca..af834947ec 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -401,7 +401,7 @@ en: flag_summary: Flag summary full_name: Full Name gbv_closure: GBV Closure - gender_identity: Gender + gender: Gender hide_name: Hide Name hide_name_error: An error ocurred when saving your changes. Please try again. id: ID#