Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into sass-upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
nf-s committed Nov 30, 2023
2 parents 3e0f19c + 179805f commit 48a13b5
Show file tree
Hide file tree
Showing 205 changed files with 6,877 additions and 3,362 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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- uses: actions/setup-node@v2
- uses: actions/setup-node@v4
with:
node-version: "14.x"
node-version-file: ".nvmrc"
- run: npm install -g yarn@^1.19.0 && yarn install

- name: Check formatting with prettier
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/setup-node@v4
with:
node-version: "14.x"
node-version-file: ".nvmrc"
- uses: google-github-actions/[email protected]
with:
service_account_key: ${{ secrets.GCP_CREDENTIALS }}
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
4 changes: 2 additions & 2 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ jobs:

- name: Set up Node.js for NPM
if: steps.detect.outputs.previous-version != steps.detect.outputs.current-version
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
registry-url: "https://registry.npmjs.org"
node-version: "14.x"
node-version-file: ".nvmrc"

- name: Install yarn
if: steps.detect.outputs.previous-version != steps.detect.outputs.current-version
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v16.20.2
42 changes: 41 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,53 @@
# Change Log

#### next release (8.4.0)
#### next release (8.3.10)

- [The next improvement]

#### 8.3.9 - 2023-11-24

- **Breaking change:** new Search Provider model
- Added SearchProviderMixin to connect searchProviders with a model system
- Created a simple base Mixin (`SearchProviderMixin`) to attach SearchProviders to the Model system and enable easier creation of new search providers.
- Made SearchProviders configurable from `config.json`.
- See [0011-configurable-search-providers ADR](./architecture/0011-configurable-search-providers.md) and [Search providers customization](./doc/customizing/search-providers.md) for more details
- Make all icons in `CatalogGroup` black by default and white when a catalog group is focused, selected or hovered over. Improve lock icon position in workbench.

#### 8.3.8 - 2023-11-15

- Fix maximum call stack size exceeded on Math.min/max when creating Charts
- Fix boolean flag in `MyDataTab` displaying number
- 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.
- Fix WMS `GetMap`/`GetFeatureInfo` requests not having `styles` parameter (will use empty string instead of `undefined`)
- Add CesiumIon geocoder
- `CatalogGroup` will now not show members until loaded
- 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 = ""`.

#### 8.3.7 - 2023-10-26

- **Breaking change:** Replaced `node-sass` with (dart) `sass`
- You will need to update your `TerriaMap` to use `sass` instead of `node-sass`.
- Fix `WebMapServiceCatalogItem` `allowFeaturePicking`
- Allow translation of TableStylingWorkflow.
- Fix "Remove all" not removing selected/picked features
- [The next improvement]
- 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

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
36 changes: 36 additions & 0 deletions architecture/0011-configurable-search-providers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# 11. Configuration of search providers

Date: 2021-01-19

## Status

Proposed

## Context

Ticket.
https://github.com/TerriaJS/terriajs/issues/5141.

### Intro

The existing approach to the definition of SearchProviders requires the development team's involvement and rebuild of the application, which can be undesired behavior in highly dynamic environments.
It's much better to enable the administrators to maintain the search providers.

## Proposal

- SearchProviders could greatly use the benefits of the new model system used for Catalog.
- Create a simple base Mixin (`SearchProviderMixin`) to attach SearchProviders to the Model system and enable easier creation of new search providers.
- Make SearchProviders configurable from `config.json`.
- Provide sensible defaults for everything.
- Typescript everything.
- Make everything translateable (administrator can specify i18next keys for all names)

## Benefits

- Much easier to implement new search providers.
- Much easier to update existing search providers, `urls` and `keys`.
- Offer administrators an option to decide wheter they want to load group members using `CatalogSearchProvider`.

## Consequences

This is quite a large change and should be thoroughly tested to avoid the possible bugs in the search providers migration.
2 changes: 1 addition & 1 deletion buildprocess/ci-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ gh api /repos/${GITHUB_REPOSITORY}/statuses/${GITHUB_SHA} -f state=pending -f co

# Install some tools we need from npm
npm install -g https://github.com/terriajs/sync-dependencies
npm install request@^2.83.0
npm install -g yarn@^1.19.0
yarn add -W [email protected]

# Clone and build TerriaMap, using this version of TerriaJS
TERRIAJS_COMMIT_HASH=$(git rev-parse HEAD)
Expand Down
7 changes: 6 additions & 1 deletion buildprocess/ci-values.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ terriamap:
initializationUrls:
- simple
parameters:
bingMapsKey: "ApZeR4iLSH_Pl2w5OSXrIqjvc_KzgPn_UXjn6jTtQDiueg72InBThCeIO4OSs6Fq"
cesiumIonAccessToken: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIxZDY5MDE1YS0yNGFlLTQ1MzctYWNkNy0wNDQ1YWNiNTM5MDIiLCJpZCI6Mjk5Miwic2NvcGVzIjpbImFzciIsImdjIl0sImlhdCI6MTUzODAzMzgyNn0.a2uTotdiHUo8FiHsO4MVNZ1KT5pOF0rb7CFdwbRAsOo"
useCesiumIonBingImagery: true
googleAnalyticsKey:
Expand All @@ -67,6 +66,12 @@ terriamap:
mobileDefaultViewerMode: "2d"
experimentalFeatures: true
feedbackUrl: "feedback"
searchProviders:
- id: search-provider/cesium-ion
type: cesium-ion-search-provider
name: "translate#viewModels.searchLocations"
flightDurationSeconds: 1.5
minCharacters: 3
languageConfiguration:
enabled: true
languages:
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.
Loading

0 comments on commit 48a13b5

Please sign in to comment.