Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into get-timeseries
Browse files Browse the repository at this point in the history
  • Loading branch information
nf-s committed Nov 5, 2023
2 parents f47b943 + 044831c commit 3c627ff
Show file tree
Hide file tree
Showing 106 changed files with 5,217 additions and 2,134 deletions.
1 change: 0 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
["@babel/typescript", { "allowNamespaces": true }]
],
"plugins": [
"babel-plugin-jsx-control-statements",
"@babel/plugin-transform-modules-commonjs",
["@babel/plugin-proposal-decorators", { "legacy": true }],
"@babel/plugin-proposal-class-properties",
Expand Down
9 changes: 2 additions & 7 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:jsx-control-statements/recommended"
],
"extends": ["eslint:recommended", "plugin:react/recommended"],
"parser": "@babel/eslint-parser",
"parserOptions": {
"requireConfigFile": false,
Expand All @@ -19,7 +15,7 @@
"commonjs": true,
"es6": true
},
"plugins": ["react", "jsx-control-statements"],
"plugins": ["react"],
"globals": {
"process": true
},
Expand All @@ -29,7 +25,6 @@
}
},
"rules": {
"jsx-control-statements/jsx-use-if-tag": 0,
"react/jsx-no-undef": 0,

/*Possible Errors */
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/find-region-mapping-alias-duplicates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Find region mapping alias duplicates

# Run when regionMapping.json file or is updated
on:
push:
paths:
- "wwwroot/data/regionMapping.json"
- "buildprocess/find-region-mapping-alias-duplicates.js"
pull_request:
paths:
- "wwwroot/data/regionMapping.json"
- "buildprocess/find-region-mapping-alias-duplicates.js"

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job
find-alias-duplicates:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Check out only 2 files
# Use without cone mode as no git operations are executed past checkout
- uses: actions/checkout@v4
with:
sparse-checkout: |
wwwroot/data/regionMapping.json
buildprocess/find-region-mapping-alias-duplicates.js
sparse-checkout-cone-mode: false

- name: Check aliases
run: |
node buildprocess/find-region-mapping-alias-duplicates.js
32 changes: 30 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,38 @@
# Change Log

#### next release (8.3.6)
#### next release (8.3.8)

- Remove `jsx-control-statements` dependency
- Fix WMS nested group IDs - nested groups with the same name were not being created
- WMS `isEsri` default value will now check for case-insensitive `mapserver/wmsserver` (instead of `MapServer/WMSServer`)
- Tweak ArcGis MapServer WMS `GetFeatureInfo` default behaviour
- Add `application/geo+json` and `application/vnd.geo+json` default `GetFeatureInfo` (after `application/json` in priority list)
- Add `application/xml` default `GetFeatureInfo`. (if `isEsri` is true, then this will be used before `text/html`)
- Added many remaining ASGS 2021 region types to region mapping (STE_2021,ILOC_2021,IARE_2021,IREG_2021,RA_2021,SAL_2021,ADD_2021,DZN_2021,LGA_2022,LGA_2023,SED_2021,SED_2022,
CED_2021,POA_2021,TR_2021,SUA_2021,UCL_2021,SOS_2021,SOSR_2021).
- See [ASGS 2021](https://www.abs.gov.au/statistics/standards/australian-statistical-geography-standard-asgs-edition-3/jul2021-jun2026/access-and-downloads/digital-boundary-files)
- Added [Melbourne CLUE blocks](https://data.melbourne.vic.gov.au/pages/clue/) to region mapping.
- [The next improvement]

#### 8.3.7 - 2023-10-26

- Fix `WebMapServiceCatalogItem` `allowFeaturePicking`
- Allow translation of TableStylingWorkflow.
- Fix "Remove all" not removing selected/picked features
- Fix crash on empty GeoJSON features
- Add `tableFeatureInfoContext` support to `GeoJsonMixin.createProtomapsImageryProvider`
- Fix `GeoJsonMixin` timeline animation for lines/polygons
- Fix bug in mismatched GeoJSON Feature `_id_` and TableMixin `rowId` - this was causing incorrect styling when using `filterByProperties` or features had `null` geometry
- Fix splitter for `GeoJsonMixin` (lines and polygon features only)
- Fix share links with picked features from `ProtomapsImageryProvider`
- Added on screen attribution and Google logo for Google Photorealistic 3D Tiles.
- Add `hideDefaultDescription` to `CatalogMemberTraits` - if true, then no generic default description will be shown when `description` is empty.

#### 8.3.6 - 2023-10-03

- Add `GetTimeseries` support to `WebMapServiceCatalogItem`. This adds a new `supportsGetTimeseries` trait, which when true will replace `GetFeatureInfo` with `GetTimeseries` requests. It will also change `info_format` to `text/csv`, and show a chart in the feature info panel. Servers which advertise `GetTimeseries` capability will have this trait set to true by default. `GetTimeseries` requests will have `time = ""`.
- Fixed a bug where incorrect "Remove all" icon is shown when the trait `displayGroup` of some group types (e.g.`wms-group`) is set to `true` but the members have not been populated yet.
- [The next improvement]
- Fix regression in `excludeMembers`, `id` and `name` should be lower-case for comparing.

#### 8.3.5 - 2023-09-26

Expand Down
2 changes: 1 addition & 1 deletion architecture/0001-babel-and-ts-loader.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ support for it covers everything we need to use it in terriajs, including
build times.

- Using _only_ ts-loader is out of the question, as we rely on tools inside the
babel ecosystem including jsx-control-statements & styled-components to name a
babel ecosystem including ~jsx-control-statements~ (removed 2023-10-16) & styled-components to name a
few.
- Using _only_ babel
- Using babel _with_ ts-loader in `transpileOnly` mode, if there are TypeScript
Expand Down
5 changes: 3 additions & 2 deletions buildprocess/ci-cleanup.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ function makeSafeName(name) {
return name
.toLowerCase()
.replace(/[^-a-z0-9]/g, "-")
.substring(0, 40);
.substring(0, 32)
.replace(/-*$/, "");
}

function createIngress(branches) {
Expand All @@ -73,7 +74,7 @@ function createIngress(branches) {
host: "ci.terria.io",
http: {
paths: branches.map((branch) => ({
path: "/" + branch.name + "(/|$)(.*)",
path: "/" + makeSafeName(branch.name) + "(/|$)(.*)",
pathType: "ImplementationSpecific",
backend: {
service: {
Expand Down
4 changes: 3 additions & 1 deletion buildprocess/ci-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ if [[ $GITHUB_BRANCH =~ ^greenkeeper/ ]]; then
fi

# A version of the branch name that can be used as a DNS name once we prepend and append some stuff.
SAFE_BRANCH_NAME=$(printf '%s' "${GITHUB_BRANCH,,:0:40}" | sed 's/[^-a-z0-9]/-/g')
SAFE_BRANCH_NAME=$(printf '%s' "${GITHUB_BRANCH:0:32}" | sed -e 's/./\L&/g' -e 's/[^-a-z0-9]/-/g' -e 's/-*$//')

[[ $SAFE_BRANCH_NAME != $GITHUB_BRANCH ]] && echo "::warning file=buildprocess/ci-deploy.sh::Branch name sanitised to '${SAFE_BRANCH_NAME}' for kubernetes resources. This may work, however using branch names less than 32 characters long with [a-z0-9] and hyphen separators are preferred"

gh api /repos/${GITHUB_REPOSITORY}/statuses/${GITHUB_SHA} -f state=pending -f context=deployment -f target_url=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}

Expand Down
1 change: 0 additions & 1 deletion buildprocess/configureWebpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ function configureWebpack(
["@babel/typescript", { allowNamespaces: true }]
],
plugins: [
"babel-plugin-jsx-control-statements",
"@babel/plugin-transform-modules-commonjs",
["@babel/plugin-proposal-decorators", { legacy: true }],
"@babel/plugin-proposal-class-properties",
Expand Down
22 changes: 22 additions & 0 deletions buildprocess/find-region-mapping-alias-duplicates.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const fs = require("fs");
const regions = JSON.parse(
fs.readFileSync("wwwroot/data/regionMapping.json")
).regionWmsMap;

const aliasToType = new Map();
for (const [regType, regDef] of Object.entries(regions)) {
for (const alias of regDef.aliases ?? []) {
aliasToType.set(alias, [...(aliasToType.get(alias) ?? []), regType]);
}
}

let issues = 0;
for (const [alias, regTypes] of aliasToType.entries()) {
if (regTypes.length > 1) {
console.error(
`Alias "${alias}" used in multiple types: ${regTypes.join(", ")}`
);
issues++;
}
}
process.exitCode = issues > 0 ? 1 : 0;
2 changes: 0 additions & 2 deletions doc/contributing/frontend-style-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,5 +167,3 @@ const BoxSpan: any = require("../../../Styled/Box").BoxSpan;

Components written in TypeScript will not need `PropTypes` defined on them, as
type errors on props will be caught at compilation rather than a runtime check.

All jsx-control-statements should be removed when migrating a .jsx file to .tsx.
38 changes: 38 additions & 0 deletions doc/contributing/problems-and-solutions.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,41 @@ yarn gulp sync-terriajs-dependencies
```

---

### Problem

I have already have NodeJS installed, but I need an early version for TerriaJS

### Solution

You can use [nvm](https://github.com/nvm-sh/nvm#installing-and-updating) to manage multiple versions of NodeJS.

Follow installation instructions [here](https://github.com/nvm-sh/nvm#installing-and-updating).

Then run the following to install NodeJS v16 and use it:

```bash
nvm install 16
nvm use 16
```

---

### Problem

Python errors when building NodeJS dependencies (eg `node-sass`). This is common on M1/M2 macs.

### Solution

You may need to install Python2 to build NodeJS dependencies (like `node-sass`)

We recommend using [`pyenv`](https://github.com/pyenv/pyenv#installation) to install Python2.

Follow installation instructions [here](https://github.com/pyenv/pyenv#installation).

Then run the following to install Python 2.7.18 and use it:

```bash
pyenv install 2.7.18
pyenv shell 2.7.18
```
4 changes: 2 additions & 2 deletions doc/customizing/initialization-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,10 @@ Definition of the story. This can be pretty complex to define for the standard u
Definition of the base map model.

| Name | Required | Type | Default | Description |
| --------------------------------------------- | -------- | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- |
| --------------------------------------------- | -------- | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <a id="basemaps-items"></a>`items` | no | [**`basemapItem`**](#basemap-item) | [default list of basemaps](https://github.com/TerriaJS/terriajs/blob/main/lib/Models/BaseMaps/defaultBaseMaps.ts) | The array of the base maps to be shown to the user. It will be combined with default list. To override the default basemap definition specify the id of the default basemap and parameter that need to be overriden. |
| `defaultBaseMapId` | no | **`string`** | | The id of the baseMap user will see on the first mapLoad. The value must be an id of the catalog item from the [**`enabledBaseMaps`**](#enabledbasemaps) array. |
| `previewBaseMapId` | no | **`string`** | | The id of the baseMap to be used as the base map in data preview. The value must be an id of the catalog item from the [**`enabledBaseMaps`**](#enabledbasemaps) array. | |
| `previewBaseMapId` | no | **`string`** | | The id of the baseMap to be used as the base map in data preview. The value must be an id of the catalog item from the [**`enabledBaseMaps`**](#enabledbasemaps) array. |
| <a id="enabledbasemaps"></a>`enabledBaseMaps` | no | **`string[]`** | _all_ | Array of base maps ids that is available to user. Use this do define order of the base maps in settings panel. Leave undefined to show all basemaps. The values must be an ids of the catalog item from the [**`baseMaps items`**](#basemaps-items) array. |

**Example**
Expand Down
2 changes: 0 additions & 2 deletions doc/deploying/controlling-in-an-iframe-or-popup.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
TerriaJS can be configured to accept messages posted to it by its parent window. This is useful when embedding a TerriaJS app in an iframe and when the parent wants to send more data to the embedded app than can be reasonably included in a URL.

Click [here](http://terriajs.github.io/embedded-natmap/) to see a demo, which also sizes the iframe to fill the available space.

First, the TerriaJS app must include a line like this:

```js
Expand Down
6 changes: 2 additions & 4 deletions doc/deploying/deploying-with-kubernetes.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ terriamap:
# Building Your Own Image
You can build your own TerriaMap image
You can build your own TerriaMap image. Choose your own `app-name` and `tag` (e.g. `awesome-map:1.0.0`) and put them into the command below:

```bash
docker build -t app-name:tag .
Expand All @@ -52,14 +52,12 @@ If you want to run a local version of TerriaMap using Kubernetes then you can tr

Or try a tool recommended in the [official Kuberntes setup documentation](https://kubernetes.io/docs/setup/).

Then run:
Then, using the same `app-name` & `tag` that you chose when building the image, run:

```bash
docker build -t app-name:tag .
helm upgrade --install -f deploy/helm/example-prod.yml terria deploy/helm/terria --set terriamap.image.full=app-name:tag --set global.image.pullPolicy=Never
```

using the same `app-name` & `tag` in both.

You can repeat the command `docker build -t app-name:tag .` and delete the terria-terriamap pod to update it, and you can run the above `helm upgrade` command after modifying or copying `example-prod.yml` to change the config.
Loading

0 comments on commit 3c627ff

Please sign in to comment.