Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 33 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -354,11 +354,11 @@ The following dependencies are used to build and run the image. Please feel feel

3. Build and run the app using Docker.
- Build<br>
`docker compose -f docker-compose.dev.yml build`
`docker compose build`
- Run<br>
`docker compose -f docker-compose.dev.yml up`
`docker compose up`
- Stop<br>
`docker compose -f docker-compose.dev.yml down`
`docker compose down`

4. Edit and execute scripts within the running docker container from **step #3**.
- For running NPM scripts (see the [Available Scripts](#available-scripts) section for more information):<br>
Expand Down Expand Up @@ -530,6 +530,10 @@ Run tests defined in the `/app/__tests__` directory.
- Downloads and parses a remote excel file.
- Demonstrates sample usage with `await`

### `npm run debug`

- Runs the `npm run list:region` with `--inspect` mode for debugging in containers.

</details>

<br>
Expand Down Expand Up @@ -920,6 +924,32 @@ This section describes several common errors and related fixes.

</details>

<details>
<summary style="font-size: 18px;">
<b>Malformed text characters in the municipality names</b>
</summary>

#### Information

- Sometimes, garbled or malformed text like `"├â┬▒"`, `"ñ"`, and others are present in the PAGASA 10-Day Weather forecast Excel files.
- This usually occurs when there is a character encoding mismatch when writing data in `UTF-8` format in Excel files, but the ph-municipalities scripts (or Microsoft Excel, Notepad or other programs) interpret it as `ANSI` (Windows-1252) or some other encoding.

#### Fix

Convert the malformed text to its original text counterparts.

1. Add the malformed characters and their expected character conversions in the `SPECIAL_CHARACTERS` env variable as pipe-delimited key-value pairs.
2. For example, the `"├â┬▒"` and `"ñ"` actually translate to the `"ñ"` character. Write them in the `SPECIAL_CHARACTERS` variable as:<br>
```
SPECIAL_CHARACTERS=├â┬▒:ñ,ñ:ñ
```
3. Add a blank space after the `":"` character if the malformed text does not have any conversion.<br>
```
SPECIAL_CHARACTERS=├â┬▒:ñ,ñ:ñ,â:
```

</details>

<br>

@ciatph<br>
Expand Down
2 changes: 1 addition & 1 deletion app/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ EXCEL_FILE_URL=https://pubfiles.pagasa.dost.gov.ph/pagasaweb/files/climate/tenda
DEFAULT_EXCEL_FILE_URL=https://pubfiles.pagasa.dost.gov.ph/pagasaweb/files/climate/tendayweatheroutlook/day1.xlsx
SHEETJS_COLUMN=__EMPTY
SORT_ALPHABETICAL=1
SPECIAL_CHARACTERS=├â┬▒:ñ,â:
SPECIAL_CHARACTERS=├â┬▒:ñ,â:,ñ:ñ
IMAGE_URL=https://raw.githubusercontent.com/ciatph/ph-municipalities/master/docs/diagrams/ph-municipalities-arch-90.png
2 changes: 1 addition & 1 deletion app/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
verbose: true,
testTimeout: 20000,
testTimeout: 30000,
moduleFileExtensions: ['js'],
testPathIgnorePatterns: [
'/node_modules/',
Expand Down
Loading
Loading