Skip to content

Commit

Permalink
feat(app): add alert for trans bans org changes (ECB-90) (#1457)
Browse files Browse the repository at this point in the history
<!--- Please provide a general summary of your changes in the title
above -->

# Pull Request type

<!-- Please try to limit your pull request to one type; submit multiple
pull requests if needed. -->

Please check the type of change your PR introduces:

- [ ] Bugfix
- [x] Feature
- [ ] Code style update (formatting, renaming)
- [ ] Refactoring (no functional changes, no API changes)
- [ ] Build-related changes
- [ ] Documentation content changes
- [ ] Other (please describe):

## What is the current behavior?

<!-- Please describe the current behavior that you are modifying, or
link to a relevant issue. -->

Issue Number: N/A

## What is the new behavior?
secondary alert responding to the Trump admin’s new federal funding /
policy changes – language: “Some organizations are adjusting services
due to recent funding cuts and policy changes. Contact providers
directly for updates.”

change anti-trans map to a secondary alert

-
-
-

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

<!-- If this does introduce a breaking change, please describe the
impact and migration path for existing applications below. -->

## Other information

<!-- Any other information that is important to this PR, such as
screenshots of how the component looks before and after the change. -->
  • Loading branch information
trigal2012 authored Jan 30, 2025
2 parents 07b78c2 + 228c73a commit 8511d23
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import { type MigrationJob } from '~db/prisma/dataMigrationRunner'
import { type JobDef } from '~db/prisma/jobPreRun'

/** Define the job metadata here. */
const jobDef: JobDef = {
jobId: '2025-01-29_update-nationwide-locationbased-alert',
title: 'change the location-based alert text string',
createdBy: 'Diana',
/** Optional: Longer description for the job */
description: 'change the location-based alert text string',
}
/**
* Job export - this variable MUST be UNIQUE
*/
export const job20250129_update_nationwide_locationbased_alert = {
title: `[${jobDef.jobId}] ${jobDef.title}`,
task: async (ctx, task) => {
const { createLogger, formatMessage, jobPostRunner, prisma } = ctx
/** Create logging instance */
createLogger(task, jobDef.jobId)
const log = (...args: Parameters<typeof formatMessage>) => (task.output = formatMessage(...args))

// Variables for the update
const key = 'locationBasedAlert.alrt_locationBasedAlert.alrt_01J5XNBQ5GREHSHK5D2QTCXRWE'
const ns = 'org-data'
const newTextValue =
'Some organizations are adjusting services due to recent funding cuts and policy changes. Contact providers directly for updates.'

// Perform the update
const update1 = await prisma.translationKey.update({
where: { ns_key: { key, ns } },
data: { text: newTextValue },
})

const update2 = await prisma.locationAlert.update({
where: { id: 'alrt_01J1D1GAT5G5S6QNMCND5PMDAX' },
data: { level: 'WARN_SECONDARY' }, // update this to the correct id
})

log(`Location-based alert text string updated: ${update1.key} with new text: "${update1.text}"`)
log(`Location-based alert level type for anti-trans map: ${update2.key} change to: "${update2.text}"`)

/**
* DO NOT REMOVE BELOW
*
* This writes a record to the DB to register that this migration has run successfully.
*/
await jobPostRunner(jobDef)
},
def: jobDef,
} satisfies MigrationJob
1 change: 1 addition & 0 deletions packages/db/prisma/data-migrations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export * from './2025-01-15_new_food-service-tag'
export * from './2025-01-15_new_medical-service-tag'
export * from './2025-01-15_update-cost-tags'
export * from './2025-01-15_update-food-tags'
export * from './2025-01-29_update-nationwide-locationbased-alert'
export * from './2025-01-29_update-parent-category-for-trans-you-health'
export * from './2025-01-29_update-translation-key-for-trans-health-youth'
// codegen:end

0 comments on commit 8511d23

Please sign in to comment.