Skip to content

Commit

Permalink
Merge remote-tracking branch 'terriajs-origin/main' into Extra-person…
Browse files Browse the repository at this point in the history
…alization-of-internationalization-frommain
  • Loading branch information
frodgar committed Oct 25, 2024
2 parents a520b5a + 727c304 commit 501dc4f
Show file tree
Hide file tree
Showing 368 changed files with 8,457 additions and 4,996 deletions.
11 changes: 7 additions & 4 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
/* Variables */
"no-label-var": 1,
"no-unused-vars": [
1,
"warn",
{
"vars": "local",
"args": "none"
Expand Down Expand Up @@ -115,18 +115,21 @@
"rules": {
// @TODO: revise these rules
"@typescript-eslint/consistent-type-assertions": "error",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_"
"caughtErrorsIgnorePattern": "^_",
"destructuredArrayIgnorePattern": "^_",
"ignoreRestSiblings": true
}
],
"@typescript-eslint/ban-ts-comment": "warn",
"@typescript-eslint/no-loss-of-precision": "warn",
"@typescript-eslint/no-unsafe-declaration-merging": "warn",
"react-hooks/exhaustive-deps": "warn",
"@typescript-eslint/no-unsafe-declaration-merging": "error",
"react-hooks/exhaustive-deps": "error",
"react/prop-types": "warn"
}
}
Expand Down
55 changes: 54 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,61 @@
# Change Log

#### next release (8.7.4)
#### next release (8.7.8)

- Fix the layout of the story builder and the item search tool.
- Add support for Cloud Optimised Geotiff (cog) in Cesium mode. Currently supports EPSG 4326 and 3857. There is experimental support for other projections but performance might suffer and there could be other issues.
- Fix `Workbench.collapseAll()` and `Workbench.expandAll()` for References.
- Add to the "doZoomTo" function the case of an imagery layer with imageryProvider.rectangle
- [The next improvement]

#### 8.7.7 - 2024-10-01

- **Breaking changes:**

- Remove RollbarErrorServiceProvder
- Error services now instantiated externally to terriajs

- Fix remaining lint warnings
- Augment cesium types and start using import instead of require in ts files
- Update to sass 1.79.1
- Add option to import assets from Cesium ion through the Add data panel. Use map config parameter "cesiumIonOAuth2ApplicationID" to enable the feature.

#### 8.7.6 - 2024-08-22

- Add I3SCatalogItem
- getFeaturesFromPickResult now async to handle I3SNode.loadFields()
- extract common style logic to new Cesium3dTilesStyleMixin.ts
- Set default value for date and datetime WPS fields only when the field is marked as required.
- Fix Sass deprecation warnings (declarations after nested blocks)
- Fix legend shown for WMS difference output item
- Add `diffItemProperties` trait to override properties of WSM difference output item. Useful for customizing feature info template strings etc.
- Add Proj4 definition for EPSG:8059
- Upgrade to terriajs-cesium 8.0.1.
- Re-enable terrain splitting.
- Add support for ArcGis ImageServer - this includes
- Support for "dynamic" `exportImage` endpoint (using `102100` wkid)
- Support for web mercator and wgs84 precached tiles
- Basic support for raster functions - a dropdown is rendered in the workbench for custom raster functions
- Traits to configure `bandIds` and `renderingRule`
- Increase `maxRefreshIntervals` from 1000 to 10000 for `WebMapServiceCatalogItem` and `ArcGisMapServerCatalogItem`.
- Add `nextDiscreteJulianDate` helper computed value to `DiscretelyTimeVaryingMixin`
- Add `EPSG:7899` to `Proj4Definitions`

#### 8.7.5 - 2024-06-26

- TSify some `js` and `jsx` files and provide `.d.ts` ambient type files for a few others. This is so that running `tsc` on an external project that imports Terria code will typecheck successfully.
- Upgraded a bunch of d3 dependencies for fixing security errors.
- Show rectangle selector for WPS bounding box parameter
- Fix `store` and `status` values send in WPS Execute request.
- Add docs for `modelDimensions`

#### 8.7.4 - 2024-06-07

