forked from bloom-housing/bloom
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'bloom/main'
- Loading branch information
Showing
14 changed files
with
298 additions
and
318 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
backend/core/src/migration/1696353656895-csv-export-translations.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { MigrationInterface, QueryRunner } from "typeorm" | ||
|
||
export class csvExportTranslations1696353656895 implements MigrationInterface { | ||
name = "csvExportTranslations1696353656895" | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
const translations: { id: string; translations: any }[] = await queryRunner.query(` | ||
SELECT | ||
id, | ||
translations | ||
FROM translations | ||
WHERE language = 'en' | ||
`) | ||
translations.forEach(async (translation) => { | ||
let data = translation.translations | ||
data.csvExport = { | ||
title: "%{listingName} applications export", | ||
body: "The attached file is an applications export for %{listingName}. If you have any questions, please reach out to your administrator.", | ||
hello: "Hello,", | ||
} | ||
data = JSON.stringify(data) | ||
await queryRunner.query(` | ||
UPDATE translations | ||
SET translations = '${data.replace(/'/g, "''")}' | ||
WHERE id = '${translation.id}' | ||
`) | ||
}) | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
// no down migration | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{{#> layout_default }} | ||
<h1> | ||
{{ t "csvExport.title" appOptions }} | ||
</h1> | ||
|
||
<table role="presentation" border="0" cellpadding="0" cellspacing="0"> | ||
<tbody> | ||
<tr> | ||
<td align="left"> | ||
<p> | ||
{{t "csvExport.hello" appOptions}} | ||
</p> | ||
<p> | ||
{{t "csvExport.body" appOptions}} | ||
</p> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td align="left"> | ||
<p> | ||
{{t "footer.thankYou" }}, | ||
</p> | ||
<p> | ||
{{t "header.logoTitle" }} | ||
</p> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
{{/layout_default }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.