- Fix position of draggable point after moving.
- Allow to modify `lookupCookie` for i18next
- Fix `getFeatureProperties` (in `FeatureInfoSection`) failing due to bad JSON parsing of nested strings.
- The `TableFeatureInfoStratum` default `featureInfoTemplate` will now not show `_id_` (internal Terria feature ID) in feature info
- Fix bug in FilterSection

#### 8.7.3 - 2024-05-28

Expand All @@ -17,6 +69,7 @@

#### 8.7.2 - 2024-05-14

- Add NumberParameterEditor to enable WPS AllowedValues Ranges to be set and use DefaultValue
- Feature info template has access to activeStyle of item having TableTraits.
- Updated a few dependencies to fix security warnings: `underscore`, `visx`, `shpjs`, `resolve-uri-loader`, `svg-sprite-loader`
- Allow related maps UI strings to be translated. Translation support for related maps content is not included.
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Please get involved in code review. It's a great way to expand your knowledge of
- Verify the code builds successfully and there are no lint warnings (run `gulp`).
- Check basic functionality of the map, such as enabling data sources in both 2D and 3D.
- Verify that all specs pass. If anything you did might be browser-dependent, you should run the specs in all the major supported browsers.
- Review the code itself for quality of implementation and consistency with coding conventions. Until we have our own coding conventions, we can [use Cesium's](https://github.com/AnalyticalGraphicsInc/cesium/wiki/JavaScript-Coding-Conventions).
- Review the code itself for quality of implementation and consistency with coding conventions. Until we have our own coding conventions, we use [Cesium's](https://github.com/CesiumGS/cesium/blob/master/Documentation/Contributors/CodingGuide/README.md).

Reviewers are welcome to make minor edits to a pull request (e.g. fixing typos) before merging it. If a reviewer makes larger changes, someone else - maybe the original author of the pull request - should take a look at the changes before the entire pull request is merged.

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ See [Getting Started](https://docs.terria.io/guide/getting-started/) in the [Doc

#### Related components

- **[TerriaMapStatic](https://github.com/terriajs/terriamapstatic)**, a pre-built version of TerriaMap, which can be deployed as a static HTML website, such as on Github Pages.
- **[TerriaMapStatic](https://github.com/terriajs/terriamap-static)**, a pre-built version of TerriaMap, which can be deployed as a static HTML website, such as on Github Pages.

### Big Thanks

Expand Down
2 changes: 1 addition & 1 deletion architecture/0002-require-instead-of-import.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Date: 2020-08-07 recorded, decision made earlier

## Status

Accepted
Superseded by [0012-do-not-use-require-for-cesium-in-ts](./0012-do-not-use-require-for-cesium-in-ts.md) on 2024-09-28

## Context

Expand Down
2 changes: 1 addition & 1 deletion architecture/0010-never-support-ie11.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Date: 2022-05-12

## Status

Proposed
Accepted

## Context

Expand Down
2 changes: 1 addition & 1 deletion architecture/0011-configurable-search-providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Date: 2021-01-19

## Status

Proposed
Accepted

## Context

Expand Down
34 changes: 34 additions & 0 deletions architecture/0012-do-not-use-require-for-cesium-in-ts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# 2. Using `imports` instead of `require` + type casting statements

Date: 2024-09-28

## Status

Proposed

## Context

A decision was made in [0002-require-instead-of-import](./0002-require-instead-of-import.md) to use non-exported terriajs-cesium features using `require` + type casting statements due to inability to augment namespace and enum imports.

Recently we found a new way to augment terriajs-cesium typescript definition in case of enums and namespaces. When we directly augment `terriajs-module` typescript will properly augment the namespaces and enums can be augmented as namespaces making everything works as should on type level.

```ts
declare module terriajs-cesium {
namespace FeatureDetection {
function isChrome(): boolean;
function isEdge(): boolean;
function isInternetExplorer(): boolean;
function isFirefox(): boolean;
function internetExplorerVersion(): number[];
function chromeVersion(): number[];
}

namespace Axis {
function fromName(name: string): number;
}
}
```

## Decission

Augment `terriajs-cesium` type definition
9 changes: 9 additions & 0 deletions buildprocess/configureWebpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ function configureWebpack(
".webpack.js",
".web.js",
".js",
".mjs",
".ts",
".tsx"
];
Expand Down Expand Up @@ -111,6 +112,14 @@ function configureWebpack(
})
});

// Some packages exports an .mjs file for ESM imports.
// This rule instructs webpack to import mjs modules correctly.
config.module.rules.push({
test: /\.mjs$/,
include: /node_modules/,
type: "javascript/auto"
});

const zipJsDir = path.dirname(require.resolve("@zip.js/zip.js/package.json"));

config.module.rules.push({
Expand Down
1 change: 0 additions & 1 deletion buildprocess/createKarmaBaseConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ module.exports = function (config) {
// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ["jasmine"],
listenAddress: "::",

// list of files / patterns to load in the browser
files: [
Expand Down
67 changes: 0 additions & 67 deletions buildprocess/directory-loader.js

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
114 changes: 114 additions & 0 deletions doc/connecting-to-data/customizing-data-appearance/model-dimensions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# Model Dimensions

Model dimensions can be used to define dropdown menus in the workbench that update model JSON - think of it as a dropdown that patches the model JSON with a new value. This is useful for changing the appearance of a dataset, such as changing the colourMap for a CSV.

## Basic example

For example - this renders a new drop down called "Color" that changes the `colorPalette` trait - [test link](http://ci.terria.io/main/#clean&start={%22initSources%22%3A[{%22homeCamera%22%3A{%22north%22%3A-8%2C%22east%22%3A158%2C%22south%22%3A-45%2C%22west%22%3A109}%2C%22workbench%22%3A[%22test%22]%2C%22catalog%22%3A[{%22type%22%3A%22csv%22%2C%22url%22%3A%22test%2FNSW_LGA_NEXIS_201212.csv%22%2C%22name%22%3A%22NSWLGANEXIS2012%22%2C%22id%22%3A%22test%22%2C%22modelDimensions%22%3A[{%22id%22%3A%22cols%22%2C%22name%22%3A%22Color%22%2C%22selectedId%22%3A%22Red%22%2C%22options%22%3A[{%22id%22%3A%22Red%22%2C%22value%22%3A{%22defaultStyle%22%3A{%22color%22%3A{%22colorPalette%22%3A%22Reds%22}}}}%2C{%22id%22%3A%22Blue%22%2C%22value%22%3A{%22defaultStyle%22%3A{%22color%22%3A{%22colorPalette%22%3A%22Blues%22}}}}]}]}]}]})

```json
{
"type": "csv",
"url": "test/NSW_LGA_NEXIS_201212.csv",
"name": "NSW LGA NEXIS 2012",
"modelDimensions": [
{
"id": "cols",
"name": "Color",
"selectedId": "Red",
"options": [
{
"id": "Red",
"value": {
"defaultStyle": {
"color": {
"colorPalette": "Reds"
}
}
}
},
{
"id": "Blue",
"value": {
"defaultStyle": {
"color": {
"colorPalette": "Blues"
}
}
}
}
]
}
]
}
```

<img src="../img/model-dim.jpeg">

## Example with Mustache template

Model dimensions also supports the use of [Mustache templates](https://mustache.github.io/) - this means you can refer to other parts of the model JSON in the value of the model dimension. For example, this changes the `colorPalette` trait:

```json
{
"type": "csv",
"url": "test/NSW_LGA_NEXIS_201212.csv",
"name": "NSW LGA NEXIS 2012",
"modelDimensions": [
{
"id": "Cols",
"selectedId": "Red",
"options": [
{
"id": "Red",
"value": {
"defaultStyle": {
"color": {
"colorPalette": "{{modelDimensions.0.selectedId}}"
}
}
}
},
{
"id": "Blue",
"value": {
"defaultStyle": {
"color": {
"colorPalette": "{{modelDimensions.0.selectedId}}"
}
}
}
}
]
}
]
}
```

This is a silly example - but the template approach means you can have "interaction" between `modelDimensions`

```json
{
...,
"modelDimensions": [
{
"id": "some-dim",
"selectedId": "some-option",
"options": [
{
"id": "some-option",
"value": {
"url": "https://example.com/{{modelDimensions.0.selectedId}}-and-{{modelDimensions.1.selectedId}}.geojson"
}
},
...
]
}
],
...
}
```

## Default `selectedId`

It is important to note that the `selectedId` does not apply/update the model JSON when the model is first loaded. So it is best to make sure that the `selectedId` matches your default model JSON.
Loading

0 comments on commit 501dc4f

Please sign in to comment.