diff --git a/.github/workflows/Lint.yml b/.github/workflows/Lint.yml
deleted file mode 100644
index ffc12ef21..000000000
--- a/.github/workflows/Lint.yml
+++ /dev/null
@@ -1,29 +0,0 @@
-# name: Lint
-
-# on: [pull_request]
-
-# jobs:
-# eslint:
-# name: Run eslint
-# runs-on: ubuntu-latest
-
-# steps:
-# - name: Check out Git repository
-# uses: actions/checkout@v2
-
-# - name: Set up Node.js
-# uses: actions/setup-node@v1
-# with:
-# node-version: 12
-
-# # ESLint and Prettier must be in `package.json`
-# - name: Install Node.js dependencies
-# run: npm install
-
-# - name: Run linters
-# uses: samuelmeuli/lint-action@v1
-# with:
-# github_token: ${{ secrets.github_token }}
-# # Enable linters
-# eslint: true
-# eslint_extensions: ts,tsx
diff --git a/.github/workflows/build-and-push.yaml b/.github/workflows/build-and-push.yaml
new file mode 100644
index 000000000..3d58b3dc3
--- /dev/null
+++ b/.github/workflows/build-and-push.yaml
@@ -0,0 +1,57 @@
+name: Build and push artifacts
+
+on:
+ push:
+ tags:
+ - 'v*'
+
+jobs:
+ build_and_push:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Artifactory Login
+ uses: MapColonies/shared-workflows/actions/artifactory-login@artifactory-login-v1.0.0
+ with:
+ registry: ${{ secrets.ACR_URL }}
+ username: ${{ secrets.ACR_PUSH_USER }}
+ password: ${{ secrets.ACR_PUSH_TOKEN }}
+
+ - name: Build Docker Image
+ id: build
+ uses: MapColonies/shared-workflows/actions/build-docker@build-docker-v1.1.0
+ with:
+ domain: app
+ registry: ${{ secrets.ACR_URL }}
+
+ - name: Push Docker Image
+ uses: MapColonies/shared-workflows/actions/push-docker@push-docker-v1.0.1
+ with:
+ image_name: ${{ steps.build.outputs.docker_image_full_name }}
+ image_tag: ${{ steps.build.outputs.docker_image_tag }}
+
+ - name: Build and Push Helm Chart
+ uses: MapColonies/shared-workflows/actions/build-and-push-helm@build-and-push-helm-v1.0.1
+ with:
+ context: ./helm
+ domain: app
+ registry: ${{ secrets.ACR_URL }}
+
+ - name: Update Artifacts File- Docker
+ uses: MapColonies/shared-workflows/actions/update-artifacts-file@update-artifacts-file-v1.1.1
+ with:
+ domain: app
+ artifact_name: ${{ github.event.repository.name }}
+ artifact_tag: ${{ github.ref_name }}
+ type: docker
+ registry: ${{ secrets.ACR_URL }}
+ github_token: ${{ secrets.GH_PAT }}
+
+ - name: Update Artifacts File- Helm
+ uses: MapColonies/shared-workflows/actions/update-artifacts-file@update-artifacts-file-v1.1.1
+ with:
+ domain: app
+ artifact_name: ${{ github.event.repository.name }}
+ artifact_tag: ${{ github.ref_name }}
+ type: helm
+ registry: ${{ secrets.ACR_URL }}
+ github_token: ${{ secrets.GH_PAT }}
diff --git a/.github/workflows/build_and_push.yaml b/.github/workflows/build_and_push.yaml
deleted file mode 100644
index 725aaca8b..000000000
--- a/.github/workflows/build_and_push.yaml
+++ /dev/null
@@ -1,31 +0,0 @@
-name: Build and push artifacts
-
-on:
- push:
- tags:
- - 'v*'
-
- workflow_dispatch:
- inputs:
- version:
- required: true
- type: string
-env:
- HELM_EXPERIMENTAL_OCI: 1
-
-permissions:
- contents: write
- pull-requests: write
-
-jobs:
- build_and_push_docker:
- uses: MapColonies/shared-workflows/.github/workflows/build-and-push-docker.yaml@v4
- secrets: inherit
- with:
- scope: app
-
- build_and_push_helm:
- uses: MapColonies/shared-workflows/.github/workflows/build-and-push-helm.yaml@v4
- secrets: inherit
- with:
- scope: app
diff --git a/.github/workflows/Main.yaml b/.github/workflows/pull-request.yaml
similarity index 53%
rename from .github/workflows/Main.yaml
rename to .github/workflows/pull-request.yaml
index 7eb89ed50..c9a37a696 100644
--- a/.github/workflows/Main.yaml
+++ b/.github/workflows/pull-request.yaml
@@ -1,23 +1,37 @@
-name: CI
+name: pull_request
on: [pull_request]
jobs:
+ helm-lint:
+ name: Run Helm lint Check
+ runs-on: ubuntu-latest
+ steps:
+ - name: Check out TS Project Git repository
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+ - name: helm-lint
+ uses: MapColonies/shared-workflows/actions/helm-lint@helm-lint-v1
+
build_and_test:
runs-on: ubuntu-latest
+ permissions:
+ checks: write
+ contents: write
strategy:
matrix:
os: [ubuntu-latest]
node-version: [16.13.x]
steps:
- name: checkout
- uses: actions/checkout@v4
+ uses: actions/checkout@v5
- uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Use Node.js ${{ matrix.node-version }}
- uses: actions/setup-node@v4
+ uses: actions/setup-node@v5
with:
node-version: ${{ matrix.node-version }}
- name: Install yarn
@@ -26,20 +40,26 @@ jobs:
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update
sudo apt-get install --no-install-recommends yarn
-
- name: Install dependecies
run: yarn
- name: Lint
- run: yarn run eslint:check
+ uses: wearerequired/lint-action@v2
+ with:
+ tsc: true
+ eslint: true
+ eslint_extensions: js,jsx,ts,tsx
+ prettier: true
+ prettier_dir: src
- name: Test
run: yarn test
- security:
+ build_docker_image:
+ name: Build Docker Image
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@master
- - name: Run Snyk to check for vulnerabilities
- uses: snyk/actions/node@master
- continue-on-error: true
- env:
- SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
+ - name: Checkout repository
+ uses: actions/checkout@v5
+ - name: Build Docker image
+ uses: docker/build-push-action@v6
+ with:
+ push: false
diff --git a/.github/workflows/release-please.yaml b/.github/workflows/release-please.yaml
index c34e43cd4..bc2af7c9e 100644
--- a/.github/workflows/release-please.yaml
+++ b/.github/workflows/release-please.yaml
@@ -2,17 +2,18 @@ on:
push:
branches:
- master
+ workflow_dispatch:
+
permissions:
contents: write
pull-requests: write
+
name: release-please
+
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v4
with:
- # this assumes that you have created a personal access token
- # (PAT) and configured it as a GitHub action secret named
- # `MY_RELEASE_PLEASE_TOKEN` (this secret name is not important).
token: ${{ secrets.GH_PAT }}
diff --git a/.prettierignore b/.prettierignore
index b77ff691a..b194e6f12 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -1,2 +1,7 @@
.vscode/settings.json
-schemas/*.json
\ No newline at end of file
+*.json
+helm
+confd
+public
+CHANGELOG.md
+src/discrete-layer/models
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index ea2b7f13e..60bf00910 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
".": "4.3.5"
-}
\ No newline at end of file
+}
diff --git a/README.md b/README.md
index fc6a03677..28f71e8b5 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,6 @@ React app created with typescript that defines manages and displays discrete lay
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app)
-
## Installation
Install deps with yarn
@@ -20,15 +19,15 @@ yarn confd
```
To generate:
-public/env-config.js <- For env variables
-public/index.html <- For PUBLIC_URL, to support non-root URL
+public/env-config.js <- For env variables
+public/index.html <- For PUBLIC_URL, to support non-root URL
To use app env variables inside a docker, run the following command
```bash
node ./confd/generate-config.js --environment production --indocker
```
-
+
Start app
```bash
@@ -45,7 +44,7 @@ To run tests, run the following command
yarn test
```
-It will run in an interactive mode
+It will run in an interactive mode
See [running tests](https://facebook.github.io/create-react-app/docs/running-tests)
@@ -63,21 +62,24 @@ See [deployment](https://facebook.github.io/create-react-app/docs/deployment)
## Deployment
-> [!IMPORTANT]
+> [!IMPORTANT]
> We depend on `Red-Hat Yaml Extension` for validating the values files against the relevant schemas from helm-common.
> That means, you should install the extension from vscode in order to be able to edit values files according to our schemas.
To update helm dependencies
+
```bash
yarn helm-update
```
-In order to create/renew values schemas
+In order to create/renew values schemas
+
```bash
yarn helm-assets
```
To deploy: helm values **MUST** be combined from global.yaml and values.yaml (use npm script!)
+
```bash
yarn helm-install
```
diff --git a/config-overrides.js b/config-overrides.js
index fc7bd018e..cd769a1e2 100644
--- a/config-overrides.js
+++ b/config-overrides.js
@@ -2,39 +2,42 @@ const webpack = require('webpack');
const path = require('path');
module.exports = function override(config, env) {
- //do stuff with the webpack config...
+ //do stuff with the webpack config...
- config.resolve.fallback = {
- url: require.resolve('url'),
- assert: require.resolve('assert'),
- crypto: require.resolve('crypto-browserify'),
- http: require.resolve('stream-http'),
- https: require.resolve('https-browserify'),
- os: require.resolve('os-browserify/browser'),
- buffer: require.resolve('buffer'),
- stream: require.resolve('stream-browserify'),
- zlib: require.resolve("browserify-zlib")
- };
+ config.resolve.fallback = {
+ url: require.resolve('url'),
+ assert: require.resolve('assert'),
+ crypto: require.resolve('crypto-browserify'),
+ http: require.resolve('stream-http'),
+ https: require.resolve('https-browserify'),
+ os: require.resolve('os-browserify/browser'),
+ buffer: require.resolve('buffer'),
+ stream: require.resolve('stream-browserify'),
+ zlib: require.resolve('browserify-zlib'),
+ };
- config.resolve.alias = {
- ...config.resolve.alias,
- 'react-dnd': path.resolve(__dirname, './node_modules/react-dnd'),
- 'react-dnd-html5-backend': path.resolve(__dirname, './node_modules/react-dnd-html5-backend'),
- }
-
- config.plugins.push(
- new webpack.ProvidePlugin({
- process: 'process/browser',
- Buffer: ['buffer', 'Buffer'],
- }),
- );
+ config.resolve.alias = {
+ ...config.resolve.alias,
+ 'react-dnd': path.resolve(__dirname, './node_modules/react-dnd'),
+ 'react-dnd-html5-backend': path.resolve(
+ __dirname,
+ './node_modules/react-dnd-html5-backend'
+ ),
+ };
- config.module.rules.push({
- test: /\.m?js/,
- resolve: {
- fullySpecified: false
- }
- })
+ config.plugins.push(
+ new webpack.ProvidePlugin({
+ process: 'process/browser',
+ Buffer: ['buffer', 'Buffer'],
+ })
+ );
- return config;
-}
\ No newline at end of file
+ config.module.rules.push({
+ test: /\.m?js/,
+ resolve: {
+ fullySpecified: false,
+ },
+ });
+
+ return config;
+};
diff --git a/docker-compose.yml b/docker-compose.yml
index 34051cbb7..cc2decafe 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -1,9 +1,7 @@
version: '3'
services:
-
- catalog-app-service:
-
+ catalog-app-service:
image: catalog-app
build: .
diff --git a/public/assets/pages/compatibilityError.html b/public/assets/pages/compatibilityError.html
index 83dd59d2c..0d85d17ec 100644
--- a/public/assets/pages/compatibilityError.html
+++ b/public/assets/pages/compatibilityError.html
@@ -14,7 +14,7 @@
-
+
diff --git a/release-please-config.json b/release-please-config.json
index 061468b65..d5dfedaaf 100644
--- a/release-please-config.json
+++ b/release-please-config.json
@@ -33,4 +33,4 @@
{ "type": "test", "section": "Tests", "hidden": true },
{ "type": "ci", "section": "Continuous Integration", "hidden": true }
]
-}
\ No newline at end of file
+}
diff --git a/src/App.css b/src/App.css
index b8c883567..5e666fe0a 100644
--- a/src/App.css
+++ b/src/App.css
@@ -1,24 +1,32 @@
-.mdc-checkbox .mdc-checkbox__native-control:checked ~ .mdc-checkbox__background::before,
-.mdc-checkbox .mdc-checkbox__native-control:indeterminate ~ .mdc-checkbox__background::before {
+.mdc-checkbox
+ .mdc-checkbox__native-control:checked
+ ~ .mdc-checkbox__background::before,
+.mdc-checkbox
+ .mdc-checkbox__native-control:indeterminate
+ ~ .mdc-checkbox__background::before {
background-color: #2979ff;
/* @alternate */
background-color: var(--mdc-theme-primary, #2979ff);
}
-.mdc-checkbox.mdc-checkbox--selected .mdc-checkbox__ripple::before, .mdc-checkbox.mdc-checkbox--selected .mdc-checkbox__ripple::after {
+.mdc-checkbox.mdc-checkbox--selected .mdc-checkbox__ripple::before,
+.mdc-checkbox.mdc-checkbox--selected .mdc-checkbox__ripple::after {
background-color: #2979ff;
/* @alternate */
background-color: var(--mdc-theme-primary, #2979ff);
}
-.mdc-checkbox.mdc-ripple-upgraded--background-focused.mdc-checkbox--selected .mdc-checkbox__ripple::before,
-.mdc-checkbox.mdc-ripple-upgraded--background-focused.mdc-checkbox--selected .mdc-checkbox__ripple::after {
+.mdc-checkbox.mdc-ripple-upgraded--background-focused.mdc-checkbox--selected
+ .mdc-checkbox__ripple::before,
+.mdc-checkbox.mdc-ripple-upgraded--background-focused.mdc-checkbox--selected
+ .mdc-checkbox__ripple::after {
background-color: #2979ff;
/* @alternate */
background-color: var(--mdc-theme-primary, #2979ff);
}
.mdc-checkbox__native-control:enabled:checked ~ .mdc-checkbox__background,
-.mdc-checkbox__native-control:enabled:indeterminate ~ .mdc-checkbox__background {
+.mdc-checkbox__native-control:enabled:indeterminate
+ ~ .mdc-checkbox__background {
border-color: #2979ff;
/* @alternate */
border-color: var(--mdc-theme-primary, #2979ff);
@@ -35,14 +43,16 @@
bottom: 40px;
left: 8px;
}
-.mdc-snackbar__label, [dir=rtl] .mdc-snackbar__label {
+.mdc-snackbar__label,
+[dir='rtl'] .mdc-snackbar__label {
padding: 0;
}
-.mdc-snackbar__surface, [dir=rtl] .mdc-snackbar__surface {
+.mdc-snackbar__surface,
+[dir='rtl'] .mdc-snackbar__surface {
padding: 0;
}
.mdc-snackbar__action:not(:disabled) {
- color: var(--mdc-theme-primary, #2979ff);;
+ color: var(--mdc-theme-primary, #2979ff);
}
.app-container {
@@ -81,7 +91,7 @@ button.cesium-infoBox-close:hover {
left: unset;
}
-[dir=rtl] .cesium-infoBox {
+[dir='rtl'] .cesium-infoBox {
right: unset;
left: 88px;
}
@@ -92,7 +102,7 @@ button.cesium-infoBox-close:hover {
justify-content: space-evenly;
}
-[dir=rtl] .cesium-infoBox-title {
+[dir='rtl'] .cesium-infoBox-title {
direction: ltr;
}
@@ -123,7 +133,7 @@ button.cesium-infoBox-close:hover {
}
.appVersionContainer-slave {
- color: var(--mdc-theme-gc-site-slave);
+ color: var(--mdc-theme-gc-site-slave);
}
title.rtl {
@@ -150,10 +160,12 @@ body[dir='ltr'] .react-datepicker__close-icon {
@keyframes glow {
from {
- text-shadow: 0 0 10px #fff, 0 0 12px #fff, 0 0 14px #e60073, 0 0 18px #e60073, 0 0 20px #e60073;
+ text-shadow: 0 0 10px #fff, 0 0 12px #fff, 0 0 14px #e60073,
+ 0 0 18px #e60073, 0 0 20px #e60073;
}
to {
- text-shadow: 0 0 12px #fff, 0 0 14px #ff4da6, 0 0 16px #ff4da6, 0 0 18px #ff4da6, 0 0 20px #ff4da6, 0 0 22px #ff4da6;
+ text-shadow: 0 0 12px #fff, 0 0 14px #ff4da6, 0 0 16px #ff4da6,
+ 0 0 18px #ff4da6, 0 0 20px #ff4da6, 0 0 22px #ff4da6;
}
}
@@ -164,8 +176,8 @@ input::-webkit-inner-spin-button {
}
input:-webkit-autofill,
-input:-webkit-autofill:hover,
-input:-webkit-autofill:focus,
+input:-webkit-autofill:hover,
+input:-webkit-autofill:focus,
input:-webkit-autofill:active {
-webkit-box-shadow: 0 0 0 30px var(--mdc-theme-alternative-surface) inset !important;
}
@@ -202,7 +214,11 @@ input:disabled {
}
}
-.mdc-checkbox .mdc-checkbox__native-control:enabled:not(:checked):not(:indeterminate):not([data-indeterminate=true]) ~ .mdc-checkbox__background {
+.mdc-checkbox
+ .mdc-checkbox__native-control:enabled:not(:checked):not(:indeterminate):not(
+ [data-indeterminate='true']
+ )
+ ~ .mdc-checkbox__background {
border: 1px solid var(--mdc-theme-on-surface);
}
@@ -220,4 +236,4 @@ input:disabled {
100% {
opacity: 1; /* Fully visible again */
}
-}
\ No newline at end of file
+}
diff --git a/src/App.dark-theme.css b/src/App.dark-theme.css
index 01d878451..d99a5b6c4 100644
--- a/src/App.dark-theme.css
+++ b/src/App.dark-theme.css
@@ -66,7 +66,7 @@
.dark-theme .mdc-menu .mdc-list {
/* color: var(--mdc-theme-text-primary-on-background, rgba(0, 0, 0, 0.87)); */
- color: var(--mdc-theme-text-primary-on-dark)
+ color: var(--mdc-theme-text-primary-on-dark);
}
.dark-theme .mdc-menu .mdc-list .mdc-list-item {
@@ -97,15 +97,18 @@
}
.dark-theme .mdc-select.mdc-select--disabled .mdc-select__selected-text {
- color: unset;
+ color: unset;
}
-.dark-theme .mdc-select.mdc-select--outlined.mdc-select--no-label.mdc-select--disabled {
+.dark-theme
+ .mdc-select.mdc-select--outlined.mdc-select--no-label.mdc-select--disabled {
background-color: var(--mdc-theme-text-disabled-on-light);
opacity: 0.3;
}
-.dark-theme .mdc-list.mdc-menu__items .mdc-list-item.mdc-ripple-upgraded--background-focused {
+.dark-theme
+ .mdc-list.mdc-menu__items
+ .mdc-list-item.mdc-ripple-upgraded--background-focused {
color: var(--mdc-theme-primary);
}
@@ -140,7 +143,7 @@
}
.dark-theme .ag-theme-alpine-dark .ag-row-hover:before {
- background-color: unset
+ background-color: unset;
}
.dark-theme .ag-theme-alpine-dark .ag-cell-focus {
@@ -176,7 +179,7 @@
.dark-theme .mdc-text-field--invalid .mdc-text-field__input {
color: var(--mdc-theme-gc-error-high, red) !important;
}
-
+
.dark-theme .mdc-text-field__input {
color: var(--mdc-theme-text-primary-on-dark, #fff) !important;
}
@@ -210,7 +213,8 @@
/* DATE-TIME-PICKER CUSTOMIZATION */
-.MuiGrid-align-items-xs-flex-end.MuiGrid-justify-content-xs-center.MuiGrid-grid-xs-6, .MuiPickersCalendarHeader-switchHeader {
+.MuiGrid-align-items-xs-flex-end.MuiGrid-justify-content-xs-center.MuiGrid-grid-xs-6,
+.MuiPickersCalendarHeader-switchHeader {
direction: ltr;
}
@@ -354,7 +358,6 @@ body[dir='rtl'] .dark-theme .rst__virtualScrollOverride {
opacity: 0.3;
}
-
/* Date Range Picker */
.dark-theme .pickerContainer {
@@ -362,20 +365,30 @@ body[dir='rtl'] .dark-theme .rst__virtualScrollOverride {
--date-picker-day-background: var(--mdc-theme-alternative-surface);
--date-picker-day-font-color: var(--mdc-theme-text-primary-on-background);
- --date-picker-day-selecting-range-background: var(--mdc-theme-gc-selection-background);
+ --date-picker-day-selecting-range-background: var(
+ --mdc-theme-gc-selection-background
+ );
--date-picker-day-selecting-range-font-color: var(--mdc-theme-on-primary);
--date-picker-day-hover-background: var(--mdc-theme-text-primary-on-dark);
--date-picker-day-hover-font-color: var(--mdc-theme-text-primary-on-light);
- --date-picker-selected-day-background: var(--mdc-theme-gc-selection-background);
- --date-picker-selected-day-hover-background: var(--mdc-theme-text-primary-on-dark);
- --date-picker-selected-day-hover-font-color: var(--mdc-theme-text-primary-on-light);
+ --date-picker-selected-day-background: var(
+ --mdc-theme-gc-selection-background
+ );
+ --date-picker-selected-day-hover-background: var(
+ --mdc-theme-text-primary-on-dark
+ );
+ --date-picker-selected-day-hover-font-color: var(
+ --mdc-theme-text-primary-on-light
+ );
--date-picker-selected-day-font-color: var(--mdc-theme-on-primary);
--date-picker-nav-icons-color: var(--mdc-theme-text-primary-on-background);
--date-picker-header-background: var(--mdc-theme-gc-selection-background);
--date-picker-header-color: var(--mdc-theme-text-primary-on-background);
- --date-picker-shortcuts-hover-background: var(--mdc-theme-text-primary-on-dark);
+ --date-picker-shortcuts-hover-background: var(
+ --mdc-theme-text-primary-on-dark
+ );
--date-picker-shortcuts-background: var(--mdc-theme-alternative-surface);
--date-picker-shortcuts-font-color: var(--mdc-theme-text-primary-on-light);
@@ -383,9 +396,15 @@ body[dir='rtl'] .dark-theme .rst__virtualScrollOverride {
--month-year-pickers-font-color: var(--mdc-theme-on-primary);
--month-year-pickers-border-color: var(--mdc-theme-gc-selection-background);
- --date-picker-scrollbar-track-background: var(--mdc-theme-text-primary-on-light);
- --date-picker-scrollbar-thumb-background: var(--mdc-theme-alternative-surface);
- --date-picker-scrollbar-thumb-hover-background: var(--mdc-theme-text-primary-on-dark);
+ --date-picker-scrollbar-track-background: var(
+ --mdc-theme-text-primary-on-light
+ );
+ --date-picker-scrollbar-thumb-background: var(
+ --mdc-theme-alternative-surface
+ );
+ --date-picker-scrollbar-thumb-hover-background: var(
+ --mdc-theme-text-primary-on-dark
+ );
}
/* LINEAR PROGRESS CUSTOMIZATION */
@@ -394,13 +413,13 @@ body[dir='rtl'] .dark-theme .rst__virtualScrollOverride {
}
/* COLLAPSABLE PANEL*/
-.dark-theme .rmwc-collapsible-list__children-inner{
- border: 1px solid var(--mdc-theme-gc-selection-background);
+.dark-theme .rmwc-collapsible-list__children-inner {
+ border: 1px solid var(--mdc-theme-gc-selection-background);
margin-bottom: 2px;
}
/* SELLECT BUTTON FLAVOR*/
-.dark-theme .selectButtonFlavor .mdc-select__anchor{
+.dark-theme .selectButtonFlavor .mdc-select__anchor {
height: 40px;
width: 144px;
background-color: transparent;
@@ -408,19 +427,21 @@ body[dir='rtl'] .dark-theme .rst__virtualScrollOverride {
border: 1px solid var(--mdc-theme-primary);
}
-.dark-theme .selectButtonFlavor .mdc-select__selected-text{
+.dark-theme .selectButtonFlavor .mdc-select__selected-text {
color: var(--mdc-theme-primary) !important;
}
-.dark-theme .selectButtonFlavor.mdc-select--disabled .mdc-select__selected-text{
+.dark-theme
+ .selectButtonFlavor.mdc-select--disabled
+ .mdc-select__selected-text {
color: var(--mdc-theme-text-disabled-on-dark) !important;
}
-.dark-theme .selectButtonFlavor.mdc-select--disabled .mdc-select__anchor{
+.dark-theme .selectButtonFlavor.mdc-select--disabled .mdc-select__anchor {
border: solid 1px var(--mdc-theme-on-secondary);
opacity: 0.4;
}
-.dark-theme .selectButtonFlavor .mdc-list-item__ripple{
+.dark-theme .selectButtonFlavor .mdc-list-item__ripple {
opacity: 0 !important;
-}
\ No newline at end of file
+}
diff --git a/src/App.tsx b/src/App.tsx
index 6d5060797..dc4e55887 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -1,4 +1,4 @@
-import React, { useState, useLayoutEffect,useEffect } from 'react';
+import React, { useState, useLayoutEffect, useEffect } from 'react';
import { IntlProvider } from 'react-intl';
import Moment from 'moment';
import 'moment/locale/he'; // TODO: improve dynamic moment locales loading
@@ -38,7 +38,6 @@ import './App.css';
import './App.dark-theme.css';
import './App.light-theme.css';
-
import { queue } from './discrete-layer/components/snackbar/notification-queue';
import { SnackContainer } from './discrete-layer/components/snackbar/snack-container';
import DiscreteLayerView from './discrete-layer/views/discrete-layer-view';
@@ -47,21 +46,27 @@ import MESSAGES from './common/i18n';
import CONFIG from './common/config';
import { camelize } from './common/helpers/string';
import { CustomTheme } from './theming/custom.theme';
-import EnumsMapContext, { IEnumsMapType } from './common/contexts/enumsMap.context';
-import LookupTablesContext, { ILookupTableData } from './common/contexts/lookupTables.context';
+import EnumsMapContext, {
+ IEnumsMapType,
+} from './common/contexts/enumsMap.context';
+import LookupTablesContext, {
+ ILookupTableData,
+} from './common/contexts/lookupTables.context';
import WebSocketNotifications from './discrete-layer/views/components/notifications/web-socket-notifications';
import { PasswordAutofillDisabler } from './discrete-layer/views/components/password-autofill-disabler.component';
const App: React.FC = () => {
- /*const prefersDarkMode = */useMediaQuery('(prefers-color-scheme: dark)');
+ /*const prefersDarkMode = */ useMediaQuery('(prefers-color-scheme: dark)');
// eslint-disable-next-line
const [lang, setLang] = useState(CONFIG.I18N.DEFAULT_LANGUAGE);
const [enumsMap, setEnumsMap] = useState
(null);
// const theme = Themes.lightTheme; //TODO: when dark theme will be tuned use this --> prefersDarkMode ? Themes.darkTheme : Themes.lightTheme;
- const customThemeProps: Record = {};
+ const customThemeProps: Record = {};
for (const prop in CustomTheme.darkTheme) {
- customThemeProps[camelize(prop)] = (CustomTheme.darkTheme as Record)[prop];
+ customThemeProps[camelize(prop)] = (
+ CustomTheme.darkTheme as Record
+ )[prop];
}
const theme = {
...Themes.darkTheme,
@@ -70,11 +75,13 @@ const App: React.FC = () => {
alternativeSurface: '#2D3748',
...customThemeProps,
custom: {
- ...CustomTheme.darkTheme
- }
+ ...CustomTheme.darkTheme,
+ },
};
- const [lookupTablesData, setLookupTablesData] = useState({});
+ const [lookupTablesData, setLookupTablesData] = useState(
+ {}
+ );
useLayoutEffect(() => {
setLang(document.documentElement.lang);
@@ -87,7 +94,11 @@ const App: React.FC = () => {
return (
<>
- null} locale={lang} messages={MESSAGES[lang] as Record}>
+ null}
+ locale={lang}
+ messages={MESSAGES[lang] as Record}
+ >
{
),
}}
>
-
+
-
+
diff --git a/src/__mocks-data__/search-results.mock.ts b/src/__mocks-data__/search-results.mock.ts
index 985730363..c3d436a5d 100644
--- a/src/__mocks-data__/search-results.mock.ts
+++ b/src/__mocks-data__/search-results.mock.ts
@@ -2,7 +2,10 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
import { ILayerImage } from '../discrete-layer/models/layerImage';
-export const createMockData = (count: number, prefix: string): ILayerImage[] => {
+export const createMockData = (
+ count: number,
+ prefix: string
+): ILayerImage[] => {
const rowData: ILayerImage[] = [];
for (let i = 0; i < count; i++) {
// @ts-ignore
@@ -32,13 +35,15 @@ export const MOCK_DATA_IMAGERY_LAYERS_ISRAEL = [
description: '',
geojson: {
type: 'Polygon',
- coordinates: [[
- [34.8076891807199, 31.9042863434239],
- [34.816135996859, 31.9042863434239],
- [34.816135996859,31.9118071956932],
- [34.8076891807199,31.9118071956932],
- [34.8076891807199,31.9042863434239],
- ]],
+ coordinates: [
+ [
+ [34.8076891807199, 31.9042863434239],
+ [34.816135996859, 31.9042863434239],
+ [34.816135996859, 31.9118071956932],
+ [34.8076891807199, 31.9118071956932],
+ [34.8076891807199, 31.9042863434239],
+ ],
+ ],
},
referenceSystem: '',
imagingTimeStart: new Date(),
@@ -50,7 +55,7 @@ export const MOCK_DATA_IMAGERY_LAYERS_ISRAEL = [
properties: {
protocol: 'XYZ_LAYER',
url: 'https://tiles.openaerialmap.org/5a852c072553e6000ce5ac8d/0/7950e2de-5d9e-49aa-adec-6e92384be0b9/{z}/{x}/{y}.png',
- meta: 'http://oin-hotosm.s3.amazonaws.com/5a852c072553e6000ce5ac8d/0/7950e2de-5d9e-49aa-adec-6e92384be0b9_meta.json'
+ meta: 'http://oin-hotosm.s3.amazonaws.com/5a852c072553e6000ce5ac8d/0/7950e2de-5d9e-49aa-adec-6e92384be0b9_meta.json',
},
},
{
@@ -60,13 +65,15 @@ export const MOCK_DATA_IMAGERY_LAYERS_ISRAEL = [
description: '',
geojson: {
type: 'Polygon',
- coordinates: [[
- [34.8099445223518, 31.9061345394902],
- [34.8200994167574, 31.9061345394902],
- [34.8200994167574, 31.9106311613979],
- [34.8099445223518, 31.9106311613979],
- [34.8099445223518, 31.9061345394902],
- ]],
+ coordinates: [
+ [
+ [34.8099445223518, 31.9061345394902],
+ [34.8200994167574, 31.9061345394902],
+ [34.8200994167574, 31.9106311613979],
+ [34.8099445223518, 31.9106311613979],
+ [34.8099445223518, 31.9061345394902],
+ ],
+ ],
},
referenceSystem: '',
imagingTimeStart: new Date(),
@@ -78,7 +85,7 @@ export const MOCK_DATA_IMAGERY_LAYERS_ISRAEL = [
properties: {
protocol: 'XYZ_LAYER',
url: 'https://tiles.openaerialmap.org/5a9f90c42553e6000ce5ad6c/0/eee1a570-128e-4947-9ffa-1e69c1efab7c/{z}/{x}/{y}.png',
- meta: 'http://oin-hotosm.s3.amazonaws.com/5a9f90c42553e6000ce5ad6c/0/eee1a570-128e-4947-9ffa-1e69c1efab7c_meta.json'
+ meta: 'http://oin-hotosm.s3.amazonaws.com/5a9f90c42553e6000ce5ad6c/0/eee1a570-128e-4947-9ffa-1e69c1efab7c_meta.json',
},
},
{
@@ -88,13 +95,15 @@ export const MOCK_DATA_IMAGERY_LAYERS_ISRAEL = [
description: '',
geojson: {
type: 'Polygon',
- coordinates: [[
- [34.8106008249547, 31.9076273723004],
- [34.8137969069015, 31.9076273723004],
- [34.8137969069015, 31.9103791381117],
- [34.8106008249547, 31.9103791381117],
- [34.8106008249547, 31.9076273723004],
- ]],
+ coordinates: [
+ [
+ [34.8106008249547, 31.9076273723004],
+ [34.8137969069015, 31.9076273723004],
+ [34.8137969069015, 31.9103791381117],
+ [34.8106008249547, 31.9103791381117],
+ [34.8106008249547, 31.9076273723004],
+ ],
+ ],
},
referenceSystem: '',
imagingTimeStart: new Date(),
@@ -106,7 +115,7 @@ export const MOCK_DATA_IMAGERY_LAYERS_ISRAEL = [
properties: {
protocol: 'XYZ_LAYER',
url: 'https://tiles.openaerialmap.org/5a8316e22553e6000ce5ac7f/0/c3fcbe99-d339-41b6-8ec0-33d90ccca020/{z}/{x}/{y}.png',
- meta: 'http://oin-hotosm.s3.amazonaws.com/5a8316e22553e6000ce5ac7f/0/c3fcbe99-d339-41b6-8ec0-33d90ccca020_meta.json'
+ meta: 'http://oin-hotosm.s3.amazonaws.com/5a8316e22553e6000ce5ac7f/0/c3fcbe99-d339-41b6-8ec0-33d90ccca020_meta.json',
},
},
{
@@ -116,13 +125,15 @@ export const MOCK_DATA_IMAGERY_LAYERS_ISRAEL = [
description: '',
geojson: {
type: 'Polygon',
- coordinates: [[
- [34.8043847068541, 31.9023297972932],
- [34.8142791322292, 31.9023297972932],
- [34.8142791322292, 31.9108796531516],
- [34.8043847068541, 31.9108796531516],
- [34.8043847068541, 31.9023297972932],
- ]],
+ coordinates: [
+ [
+ [34.8043847068541, 31.9023297972932],
+ [34.8142791322292, 31.9023297972932],
+ [34.8142791322292, 31.9108796531516],
+ [34.8043847068541, 31.9108796531516],
+ [34.8043847068541, 31.9023297972932],
+ ],
+ ],
},
referenceSystem: '',
imagingTimeStart: new Date(),
@@ -134,7 +145,7 @@ export const MOCK_DATA_IMAGERY_LAYERS_ISRAEL = [
properties: {
protocol: 'XYZ_LAYER',
url: 'https://tiles.openaerialmap.org/5a831b4a2553e6000ce5ac80/0/d02ddc76-9c2e-4994-97d4-a623eb371456/{z}/{x}/{y}.png',
- meta: 'http://oin-hotosm.s3.amazonaws.com/5a831b4a2553e6000ce5ac80/0/d02ddc76-9c2e-4994-97d4-a623eb371456_meta.json'
+ meta: 'http://oin-hotosm.s3.amazonaws.com/5a831b4a2553e6000ce5ac80/0/d02ddc76-9c2e-4994-97d4-a623eb371456_meta.json',
},
},
{
@@ -143,31 +154,101 @@ export const MOCK_DATA_IMAGERY_LAYERS_ISRAEL = [
creationDate: new Date('2018-06-01T16:39:55.400Z'),
description: '',
geojson: {
- type:'MultiPolygon',
- coordinates:[
- [[
- [34.820514,31.90975],[34.820513,31.909689],[34.820549,31.909688],[34.82055,31.909749],[34.820514,31.90975]
- ]],
- [[
- [34.81642,31.913197],[34.816419,31.913136],[34.816383,31.913136],[34.816312,31.913138],[34.81631,31.913076],
- [34.816275,31.913077],[34.816239,31.913077],[34.816238,31.913047],[34.816166,31.913048],[34.816167,31.913079],
- [34.816095,31.91308],[34.816095,31.913049],[34.816059,31.91305],[34.816023,31.91305],[34.816021,31.912959],
- [34.816057,31.912958],[34.816056,31.912897],[34.81602,31.912897],[34.816017,31.912745],[34.815981,31.912745],
- [34.815873,31.912747],[34.815828,31.910458],[34.815864,31.910458],[34.815863,31.910397],[34.815899,31.910396],
- [34.815897,31.910274],[34.815861,31.910274],[34.815858,31.910122],[34.815822,31.910122],[34.815818,31.909939],
- [34.815854,31.909939],[34.815854,31.909908],[34.815889,31.909908],[34.815888,31.909847],[34.815924,31.909846],
- [34.815923,31.909816],[34.815888,31.909816],[34.815887,31.909786],[34.815851,31.909786],[34.815852,31.909817],
- [34.815816,31.909817],[34.815812,31.909634],[34.815848,31.909634],[34.815848,31.909603],[34.815883,31.909603],
- [34.815882,31.909542],[34.815954,31.909541],[34.815952,31.909449],[34.816167,31.909446],[34.816166,31.909354],
- [34.81882,31.909316],[34.818821,31.909377],[34.818893,31.909376],[34.818929,31.909376],[34.818929,31.909406],
- [34.819252,31.909402],[34.81925,31.90931],[34.819896,31.909301],[34.819896,31.909331],[34.819932,31.909331],
- [34.819933,31.909392],[34.820364,31.909386],[34.8204,31.909385],[34.820406,31.90969],[34.820442,31.90969],
- [34.820477,31.909689],[34.820479,31.909751],[34.820514,31.90975],[34.820515,31.909781],[34.820551,31.90978],
- [34.820608,31.912679],[34.820536,31.91268],[34.820539,31.912833],[34.820468,31.912834],[34.820471,31.912986],
- [34.820363,31.912988],[34.820366,31.913141],[34.81642,31.913197]
- ]]
+ type: 'MultiPolygon',
+ coordinates: [
+ [
+ [
+ [34.820514, 31.90975],
+ [34.820513, 31.909689],
+ [34.820549, 31.909688],
+ [34.82055, 31.909749],
+ [34.820514, 31.90975],
+ ],
+ ],
+ [
+ [
+ [34.81642, 31.913197],
+ [34.816419, 31.913136],
+ [34.816383, 31.913136],
+ [34.816312, 31.913138],
+ [34.81631, 31.913076],
+ [34.816275, 31.913077],
+ [34.816239, 31.913077],
+ [34.816238, 31.913047],
+ [34.816166, 31.913048],
+ [34.816167, 31.913079],
+ [34.816095, 31.91308],
+ [34.816095, 31.913049],
+ [34.816059, 31.91305],
+ [34.816023, 31.91305],
+ [34.816021, 31.912959],
+ [34.816057, 31.912958],
+ [34.816056, 31.912897],
+ [34.81602, 31.912897],
+ [34.816017, 31.912745],
+ [34.815981, 31.912745],
+ [34.815873, 31.912747],
+ [34.815828, 31.910458],
+ [34.815864, 31.910458],
+ [34.815863, 31.910397],
+ [34.815899, 31.910396],
+ [34.815897, 31.910274],
+ [34.815861, 31.910274],
+ [34.815858, 31.910122],
+ [34.815822, 31.910122],
+ [34.815818, 31.909939],
+ [34.815854, 31.909939],
+ [34.815854, 31.909908],
+ [34.815889, 31.909908],
+ [34.815888, 31.909847],
+ [34.815924, 31.909846],
+ [34.815923, 31.909816],
+ [34.815888, 31.909816],
+ [34.815887, 31.909786],
+ [34.815851, 31.909786],
+ [34.815852, 31.909817],
+ [34.815816, 31.909817],
+ [34.815812, 31.909634],
+ [34.815848, 31.909634],
+ [34.815848, 31.909603],
+ [34.815883, 31.909603],
+ [34.815882, 31.909542],
+ [34.815954, 31.909541],
+ [34.815952, 31.909449],
+ [34.816167, 31.909446],
+ [34.816166, 31.909354],
+ [34.81882, 31.909316],
+ [34.818821, 31.909377],
+ [34.818893, 31.909376],
+ [34.818929, 31.909376],
+ [34.818929, 31.909406],
+ [34.819252, 31.909402],
+ [34.81925, 31.90931],
+ [34.819896, 31.909301],
+ [34.819896, 31.909331],
+ [34.819932, 31.909331],
+ [34.819933, 31.909392],
+ [34.820364, 31.909386],
+ [34.8204, 31.909385],
+ [34.820406, 31.90969],
+ [34.820442, 31.90969],
+ [34.820477, 31.909689],
+ [34.820479, 31.909751],
+ [34.820514, 31.90975],
+ [34.820515, 31.909781],
+ [34.820551, 31.90978],
+ [34.820608, 31.912679],
+ [34.820536, 31.91268],
+ [34.820539, 31.912833],
+ [34.820468, 31.912834],
+ [34.820471, 31.912986],
+ [34.820363, 31.912988],
+ [34.820366, 31.913141],
+ [34.81642, 31.913197],
+ ],
+ ],
],
- bbox:[34.815812,31.909301,34.820608,31.913197]
+ bbox: [34.815812, 31.909301, 34.820608, 31.913197],
},
referenceSystem: '',
imagingTimeStart: new Date(),
@@ -179,7 +260,7 @@ export const MOCK_DATA_IMAGERY_LAYERS_ISRAEL = [
properties: {
protocol: 'XYZ_LAYER',
url: 'https://tiles.openaerialmap.org/5b1388c02b6a08001185f4f3/0/5b1388c02b6a08001185f4f4/{z}/{x}/{y}.png',
- meta: 'http://oin-hotosm.s3.amazonaws.com/5b1388c02b6a08001185f4f3/0/5b1388c02b6a08001185f4f4_meta.json'
+ meta: 'http://oin-hotosm.s3.amazonaws.com/5b1388c02b6a08001185f4f3/0/5b1388c02b6a08001185f4f4_meta.json',
},
},
{
@@ -188,32 +269,108 @@ export const MOCK_DATA_IMAGERY_LAYERS_ISRAEL = [
creationDate: new Date('2018-06-08T16:39:55.400Z'),
description: '',
geojson: {
- type:'MultiPolygon',
- coordinates:[[
- [
- [34.813942,32.041277],[34.813942,32.041233],[34.813916,32.041233],[34.813813,32.041235],[34.813812,32.041169],[34.813786,32.04117],
- [34.813785,32.041126],[34.81376,32.041126],[34.813734,32.041127],[34.813733,32.041061],[34.813707,32.041061],[34.813656,32.041062],
- [34.813653,32.040909],[34.813627,32.040909],[34.813602,32.04091],[34.8136,32.040844],[34.813575,32.040845],[34.813575,32.040866],
- [34.813549,32.040867],[34.813521,32.039446],[34.813624,32.039444],[34.813624,32.039423],[34.813649,32.039422],[34.813648,32.039378],
- [34.813751,32.039377],[34.81375,32.039311],[34.813775,32.039311],[34.813775,32.039289],[34.813852,32.039288],[34.813851,32.039266],
- [34.813928,32.039265],[34.81393,32.039331],[34.814161,32.039327],[34.81416,32.039284],[34.814211,32.039283],[34.814211,32.039261],
- [34.81457,32.039256],[34.81457,32.0393],[34.814801,32.039296],[34.8148,32.039253],[34.815236,32.039246],[34.815237,32.03929],
- [34.81534,32.039289],[34.81534,32.039267],[34.815468,32.039265],[34.815467,32.039243],[34.815749,32.039239],[34.81575,32.039283],
- [34.815853,32.039281],[34.815852,32.039238],[34.81598,32.039236],[34.816006,32.039235],[34.816007,32.039301],[34.816366,32.039296],
- [34.816392,32.039295],[34.816401,32.039733],[34.816426,32.039732],[34.816452,32.039732],[34.816475,32.040912],[34.816424,32.040913],
- [34.816428,32.041132],[34.816403,32.041132],[34.816403,32.041154],[34.816377,32.041154],[34.816378,32.041176],[34.816352,32.041177],
- [34.816353,32.041198],[34.816301,32.041199],[34.816302,32.041221],[34.816327,32.041221],[34.816328,32.041243],[34.814789,32.041265],
- [34.814788,32.041243],[34.814763,32.041243],[34.814763,32.041265],[34.814712,32.041266],[34.814711,32.041244],[34.814609,32.041245],
- [34.814609,32.041267],[34.813942,32.041277]
- ],
+ type: 'MultiPolygon',
+ coordinates: [
[
- [34.814956,32.039316],[34.815058,32.039314],[34.815058,32.039293],[34.814955,32.039294],[34.814956,32.039316]
+ [
+ [34.813942, 32.041277],
+ [34.813942, 32.041233],
+ [34.813916, 32.041233],
+ [34.813813, 32.041235],
+ [34.813812, 32.041169],
+ [34.813786, 32.04117],
+ [34.813785, 32.041126],
+ [34.81376, 32.041126],
+ [34.813734, 32.041127],
+ [34.813733, 32.041061],
+ [34.813707, 32.041061],
+ [34.813656, 32.041062],
+ [34.813653, 32.040909],
+ [34.813627, 32.040909],
+ [34.813602, 32.04091],
+ [34.8136, 32.040844],
+ [34.813575, 32.040845],
+ [34.813575, 32.040866],
+ [34.813549, 32.040867],
+ [34.813521, 32.039446],
+ [34.813624, 32.039444],
+ [34.813624, 32.039423],
+ [34.813649, 32.039422],
+ [34.813648, 32.039378],
+ [34.813751, 32.039377],
+ [34.81375, 32.039311],
+ [34.813775, 32.039311],
+ [34.813775, 32.039289],
+ [34.813852, 32.039288],
+ [34.813851, 32.039266],
+ [34.813928, 32.039265],
+ [34.81393, 32.039331],
+ [34.814161, 32.039327],
+ [34.81416, 32.039284],
+ [34.814211, 32.039283],
+ [34.814211, 32.039261],
+ [34.81457, 32.039256],
+ [34.81457, 32.0393],
+ [34.814801, 32.039296],
+ [34.8148, 32.039253],
+ [34.815236, 32.039246],
+ [34.815237, 32.03929],
+ [34.81534, 32.039289],
+ [34.81534, 32.039267],
+ [34.815468, 32.039265],
+ [34.815467, 32.039243],
+ [34.815749, 32.039239],
+ [34.81575, 32.039283],
+ [34.815853, 32.039281],
+ [34.815852, 32.039238],
+ [34.81598, 32.039236],
+ [34.816006, 32.039235],
+ [34.816007, 32.039301],
+ [34.816366, 32.039296],
+ [34.816392, 32.039295],
+ [34.816401, 32.039733],
+ [34.816426, 32.039732],
+ [34.816452, 32.039732],
+ [34.816475, 32.040912],
+ [34.816424, 32.040913],
+ [34.816428, 32.041132],
+ [34.816403, 32.041132],
+ [34.816403, 32.041154],
+ [34.816377, 32.041154],
+ [34.816378, 32.041176],
+ [34.816352, 32.041177],
+ [34.816353, 32.041198],
+ [34.816301, 32.041199],
+ [34.816302, 32.041221],
+ [34.816327, 32.041221],
+ [34.816328, 32.041243],
+ [34.814789, 32.041265],
+ [34.814788, 32.041243],
+ [34.814763, 32.041243],
+ [34.814763, 32.041265],
+ [34.814712, 32.041266],
+ [34.814711, 32.041244],
+ [34.814609, 32.041245],
+ [34.814609, 32.041267],
+ [34.813942, 32.041277],
+ ],
+ [
+ [34.814956, 32.039316],
+ [34.815058, 32.039314],
+ [34.815058, 32.039293],
+ [34.814955, 32.039294],
+ [34.814956, 32.039316],
+ ],
+ [
+ [34.814481, 32.041247],
+ [34.81448, 32.041225],
+ [34.814583, 32.041224],
+ [34.814583, 32.041246],
+ [34.814481, 32.041247],
+ ],
],
- [
- [34.814481,32.041247],[34.81448,32.041225],[34.814583,32.041224],[34.814583,32.041246],[34.814481,32.041247]
- ]
- ]],
- bbox :[34.813521,32.039235,34.816475,32.041277]
+ ],
+ bbox: [34.813521, 32.039235, 34.816475, 32.041277],
},
referenceSystem: '',
imagingTimeStart: new Date(),
@@ -225,7 +382,7 @@ export const MOCK_DATA_IMAGERY_LAYERS_ISRAEL = [
properties: {
protocol: 'XYZ_LAYER',
url: 'https://tiles.openaerialmap.org/5b25fa612b6a08001185f80f/0/5b25fa612b6a08001185f810/{z}/{x}/{y}.png',
- meta: 'http://oin-hotosm.s3.amazonaws.com/5b25fa612b6a08001185f80f/0/5b25fa612b6a08001185f810_meta.json'
+ meta: 'http://oin-hotosm.s3.amazonaws.com/5b25fa612b6a08001185f80f/0/5b25fa612b6a08001185f810_meta.json',
},
},
{
@@ -234,14 +391,16 @@ export const MOCK_DATA_IMAGERY_LAYERS_ISRAEL = [
creationDate: new Date('2021-01-07T10:39:55.400Z'),
description: '',
geojson: {
- type:'Polygon',
- coordinates:[[
- [34.81576, 31.91132],
- [34.81901, 31.91126],
- [34.81904, 31.90932],
- [34.81569, 31.90938],
- [34.81576, 31.91132],
- ]],
+ type: 'Polygon',
+ coordinates: [
+ [
+ [34.81576, 31.91132],
+ [34.81901, 31.91126],
+ [34.81904, 31.90932],
+ [34.81569, 31.90938],
+ [34.81576, 31.91132],
+ ],
+ ],
},
referenceSystem: '',
imagingTimeStart: new Date(),
@@ -253,7 +412,7 @@ export const MOCK_DATA_IMAGERY_LAYERS_ISRAEL = [
properties: {
protocol: '3D_LAYER',
url: '/mock/Rehovot_solar_tileset/L16_31023/L16_31023.json',
- meta: 'NOT_DEFINED'
+ meta: 'NOT_DEFINED',
},
},
{
@@ -262,14 +421,16 @@ export const MOCK_DATA_IMAGERY_LAYERS_ISRAEL = [
creationDate: new Date('2021-01-07T10:39:55.400Z'),
description: '',
geojson: {
- type:'Polygon',
- coordinates:[[
- [34.82720, 31.91292],
- [34.83051, 31.91287],
- [34.83042, 31.91093],
- [34.82717, 31.91097],
- [34.82720, 31.91292],
- ]],
+ type: 'Polygon',
+ coordinates: [
+ [
+ [34.8272, 31.91292],
+ [34.83051, 31.91287],
+ [34.83042, 31.91093],
+ [34.82717, 31.91097],
+ [34.8272, 31.91292],
+ ],
+ ],
},
referenceSystem: '',
imagingTimeStart: new Date(),
@@ -281,7 +442,7 @@ export const MOCK_DATA_IMAGERY_LAYERS_ISRAEL = [
properties: {
protocol: '3D_LAYER',
url: '/mock/Rehovot_solar_tileset/L16_31023/L16_31023.json',
- meta: 'NOT_DEFINED'
+ meta: 'NOT_DEFINED',
},
},
];
diff --git a/src/__mocks__/confEnvShim.js b/src/__mocks__/confEnvShim.js
index 2dac4efb8..a2fa1a3da 100644
--- a/src/__mocks__/confEnvShim.js
+++ b/src/__mocks__/confEnvShim.js
@@ -17,7 +17,8 @@ if (!window._env_) {
},
ACTIVE_LAYER: 'ACTIVE_LAYER',
ACTIVE_LAYER_PROPERTIES: {
- urlPattern: 'arcgis/rest/services/Demographics/USA_Population_Density/MapServer/WMTS',
+ urlPattern:
+ 'arcgis/rest/services/Demographics/USA_Population_Density/MapServer/WMTS',
urlPatternParams: {
service: 'WMTS',
layers: 'USGSShadedReliefOnly',
@@ -53,7 +54,8 @@ if (!window._env_) {
DEFAULT_USER: {
role: 'USER',
},
- BASE_MAPS: '{ "maps": [ { "id": "1st", "title": "1st Map", "isForPreview": true, "thumbnail": "https://mt1.google.com/vt/lyrs=s&x=6&y=4&z=3", "baseRasterLayers": [ { "id": "GOOGLE_TERRAIN", "type": "XYZ_LAYER", "opacity": 1, "zIndex": 0, "options": { "url": "https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}", "layers": "", "credit": "GOOGLE" } }, { "id": "INFRARED_RASTER", "type": "WMS_LAYER", "opacity": 0.6, "zIndex": 1, "options": { "url": "https://mesonet.agron.iastate.edu/cgi-bin/wms/goes/conus_ir.cgi?", "layers": "goes_conus_ir", "credit": "Infrared data courtesy Iowa Environmental Mesonet", "parameters": { "transparent": "true", "format": "image/png" } } } ] }, { "id": "2nd", "title": "2nd Map", "thumbnail": "https://mt1.google.com/vt/lyrs=s&x=6&y=4&z=3", "baseRasterLayers": [ { "id": "RADAR_RASTER", "type": "WMS_LAYER", "opacity": 0.6, "zIndex": 1, "options": { "url": "https://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi?", "layers": "nexrad-n0r", "credit": "Radar data courtesy Iowa Environmental Mesonet", "parameters": { "transparent": "true", "format": "image/png" } } }, { "id": "GOOGLE_TERRAIN", "type": "XYZ_LAYER", "opacity": 1, "zIndex": 0, "options": { "url": "https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}", "layers": "", "credit": "GOOGLE" } }, { "id": "VECTOR_TILES_GPS", "type": "XYZ_LAYER", "opacity": 1, "zIndex": 2, "options": { "url": "https://gps.tile.openstreetmap.org/lines/{z}/{x}/{y}.png", "layers": "", "credit": "openstreetmap" } } ] }, { "id": "3rd", "title": "3rd Map", "isCurrent": true, "thumbnail": "https://a.tile.thunderforest.com/cycle/17/78208/53265.png", "baseRasterLayers": [ { "id": "VECTOR_TILES", "type": "XYZ_LAYER", "opacity": 1, "zIndex": 0, "options": { "url": "https://{s}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png?apikey=6170aad10dfd42a38d4d8c709a536f38", "layers": "", "credit": "thunderforest" } }, { "id": "VECTOR_TILES_GPS", "type": "XYZ_LAYER", "opacity": 1, "zIndex": 1, "options": { "url": "https://gps.tile.openstreetmap.org/lines/{z}/{x}/{y}.png", "layers": "", "credit": "openstreetmap" } } ] } ] }',
+ BASE_MAPS:
+ '{ "maps": [ { "id": "1st", "title": "1st Map", "isForPreview": true, "thumbnail": "https://mt1.google.com/vt/lyrs=s&x=6&y=4&z=3", "baseRasterLayers": [ { "id": "GOOGLE_TERRAIN", "type": "XYZ_LAYER", "opacity": 1, "zIndex": 0, "options": { "url": "https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}", "layers": "", "credit": "GOOGLE" } }, { "id": "INFRARED_RASTER", "type": "WMS_LAYER", "opacity": 0.6, "zIndex": 1, "options": { "url": "https://mesonet.agron.iastate.edu/cgi-bin/wms/goes/conus_ir.cgi?", "layers": "goes_conus_ir", "credit": "Infrared data courtesy Iowa Environmental Mesonet", "parameters": { "transparent": "true", "format": "image/png" } } } ] }, { "id": "2nd", "title": "2nd Map", "thumbnail": "https://mt1.google.com/vt/lyrs=s&x=6&y=4&z=3", "baseRasterLayers": [ { "id": "RADAR_RASTER", "type": "WMS_LAYER", "opacity": 0.6, "zIndex": 1, "options": { "url": "https://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi?", "layers": "nexrad-n0r", "credit": "Radar data courtesy Iowa Environmental Mesonet", "parameters": { "transparent": "true", "format": "image/png" } } }, { "id": "GOOGLE_TERRAIN", "type": "XYZ_LAYER", "opacity": 1, "zIndex": 0, "options": { "url": "https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}", "layers": "", "credit": "GOOGLE" } }, { "id": "VECTOR_TILES_GPS", "type": "XYZ_LAYER", "opacity": 1, "zIndex": 2, "options": { "url": "https://gps.tile.openstreetmap.org/lines/{z}/{x}/{y}.png", "layers": "", "credit": "openstreetmap" } } ] }, { "id": "3rd", "title": "3rd Map", "isCurrent": true, "thumbnail": "https://a.tile.thunderforest.com/cycle/17/78208/53265.png", "baseRasterLayers": [ { "id": "VECTOR_TILES", "type": "XYZ_LAYER", "opacity": 1, "zIndex": 0, "options": { "url": "https://{s}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png?apikey=6170aad10dfd42a38d4d8c709a536f38", "layers": "", "credit": "thunderforest" } }, { "id": "VECTOR_TILES_GPS", "type": "XYZ_LAYER", "opacity": 1, "zIndex": 1, "options": { "url": "https://gps.tile.openstreetmap.org/lines/{z}/{x}/{y}.png", "layers": "", "credit": "openstreetmap" } } ] } ] }',
DEFAULT_TERRAIN_PROVIDER_URL: 'http://nginx-s3-gateway-URL',
WEB_TOOLS_URL: 'http://mc-web-tools-URL',
MODEL_VIEWER_ROUTE: 'simple-catalog-viewer',
@@ -63,15 +65,18 @@ if (!window._env_) {
autocomplete: false,
},
NUMBER_OF_CHARACTERS_LIMIT: 18,
- SERVED_ENTITY_TYPES: 'RECORD_ALL,RECORD_RASTER,RECORD_3D,RECORD_DEM,RECORD_VECTOR',
+ SERVED_ENTITY_TYPES:
+ 'RECORD_ALL,RECORD_RASTER,RECORD_3D,RECORD_DEM,RECORD_VECTOR',
ACCESS_TOKEN: {
attributeName: 'token',
injectionType: 'queryParam',
tokenValue: 'TOKEN',
},
- RASTER_INGESTION_FILES_STRUCTURE: '{"data": {"allowedExt": [".gpkg"], "selectableExt": [".gpkg"], "relativeToAOIDirPath": "./data", "producerFileName": "*", "selectablePattern": "*"}, "product": {"allowedExt": [".shp", ".shx", ".dbf", ".prj", ".sbn", ".sbx", ".xml", ".cpg", ".qix"], "selectableExt": [".shp"], "relativeToAOIDirPath": "./shape", "producerFileName": "Product", "selectablePattern": "Product"}, "shapeMetadata": {"allowedExt": [".shp", ".shx", ".dbf", ".prj", ".sbn", ".sbx", ".xml", ".cpg", ".qix"], "selectableExt": [".shp"], "relativeToAOIDirPath": "./shape", "producerFileName": "ShapeMetadata", "selectablePattern": "ShapeMetadata"}}',
+ RASTER_INGESTION_FILES_STRUCTURE:
+ '{"data": {"allowedExt": [".gpkg"], "selectableExt": [".gpkg"], "relativeToAOIDirPath": "./data", "producerFileName": "*", "selectablePattern": "*"}, "product": {"allowedExt": [".shp", ".shx", ".dbf", ".prj", ".sbn", ".sbx", ".xml", ".cpg", ".qix"], "selectableExt": [".shp"], "relativeToAOIDirPath": "./shape", "producerFileName": "Product", "selectablePattern": "Product"}, "shapeMetadata": {"allowedExt": [".shp", ".shx", ".dbf", ".prj", ".sbn", ".sbx", ".xml", ".cpg", ".qix"], "selectableExt": [".shp"], "relativeToAOIDirPath": "./shape", "producerFileName": "ShapeMetadata", "selectablePattern": "ShapeMetadata"}}',
WHATSNEW_URL: 'http://whatsnew-URL',
- SITES_CONFIG: '{"masters": [{ "dns": "http://localhost:3000", "isAlias": false }], "slaves": [{ "dns": "http://localhost:8090", "isAlias": false }], "generics": [{ "dns": "https://catalog.mapcolonies.net", "isAlias": false }]}',
+ SITES_CONFIG:
+ '{"masters": [{ "dns": "http://localhost:3000", "isAlias": false }], "slaves": [{ "dns": "http://localhost:8090", "isAlias": false }], "generics": [{ "dns": "https://catalog.mapcolonies.net", "isAlias": false }]}',
BFF_PATH: '/graphql',
SELECTION_MODE_DEFAULT: '',
SHOW_SELECTION_MODE_SWITCH: true,
@@ -88,7 +93,8 @@ if (!window._env_) {
},
},
WFS: {
- style: '{"color": "#01FF1F", "hover": "#24AEE9", "pointStroke": "#01FF1F"}',
+ style:
+ '{"color": "#01FF1F", "hover": "#24AEE9", "pointStroke": "#01FF1F"}',
keyField: 'id',
max: {
pageSize: 300,
@@ -99,7 +105,7 @@ if (!window._env_) {
GEOCODER: {
url: 'http://geocoder-URL',
callbackUrl: 'http://geocoder-callback-URL',
- },
+ },
CHANGES_IN_SHAPE_FILES: {
timeDifferenceGraceMinutes: 10,
timeModifiedThresholdHours: 12,
diff --git a/src/common/actions/context.actions.ts b/src/common/actions/context.actions.ts
index 0a7ba4418..777887de5 100644
--- a/src/common/actions/context.actions.ts
+++ b/src/common/actions/context.actions.ts
@@ -1,4 +1,3 @@
-
import { TabViews } from '../../discrete-layer/views/tab-views';
import { IAction, IActionGroup } from './entity.actions';
@@ -33,15 +32,15 @@ export enum ContextActionsGroupTemplates {
export enum ActionSpreadPreference {
FLAT = 'flat',
- MENU = 'menu'
+ MENU = 'menu',
}
-export type SeparatorPosition = "BEFORE" | "AFTER";
+export type SeparatorPosition = 'BEFORE' | 'AFTER';
export interface IContextAction extends IAction {
templateId?: ContextActionsTemplates;
separator?: SeparatorPosition;
-};
+}
export interface IContextActionGroup extends Omit {
order: number;
@@ -62,11 +61,12 @@ export interface IContextActions {
groups: IContextActionGroup[];
}
-
// A "type guard" helper function used to infer if action is a group or a single action.
-export const isActionGroup = (action: IContextAction | IContextActionGroup): action is IContextActionGroup => {
+export const isActionGroup = (
+ action: IContextAction | IContextActionGroup
+): action is IContextActionGroup => {
return (action as IContextActionGroup).actions !== undefined;
-}
+};
const DEFAULT_MINIMUM_ITEMS_IN_MENU = 2;
@@ -79,14 +79,14 @@ const defaultContextActionProps: IAction = {
views: [TabViews.CATALOG, TabViews.SEARCH_RESULTS],
};
-const defaultContextActionGroupProps: Omit = {
+const defaultContextActionGroupProps: Omit = {
id: 0,
actionsSpreadPreference: ActionSpreadPreference.MENU,
minimumItemsInMenu: DEFAULT_MINIMUM_ITEMS_IN_MENU,
actions: [],
titleTranslationId: '',
- type: ''
-}
+ type: '',
+};
const CONTEXT_ACTIONS_CONFIG: IContextActions[] = [
{
@@ -107,7 +107,7 @@ const CONTEXT_ACTIONS_CONFIG: IContextActions[] = [
...defaultContextActionProps,
templateId: ContextActionsTemplates.WFS_QUERY_FEATURES,
action: ContextActions.QUERY_WFS_FEATURE,
- }
+ },
],
},
{
@@ -149,7 +149,7 @@ const CONTEXT_ACTIONS_CONFIG: IContextActions[] = [
...defaultContextActionProps,
titleTranslationId: 'map-context-menu.polygon-parts.title',
action: ContextActions.QUERY_POLYGON_PARTS,
- separator: 'AFTER'
+ separator: 'AFTER',
},
{
...defaultContextActionProps,
diff --git a/src/common/actions/entity.actions.ts b/src/common/actions/entity.actions.ts
index eb4161156..835b36f58 100644
--- a/src/common/actions/entity.actions.ts
+++ b/src/common/actions/entity.actions.ts
@@ -16,7 +16,7 @@ export interface IAction {
titleTranslationId: string;
views: TabViews[];
dependentField?: DependentField;
-};
+}
export interface IActionGroup {
id: number;
@@ -39,8 +39,14 @@ export enum EntityActionsTypes {
EXPORT_ACTIONS = 'exportActions',
}
-export const isDependentFieldWithValue = (dependentField?: DependentField): dependentField is DependentFieldWithValue => {
- return typeof dependentField !== 'undefined' && typeof dependentField !== 'string' && 'expectedValue' in dependentField;
+export const isDependentFieldWithValue = (
+ dependentField?: DependentField
+): dependentField is DependentFieldWithValue => {
+ return (
+ typeof dependentField !== 'undefined' &&
+ typeof dependentField !== 'string' &&
+ 'expectedValue' in dependentField
+ );
};
const GENERAL_ACTIONS_GROUP: IActionGroup = {
@@ -54,7 +60,7 @@ const GENERAL_ACTIONS_GROUP: IActionGroup = {
icon: '',
class: 'mc-icon-Fly-to',
titleTranslationId: 'action.flyTo.tooltip',
- views: [TabViews.CATALOG, TabViews.SEARCH_RESULTS]
+ views: [TabViews.CATALOG, TabViews.SEARCH_RESULTS],
},
{
action: 'viewer',
@@ -62,8 +68,12 @@ const GENERAL_ACTIONS_GROUP: IActionGroup = {
icon: '',
class: 'mc-icon-Earth',
titleTranslationId: 'action.viewer.tooltip',
- dependentField: {field: 'productStatus', expectedValue: RecordStatus.BEING_DELETED, operator: 'notEquals'},
- views: [TabViews.CATALOG, TabViews.SEARCH_RESULTS]
+ dependentField: {
+ field: 'productStatus',
+ expectedValue: RecordStatus.BEING_DELETED,
+ operator: 'notEquals',
+ },
+ views: [TabViews.CATALOG, TabViews.SEARCH_RESULTS],
},
{
action: 'export',
@@ -71,8 +81,8 @@ const GENERAL_ACTIONS_GROUP: IActionGroup = {
icon: '',
class: 'mc-icon-Export',
titleTranslationId: 'action.export.tooltip',
- dependentField: {field: 'layerURLMissing', expectedValue: false},
- views: [TabViews.CATALOG, TabViews.SEARCH_RESULTS]
+ dependentField: { field: 'layerURLMissing', expectedValue: false },
+ views: [TabViews.CATALOG, TabViews.SEARCH_RESULTS],
},
],
};
@@ -93,8 +103,8 @@ const ACTIONS_CONFIG: IEntityActions[] = [
icon: '',
class: 'mc-icon-Edit1',
titleTranslationId: 'action.edit.tooltip',
- dependentField: {field: 'layerURLMissing', expectedValue: false},
- views: [TabViews.CATALOG, TabViews.SEARCH_RESULTS]
+ dependentField: { field: 'layerURLMissing', expectedValue: false },
+ views: [TabViews.CATALOG, TabViews.SEARCH_RESULTS],
},
{
action: 'update',
@@ -102,12 +112,12 @@ const ACTIONS_CONFIG: IEntityActions[] = [
icon: '',
class: 'mc-icon-Update',
titleTranslationId: 'action.update.tooltip',
- dependentField: {field: 'layerURLMissing', expectedValue: false},
- views: [TabViews.CATALOG, TabViews.SEARCH_RESULTS]
+ dependentField: { field: 'layerURLMissing', expectedValue: false },
+ views: [TabViews.CATALOG, TabViews.SEARCH_RESULTS],
},
],
- }
- ]
+ },
+ ],
},
{
entity: 'Layer3DRecord',
@@ -124,8 +134,12 @@ const ACTIONS_CONFIG: IEntityActions[] = [
icon: '',
class: 'mc-icon-Edit1',
titleTranslationId: 'action.edit.tooltip',
- dependentField: {field: 'productStatus', expectedValue: RecordStatus.BEING_DELETED, operator: 'notEquals'},
- views: [TabViews.CATALOG, TabViews.SEARCH_RESULTS]
+ dependentField: {
+ field: 'productStatus',
+ expectedValue: RecordStatus.BEING_DELETED,
+ operator: 'notEquals',
+ },
+ views: [TabViews.CATALOG, TabViews.SEARCH_RESULTS],
},
{
action: 'delete',
@@ -133,12 +147,16 @@ const ACTIONS_CONFIG: IEntityActions[] = [
icon: '',
class: 'mc-icon-Delete',
titleTranslationId: 'action.delete.tooltip',
- dependentField: {field: 'productStatus', expectedValue: RecordStatus.BEING_DELETED, operator: 'notEquals'},
- views: [TabViews.CATALOG, TabViews.SEARCH_RESULTS]
+ dependentField: {
+ field: 'productStatus',
+ expectedValue: RecordStatus.BEING_DELETED,
+ operator: 'notEquals',
+ },
+ views: [TabViews.CATALOG, TabViews.SEARCH_RESULTS],
},
],
},
- ]
+ ],
},
{
entity: 'VectorBestRecord',
@@ -155,11 +173,11 @@ const ACTIONS_CONFIG: IEntityActions[] = [
icon: '',
class: 'mc-icon-Edit1',
titleTranslationId: 'action.edit.tooltip',
- views: [TabViews.CATALOG, TabViews.SEARCH_RESULTS]
+ views: [TabViews.CATALOG, TabViews.SEARCH_RESULTS],
},
],
- }
- ]
+ },
+ ],
},
{
entity: 'QuantizedMeshBestRecord',
@@ -176,11 +194,11 @@ const ACTIONS_CONFIG: IEntityActions[] = [
icon: '',
class: 'mc-icon-Edit1',
titleTranslationId: 'action.edit.tooltip',
- views: [TabViews.CATALOG, TabViews.SEARCH_RESULTS]
+ views: [TabViews.CATALOG, TabViews.SEARCH_RESULTS],
},
],
- }
- ]
+ },
+ ],
},
{
entity: 'LayerDemRecord',
@@ -197,7 +215,7 @@ const ACTIONS_CONFIG: IEntityActions[] = [
icon: '',
class: 'mc-icon-Edit1',
titleTranslationId: 'action.edit.tooltip',
- views: [TabViews.CATALOG, TabViews.SEARCH_RESULTS]
+ views: [TabViews.CATALOG, TabViews.SEARCH_RESULTS],
},
// {
// action: 'delete',
@@ -208,8 +226,8 @@ const ACTIONS_CONFIG: IEntityActions[] = [
// views: [TabViews.CATALOG, TabViews.SEARCH_RESULTS]
// },
],
- }
- ]
+ },
+ ],
},
{
entity: 'Job',
@@ -262,10 +280,9 @@ const ACTIONS_CONFIG: IEntityActions[] = [
views: [],
},
],
- }
- ]
-
- }
+ },
+ ],
+ },
];
export default ACTIONS_CONFIG;
diff --git a/src/common/components/auto-direction-box/auto-direction-box.component.tsx b/src/common/components/auto-direction-box/auto-direction-box.component.tsx
index df04ea371..ac89eab86 100644
--- a/src/common/components/auto-direction-box/auto-direction-box.component.tsx
+++ b/src/common/components/auto-direction-box/auto-direction-box.component.tsx
@@ -1,8 +1,13 @@
-import { DetailedHTMLProps, HTMLAttributes, PropsWithChildren, forwardRef } from 'react';
+import {
+ DetailedHTMLProps,
+ HTMLAttributes,
+ PropsWithChildren,
+ forwardRef,
+} from 'react';
export const AutoDirectionBox = forwardRef<
HTMLElement,
PropsWithChildren, HTMLElement>>
>((props, ref) => {
return ;
-});
\ No newline at end of file
+});
diff --git a/src/common/components/browser-compatibility-checker/browser-compatibility-checker.css b/src/common/components/browser-compatibility-checker/browser-compatibility-checker.css
index 76e4a2422..4dd7b2198 100644
--- a/src/common/components/browser-compatibility-checker/browser-compatibility-checker.css
+++ b/src/common/components/browser-compatibility-checker/browser-compatibility-checker.css
@@ -13,4 +13,4 @@
white-space: pre-line;
text-align: center;
user-select: none;
-}
\ No newline at end of file
+}
diff --git a/src/common/components/browser-compatibility-checker/browser-compatibility-checker.tsx b/src/common/components/browser-compatibility-checker/browser-compatibility-checker.tsx
index c26a9a0ab..007294140 100644
--- a/src/common/components/browser-compatibility-checker/browser-compatibility-checker.tsx
+++ b/src/common/components/browser-compatibility-checker/browser-compatibility-checker.tsx
@@ -5,7 +5,7 @@ import { Typography } from '@map-colonies/react-core';
import { Box } from '@map-colonies/react-components';
import CONFIG from '../../config';
-import './browser-compatibility-checker.css'
+import './browser-compatibility-checker.css';
const uaParserObj = new UAParser();
const FIRST_ELEM = 0;
@@ -34,14 +34,13 @@ export const BrowserCompatibilityChecker: React.FC = () => {
return (
<>
- {
- (!isEngineChromium || !isBrowserVersionSupported) &&
+ {(!isEngineChromium || !isBrowserVersionSupported) && (
{isEngineChromium ? browserTooOldErr : browserNotSupportedErr}
- }
+ )}
>
);
};
diff --git a/src/common/components/collapse-button/collapse.button.tsx b/src/common/components/collapse-button/collapse.button.tsx
index eb73037f1..487e1fe15 100644
--- a/src/common/components/collapse-button/collapse.button.tsx
+++ b/src/common/components/collapse-button/collapse.button.tsx
@@ -2,7 +2,6 @@ import React, { useState, useEffect } from 'react';
import { Icon } from '@map-colonies/react-core';
import { Box } from '@map-colonies/react-components';
-
const BASE_ICON_ANGLE = 0;
const UPSIDE_DOWN_ANGLE = 180;
diff --git a/src/common/components/copy/copy.tsx b/src/common/components/copy/copy.tsx
index dfd1e0683..774d3f1d6 100644
--- a/src/common/components/copy/copy.tsx
+++ b/src/common/components/copy/copy.tsx
@@ -20,29 +20,31 @@ export const Copy = (props: IProps) => {
return (
<>
- setIsCopied(true)}>
+ setIsCopied(true)}
+ >
- {
+ {props.copyToClipboardChildren ? (
props.copyToClipboardChildren
- ? props.copyToClipboardChildren
- : {
- setIsCopied(true);
- }}
- label={isCopied ? 'Success' : 'Copy'}
- />
- }
- {
- isCopied &&
+ ) : (
+ {
+ setIsCopied(true);
+ }}
+ label={isCopied ? 'Success' : 'Copy'}
+ />
+ )}
+ {isCopied && (
- }
+ )}
>
- )
+ );
};
diff --git a/src/common/components/error/graphql.error-presentor.tsx b/src/common/components/error/graphql.error-presentor.tsx
index 16eb9cde1..3bc60001f 100644
--- a/src/common/components/error/graphql.error-presentor.tsx
+++ b/src/common/components/error/graphql.error-presentor.tsx
@@ -30,28 +30,34 @@ interface IServerErrorResponse {
}
export const GraphQLError: React.FC = ({ error }) => {
-
const intl = useIntl();
const formatMessage = (serverError: IServerError): string => {
const status = serverError.serverResponse?.status ?? NONE;
- const message = serverError.serverResponse?.data.message ?
- serverError.serverResponse.data.message :
- serverError.serverResponse?.statusText ?? '';
- if (status && status >= USER_ERROR_RESPONSE_CODE && status < SERVER_ERROR_RESPONSE_CODE) {
- const translatedError = intl.formatMessage({ id: `general.http-${status}.error` });
+ const message = serverError.serverResponse?.data.message
+ ? serverError.serverResponse.data.message
+ : serverError.serverResponse?.statusText ?? '';
+ if (
+ status &&
+ status >= USER_ERROR_RESPONSE_CODE &&
+ status < SERVER_ERROR_RESPONSE_CODE
+ ) {
+ const translatedError = intl.formatMessage({
+ id: `general.http-${status}.error`,
+ });
return `${translatedError}
${message}`;
- } else if (message) {
+ } else if (message) {
return message;
} else {
- return serverError.message.substring(+serverError.message.indexOf('; ') + 1);
+ return serverError.message.substring(
+ +serverError.message.indexOf('; ') + 1
+ );
}
};
return (
<>
- {
- !isEmpty(error?.response) &&
+ {!isEmpty(error?.response) && (
= ({ error }) => {
}}
/>
- {
- error.response.errors?.map((error: IServerError, index: number) => {
+ {error.response.errors?.map(
+ (error: IServerError, index: number) => {
return (
-
+
);
- })
- }
- {
- error.response.status >= USER_ERROR_RESPONSE_CODE &&
- error.response.status < SERVER_ERROR_RESPONSE_CODE &&
-
- }
- {
- error.response.status >= SERVER_ERROR_RESPONSE_CODE &&
-
- }
+ }
+ )}
+ {error.response.status >= USER_ERROR_RESPONSE_CODE &&
+ error.response.status < SERVER_ERROR_RESPONSE_CODE && (
+ -
+
+
+ )}
+ {error.response.status >= SERVER_ERROR_RESPONSE_CODE && (
+ -
+
+
+ )}
- }
+ )}
>
);
-
};
diff --git a/src/common/components/error/logic.error-presentor.tsx b/src/common/components/error/logic.error-presentor.tsx
index 41e7d4c05..ce6c140a8 100644
--- a/src/common/components/error/logic.error-presentor.tsx
+++ b/src/common/components/error/logic.error-presentor.tsx
@@ -12,17 +12,17 @@ interface ILogicErrorProps {
}
export const LogicError: React.FC = ({ errors }) => {
-
const intl = useIntl();
const iconButtonErrorLevel = React.useMemo(() => {
- return errors.some((error) => error.level === 'error') ? 'error' : 'warning';
+ return errors.some((error) => error.level === 'error')
+ ? 'error'
+ : 'warning';
}, [errors]);
return (
<>
- {
- !isEmpty(errors) &&
+ {!isEmpty(errors) && (
= ({ errors }) => {
}}
/>
- {
- errors.map((error, index) => (
-
- ))
- }
+ {errors.map((error, index) => (
+
+ ))}
- }
+ )}
>
);
-
};
diff --git a/src/common/components/error/validations.error-presentor.tsx b/src/common/components/error/validations.error-presentor.tsx
index 4a2c14cf8..0efa18c9b 100644
--- a/src/common/components/error/validations.error-presentor.tsx
+++ b/src/common/components/error/validations.error-presentor.tsx
@@ -13,31 +13,33 @@ interface IValidationsError {
errors: Record;
}
-export const ValidationsError: React.FC = ({ errors })=> {
+export const ValidationsError: React.FC = ({ errors }) => {
return (
<>
- {
- Object.keys(errors).length > NONE &&
+ {Object.keys(errors).length > NONE && (
- {
e.preventDefault();
e.stopPropagation();
}}
/>
- {
- Object.keys(errors).map((key: string) => {
- return errors[key].map((errorMessage: string, index: number) => {
- return (
-
- );
- })
- })
- }
+ {Object.keys(errors).map((key: string) => {
+ return errors[key].map((errorMessage: string, index: number) => {
+ return (
+
+ );
+ });
+ })}
- }
+ )}
>
);
};
diff --git a/src/common/components/file-picker/file-picker.tsx b/src/common/components/file-picker/file-picker.tsx
index 154418bd3..0821638a7 100644
--- a/src/common/components/file-picker/file-picker.tsx
+++ b/src/common/components/file-picker/file-picker.tsx
@@ -104,8 +104,9 @@ export const FilePickerComponent = React.forwardRef<
}
} else if (data.id === FilePickerActions.ChangeSelection.id) {
setSelection((currentSelection) => {
- const selectedIds = fpRef.current?.getFileSelection() as Set;
-
+ const selectedIds =
+ fpRef.current?.getFileSelection() as Set;
+
if (!isMultiSelection && selectedIds.size > 1) {
fpRef.current?.setFileSelection(
new Set(currentSelection.files.map((file) => file.id))
diff --git a/src/common/components/form/field-label.tsx b/src/common/components/form/field-label.tsx
index a1c76b579..3f259f7e6 100644
--- a/src/common/components/form/field-label.tsx
+++ b/src/common/components/form/field-label.tsx
@@ -19,7 +19,11 @@ export const FieldLabelComponent: React.FC = ({
showTooltip,
}) => {
return (
-
+
diff --git a/src/common/components/form/tooltipped.value.tsx b/src/common/components/form/tooltipped.value.tsx
index 05cd1bada..bf6006a69 100644
--- a/src/common/components/form/tooltipped.value.tsx
+++ b/src/common/components/form/tooltipped.value.tsx
@@ -21,14 +21,25 @@ const TooltippedValue: React.FC> = ({
}) => {
const elementRef = useRef(null);
const isEllipsisActive = useIsEllipsisActive(elementRef);
- const typographyElement = useMemo(() => (
- }>
- {children}
-
- ), [children]);
+ const typographyElement = useMemo(
+ () => (
+ }
+ >
+ {children}
+
+ ),
+ [children]
+ );
return alwaysTooltip || (isEllipsisActive && !disableTooltip) ? (
- {typographyElement}
+
+ {typographyElement}
+
) : (
typographyElement
);
diff --git a/src/common/components/gpu-insufficiency-detector/gpu-insufficiency-detector.css b/src/common/components/gpu-insufficiency-detector/gpu-insufficiency-detector.css
index 4d24a0b43..855e938e6 100644
--- a/src/common/components/gpu-insufficiency-detector/gpu-insufficiency-detector.css
+++ b/src/common/components/gpu-insufficiency-detector/gpu-insufficiency-detector.css
@@ -1,40 +1,39 @@
-
.gpuInsufficientError * {
- padding: 0;
- margin: 0;
- box-sizing: border-box;
+ padding: 0;
+ margin: 0;
+ box-sizing: border-box;
}
.gpuInsufficientError {
- display: flex;
- flex-direction: column;
- position: absolute;
- top: 20px;
- left: 50%;
- align-items: center;
- justify-content: center;
- width: 70%;
- min-height: 3rem;
- background: var(--mdc-theme-gc-error-high);
- z-index: 0;
- transform: translateX(-50%);
- white-space: pre-line;
- gap: 12px;
- padding: 12px 0;
- text-align: center;
+ display: flex;
+ flex-direction: column;
+ position: absolute;
+ top: 20px;
+ left: 50%;
+ align-items: center;
+ justify-content: center;
+ width: 70%;
+ min-height: 3rem;
+ background: var(--mdc-theme-gc-error-high);
+ z-index: 0;
+ transform: translateX(-50%);
+ white-space: pre-line;
+ gap: 12px;
+ padding: 12px 0;
+ text-align: center;
}
.closeIconContainer {
- position: absolute;
- top: 12px;
- right: 12px;
+ position: absolute;
+ top: 12px;
+ right: 12px;
}
.closeIcon {
- color: var(--mdc-theme-text-secondary-on-background) !important;
- scale: 1.5;
+ color: var(--mdc-theme-text-secondary-on-background) !important;
+ scale: 1.5;
}
.closeIcon:hover {
- color: white !important;
-}
\ No newline at end of file
+ color: white !important;
+}
diff --git a/src/common/components/grid/cell-renderer/actions.cell-renderer.css b/src/common/components/grid/cell-renderer/actions.cell-renderer.css
index 85e2f0078..dbfd442e9 100644
--- a/src/common/components/grid/cell-renderer/actions.cell-renderer.css
+++ b/src/common/components/grid/cell-renderer/actions.cell-renderer.css
@@ -45,7 +45,9 @@ body[dir='rtl'] #gridActionsCellRenderer.actionsContainer .actionIcon {
right: 0;
}
-body[dir='rtl'] #gridActionsCellRenderer.actionsContainer > button:not(#allActionsIcon) {
+body[dir='rtl']
+ #gridActionsCellRenderer.actionsContainer
+ > button:not(#allActionsIcon) {
right: unset;
left: -20px;
}
@@ -61,7 +63,9 @@ body[dir='rtl'] #gridActionsCellRenderer.actionsContainer > button:not(#allActio
/* position: fixed; */
}
-body[dir='rtl'] #gridActionsMenuContainer .mdc-menu-surface.mdc-menu-surface--open {
+body[dir='rtl']
+ #gridActionsMenuContainer
+ .mdc-menu-surface.mdc-menu-surface--open {
right: -160px !important;
left: unset;
}
diff --git a/src/common/components/grid/cell-renderer/actions.cell-renderer.tsx b/src/common/components/grid/cell-renderer/actions.cell-renderer.tsx
index ae57d0f2f..fcea43998 100644
--- a/src/common/components/grid/cell-renderer/actions.cell-renderer.tsx
+++ b/src/common/components/grid/cell-renderer/actions.cell-renderer.tsx
@@ -1,9 +1,19 @@
import React, { useMemo, useState } from 'react';
import { ICellRendererParams } from 'ag-grid-community';
import { get, isEmpty } from 'lodash';
-import { IconButton, MenuSurfaceAnchor, Typography, Menu, MenuItem } from '@map-colonies/react-core';
+import {
+ IconButton,
+ MenuSurfaceAnchor,
+ Typography,
+ Menu,
+ MenuItem,
+} from '@map-colonies/react-core';
import { Box } from '@map-colonies/react-components';
-import { IActionGroup, IAction, isDependentFieldWithValue } from '../../../actions/entity.actions';
+import {
+ IActionGroup,
+ IAction,
+ isDependentFieldWithValue,
+} from '../../../actions/entity.actions';
import './actions.cell-renderer.css';
@@ -11,59 +21,69 @@ const FIRST = 0;
const EMPTY_ACTION_GROUP = 0;
interface IActionsRendererParams extends ICellRendererParams {
- actions: Record;
- actionHandler: (action: Record) => void;
+ actions: Record;
+ actionHandler: (action: Record) => void;
}
export const ActionsRenderer: React.FC = (props) => {
- const entity = (props.data as Record).__typename as string;
+ const entity = (props.data as Record).__typename as string;
- const filterActionsByDependentFields = (actions: IActionGroup[]): IActionGroup[] => {
- const data = (props.data as Record);
- const filteredActionGroups = actions.map(actionGroup => {
- return ({
+ const filterActionsByDependentFields = (
+ actions: IActionGroup[]
+ ): IActionGroup[] => {
+ const data = props.data as Record;
+ const filteredActionGroups = actions.map((actionGroup) => {
+ return {
...actionGroup,
- group: actionGroup.group.filter(action => {
+ group: actionGroup.group.filter((action) => {
const { dependentField } = action;
if (typeof dependentField === 'undefined') return true;
-
+
if (isDependentFieldWithValue(dependentField)) {
if (!(dependentField.field in data)) return true;
- if (dependentField.operator === 'notEquals') {
- return get(data, dependentField.field) !== dependentField.expectedValue;
+ if (dependentField.operator === 'notEquals') {
+ return (
+ get(data, dependentField.field) !== dependentField.expectedValue
+ );
}
- return get(data, dependentField.field) === dependentField.expectedValue;
+ return (
+ get(data, dependentField.field) === dependentField.expectedValue
+ );
}
-
+
return get(data, dependentField) as boolean;
- })
- })
+ }),
+ };
});
return filteredActionGroups;
};
- const actions = useMemo(() => filterActionsByDependentFields(props.actions[entity]), [props.actions[entity]]);
+ const actions = useMemo(
+ () => filterActionsByDependentFields(props.actions[entity]),
+ [props.actions[entity]]
+ );
let frequentActions: IAction[] = [];
let allFlatActions: IAction[] = [];
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
if (actions !== undefined) {
- actions.forEach(actionGroup => {
+ actions.forEach((actionGroup) => {
frequentActions = [
...frequentActions,
- ...actionGroup.group.filter(action => action.frequent)
- ];
- allFlatActions = [
- ...allFlatActions,
- ...actionGroup.group
+ ...actionGroup.group.filter((action) => action.frequent),
];
+ allFlatActions = [...allFlatActions, ...actionGroup.group];
});
}
const [openActionsMenu, setOpenActionsMenu] = useState(false);
- const sendAction = (entity: string, action: IAction, data: Record): void => {
+ const sendAction = (
+ entity: string,
+ action: IAction,
+ data: Record
+ ): void => {
console.log(`SEND for ${entity} ${action.action} EVENT`);
props.actionHandler({
action: `${entity}.${action.action}`,
@@ -73,74 +93,77 @@ export const ActionsRenderer: React.FC = (props) => {
return (
- {
- frequentActions.map((action, idx) => {
- return (
- {
- sendAction(entity, action, props.data);
- }}
- />
- );
- })
- }
+ {frequentActions.map((action, idx) => {
+ return (
+ {
+ sendAction(entity, action, props.data);
+ }}
+ />
+ );
+ })}
+
+ );
+ })}
+
+ );
+ })}
- {
- !isEmpty(allFlatActions) &&
- setOpenActionsMenu(!openActionsMenu)}
/>
- }
+ )}
);
diff --git a/src/common/components/grid/cell-renderer/details-expander.cell-renderer.css b/src/common/components/grid/cell-renderer/details-expander.cell-renderer.css
index 0369c1e21..7324ef312 100644
--- a/src/common/components/grid/cell-renderer/details-expander.cell-renderer.css
+++ b/src/common/components/grid/cell-renderer/details-expander.cell-renderer.css
@@ -12,4 +12,4 @@
#jobsDialog .ag-react-container > span:first-of-type {
display: none;
pointer-events: none;
-}
\ No newline at end of file
+}
diff --git a/src/common/components/grid/cell-renderer/details-expander.cell-renderer.spec.tsx b/src/common/components/grid/cell-renderer/details-expander.cell-renderer.spec.tsx
index 4f9cd87b4..eba07dafb 100644
--- a/src/common/components/grid/cell-renderer/details-expander.cell-renderer.spec.tsx
+++ b/src/common/components/grid/cell-renderer/details-expander.cell-renderer.spec.tsx
@@ -1,6 +1,13 @@
import React from 'react';
import { shallow } from 'enzyme';
-import { ICellRendererParams, Column, RowNode, GridApi, ColumnApi, IRowNode } from 'ag-grid-community';
+import {
+ ICellRendererParams,
+ Column,
+ RowNode,
+ GridApi,
+ ColumnApi,
+ IRowNode,
+} from 'ag-grid-community';
// eslint-disable-next-line
import '../../../../__mocks__/confEnvShim';
import { DETAILS_ROW_ID_SUFFIX } from '../grid';
@@ -8,15 +15,15 @@ import { DetailsExpanderRenderer } from './details-expander.cell-renderer';
const ID = '1';
/* eslint-disable */
-const mockDataBase:ICellRendererParams = {
+const mockDataBase: ICellRendererParams = {
value: '',
valueFormatted: null,
getValue: () => {},
setValue: () => {},
formatValue: () => {},
data: {
- isVisible:true,
- id: ID,
+ isVisible: true,
+ id: ID,
},
node: new RowNode(),
colDef: {},
@@ -24,7 +31,9 @@ const mockDataBase:ICellRendererParams = {
rowIndex: 1,
api: {
onFilterChanged: () => {},
- getRowNode: (id: string):IRowNode | undefined => {return undefined},
+ getRowNode: (id: string): IRowNode | undefined => {
+ return undefined;
+ },
},
context: null,
refreshCell: () => {},
@@ -37,12 +46,10 @@ const mockDataBase:ICellRendererParams = {
describe('AgGrid DetailsExpanderRenderer component', () => {
it('renders correctly', () => {
const mockData = {
- ...mockDataBase
+ ...mockDataBase,
};
- const wrapper = shallow(
-
- );
+ const wrapper = shallow();
expect(wrapper).toMatchSnapshot();
});
@@ -54,23 +61,22 @@ describe('AgGrid DetailsExpanderRenderer component', () => {
// eslint-disable-next-line
jest.spyOn(mockData.api, 'onFilterChanged').mockImplementation(() => {});
- const spyGetRonNode = jest.spyOn(mockData.api, 'getRowNode').mockImplementation(() => {
- const val = new RowNode();
- // eslint-disable-next-line
- val.setDataValue = (propName, val) => {};
- val.data = {
- isVisible: false
- };
- return val;
- });
+ const spyGetRonNode = jest
+ .spyOn(mockData.api, 'getRowNode')
+ .mockImplementation(() => {
+ const val = new RowNode();
+ // eslint-disable-next-line
+ val.setDataValue = (propName, val) => {};
+ val.data = {
+ isVisible: false,
+ };
+ return val;
+ });
+
+ const wrapper = shallow();
- const wrapper = shallow(
-
- );
-
const iconContainer = wrapper.find('CollapseButton');
iconContainer.simulate('click');
expect(spyGetRonNode).toHaveBeenCalledWith(`${ID}${DETAILS_ROW_ID_SUFFIX}`);
});
-
});
diff --git a/src/common/components/grid/cell-renderer/details-expander.cell-renderer.tsx b/src/common/components/grid/cell-renderer/details-expander.cell-renderer.tsx
index aee31c384..287230ff6 100644
--- a/src/common/components/grid/cell-renderer/details-expander.cell-renderer.tsx
+++ b/src/common/components/grid/cell-renderer/details-expander.cell-renderer.tsx
@@ -1,6 +1,6 @@
import React from 'react';
import { ICellRendererParams } from 'ag-grid-community';
-import {CollapseButton} from '../../collapse-button/collapse.button';
+import { CollapseButton } from '../../collapse-button/collapse.button';
import { DETAILS_ROW_ID_SUFFIX, IGridRowDataDetailsExt } from '../grid';
import './details-expander.cell-renderer.css';
@@ -9,17 +9,22 @@ interface DetailsExpanderRendererProps extends ICellRendererParams {
detailsRowCellRendererPresencePredicate?: (data: any) => boolean;
}
-export const DetailsExpanderRenderer: React.FC = (props): JSX.Element | null => {
- const shouldRenderBtn = props.detailsRowCellRendererPresencePredicate?.(props.data) ?? true;
+export const DetailsExpanderRenderer: React.FC = (
+ props
+): JSX.Element | null => {
+ const shouldRenderBtn =
+ props.detailsRowCellRendererPresencePredicate?.(props.data) ?? true;
const handleCollapseExpand = (): void => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
- const rowNode = props.api.getRowNode(`${props.data?.id as string}${DETAILS_ROW_ID_SUFFIX}`);
+ const rowNode = props.api.getRowNode(
+ `${props.data?.id as string}${DETAILS_ROW_ID_SUFFIX}`
+ );
const isVisible = (rowNode?.data as IGridRowDataDetailsExt).isVisible;
rowNode?.setDataValue('isVisible', !isVisible);
props.api.onFilterChanged();
};
- if (shouldRenderBtn) return
+ if (shouldRenderBtn) return ;
return null;
};
diff --git a/src/common/components/grid/cell-renderer/footprint.cell-renderer.tsx b/src/common/components/grid/cell-renderer/footprint.cell-renderer.tsx
index 94928e72c..f3a30e1b4 100644
--- a/src/common/components/grid/cell-renderer/footprint.cell-renderer.tsx
+++ b/src/common/components/grid/cell-renderer/footprint.cell-renderer.tsx
@@ -6,21 +6,24 @@ import { GridRowNode } from '..';
import './footprint.cell-renderer.css';
interface IFootprintCellRendererParams extends ICellRendererParams {
- onClick: (id: string, value: boolean, node: GridRowNode) => void;
+ onClick: (id: string, value: boolean, node: GridRowNode) => void;
}
-export const FootprintRenderer: React.FC = (props) => {
+export const FootprintRenderer: React.FC = (
+ props
+) => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
- const [checked, setChecked] = useState(props.data.footprintShown as boolean);
+ const [checked, setChecked] = useState(
+ props.data.footprintShown as boolean
+ );
return (
- ): void => {
- setChecked(evt.currentTarget.checked);
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
- props.onClick(props.data.id, evt.currentTarget.checked, props.node);
- }}
+ onChange={(evt: React.MouseEvent): void => {
+ setChecked(evt.currentTarget.checked);
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
+ props.onClick(props.data.id, evt.currentTarget.checked, props.node);
+ }}
/>
- );
+ );
};
diff --git a/src/common/components/grid/cell-renderer/icon.cell-renderer.tsx b/src/common/components/grid/cell-renderer/icon.cell-renderer.tsx
index 71239d1ab..be171a55e 100644
--- a/src/common/components/grid/cell-renderer/icon.cell-renderer.tsx
+++ b/src/common/components/grid/cell-renderer/icon.cell-renderer.tsx
@@ -5,17 +5,17 @@ import { Icon } from '@map-colonies/react-core';
import './icon.cell-renderer.css';
export const IconRenderer: React.FC = (props) => {
-
return (
<>
- {
- // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
- props.value &&
- }
+ {
+ // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
+ props.value && (
+
+ )
+ }
>
);
-
};
diff --git a/src/common/components/grid/cell-renderer/job-product-type.cell-renderer.css b/src/common/components/grid/cell-renderer/job-product-type.cell-renderer.css
index 4a0860322..e915e0ce7 100644
--- a/src/common/components/grid/cell-renderer/job-product-type.cell-renderer.css
+++ b/src/common/components/grid/cell-renderer/job-product-type.cell-renderer.css
@@ -1,4 +1,4 @@
.productTypeIconContainer {
- display: flex;
- justify-content: flex-end;
-}
\ No newline at end of file
+ display: flex;
+ justify-content: flex-end;
+}
diff --git a/src/common/components/grid/cell-renderer/job-product-type.cell-renderer.tsx b/src/common/components/grid/cell-renderer/job-product-type.cell-renderer.tsx
index fd8f57aff..9e68fe97b 100644
--- a/src/common/components/grid/cell-renderer/job-product-type.cell-renderer.tsx
+++ b/src/common/components/grid/cell-renderer/job-product-type.cell-renderer.tsx
@@ -9,14 +9,17 @@ interface IProductTypeCellRendererParams extends ICellRendererParams {
style?: Record;
}
-export const JobProductTypeRenderer: React.FC = (props) => {
-
+export const JobProductTypeRenderer: React.FC<
+ IProductTypeCellRendererParams
+> = (props) => {
const data = props.data as JobModelType;
return (
-
-
+
+
);
-
};
diff --git a/src/common/components/grid/cell-renderer/layer-details.cell-renderer.spec.tsx b/src/common/components/grid/cell-renderer/layer-details.cell-renderer.spec.tsx
index f16660386..2587319d6 100644
--- a/src/common/components/grid/cell-renderer/layer-details.cell-renderer.spec.tsx
+++ b/src/common/components/grid/cell-renderer/layer-details.cell-renderer.spec.tsx
@@ -1,13 +1,19 @@
import React from 'react';
import { shallow } from 'enzyme';
-import { ICellRendererParams, Column, RowNode, GridApi, ColumnApi } from 'ag-grid-community';
+import {
+ ICellRendererParams,
+ Column,
+ RowNode,
+ GridApi,
+ ColumnApi,
+} from 'ag-grid-community';
import timezoneMock from 'timezone-mock';
// eslint-disable-next-line
import '../../../../__mocks__/confEnvShim';
import { LayerDetailsRenderer } from './layer-details.cell-renderer';
/* eslint-disable */
-const mockDataBase:ICellRendererParams = {
+const mockDataBase: ICellRendererParams = {
value: '',
valueFormatted: null,
getValue: () => {},
@@ -39,24 +45,20 @@ describe('AgGrid LayerDetailsRenderer component', () => {
it('renders correctly', () => {
const mockData = {
- ...mockDataBase
+ ...mockDataBase,
};
- const wrapper = shallow(
-
- );
+ const wrapper = shallow();
expect(wrapper).toMatchSnapshot();
});
it('data fields presented as TOTAL_PARTS = NUM_SPAN_PER_FIELD * NUM_FIEDLS', () => {
const mockData = {
- ...mockDataBase
+ ...mockDataBase,
};
- const wrapper = shallow(
-
- );
+ const wrapper = shallow();
const spans = wrapper.find('span');
expect(spans).toHaveLength(NUM_SPAN_PER_FIELD * NUM_FIEDLS);
diff --git a/src/common/components/grid/cell-renderer/layer-details.cell-renderer.tsx b/src/common/components/grid/cell-renderer/layer-details.cell-renderer.tsx
index 7af27bc2a..2bad11952 100644
--- a/src/common/components/grid/cell-renderer/layer-details.cell-renderer.tsx
+++ b/src/common/components/grid/cell-renderer/layer-details.cell-renderer.tsx
@@ -2,14 +2,18 @@ import React from 'react';
import { ICellRendererParams } from 'ag-grid-community';
import { FormattedMessage } from 'react-intl';
import { Box } from '@map-colonies/react-components';
-import { dateFormatter, FormatterFunc, stringFormatter } from '../../../helpers/formatters';
+import {
+ dateFormatter,
+ FormatterFunc,
+ stringFormatter,
+} from '../../../helpers/formatters';
import './layer-details.cell-renderer.css';
interface DetailsProp {
- propName: string,
- propLabelId: string,
- formatter: FormatterFunc
+ propName: string;
+ propLabelId: string;
+ formatter: FormatterFunc;
}
const detailsPropsLayout = new Array(
@@ -69,37 +73,31 @@ const detailsPropsLayout = new Array(
]
);
-export const LayerDetailsRenderer: React.FC = (
- props
-) => {
+export const LayerDetailsRenderer: React.FC = (props) => {
return (
- {
- detailsPropsLayout.map((layoutColumn,i) => {
+ {detailsPropsLayout.map((layoutColumn, i) => {
return (
-
- {
- layoutColumn.map((item:DetailsProp, ii) => {
- return(
-
-
- :
-
-
- {
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
- item.formatter(props.data[item.propName])
- }
-
-
- )
- })
- }
+
+ {layoutColumn.map((item: DetailsProp, ii) => {
+ return (
+
+
+
+ :
+
+
+ {
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
+ item.formatter(props.data[item.propName])
+ }
+
+
+ );
+ })}
- )
- })
- }
-
+ );
+ })}
+
);
-
};
diff --git a/src/common/components/grid/cell-renderer/layer-image.cell-renderer.tsx b/src/common/components/grid/cell-renderer/layer-image.cell-renderer.tsx
index 28b3fdd02..3779edca4 100644
--- a/src/common/components/grid/cell-renderer/layer-image.cell-renderer.tsx
+++ b/src/common/components/grid/cell-renderer/layer-image.cell-renderer.tsx
@@ -2,7 +2,10 @@ import React, { useEffect, useState } from 'react';
import { ICellRendererParams } from 'ag-grid-community';
import { IconButton } from '@map-colonies/react-core';
import { Box } from '@map-colonies/react-components';
-import { isBeingDeleted, isValidLayerMetadata } from '../../../helpers/layer-url';
+import {
+ isBeingDeleted,
+ isValidLayerMetadata,
+} from '../../../helpers/layer-url';
import { GridRowNode } from '..';
import './layer-image.cell-renderer.css';
@@ -11,9 +14,13 @@ interface ILayerImageCellRendererParams extends ICellRendererParams {
onClick: (id: string, value: boolean, node: GridRowNode) => void;
}
-export const LayerImageRenderer: React.FC = (props) => {
+export const LayerImageRenderer: React.FC = (
+ props
+) => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
- const [layerImageShown, setLayerImageShown] = useState(props.data.layerImageShown as boolean);
+ const [layerImageShown, setLayerImageShown] = useState(
+ props.data.layerImageShown as boolean
+ );
useEffect(() => {
if (layerImageShown && isBeingDeleted(props.data)) {
@@ -22,19 +29,25 @@ export const LayerImageRenderer: React.FC = (prop
}, [props.data?.productStatus]);
return (
-
+
{
- if (isValidLayerMetadata(props.data)) {
- setLayerImageShown(!layerImageShown);
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
- props.onClick(props.data.id, !layerImageShown, props.node);
- }
+ onClick={(): void => {
+ if (isValidLayerMetadata(props.data)) {
+ setLayerImageShown(!layerImageShown);
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
+ props.onClick(props.data.id, !layerImageShown, props.node);
}
- }
+ }}
/>
);
diff --git a/src/common/components/grid/cell-renderer/product-type.cell-renderer.tsx b/src/common/components/grid/cell-renderer/product-type.cell-renderer.tsx
index ec6d4203c..1ebc28001 100644
--- a/src/common/components/grid/cell-renderer/product-type.cell-renderer.tsx
+++ b/src/common/components/grid/cell-renderer/product-type.cell-renderer.tsx
@@ -2,7 +2,10 @@ import React, { useMemo } from 'react';
import { ICellRendererParams } from 'ag-grid-community';
import { getLinkUrlWithToken } from '../../../../discrete-layer/components/helpers/layersUtils';
import { ILayerImage } from '../../../../discrete-layer/models/layerImage';
-import { LayerRasterRecordModelType, LinkModelType } from '../../../../discrete-layer/models';
+import {
+ LayerRasterRecordModelType,
+ LinkModelType,
+} from '../../../../discrete-layer/models';
import { getIconStyle } from '../../../helpers/style';
import { LinkType } from '../../../models/link-type.enum';
import { TypeIcon } from '../../shared/type-icon';
@@ -13,28 +16,43 @@ interface IProductTypeCellRendererParams extends ICellRendererParams {
onClick?: (data: ILayerImage, value: boolean, gridApi: GridApi) => void;
}
-export const ProductTypeRenderer: React.FC = (props) => {
+export const ProductTypeRenderer: React.FC = (
+ props
+) => {
const data = props.data as ILayerImage;
const handleClick = (event: React.MouseEvent) => {
if (props.onClick) {
- props.onClick(data, !(data as LayerRasterRecordModelType).polygonPartsShown, props.api);
+ props.onClick(
+ data,
+ !(data as LayerRasterRecordModelType).polygonPartsShown,
+ props.api
+ );
}
};
const computedStyle = useMemo(() => {
return {
...(props.style ?? {}),
- ...(getIconStyle(data as any, 'color') ?? {})
+ ...(getIconStyle(data as any, 'color') ?? {}),
};
}, [props.style, data]);
return (
);
};
diff --git a/src/common/components/grid/cell-renderer/styled-by-data.cell-renderer.tsx b/src/common/components/grid/cell-renderer/styled-by-data.cell-renderer.tsx
index 88717efc8..01f1fcfb5 100644
--- a/src/common/components/grid/cell-renderer/styled-by-data.cell-renderer.tsx
+++ b/src/common/components/grid/cell-renderer/styled-by-data.cell-renderer.tsx
@@ -4,11 +4,9 @@ import { Typography } from '@map-colonies/react-core';
import { getIconStyle } from '../../../helpers/style';
export const StyledByDataRenderer: React.FC = (props) => {
-
return (
{props.value}
);
-
};
diff --git a/src/common/components/grid/grid.tsx b/src/common/components/grid/grid.tsx
index cb3a9a325..2c7583ef7 100644
--- a/src/common/components/grid/grid.tsx
+++ b/src/common/components/grid/grid.tsx
@@ -14,9 +14,9 @@ import {
IRowNode,
RowHeightParams,
RowClickedEvent,
- AllCommunityModule,
- ModuleRegistry,
- IsFullWidthRowParams
+ AllCommunityModule,
+ ModuleRegistry,
+ IsFullWidthRowParams,
} from 'ag-grid-community';
import { useTheme } from '@map-colonies/react-core';
import { Box } from '@map-colonies/react-components';
@@ -43,47 +43,48 @@ interface GridComponentProps {
focusByRowId?: string;
setIsRowFound?: (val: boolean) => void;
handleFocusError?: (error: IError | undefined) => void;
-};
+}
-export interface GridApi extends AgGridApi{};
-export interface GridReadyEvent extends AgGridReadyEvent{};
-export interface GridCellMouseOutEvent extends CellMouseOutEvent{};
-export interface GridCellMouseOverEvent extends CellMouseOverEvent{};
-export interface GridRowDragEnterEvent extends RowDragEnterEvent{};
-export interface GridRowDragEndEvent extends RowDragEndEvent{};
-export interface GridRowSelectedEvent extends RowSelectedEvent{};
-export interface GridRowClickedEvent extends RowClickedEvent{};
-export interface GridValueFormatterParams extends ValueFormatterParams{};
+export interface GridApi extends AgGridApi {}
+export interface GridReadyEvent extends AgGridReadyEvent {}
+export interface GridCellMouseOutEvent extends CellMouseOutEvent {}
+export interface GridCellMouseOverEvent extends CellMouseOverEvent {}
+export interface GridRowDragEnterEvent extends RowDragEnterEvent {}
+export interface GridRowDragEndEvent extends RowDragEndEvent {}
+export interface GridRowSelectedEvent extends RowSelectedEvent {}
+export interface GridRowClickedEvent extends RowClickedEvent {}
+export interface GridValueFormatterParams extends ValueFormatterParams {}
export interface GridComponentOptions extends GridOptions {
detailsRowCellRenderer?: string;
detailsRowHeight?: number;
detailsRowExpanderPosition?: 'start' | 'end';
context?: {
detailsRowCellRendererPresencePredicate?: (data: any) => boolean;
- }
-};
+ };
+}
export interface IGridRowDataDetailsExt {
rowHeight: number;
fullWidth: boolean;
isVisible: boolean;
-};
+}
export interface IRowPosition {
pageNumber: number;
rowIndex: number;
}
-export interface GridRowNode extends IRowNode {};
+export interface GridRowNode extends IRowNode {}
export const GridComponent: React.FC = (props) => {
- const [rowData, setRowData] = useState()
+ const [rowData, setRowData] = useState();
const theme = useTheme();
const [gridApi, setGridApi] = useState();
- const {focusByRowId, setIsRowFound, handleFocusError} = props
-
- const {detailsRowExpanderPosition, ...restGridOptions} = props.gridOptions as GridComponentOptions;
+ const { focusByRowId, setIsRowFound, handleFocusError } = props;
+
+ const { detailsRowExpanderPosition, ...restGridOptions } =
+ props.gridOptions as GridComponentOptions;
const gridOptionsFromProps: GridComponentOptions = {
...restGridOptions,
@@ -92,71 +93,91 @@ export const GridComponent: React.FC = (props) => {
field: 'isVisible',
hide: true,
},
- (props.gridOptions?.detailsRowExpanderPosition === 'start' && props.gridOptions.detailsRowCellRenderer !== undefined) ?
- {
- headerName: '',
- width: EXPANDER_COLUMN_WIDTH,
- cellRenderer: 'detailsExpanderRenderer',
- suppressMovable: true,
- sortable: false,
- cellRendererParams: {
- detailsRowCellRendererPresencePredicate: props.gridOptions.context?.detailsRowCellRendererPresencePredicate
+ props.gridOptions?.detailsRowExpanderPosition === 'start' &&
+ props.gridOptions.detailsRowCellRenderer !== undefined
+ ? {
+ headerName: '',
+ width: EXPANDER_COLUMN_WIDTH,
+ cellRenderer: 'detailsExpanderRenderer',
+ suppressMovable: true,
+ sortable: false,
+ cellRendererParams: {
+ detailsRowCellRendererPresencePredicate:
+ props.gridOptions.context
+ ?.detailsRowCellRendererPresencePredicate,
+ },
+ }
+ : {
+ hide: true,
+ },
+ ...(props.gridOptions?.columnDefs as []),
+ props.gridOptions?.detailsRowExpanderPosition !== 'start' &&
+ props.gridOptions?.detailsRowCellRenderer !== undefined
+ ? {
+ headerName: '',
+ width: EXPANDER_COLUMN_WIDTH,
+ cellRenderer: 'detailsExpanderRenderer',
+ suppressMovable: true,
+ sortable: false,
+ cellRendererParams: {
+ detailsRowCellRendererPresencePredicate:
+ props.gridOptions.context
+ ?.detailsRowCellRendererPresencePredicate,
+ },
+ }
+ : {
+ hide: true,
+ },
+ ],
+ getRowHeight:
+ props.gridOptions?.detailsRowCellRenderer !== undefined
+ ? (params: RowHeightParams): number => {
+ return (params.data as IGridRowDataDetailsExt).rowHeight;
}
- } :
- {
- hide: true,
- },
- ...props.gridOptions?.columnDefs as [],
- (props.gridOptions?.detailsRowExpanderPosition !== 'start' && props.gridOptions?.detailsRowCellRenderer !== undefined) ?
- {
- headerName: '',
- width: EXPANDER_COLUMN_WIDTH,
- cellRenderer: 'detailsExpanderRenderer',
- suppressMovable: true,
- sortable: false,
- cellRendererParams: {
- detailsRowCellRendererPresencePredicate: props.gridOptions.context?.detailsRowCellRendererPresencePredicate
+ : undefined,
+ isExternalFilterPresent:
+ props.gridOptions?.detailsRowCellRenderer !== undefined
+ ? (): boolean => true
+ : undefined,
+ doesExternalFilterPass:
+ props.gridOptions?.detailsRowCellRenderer !== undefined
+ ? (node): boolean => {
+ return (node.data as IGridRowDataDetailsExt).isVisible;
+ //return gridOptions.api.getValue("isVisible", node.rowNode);
}
- } :
- {
- hide: true,
- },
- ],
- getRowHeight: props.gridOptions?.detailsRowCellRenderer !== undefined ? (params: RowHeightParams): number => {
- return (params.data as IGridRowDataDetailsExt).rowHeight;
- } : undefined,
- isExternalFilterPresent: props.gridOptions?.detailsRowCellRenderer !== undefined ? (): boolean => true : undefined,
- doesExternalFilterPass: props.gridOptions?.detailsRowCellRenderer !== undefined ? (node): boolean => {
- return (node.data as IGridRowDataDetailsExt).isVisible;
- //return gridOptions.api.getValue("isVisible", node.rowNode);
- } : undefined,
- isFullWidthRow: props.gridOptions?.detailsRowCellRenderer !== undefined ? (params: IsFullWidthRowParams): boolean => {
- // checked the fullWidth attribute that was set while creating the data
- return (params.rowNode.data as IGridRowDataDetailsExt).fullWidth;
- } : undefined,
- fullWidthCellRenderer: props.gridOptions?.detailsRowCellRenderer ?? undefined,
-
- components: {
- ...props.gridOptions?.components as {[key: string]: any},
- detailsExpanderRenderer: useCallback(DetailsExpanderRenderer, []),
- },
- localeText: GRID_MESSAGES[CONFIG.I18N.DEFAULT_LANGUAGE],
- onGridReady(params: GridReadyEvent) {
- if (typeof(restGridOptions.onGridReady) === 'function') {
- restGridOptions.onGridReady(params);
- }
-
- setGridApi(params.api);
- },
+ : undefined,
+ isFullWidthRow:
+ props.gridOptions?.detailsRowCellRenderer !== undefined
+ ? (params: IsFullWidthRowParams): boolean => {
+ // checked the fullWidth attribute that was set while creating the data
+ return (params.rowNode.data as IGridRowDataDetailsExt).fullWidth;
+ }
+ : undefined,
+ fullWidthCellRenderer:
+ props.gridOptions?.detailsRowCellRenderer ?? undefined,
+
+ components: {
+ ...(props.gridOptions?.components as { [key: string]: any }),
+ detailsExpanderRenderer: useCallback(DetailsExpanderRenderer, []),
+ },
+ localeText: GRID_MESSAGES[CONFIG.I18N.DEFAULT_LANGUAGE],
+ onGridReady(params: GridReadyEvent) {
+ if (typeof restGridOptions.onGridReady === 'function') {
+ restGridOptions.onGridReady(params);
+ }
+
+ setGridApi(params.api);
+ },
};
- const {detailsRowCellRenderer, detailsRowHeight, ...gridOptions} = gridOptionsFromProps;
+ const { detailsRowCellRenderer, detailsRowHeight, ...gridOptions } =
+ gridOptionsFromProps;
- const getIsVisible = (id:string): boolean => {
+ const getIsVisible = (id: string): boolean => {
let res = false;
gridApi?.forEachNode((node) => {
- const nodeData = node.data as Record;
+ const nodeData = node.data as Record;
if (nodeData.id === id) {
res = nodeData.isVisible as boolean;
}
@@ -167,20 +188,26 @@ export const GridComponent: React.FC = (props) => {
useEffect(() => {
const result: any[] = [];
if (props.gridOptions?.detailsRowCellRenderer !== undefined) {
- props.rowData?.forEach((element,idx) => {
- const rowElement: Record = element as Record;
+ props.rowData?.forEach((element, idx) => {
+ const rowElement: Record = element as Record<
+ string,
+ unknown
+ >;
result.push({
...rowElement,
- isVisible: true
+ isVisible: true,
});
result.push({
- ...rowElement,
+ ...rowElement,
fullWidth: true,
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
id: `${rowElement.id as string}${DETAILS_ROW_ID_SUFFIX}`,
- isVisible: getIsVisible(`${rowElement.id as string}${DETAILS_ROW_ID_SUFFIX}`),
- rowHeight: props.gridOptions?.detailsRowHeight ?? DEFAULT_DETAILS_ROW_HEIGHT,
+ isVisible: getIsVisible(
+ `${rowElement.id as string}${DETAILS_ROW_ID_SUFFIX}`
+ ),
+ rowHeight:
+ props.gridOptions?.detailsRowHeight ?? DEFAULT_DETAILS_ROW_HEIGHT,
});
});
} else {
@@ -188,13 +215,12 @@ export const GridComponent: React.FC = (props) => {
}
if (typeof props.isLoading === 'undefined' || props.isLoading === false) {
setRowData(result);
- if(result){
- gridApi?.setGridOption("loading", false);
+ if (result) {
+ gridApi?.setGridOption('loading', false);
}
} else {
- gridApi?.setGridOption("loading", true);
+ gridApi?.setGridOption('loading', true);
}
-
}, [props.rowData, props.gridOptions, props.isLoading]);
useEffect(() => {
@@ -205,7 +231,10 @@ export const GridComponent: React.FC = (props) => {
focusAndExpandRow(gridApi, focusByRowId);
}, [rowData]);
- const getRowPosition = (gridApi: GridApi, id: string): IRowPosition | undefined => {
+ const getRowPosition = (
+ gridApi: GridApi,
+ id: string
+ ): IRowPosition | undefined => {
const node = gridApi.getRowNode(id);
if (!node || node.rowIndex == null) {
@@ -219,8 +248,8 @@ export const GridComponent: React.FC = (props) => {
return {
pageNumber,
rowIndex,
- }
- }
+ };
+ };
const goToRowAndFocus = (gridApi: GridApi, row: IRowPosition) => {
gridApi.paginationGoToPage(row.pageNumber);
@@ -235,7 +264,7 @@ export const GridComponent: React.FC = (props) => {
handleFocusError?.({
code: 'warning.row-not-found',
message: '',
- level: 'warning'
+ level: 'warning',
});
setIsRowFound?.(false);
return;
@@ -244,26 +273,27 @@ export const GridComponent: React.FC = (props) => {
handleFocusError?.(undefined);
setIsRowFound?.(true);
goToRowAndFocus(gridApi, row);
-
- const rowNode = gridApi.getRowNode(`${id as unknown as string}${DETAILS_ROW_ID_SUFFIX}`);
+
+ const rowNode = gridApi.getRowNode(
+ `${id as unknown as string}${DETAILS_ROW_ID_SUFFIX}`
+ );
rowNode?.setDataValue('isVisible', true);
gridApi.onFilterChanged();
};
const agGridThemeOverrides = GridThemes.getTheme(theme);
-
+
return (
-
+
);
};
diff --git a/src/common/components/grid/header-renderer/footprint.header-renderer.css b/src/common/components/grid/header-renderer/footprint.header-renderer.css
index 3abf50cf6..1a1edf8e6 100644
--- a/src/common/components/grid/header-renderer/footprint.header-renderer.css
+++ b/src/common/components/grid/header-renderer/footprint.header-renderer.css
@@ -1,3 +1,7 @@
-body[dir='rtl'] .ag-theme-alpine-dark .ag-header .ag-react-container .mdc-checkbox {
- position: unset;
+body[dir='rtl']
+ .ag-theme-alpine-dark
+ .ag-header
+ .ag-react-container
+ .mdc-checkbox {
+ position: unset;
}
diff --git a/src/common/components/grid/header-renderer/footprint.header-renderer.tsx b/src/common/components/grid/header-renderer/footprint.header-renderer.tsx
index 8d1e514d0..d24c7e619 100644
--- a/src/common/components/grid/header-renderer/footprint.header-renderer.tsx
+++ b/src/common/components/grid/header-renderer/footprint.header-renderer.tsx
@@ -7,21 +7,22 @@ import './footprint.header-renderer.css';
interface IFootprintCellRendererParams extends ICellRendererParams {
isChecked: boolean;
- onClick: (value: boolean, gridApi: GridApi) => void;
+ onClick: (value: boolean, gridApi: GridApi) => void;
}
-export const HeaderFootprintRenderer: React.FC = (props) => {
+export const HeaderFootprintRenderer: React.FC = (
+ props
+) => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
const [checked, setChecked] = useState(props.isChecked);
return (
- ): void => {
- setChecked(evt.currentTarget.checked);
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
- props.onClick(evt.currentTarget.checked, props.api);
- }}
+ onClick={(evt: React.MouseEvent): void => {
+ setChecked(evt.currentTarget.checked);
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
+ props.onClick(evt.currentTarget.checked, props.api);
+ }}
/>
- );
+ );
};
diff --git a/src/common/components/grid/themes/themes.ts b/src/common/components/grid/themes/themes.ts
index fed4f6345..361724c4c 100644
--- a/src/common/components/grid/themes/themes.ts
+++ b/src/common/components/grid/themes/themes.ts
@@ -9,21 +9,30 @@ export class GridThemes {
// "--ag-header-background-color": 'green',
// },
public static getTheme(mainTheme: IOptions): IOptions {
- const alternativeSurfaceColor = get(mainTheme, 'custom.GC_ALTERNATIVE_SURFACE', mainTheme.surface) as string;
+ const alternativeSurfaceColor = get(
+ mainTheme,
+ 'custom.GC_ALTERNATIVE_SURFACE',
+ mainTheme.surface
+ ) as string;
// const selectionBackground = get(mainTheme, 'custom.GC_SELECTION_BACKGROUND', mainTheme.surface) as string;
- const foregroundColor = get(mainTheme, 'textIconOnDark', mainTheme.textPrimaryOnDark) as string;
-
+ const foregroundColor = get(
+ mainTheme,
+ 'textIconOnDark',
+ mainTheme.textPrimaryOnDark
+ ) as string;
+
return {
- "--ag-header-background-color": alternativeSurfaceColor,
- "--ag-border-color": alternativeSurfaceColor,
- "--ag-background-color": alternativeSurfaceColor,
- "--ag-row-border-color": alternativeSurfaceColor,
- "--ag-secondary-border-color": alternativeSurfaceColor,
- "--ag-odd-row-background-color": alternativeSurfaceColor,
- "--ag-selected-row-background-color": "transparent",
- "--ag-foreground-color": foregroundColor,
- "--ag-font-size": '13px',
- "--ag-selected-details-row-background": '#38455c', /*GC_SELECTION_BACKGROUND with opacity 0.5*/
+ '--ag-header-background-color': alternativeSurfaceColor,
+ '--ag-border-color': alternativeSurfaceColor,
+ '--ag-background-color': alternativeSurfaceColor,
+ '--ag-row-border-color': alternativeSurfaceColor,
+ '--ag-secondary-border-color': alternativeSurfaceColor,
+ '--ag-odd-row-background-color': alternativeSurfaceColor,
+ '--ag-selected-row-background-color': 'transparent',
+ '--ag-foreground-color': foregroundColor,
+ '--ag-font-size': '13px',
+ '--ag-selected-details-row-background':
+ '#38455c' /*GC_SELECTION_BACKGROUND with opacity 0.5*/,
};
}
-};
\ No newline at end of file
+}
diff --git a/src/common/components/grid/tooltip-renderer/name.tooltip-renderer.tsx b/src/common/components/grid/tooltip-renderer/name.tooltip-renderer.tsx
index d2db28268..1cc39facd 100644
--- a/src/common/components/grid/tooltip-renderer/name.tooltip-renderer.tsx
+++ b/src/common/components/grid/tooltip-renderer/name.tooltip-renderer.tsx
@@ -4,19 +4,28 @@ import { get } from 'lodash';
import { ITooltipParams } from 'ag-grid-community';
import { Typography } from '@map-colonies/react-core';
import { LayerRecordTypes } from '../../../../discrete-layer/components/layer-details/entity-types-keys';
-import { DateGranularityType, FieldConfigModelType } from '../../../../discrete-layer/models';
+import {
+ DateGranularityType,
+ FieldConfigModelType,
+} from '../../../../discrete-layer/models';
import { ILayerImage } from '../../../../discrete-layer/models/layerImage';
import { dateFormatter } from '../../../helpers/formatters';
import './name.tooltip-renderer.css';
export default forwardRef((props: ITooltipParams, ref) => {
- const [data] = useState(props.api.getDisplayedRowAtIndex(props?.rowIndex as number)?.data);
+ const [data] = useState(
+ props.api.getDisplayedRowAtIndex(props?.rowIndex as number)?.data
+ );
const [layerRecordTypename] = useState(data.__typename);
const [color] = useState(get(props, 'color', 'white'));
- const [infoTooltipMap] = useState
diff --git a/src/common/components/tree/renderers/tree-node-renderer.tsx b/src/common/components/tree/renderers/tree-node-renderer.tsx
index 69bfd6cef..f37a0bd4f 100644
--- a/src/common/components/tree/renderers/tree-node-renderer.tsx
+++ b/src/common/components/tree/renderers/tree-node-renderer.tsx
@@ -37,7 +37,7 @@ class FileThemeTreeNodeRenderer extends Component {
return connectDropTarget(
- {Children.map(children, child =>
+ {Children.map(children, (child) =>
cloneElement(child, {
isOver,
canDrop,
diff --git a/src/common/components/tree/statuses/error.tsx b/src/common/components/tree/statuses/error.tsx
index 2a65c27e9..b10f15311 100644
--- a/src/common/components/tree/statuses/error.tsx
+++ b/src/common/components/tree/statuses/error.tsx
@@ -17,25 +17,35 @@ export const Error: React.FC
= (props) => {
return (
-
-
+
+
+
+
+
+
+
+
+
+
-
- {
- message && {message}
- }
- {
- !message &&
- }
+
+
+
+ {message && {message}}
+ {!message && (
+
+ {' '}
+
+
+ )}
- {
- details !== undefined &&
+ {details !== undefined && (
{details}
- }
+ )}
);
};
diff --git a/src/common/components/tree/statuses/loading.tsx b/src/common/components/tree/statuses/loading.tsx
index 1b205067e..b8c9be7cd 100644
--- a/src/common/components/tree/statuses/loading.tsx
+++ b/src/common/components/tree/statuses/loading.tsx
@@ -4,5 +4,10 @@ import { CircularProgress } from '@map-colonies/react-core';
import { Box } from '@map-colonies/react-components';
export const Loading: React.FC = (): JSX.Element => {
- return ;
+ return (
+
+
+
+
+ );
};
diff --git a/src/common/components/tree/themes/themes.ts b/src/common/components/tree/themes/themes.ts
index 3ab0d6a3a..546b87407 100644
--- a/src/common/components/tree/themes/themes.ts
+++ b/src/common/components/tree/themes/themes.ts
@@ -4,19 +4,27 @@ import { IOptions } from '@map-colonies/react-core';
// eslint-disable-next-line
export class TreeThemes {
public static getTheme(mainTheme: IOptions): IOptions {
- const selectionBackground = get(mainTheme, 'custom.GC_SELECTION_BACKGROUND', mainTheme.surface) as string;
- const hoverBackground = get(mainTheme, 'custom.GC_HOVER_BACKGROUND', 'rgba(33, 150, 243, 0.1)') as string;
-
+ const selectionBackground = get(
+ mainTheme,
+ 'custom.GC_SELECTION_BACKGROUND',
+ mainTheme.surface
+ ) as string;
+ const hoverBackground = get(
+ mainTheme,
+ 'custom.GC_HOVER_BACKGROUND',
+ 'rgba(33, 150, 243, 0.1)'
+ ) as string;
+
const rstTheme = {
- "--rst-selected-background-color": selectionBackground,
- "--rst-hover-background-color": hoverBackground,
- "--rst-highlight-line-size": '6px',
- "--rst-node-label-width": '280px',
- "--rst-expander-size": '30px',
+ '--rst-selected-background-color': selectionBackground,
+ '--rst-hover-background-color': hoverBackground,
+ '--rst-highlight-line-size': '6px',
+ '--rst-node-label-width': '280px',
+ '--rst-expander-size': '30px',
};
// return Object.entries(rstTheme).map(
// ([key, value]) => `${key}:${value}`
// ).join(';');
return rstTheme;
}
-};
\ No newline at end of file
+}
diff --git a/src/common/components/tree/tree.tsx b/src/common/components/tree/tree.tsx
index d6227ff59..8515c57df 100644
--- a/src/common/components/tree/tree.tsx
+++ b/src/common/components/tree/tree.tsx
@@ -1,22 +1,29 @@
import React, { CSSProperties } from 'react';
import { useTheme } from '@map-colonies/react-core';
-import SortableTree, { ThemeProps, ReactSortableTreeProps, TreeItem as RSTTreeItem } from 'react-sortable-tree';
+import SortableTree, {
+ ThemeProps,
+ ReactSortableTreeProps,
+ TreeItem as RSTTreeItem,
+} from 'react-sortable-tree';
import CONFIG from '../../config';
import { TreeThemes } from './themes/themes';
import FileExplorerTheme from './renderers';
-export interface TreeItem extends RSTTreeItem{};
+export interface TreeItem extends RSTTreeItem {}
export const TreeComponent: React.FC = (props) => {
const theme = useTheme();
const treeTheme = TreeThemes.getTheme(theme) as CSSProperties;
- const rowDirection = CONFIG.I18N.DEFAULT_LANGUAGE.toUpperCase() === 'HE' ? 'rtl' : 'ltr';
-
+ const rowDirection =
+ CONFIG.I18N.DEFAULT_LANGUAGE.toUpperCase() === 'HE' ? 'rtl' : 'ltr';
+
return (
-
+
= (props) => {
/>
);
-}
\ No newline at end of file
+};
diff --git a/src/common/components/utm-grid-data-source/utm-grid-data-source.component.tsx b/src/common/components/utm-grid-data-source/utm-grid-data-source.component.tsx
index 909700e07..117e9271d 100644
--- a/src/common/components/utm-grid-data-source/utm-grid-data-source.component.tsx
+++ b/src/common/components/utm-grid-data-source/utm-grid-data-source.component.tsx
@@ -11,7 +11,6 @@ import center from '@turf/center';
import { points } from '@turf/helpers';
import React from 'react';
-
const SELECTION_POLYGON_OUTLINE_COLOR = '#8a3e00';
const SELECTION_POLYGON_LINE_WIDTH = 2;
@@ -25,12 +24,16 @@ const UTMGridDataSource: React.FC = () => {
// TODO: Change the data source path.
data={'./assets/data/utmzone.geojson'}
onLoad={(geoJsonDataSource): void => {
- geoJsonDataSource.entities.values.forEach(item => {
+ geoJsonDataSource.entities.values.forEach((item) => {
let centerInDegrees;
if (item.polyline) {
- (item.polyline.clampToGround as CesiumConstantProperty).setValue(true);
- (item.polyline.width as CesiumConstantProperty).setValue(HIGHLIGHT_OUTLINE_WIDTH);
+ (item.polyline.clampToGround as CesiumConstantProperty).setValue(
+ true
+ );
+ (item.polyline.width as CesiumConstantProperty).setValue(
+ HIGHLIGHT_OUTLINE_WIDTH
+ );
// @ts-ignore
item.polyline.material = SELECTION_OUTLINE_COLOR;
@@ -38,20 +41,28 @@ const UTMGridDataSource: React.FC = () => {
centerInDegrees = center(
points(
// @ts-ignore
- ((item.polyline.positions.getValue() as Record
).map((pos) => {
- const cartographicPos = CesiumCartographic.fromCartesian(pos);
+ (
+ item.polyline.positions.getValue() as Record<
+ string,
+ unknown
+ >
+ ).map((pos) => {
+ const cartographicPos =
+ CesiumCartographic.fromCartesian(pos);
return [
CesiumMath.toDegrees(cartographicPos.latitude),
CesiumMath.toDegrees(cartographicPos.longitude),
];
- }))
+ })
)
).geometry.coordinates;
}
if (item.polygon) {
// @ts-ignore
- (item.polygon.outlineColor as CesiumConstantProperty).setValue(CesiumColor.fromCssColorString(SELECTION_POLYGON_OUTLINE_COLOR));
+ (item.polygon.outlineColor as CesiumConstantProperty).setValue(
+ CesiumColor.fromCssColorString(SELECTION_POLYGON_OUTLINE_COLOR)
+ );
(item.polygon.outlineWidth as CesiumConstantProperty).setValue(
SELECTION_POLYGON_LINE_WIDTH
);
@@ -62,21 +73,30 @@ const UTMGridDataSource: React.FC = () => {
centerInDegrees = center(
points(
// @ts-ignore
- ((item.polygon.hierarchy.getValue() as Record)
- .positions as CesiumCartesian3[]).map((pos) => {
- const cartographicPos = CesiumCartographic.fromCartesian(pos);
- return [
- CesiumMath.toDegrees(cartographicPos.latitude),
- CesiumMath.toDegrees(cartographicPos.longitude),
- ];
- }
- )
+ (
+ (
+ item.polygon.hierarchy.getValue() as Record<
+ string,
+ unknown
+ >
+ ).positions as CesiumCartesian3[]
+ ).map((pos) => {
+ const cartographicPos =
+ CesiumCartographic.fromCartesian(pos);
+ return [
+ CesiumMath.toDegrees(cartographicPos.latitude),
+ CesiumMath.toDegrees(cartographicPos.longitude),
+ ];
+ })
)
).geometry.coordinates;
}
// @ts-ignore
- item.position = CesiumCartesian3.fromDegrees(centerInDegrees[1], centerInDegrees[0]); // [lon, lat]
+ item.position = CesiumCartesian3.fromDegrees(
+ centerInDegrees[1],
+ centerInDegrees[0]
+ ); // [lon, lat]
const label = {
// eslint-disable-next-line
diff --git a/src/common/config/index.ts b/src/common/config/index.ts
index b289d321c..3fd48ee1c 100644
--- a/src/common/config/index.ts
+++ b/src/common/config/index.ts
@@ -1,6 +1,12 @@
-import { CesiumGeographicTilingScheme, Proj } from '@map-colonies/react-components';
+import {
+ CesiumGeographicTilingScheme,
+ Proj,
+} from '@map-colonies/react-components';
import { IRasterLayer } from '@map-colonies/react-components/dist/cesium-map/layers-manager';
-import { IBaseMaps, IBaseMap } from '@map-colonies/react-components/dist/cesium-map/map';
+import {
+ IBaseMaps,
+ IBaseMap,
+} from '@map-colonies/react-components/dist/cesium-map/map';
import { LinkType } from '../models/link-type.enum';
import { IRasterIngestionFilesStructureConfig } from '../models/raster-ingestion-files-structure';
@@ -22,28 +28,33 @@ const MAP = (window as any)._env_.MAP;
const JOB_MANAGER = (window as any)._env_.JOB_MANAGER;
const DEFAULT_USER = (window as any)._env_.DEFAULT_USER;
const BASE_MAPS = JSON.parse((window as any)._env_.BASE_MAPS);
-const DEFAULT_TERRAIN_PROVIDER_URL = (window as any)._env_.DEFAULT_TERRAIN_PROVIDER_URL;
+const DEFAULT_TERRAIN_PROVIDER_URL = (window as any)._env_
+ .DEFAULT_TERRAIN_PROVIDER_URL;
const WEB_TOOLS_URL = (window as any)._env_.WEB_TOOLS_URL;
const MODEL_VIEWER_ROUTE = (window as any)._env_.MODEL_VIEWER_ROUTE;
const MODEL_VIEWER_TOKEN_VALUE = (window as any)._env_.MODEL_VIEWER_TOKEN_VALUE;
const RUNNING_MODE = (window as any)._env_.RUNNING_MODE;
-const NUMBER_OF_CHARACTERS_LIMIT = (window as any)._env_.NUMBER_OF_CHARACTERS_LIMIT;
+const NUMBER_OF_CHARACTERS_LIMIT = (window as any)._env_
+ .NUMBER_OF_CHARACTERS_LIMIT;
const SERVED_ENTITY_TYPES = (window as any)._env_.SERVED_ENTITY_TYPES;
const ACCESS_TOKEN = (window as any)._env_.ACCESS_TOKEN;
-const RASTER_INGESTION_FILES_STRUCTURE = JSON.parse((window as any)._env_.RASTER_INGESTION_FILES_STRUCTURE);
+const RASTER_INGESTION_FILES_STRUCTURE = JSON.parse(
+ (window as any)._env_.RASTER_INGESTION_FILES_STRUCTURE
+);
const PROJECT_VERSION = (window as any)._env_.PROJECT_VERSION;
const WHATSNEW_URL = (window as any)._env_.WHATSNEW_URL;
const SITES_CONFIG = JSON.parse((window as any)._env_.SITES_CONFIG);
const BFF_PATH = (window as any)._env_.BFF_PATH;
const SELECTION_MODE_DEFAULT = (window as any)._env_.SELECTION_MODE_DEFAULT;
-const SHOW_SELECTION_MODE_SWITCH = (window as any)._env_.SHOW_SELECTION_MODE_SWITCH;
+const SHOW_SELECTION_MODE_SWITCH = (window as any)._env_
+ .SHOW_SELECTION_MODE_SWITCH;
const POLYGON_PARTS = {
...(window as any)._env_.POLYGON_PARTS,
highResolutionColor: '#01FF1F',
mediumResolutionColor: '#fbff01',
lowResolutionColor: '#ff3401',
hoverColor: '#24AEE9',
- billBoardStrokeColor: '#FFFF00'
+ billBoardStrokeColor: '#FFFF00',
};
const WFS = (window as any)._env_.WFS;
const GEOCODER = (window as any)._env_.GEOCODER;
@@ -54,19 +65,28 @@ function enrichBaseMaps(baseMaps: IBaseMaps): IBaseMaps {
maps: baseMaps.maps.map((baseMap: IBaseMap) => {
return {
...baseMap,
- thumbnail: baseMap.thumbnail && ACCESS_TOKEN.injectionType?.toLowerCase() === 'queryparam' ? `${baseMap.thumbnail}?${ACCESS_TOKEN.attributeName}=${ACCESS_TOKEN.tokenValue}` : baseMap.thumbnail,
- baseRasterLayers: (baseMap.baseRasterLayers as IRasterLayer[]).map((rasterLayer) => {
- return {
- ...rasterLayer,
- options: {
- ...rasterLayer.options,
- tilingScheme: (rasterLayer.type === LinkType.WMTS_LAYER) ? new CesiumGeographicTilingScheme() : undefined
- }
- };
- })
- }
- })
- }
+ thumbnail:
+ baseMap.thumbnail &&
+ ACCESS_TOKEN.injectionType?.toLowerCase() === 'queryparam'
+ ? `${baseMap.thumbnail}?${ACCESS_TOKEN.attributeName}=${ACCESS_TOKEN.tokenValue}`
+ : baseMap.thumbnail,
+ baseRasterLayers: (baseMap.baseRasterLayers as IRasterLayer[]).map(
+ (rasterLayer) => {
+ return {
+ ...rasterLayer,
+ options: {
+ ...rasterLayer.options,
+ tilingScheme:
+ rasterLayer.type === LinkType.WMTS_LAYER
+ ? new CesiumGeographicTilingScheme()
+ : undefined,
+ },
+ };
+ }
+ ),
+ };
+ }),
+ };
}
const systemJobsPriorityOptions =
@@ -119,8 +139,8 @@ const APP_CONFIG = {
DATE_TIME_FORMAT: `${DATE_FORMAT} HH:mm`,
DATE_FNS_FORMAT: DATE_FNS_FORMAT,
DATE_FNS_TIME_FORMAT: `${DATE_FNS_FORMAT} hh:mm`,
- DATE_FNS_HUMAN_READABLE_DATE: "PPPP",
- DATE_FNS_HUMAN_READABLE_DATE_TIME: "PPPPp",
+ DATE_FNS_HUMAN_READABLE_DATE: 'PPPP',
+ DATE_FNS_HUMAN_READABLE_DATE_TIME: 'PPPPp',
},
I18N: {
DEFAULT_LANGUAGE: LANGUAGE,
@@ -254,10 +274,13 @@ const APP_CONFIG = {
RESULTS_LIMIT: 6,
},
RASTER_INGESTION: {
- FILES_STRUCTURE: RASTER_INGESTION_FILES_STRUCTURE as IRasterIngestionFilesStructureConfig,
+ FILES_STRUCTURE:
+ RASTER_INGESTION_FILES_STRUCTURE as IRasterIngestionFilesStructureConfig,
CHANGES_IN_SHAPE_FILES: {
- TIME_DIFFERENCE_GRACE_MINUTES: CHANGES_IN_SHAPE_FILES.timeDifferenceGraceMinutes,
- TIME_MODIFIED_THRESHOLD_HOURS: CHANGES_IN_SHAPE_FILES.timeModifiedThresholdHours,
+ TIME_DIFFERENCE_GRACE_MINUTES:
+ CHANGES_IN_SHAPE_FILES.timeDifferenceGraceMinutes,
+ TIME_MODIFIED_THRESHOLD_HOURS:
+ CHANGES_IN_SHAPE_FILES.timeModifiedThresholdHours,
},
},
};
diff --git a/src/common/contexts/enumsMap.context.ts b/src/common/contexts/enumsMap.context.ts
index cc3b0f893..9cf4991f2 100644
--- a/src/common/contexts/enumsMap.context.ts
+++ b/src/common/contexts/enumsMap.context.ts
@@ -35,7 +35,9 @@ export const DEFAULT_ENUM_DESCRIPTOR: IEnumDescriptor = {
// eslint-disable-next-line @typescript-eslint/naming-convention
const EnumsMapContext = createContext({
enumsMap: null,
- setEnumsMap: (enums) => {return}
+ setEnumsMap: (enums) => {
+ return;
+ },
});
export default EnumsMapContext;
diff --git a/src/common/contexts/lookupTables.context.ts b/src/common/contexts/lookupTables.context.ts
index f1d64c4a7..afe9a3744 100644
--- a/src/common/contexts/lookupTables.context.ts
+++ b/src/common/contexts/lookupTables.context.ts
@@ -1,11 +1,11 @@
import { createContext } from 'react';
-import { CountryTranslation} from '@map-colonies/types'
+import { CountryTranslation } from '@map-colonies/types';
export interface ILookupOption {
value: string;
translationCode?: string;
translation?: CountryTranslation[];
- properties: Record
+ properties: Record;
}
export interface ILookupTableData {
dictionary?: Record;
@@ -17,5 +17,7 @@ interface ILookupTablesContext {
}
export default createContext({
- setLookupTablesData: () => { return }
+ setLookupTablesData: () => {
+ return;
+ },
});
diff --git a/src/common/helpers/array.ts b/src/common/helpers/array.ts
index 9c38c1a59..86542f584 100644
--- a/src/common/helpers/array.ts
+++ b/src/common/helpers/array.ts
@@ -4,6 +4,8 @@ export const isArrayEqual = (x: Array, y: Array) => {
return _(x).differenceWith(y, _.isEqual).isEmpty();
};
-export const is2dArray = (array: [] | [][]) => array.every(item => Array.isArray(item));
+export const is2dArray = (array: [] | [][]) =>
+ array.every((item) => Array.isArray(item));
-export const getMax = (array: number[]): number => array.reduce((prev, current) => (prev > current) ? prev : current);
+export const getMax = (array: number[]): number =>
+ array.reduce((prev, current) => (prev > current ? prev : current));
diff --git a/src/common/helpers/enums.ts b/src/common/helpers/enums.ts
index 51791a547..fa08ecd31 100644
--- a/src/common/helpers/enums.ts
+++ b/src/common/helpers/enums.ts
@@ -1,5 +1,6 @@
-
// eslint-disable-next-line @typescript-eslint/ban-types
-export function enumKeys(obj: O): K[] {
- return Object.keys(obj).filter(k => Number.isNaN(+k)) as K[];
+export function enumKeys(
+ obj: O
+): K[] {
+ return Object.keys(obj).filter((k) => Number.isNaN(+k)) as K[];
}
diff --git a/src/common/helpers/formatters.ts b/src/common/helpers/formatters.ts
index 93f8d79dc..7e9e5c6f9 100644
--- a/src/common/helpers/formatters.ts
+++ b/src/common/helpers/formatters.ts
@@ -3,12 +3,20 @@ import moment from 'moment';
import { BASE_PATH } from '../../discrete-layer/components/layer-details/raster/state-machine/types';
import CONFIG from '../config';
-export const getDateformatType = (withTime = false, fnsFormat = false, humanReadable = false): string => {
+export const getDateformatType = (
+ withTime = false,
+ fnsFormat = false,
+ humanReadable = false
+): string => {
if (fnsFormat) {
if (humanReadable) {
- return withTime ? CONFIG.LOCALE.DATE_FNS_HUMAN_READABLE_DATE_TIME: CONFIG.LOCALE.DATE_FNS_HUMAN_READABLE_DATE;
+ return withTime
+ ? CONFIG.LOCALE.DATE_FNS_HUMAN_READABLE_DATE_TIME
+ : CONFIG.LOCALE.DATE_FNS_HUMAN_READABLE_DATE;
}
- return withTime ? CONFIG.LOCALE.DATE_FNS_TIME_FORMAT : CONFIG.LOCALE.DATE_FNS_FORMAT;
+ return withTime
+ ? CONFIG.LOCALE.DATE_FNS_TIME_FORMAT
+ : CONFIG.LOCALE.DATE_FNS_FORMAT;
}
return withTime ? CONFIG.LOCALE.DATE_TIME_FORMAT : CONFIG.LOCALE.DATE_FORMAT;
};
@@ -25,7 +33,10 @@ export const stringFormatter: FormatterFunc = (val): string => {
return val !== undefined ? val.toString() : '';
};
-export const dateFormatter: FormatterFunc = (date, withTime = false): string => {
+export const dateFormatter: FormatterFunc = (
+ date,
+ withTime = false
+): string => {
// eslint-disable-next-line
return date !== undefined && 'toISOString' in (moment(date) as moment.Moment)
? moment(date).format(getDateformatType(withTime))
@@ -33,9 +44,7 @@ export const dateFormatter: FormatterFunc = (date, withTime = false): string =>
};
export const relativeDateFormatter: FormatterFunc = (date): string => {
- return date !== undefined
- ? moment(date).fromNow()
- : '-';
+ return date !== undefined ? moment(date).fromNow() : '-';
};
export const dateSerializer: FormatterFunc = (date): string => {
@@ -48,7 +57,7 @@ export const dateSerializer: FormatterFunc = (date): string => {
}
if (typeof date !== 'undefined') {
- return (date).toISOString();
+ return date.toISOString();
}
return '-';
@@ -59,7 +68,10 @@ export const emphasizeByHTML: FormatterFunc = (value): string => {
};
const DEFAULT_DECIMALS = 2;
-export const formatBytes = (bytes: number, decimals = DEFAULT_DECIMALS): string => {
+export const formatBytes = (
+ bytes: number,
+ decimals = DEFAULT_DECIMALS
+): string => {
const NONE = 0;
if (!+bytes) return '0 Bytes';
diff --git a/src/common/helpers/group-by.ts b/src/common/helpers/group-by.ts
index 756637926..0dcbf2e67 100644
--- a/src/common/helpers/group-by.ts
+++ b/src/common/helpers/group-by.ts
@@ -2,7 +2,9 @@
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-nocheck
export const resolveProperty = (obj: any, property: string): any =>
- property.split('.').reduce((result, prop) => (result ? result[prop] : undefined), obj);
+ property
+ .split('.')
+ .reduce((result, prop) => (result ? result[prop] : undefined), obj);
export interface Group {
key: any;
@@ -28,7 +30,10 @@ export const totalRowItem = (obj: any, prop: string) => {
export const flattenGroup = (group: Group): any[] => {
const items =
- group.items.length && group.items[0] && group.items[0].key && group.items[0].items
+ group.items.length &&
+ group.items[0] &&
+ group.items[0].key &&
+ group.items[0].items
? flattenGroups(group.items)
: group.items;
@@ -44,21 +49,24 @@ export const flattenGroup = (group: Group): any[] => {
return group.sum && flattenedItems && flattenedItems.length
? [
...flattenedItems,
- Object.getOwnPropertyNames(flattenedItems[0]).reduce((o, prop) => {
- const val = resolveProperty(group.sum, prop);
- o[prop] = val;
- if (val !== undefined) {
- o._sum[prop] = true;
- }
- return o;
- }, { _sum: {} })
+ Object.getOwnPropertyNames(flattenedItems[0]).reduce(
+ (o, prop) => {
+ const val = resolveProperty(group.sum, prop);
+ o[prop] = val;
+ if (val !== undefined) {
+ o._sum[prop] = true;
+ }
+ return o;
+ },
+ { _sum: {} }
+ ),
]
: flattenedItems;
};
export const flattenGroups = (groups: Group[]): any[] =>
groups
? groups.reduce((array, group) => {
- flattenGroup(group).forEach(item => array.push(item));
+ flattenGroup(group).forEach((item) => array.push(item));
return array;
}, [])
: groups;
@@ -72,10 +80,12 @@ export const sumGroup = (group: Group, sum: string[]): Group => {
sum: sum.reduce(
(sumObj, sumProp) => ({
...sumObj,
- [sumProp]: group.items.reduce((a, b) => resolveProperty(a, sumProp) + resolveProperty(b, sumProp))
+ [sumProp]: group.items.reduce(
+ (a, b) => resolveProperty(a, sumProp) + resolveProperty(b, sumProp)
+ ),
}),
{}
- )
+ ),
};
};
@@ -85,10 +95,15 @@ export const groupBy = (array: any[], grouping: GroupBy): Group[] => {
}
const keys = grouping.keys;
const groups: Group[] = array.reduce((results: Group[], item) => {
- const group = results.find(g => keys.every(({ name, predicate }) => predicate(item[name]) === predicate(g.key[name])));
+ const group = results.find((g) =>
+ keys.every(
+ ({ name, predicate }) =>
+ predicate(item[name]) === predicate(g.key[name])
+ )
+ );
const data = Object.getOwnPropertyNames(item).reduce((o, prop) => {
// if (!keys.some(key => key === prop)) {
- o[prop] = item[prop];
+ o[prop] = item[prop];
// }
return o;
}, {});
@@ -100,13 +115,13 @@ export const groupBy = (array: any[], grouping: GroupBy): Group[] => {
o[key.name] = item[key.name];
return o;
}, {}),
- items: [data]
+ items: [data],
});
}
return results;
}, []);
return grouping.thenby
- ? groups.map(g => ({ ...g, items: groupBy(g.items, grouping.thenby) }))
+ ? groups.map((g) => ({ ...g, items: groupBy(g.items, grouping.thenby) }))
: groups.reduce((arr, g) => {
arr.push(sumGroup(g, grouping.sum));
return arr;
diff --git a/src/common/helpers/layer-url.ts b/src/common/helpers/layer-url.ts
index bf334d6ea..b87d42c6a 100644
--- a/src/common/helpers/layer-url.ts
+++ b/src/common/helpers/layer-url.ts
@@ -1,26 +1,35 @@
/* eslint-disable */
import { get } from 'lodash';
-import { LayerMetadataMixedUnion, RecordStatus } from '../../discrete-layer/models';
+import {
+ LayerMetadataMixedUnion,
+ RecordStatus,
+} from '../../discrete-layer/models';
import CONFIG from '../config';
-const getParamsString = (params: {[key: string]: string | boolean | number}) : string => {
+const getParamsString = (params: {
+ [key: string]: string | boolean | number;
+}): string => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
- const paramArray = Object.keys(params).map((key: string) => `${key}=${String(params[key])}`);
+ const paramArray = Object.keys(params).map(
+ (key: string) => `${key}=${String(params[key])}`
+ );
return paramArray.join('&');
};
-const fullUrls : {[key : string] : string} = {
+const fullUrls: { [key: string]: string } = {
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'WMS_LAYER': `${CONFIG.WMS_LAYER.URL}?${getParamsString(CONFIG.WMS_LAYER.PARAMS)}`,
+ WMS_LAYER: `${CONFIG.WMS_LAYER.URL}?${getParamsString(
+ CONFIG.WMS_LAYER.PARAMS
+ )}`,
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'WMTS_LAYER': CONFIG.WMTS_LAYER.URL,
+ WMTS_LAYER: CONFIG.WMTS_LAYER.URL,
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'XYZ_LAYER': CONFIG.XYZ_LAYER.URL,
+ XYZ_LAYER: CONFIG.XYZ_LAYER.URL,
// eslint-disable-next-line @typescript-eslint/naming-convention
- 'OSM_LAYER': CONFIG.OSM_LAYER.URL
+ OSM_LAYER: CONFIG.OSM_LAYER.URL,
};
-export const getLayerUrl = () : string => {
+export const getLayerUrl = (): string => {
const activeLayer = CONFIG.ACTIVE_LAYER as string;
return fullUrls[activeLayer];
};
@@ -35,4 +44,4 @@ export const isBeingDeleted = (data: LayerMetadataMixedUnion): boolean => {
export const isValidLayerMetadata = (data: LayerMetadataMixedUnion) => {
return isExistLayerURL(data) && !isBeingDeleted(data);
-}
\ No newline at end of file
+};
diff --git a/src/common/helpers/number.ts b/src/common/helpers/number.ts
index 304018181..983c7c585 100644
--- a/src/common/helpers/number.ts
+++ b/src/common/helpers/number.ts
@@ -1,6 +1,8 @@
const NOT_FOUND = -1;
-export const convertExponentialToDecimal = (exponentialNumber: string): string => {
+export const convertExponentialToDecimal = (
+ exponentialNumber: string
+): string => {
if (exponentialNumber.indexOf('e') !== NOT_FOUND) {
const exponent = parseInt(exponentialNumber.split('-')[1], 10);
const result = Number(exponentialNumber).toFixed(exponent);
diff --git a/src/common/helpers/object.ts b/src/common/helpers/object.ts
index 1a267e9a6..5cca0da0d 100644
--- a/src/common/helpers/object.ts
+++ b/src/common/helpers/object.ts
@@ -1,36 +1,44 @@
- import { isObject, cloneDeep } from 'lodash';
+import { isObject, cloneDeep } from 'lodash';
- // eslint-disable-next-line @typescript-eslint/ban-types
- export function hasOwnProperty
- (obj: X, prop: Y): obj is X & Record {
- // eslint-disable-next-line no-prototype-builtins
- return obj.hasOwnProperty(prop)
- }
+// eslint-disable-next-line @typescript-eslint/ban-types
+export function hasOwnProperty(
+ obj: X,
+ prop: Y
+): obj is X & Record {
+ // eslint-disable-next-line no-prototype-builtins
+ return obj.hasOwnProperty(prop);
+}
- export const mergeRecursive = (obj1: Record, obj2: Record): Record => {
- const retObj = cloneDeep(obj1);
- for (let p in obj2) {
- try {
- // Property in destination object set; update its value.
- if ( isObject(obj2[p]) ) {
- retObj[p] = mergeRecursive(retObj[p] as Record, obj2[p] as Record);
- } else {
- retObj[p] = obj2[p];
- }
- } catch(e) {
- // Property in destination object not set; create it and set its value.
+export const mergeRecursive = (
+ obj1: Record,
+ obj2: Record
+): Record => {
+ const retObj = cloneDeep(obj1);
+ for (let p in obj2) {
+ try {
+ // Property in destination object set; update its value.
+ if (isObject(obj2[p])) {
+ retObj[p] = mergeRecursive(
+ retObj[p] as Record,
+ obj2[p] as Record
+ );
+ } else {
retObj[p] = obj2[p];
}
+ } catch (e) {
+ // Property in destination object not set; create it and set its value.
+ retObj[p] = obj2[p];
}
-
- return retObj;
}
- export const removePropertiesWithPrefix = (obj: any, prefix: string): any => {
- for (const key in obj) {
- if (key.startsWith(prefix)) {
- delete obj[key];
- }
+ return retObj;
+};
+
+export const removePropertiesWithPrefix = (obj: any, prefix: string): any => {
+ for (const key in obj) {
+ if (key.startsWith(prefix)) {
+ delete obj[key];
}
- return obj;
- };
\ No newline at end of file
+ }
+ return obj;
+};
diff --git a/src/common/helpers/set.ts b/src/common/helpers/set.ts
index 142f2dc70..d7ec40358 100644
--- a/src/common/helpers/set.ts
+++ b/src/common/helpers/set.ts
@@ -3,21 +3,23 @@ export class SetWithContentEquality {
private getKey: (item: T) => string;
constructor(getKey: (item: T) => string) {
- this.getKey = getKey;
+ this.getKey = getKey;
}
add(item: T): void {
- const key = this.getKey(item);
- if (!this.items.some(existing => this.getKey(existing) === key)) {
- this.items.push(item);
- }
+ const key = this.getKey(item);
+ if (!this.items.some((existing) => this.getKey(existing) === key)) {
+ this.items.push(item);
+ }
}
has(item: T): boolean {
- return this.items.some(existing => this.getKey(existing) === this.getKey(item));
+ return this.items.some(
+ (existing) => this.getKey(existing) === this.getKey(item)
+ );
}
values(): T[] {
- return [...this.items];
+ return [...this.items];
}
-}
\ No newline at end of file
+}
diff --git a/src/common/helpers/siteUrl.ts b/src/common/helpers/siteUrl.ts
index 84fe0aa32..0ad306b36 100644
--- a/src/common/helpers/siteUrl.ts
+++ b/src/common/helpers/siteUrl.ts
@@ -6,15 +6,21 @@ import CONFIG from '../config';
export const currentClientUrl = window.location.origin;
export const currentSite = (): siteName => {
- return CONFIG.SITES_CONFIG.slaves.map((slave: site) => slave.dns).includes(currentClientUrl)
+ return CONFIG.SITES_CONFIG.slaves
+ .map((slave: site) => slave.dns)
+ .includes(currentClientUrl)
? 'slave'
- : CONFIG.SITES_CONFIG.masters.map((master: site) => master.dns).includes(currentClientUrl)
+ : CONFIG.SITES_CONFIG.masters
+ .map((master: site) => master.dns)
+ .includes(currentClientUrl)
? 'master'
- : CONFIG.SITES_CONFIG.generics.map((generic: site) => generic.dns).includes(currentClientUrl)
+ : CONFIG.SITES_CONFIG.generics
+ .map((generic: site) => generic.dns)
+ .includes(currentClientUrl)
? 'generic'
: 'undefined';
};
-export const syncSlavesClients: GraphQLClient[] = CONFIG.SITES_CONFIG.slaves?.filter((slave: site) => !slave.isAlias)
- .map((slave: site) => createHttpClient(slave.dns + CONFIG.BFF_PATH)
-);
+export const syncSlavesClients: GraphQLClient[] = CONFIG.SITES_CONFIG.slaves
+ ?.filter((slave: site) => !slave.isAlias)
+ .map((slave: site) => createHttpClient(slave.dns + CONFIG.BFF_PATH));
diff --git a/src/common/helpers/storage.ts b/src/common/helpers/storage.ts
index 6d55e464b..557b4e962 100644
--- a/src/common/helpers/storage.ts
+++ b/src/common/helpers/storage.ts
@@ -6,11 +6,12 @@ export interface IStorage {
remove: (key: string) => void;
clear: () => void;
key: (index: number) => string | null;
- watchMethods: ( methods: string[],
- callbackBefore?: (method: string, key: string, ...args: any[]) => void,
- callbackAfter?: (method: string, key: string, ...args: any[]) => void
- ) => void,
- unWatchMethods: () => void,
+ watchMethods: (
+ methods: string[],
+ callbackBefore?: (method: string, key: string, ...args: any[]) => void,
+ callbackAfter?: (method: string, key: string, ...args: any[]) => void
+ ) => void;
+ unWatchMethods: () => void;
length: number;
}
@@ -93,11 +94,19 @@ function storageFactory(storage: Storage, prefix = ''): IStorage {
}
let originalMethods: Record void> = {};
-
- function watchMethods (
+
+ function watchMethods(
methods: string[] = [],
- callbackBefore: (method: string, key: string, ...args: any[]) => void = function () {},
- callbackAfter: (method: string, key: string, ...args: any[]) => void = function () {},
+ callbackBefore: (
+ method: string,
+ key: string,
+ ...args: any[]
+ ) => void = function () {},
+ callbackAfter: (
+ method: string,
+ key: string,
+ ...args: any[]
+ ) => void = function () {}
) {
for (let method of methods) {
const original = storage[method].bind(storage);
@@ -114,13 +123,12 @@ function storageFactory(storage: Storage, prefix = ''): IStorage {
}
}
- function unWatchMethods () {
- Object.keys(originalMethods).forEach(method => {
+ function unWatchMethods() {
+ Object.keys(originalMethods).forEach((method) => {
storage[method] = originalMethods[method];
});
- originalMethods={};
+ originalMethods = {};
}
-
return {
get,
diff --git a/src/common/helpers/string.ts b/src/common/helpers/string.ts
index 9e7ec8007..588ef0f86 100644
--- a/src/common/helpers/string.ts
+++ b/src/common/helpers/string.ts
@@ -1,17 +1,21 @@
export const camelize = (value: string): string => {
- return value.toLowerCase().replace(
- /^([A-Z])|[\s-_]+(\w)/g,
- (match, p1: string, p2: string, offset) => {
- if (p2) return p2.toUpperCase();
- return p1.toLowerCase();
- }
- );
+ return value
+ .toLowerCase()
+ .replace(
+ /^([A-Z])|[\s-_]+(\w)/g,
+ (match, p1: string, p2: string, offset) => {
+ if (p2) return p2.toUpperCase();
+ return p1.toLowerCase();
+ }
+ );
};
-export const extractJsonObjFromString = >(input: string): T | undefined => {
+export const extractJsonObjFromString = >(
+ input: string
+): T | undefined => {
const FIRST_MATCH = 0;
const jsonRegex = new RegExp(/\{(?:[^{}]|(R))*\}/);
const match = jsonRegex.exec(input)?.[FIRST_MATCH];
if (typeof match === 'string') return JSON.parse(match) as T;
-};
\ No newline at end of file
+};
diff --git a/src/common/helpers/style.ts b/src/common/helpers/style.ts
index 2ff6e9013..45b0d6a2c 100644
--- a/src/common/helpers/style.ts
+++ b/src/common/helpers/style.ts
@@ -1,5 +1,8 @@
import { get } from 'lodash';
-import { LayerMetadataMixedUnion, RecordStatus } from '../../discrete-layer/models';
+import {
+ LayerMetadataMixedUnion,
+ RecordStatus,
+} from '../../discrete-layer/models';
import { DEFAULT_ID } from '../../discrete-layer/components/layer-details/entity.dialog';
import CONFIG from '../config';
import { isValidLayerMetadata } from './layer-url';
@@ -7,7 +10,8 @@ import { isValidLayerMetadata } from './layer-url';
const STATUS = 'productStatus';
const ID = 'id';
const POLYGON_PARTS_SHOWN = 'polygonPartsShown';
-const POLYGON_PARTS_SHOWN_COLOR = CONFIG.CONTEXT_MENUS.MAP.POLYGON_PARTS_FEATURE_CONFIG.outlineColor;
+const POLYGON_PARTS_SHOWN_COLOR =
+ CONFIG.CONTEXT_MENUS.MAP.POLYGON_PARTS_FEATURE_CONFIG.outlineColor;
const UNPUBLISHED_COLOR = 'var(--mdc-theme-gc-warning-high)';
const ERROR_COLOR = 'var(--mdc-theme-gc-error-high)';
@@ -20,7 +24,10 @@ export const existPolygonParts = (data: Record): boolean => {
};
export const isUnpublished = (data: Record): boolean => {
- return get(data, STATUS) === RecordStatus.UNPUBLISHED && get(data, ID) !== DEFAULT_ID;
+ return (
+ get(data, STATUS) === RecordStatus.UNPUBLISHED &&
+ get(data, ID) !== DEFAULT_ID
+ );
};
export const isPolygonPartsShown = (data: Record): boolean => {
@@ -56,7 +63,9 @@ export const getIconStyle = (
resStyle = { [colorProperty]: UNPUBLISHED_COLOR };
}
if (existPolygonParts(data) && isPolygonPartsShown(data)) {
- const hasWFSLink = (data.links as Array>)?.some(link => link.protocol === 'WFS');
+ const hasWFSLink = (data.links as Array>)?.some(
+ (link) => link.protocol === 'WFS'
+ );
if (hasWFSLink) {
resStyle = { [colorProperty]: POLYGON_PARTS_SHOWN_COLOR };
} else {
@@ -64,11 +73,13 @@ export const getIconStyle = (
}
}
if (existPolygonParts(data) && !isPolygonPartsShown(data)) {
- const hasWFSLink = (data.links as Array>)?.some(link => link.protocol === 'WFS');
+ const hasWFSLink = (data.links as Array>)?.some(
+ (link) => link.protocol === 'WFS'
+ );
if (!hasWFSLink) {
resStyle = {
...resStyle,
- opacity: 0.5
+ opacity: 0.5,
};
}
}
diff --git a/src/common/hooks/countdown.hook.ts b/src/common/hooks/countdown.hook.ts
index c8795a79f..c3ef9d708 100644
--- a/src/common/hooks/countdown.hook.ts
+++ b/src/common/hooks/countdown.hook.ts
@@ -13,8 +13,11 @@ const useCountDown = (timeToCount = 60 * 1000, interval = 1000) => {
timer.current.lastInterval = ts;
}
- const localInterval = Math.min(interval, (timer.current.timeLeft || Infinity));
- if ((ts - timer.current.lastInterval) >= localInterval) {
+ const localInterval = Math.min(
+ interval,
+ timer.current.timeLeft || Infinity
+ );
+ if (ts - timer.current.lastInterval >= localInterval) {
timer.current.lastInterval += localInterval;
setTimeLeft((timeLeft) => {
timer.current.timeLeft = timeLeft - localInterval;
@@ -30,61 +33,46 @@ const useCountDown = (timeToCount = 60 * 1000, interval = 1000) => {
}
};
- const start = React.useCallback(
- (ttc) => {
- window.cancelAnimationFrame(timer.current.requestId);
+ const start = React.useCallback((ttc) => {
+ window.cancelAnimationFrame(timer.current.requestId);
- const newTimeToCount = ttc !== undefined ? ttc : timeToCount
- timer.current.started = null;
- timer.current.lastInterval = null;
- timer.current.timeToCount = newTimeToCount;
- timer.current.requestId = window.requestAnimationFrame(run);
+ const newTimeToCount = ttc !== undefined ? ttc : timeToCount;
+ timer.current.started = null;
+ timer.current.lastInterval = null;
+ timer.current.timeToCount = newTimeToCount;
+ timer.current.requestId = window.requestAnimationFrame(run);
- setTimeLeft(newTimeToCount);
- },
- [],
- );
+ setTimeLeft(newTimeToCount);
+ }, []);
- const pause = React.useCallback(
- () => {
- window.cancelAnimationFrame(timer.current.requestId);
- timer.current.started = null;
- timer.current.lastInterval = null;
- timer.current.timeToCount = timer.current.timeLeft;
- },
- [],
- );
+ const pause = React.useCallback(() => {
+ window.cancelAnimationFrame(timer.current.requestId);
+ timer.current.started = null;
+ timer.current.lastInterval = null;
+ timer.current.timeToCount = timer.current.timeLeft;
+ }, []);
- const resume = React.useCallback(
- () => {
- if (!timer.current.started && timer.current.timeLeft > 0) {
- window.cancelAnimationFrame(timer.current.requestId);
- timer.current.requestId = window.requestAnimationFrame(run);
- }
- },
- [],
- );
+ const resume = React.useCallback(() => {
+ if (!timer.current.started && timer.current.timeLeft > 0) {
+ window.cancelAnimationFrame(timer.current.requestId);
+ timer.current.requestId = window.requestAnimationFrame(run);
+ }
+ }, []);
- const reset = React.useCallback(
- () => {
- if (timer.current.timeLeft) {
- window.cancelAnimationFrame(timer.current.requestId);
- timer.current = {};
- setTimeLeft(0);
- }
- },
- [],
- );
+ const reset = React.useCallback(() => {
+ if (timer.current.timeLeft) {
+ window.cancelAnimationFrame(timer.current.requestId);
+ timer.current = {};
+ setTimeLeft(0);
+ }
+ }, []);
- const actions = React.useMemo(
- () => ({ start, pause, resume, reset }),
- [],
- );
+ const actions = React.useMemo(() => ({ start, pause, resume, reset }), []);
React.useEffect(() => reset, []);
return [timeLeft, actions];
-}
+};
export interface IActions {
start: (ttc?: any) => void;
diff --git a/src/common/hooks/debounce-field.hook.ts b/src/common/hooks/debounce-field.hook.ts
index 681c06213..cf937c446 100644
--- a/src/common/hooks/debounce-field.hook.ts
+++ b/src/common/hooks/debounce-field.hook.ts
@@ -2,27 +2,30 @@ import React, { useState, useEffect, useCallback } from 'react';
import { useDebouncedCallback } from 'use-debounce';
import { EntityFormikHandlers } from '../../discrete-layer/components/layer-details/layer-datails-form';
-export interface GCHTMLInputElement{
- [prop:string]: unknown;
- persist: ()=>void;
+export interface GCHTMLInputElement {
+ [prop: string]: unknown;
+ persist: () => void;
currentTarget: {
- [prop:string]: unknown;
- value: unknown
- }
-};
+ [prop: string]: unknown;
+ value: unknown;
+ };
+}
const DEFAULT_DEBOUNCE = 500;
-const useDebounceField = (
+const useDebounceField = (
formikHandlers: EntityFormikHandlers,
value: T | string,
debouncePeriod = DEFAULT_DEBOUNCE
-): [T | string, (event: React.ChangeEvent) => void] => {
+): [
+ T | string,
+ (event: React.ChangeEvent) => void
+] => {
const [innerValue, setInnerValue] = useState(value);
const INPUT_DELAY = debouncePeriod;
useEffect(() => {
- setInnerValue(value);
+ setInnerValue(value);
}, [value]);
const debouncedHandleOnChange = useDebouncedCallback(
@@ -35,13 +38,14 @@ const useDebounceField = (
const handleOnChange = useCallback(
(event: React.ChangeEvent) => {
event.persist();
- const newValue = event.currentTarget.value as (T | string);
+ const newValue = event.currentTarget.value as T | string;
setInnerValue(newValue);
debouncedHandleOnChange(event);
-
- }, []);
+ },
+ []
+ );
return [innerValue, handleOnChange];
};
-export default useDebounceField;
\ No newline at end of file
+export default useDebounceField;
diff --git a/src/common/hooks/isEllipsisActive.hook.ts b/src/common/hooks/isEllipsisActive.hook.ts
index 2baeb7b98..87aa86680 100644
--- a/src/common/hooks/isEllipsisActive.hook.ts
+++ b/src/common/hooks/isEllipsisActive.hook.ts
@@ -1,16 +1,25 @@
import { useState, useEffect, RefObject } from 'react';
-
-const useIsEllipsisActive = (containerElement: RefObject): boolean => {
+const useIsEllipsisActive = (
+ containerElement: RefObject
+): boolean => {
const [isEllipsisActive, setIsEllipsisActive] = useState(false);
useEffect(() => {
- if (containerElement.current !== null && containerElement.current.offsetWidth < containerElement.current.scrollWidth) {
+ if (
+ containerElement.current !== null &&
+ containerElement.current.offsetWidth <
+ containerElement.current.scrollWidth
+ ) {
setIsEllipsisActive(true);
}
- }, [containerElement.current, containerElement.current?.innerText, containerElement.current?.innerHTML ]);
+ }, [
+ containerElement.current,
+ containerElement.current?.innerText,
+ containerElement.current?.innerHTML,
+ ]);
return isEllipsisActive;
-}
+};
-export default useIsEllipsisActive;
\ No newline at end of file
+export default useIsEllipsisActive;
diff --git a/src/common/hooks/mapMenus/useGetMenuDimensions.ts b/src/common/hooks/mapMenus/useGetMenuDimensions.ts
index b6a277700..c9904189c 100644
--- a/src/common/hooks/mapMenus/useGetMenuDimensions.ts
+++ b/src/common/hooks/mapMenus/useGetMenuDimensions.ts
@@ -1,38 +1,59 @@
import { get } from 'lodash';
import { useMemo } from 'react';
import { useTheme } from '@map-colonies/react-core';
-import { TITLE_HEIGHT, SUB_MENU_MAX_HEIGHT } from '../../../discrete-layer/components/map-container/contextMenus/context-menu';
-import { IMapMenuProperties, isMenuItemGroup } from '../../../discrete-layer/models/mapMenusManagerStore';
+import {
+ TITLE_HEIGHT,
+ SUB_MENU_MAX_HEIGHT,
+} from '../../../discrete-layer/components/map-container/contextMenus/context-menu';
+import {
+ IMapMenuProperties,
+ isMenuItemGroup,
+} from '../../../discrete-layer/models/mapMenusManagerStore';
import { IDimensions } from '../useElementDimensions.hook';
-
+
export interface MenuDimensions extends IDimensions {
dynamicHeightIncrement: number;
}
-const useGetMenuDimensions = (menuProperties?: IMapMenuProperties, customDynamicHeightIncrement?: number): MenuDimensions | undefined => {
+const useGetMenuDimensions = (
+ menuProperties?: IMapMenuProperties,
+ customDynamicHeightIncrement?: number
+): MenuDimensions | undefined => {
const theme = useTheme();
-
+
const menuDimensions = useMemo((): MenuDimensions | undefined => {
if (typeof menuProperties === 'undefined') return undefined;
const DEFAULT_HEIGHT_BUFFER = 5;
- const themedMenuItemHeight = Number((get(theme, 'gcMenuItemHeight') as string).split('px')[0]);
- const themedContextMenuWidth = Number((get(theme, 'gcContextMenuWidth') as string).split('px')[0]);
-
- const numberOfMenuItems = menuProperties.itemsList.reduce((itemsCount, menuItemOrGroup) => {
- if (!isMenuItemGroup(menuItemOrGroup)) return ++itemsCount;
- return itemsCount + menuItemOrGroup.items.length;
- }, 0);
- const calculatedMenuHeight = menuProperties.absoluteHeight ??
- (
- ((numberOfMenuItems * themedMenuItemHeight) + (menuProperties.heightBuffer ?? DEFAULT_HEIGHT_BUFFER)) + TITLE_HEIGHT
+ const themedMenuItemHeight = Number(
+ (get(theme, 'gcMenuItemHeight') as string).split('px')[0]
+ );
+ const themedContextMenuWidth = Number(
+ (get(theme, 'gcContextMenuWidth') as string).split('px')[0]
);
- return { width: themedContextMenuWidth, height: calculatedMenuHeight, dynamicHeightIncrement: customDynamicHeightIncrement ?? SUB_MENU_MAX_HEIGHT };
+ const numberOfMenuItems = menuProperties.itemsList.reduce(
+ (itemsCount, menuItemOrGroup) => {
+ if (!isMenuItemGroup(menuItemOrGroup)) return ++itemsCount;
+ return itemsCount + menuItemOrGroup.items.length;
+ },
+ 0
+ );
+ const calculatedMenuHeight =
+ menuProperties.absoluteHeight ??
+ numberOfMenuItems * themedMenuItemHeight +
+ (menuProperties.heightBuffer ?? DEFAULT_HEIGHT_BUFFER) +
+ TITLE_HEIGHT;
+ return {
+ width: themedContextMenuWidth,
+ height: calculatedMenuHeight,
+ dynamicHeightIncrement:
+ customDynamicHeightIncrement ?? SUB_MENU_MAX_HEIGHT,
+ };
}, [menuProperties]);
return menuDimensions;
-}
+};
-export default useGetMenuDimensions;
\ No newline at end of file
+export default useGetMenuDimensions;
diff --git a/src/common/hooks/mapMenus/useGetMenuProperties.hook.ts b/src/common/hooks/mapMenus/useGetMenuProperties.hook.ts
index 8891a1512..8f2bc0f4d 100644
--- a/src/common/hooks/mapMenus/useGetMenuProperties.hook.ts
+++ b/src/common/hooks/mapMenus/useGetMenuProperties.hook.ts
@@ -1,21 +1,32 @@
import { useEffect } from 'react';
import { IContextMenuData } from '@map-colonies/react-components';
import { useStore } from '../../../discrete-layer/models';
-import { MapMenusIds, IMapMenuProperties } from '../../../discrete-layer/models/mapMenusManagerStore';
+import {
+ MapMenusIds,
+ IMapMenuProperties,
+} from '../../../discrete-layer/models/mapMenusManagerStore';
import { useHandleMapMenuTemplates } from './useHandleMapMenuTemplates.hook';
-const useGetMenuProperties = (menuId: MapMenusIds, contextProps?: IContextMenuData): IMapMenuProperties | undefined => {
+const useGetMenuProperties = (
+ menuId: MapMenusIds,
+ contextProps?: IContextMenuData
+): IMapMenuProperties | undefined => {
const store = useStore();
const mapMenus = store.mapMenusManagerStore.mapMenus;
- const generatedByContextMenuProperties = useHandleMapMenuTemplates(mapMenus?.[menuId], contextProps);
-
+ const generatedByContextMenuProperties = useHandleMapMenuTemplates(
+ mapMenus?.[menuId],
+ contextProps
+ );
+
useEffect(() => {
if (contextProps?.coordinates) {
- store.mapMenusManagerStore.setLastMenuCoordinate(contextProps?.coordinates);
+ store.mapMenusManagerStore.setLastMenuCoordinate(
+ contextProps?.coordinates
+ );
}
}, [contextProps?.coordinates]);
return generatedByContextMenuProperties;
-}
+};
-export default useGetMenuProperties;
\ No newline at end of file
+export default useGetMenuProperties;
diff --git a/src/common/hooks/mapMenus/useHandleDemHeightsRequests.ts b/src/common/hooks/mapMenus/useHandleDemHeightsRequests.ts
index 6e0ecd302..a92339410 100644
--- a/src/common/hooks/mapMenus/useHandleDemHeightsRequests.ts
+++ b/src/common/hooks/mapMenus/useHandleDemHeightsRequests.ts
@@ -7,44 +7,54 @@ import {
} from '../../../discrete-layer/models';
import { GetDemPointsHeightsInput } from '../../../discrete-layer/models/RootStore.base';
-type HandlerDemHeightsOptions = GetDemPointsHeightsInput & { onDataResolved?: (data?: PositionsWithHeightsModelType) => void };
+type HandlerDemHeightsOptions = GetDemPointsHeightsInput & {
+ onDataResolved?: (data?: PositionsWithHeightsModelType) => void;
+};
-const DEM_POINTS_HEIGHTS_QUERY =
-`data {
+const DEM_POINTS_HEIGHTS_QUERY = `data {
latitude
longitude
height
}`;
const useHandleDemHeightsRequests = (): {
- data: { getPointsHeights: PositionsWithHeightsModelType} | undefined;
+ data: { getPointsHeights: PositionsWithHeightsModelType } | undefined;
loading: boolean;
demHeightsOptions: GetDemPointsHeightsInput | undefined;
setDemHeightsOptions: (options: HandlerDemHeightsOptions) => void;
} => {
const store = useStore();
- const [demHeightsOptions, setDemHeightsOptions] = useState();
+ const [demHeightsOptions, setDemHeightsOptions] =
+ useState();
const { data, loading, setQuery } = useQuery<{
- getPointsHeights: PositionsWithHeightsModelType;
+ getPointsHeights: PositionsWithHeightsModelType;
}>();
useEffect(() => {
if (demHeightsOptions) {
-
- setQuery(store.queryGetPointsHeights({ data: { ...demHeightsOptions } }, DEM_POINTS_HEIGHTS_QUERY));
+ setQuery(
+ store.queryGetPointsHeights(
+ { data: { ...demHeightsOptions } },
+ DEM_POINTS_HEIGHTS_QUERY
+ )
+ );
}
}, [demHeightsOptions]);
useEffect(() => {
if (demHeightsOptions && !loading && data) {
- const demPositionsWithHeights = [...(data?.getPointsHeights as PositionsWithHeightsModelType)?.data as PositionWithHeightModelType[]];
-
- store.mapMenusManagerStore.setCurrentPositionDemHeight(demPositionsWithHeights[0]);
+ const demPositionsWithHeights = [
+ ...((data?.getPointsHeights as PositionsWithHeightsModelType)
+ ?.data as PositionWithHeightModelType[]),
+ ];
- demHeightsOptions.onDataResolved?.(data.getPointsHeights);
- }
+ store.mapMenusManagerStore.setCurrentPositionDemHeight(
+ demPositionsWithHeights[0]
+ );
+ demHeightsOptions.onDataResolved?.(data.getPointsHeights);
+ }
}, [data, loading]);
return { data, loading, demHeightsOptions, setDemHeightsOptions };
diff --git a/src/common/hooks/mapMenus/useHandleMapMenuTemplates.hook.ts b/src/common/hooks/mapMenus/useHandleMapMenuTemplates.hook.ts
index 3c0997091..4acbb3c7f 100644
--- a/src/common/hooks/mapMenus/useHandleMapMenuTemplates.hook.ts
+++ b/src/common/hooks/mapMenus/useHandleMapMenuTemplates.hook.ts
@@ -8,17 +8,22 @@ import {
MenuItem,
MenuItemsGroup,
MenuItemsList,
- isMenuItemGroup
+ isMenuItemGroup,
} from '../../../discrete-layer/models/mapMenusManagerStore';
import { useStore } from '../../../discrete-layer/models';
import { IDispatchAction } from '../../../discrete-layer/models/actionDispatcherStore';
import { DEFAULT_LAYER_HUE_FACTOR } from '../../../discrete-layer/views/components/map-action-resolver.component';
-import { ContextActionGroupProps, ContextActions, ContextActionsGroupTemplates, ContextActionsTemplates } from '../../actions/context.actions';
+import {
+ ContextActionGroupProps,
+ ContextActions,
+ ContextActionsGroupTemplates,
+ ContextActionsTemplates,
+} from '../../actions/context.actions';
import CONFIG from '../../config';
export const useHandleMapMenuTemplates = (
menuProperties?: IMapMenuProperties,
- contextProps?: IContextMenuData,
+ contextProps?: IContextMenuData
): IMapMenuProperties | undefined => {
/**
* The hook should be able to generate the menu properties passed as an argument,
@@ -35,85 +40,114 @@ export const useHandleMapMenuTemplates = (
// Gather all of the data to be used in the process to build the complete menu. store / contexts / hooks / etc.
const store = useStore();
- const activeLayersInPosition = contextProps?.data as Record[];
+ const activeLayersInPosition = contextProps?.data as Record<
+ string,
+ unknown
+ >[];
const wfsFeatureTypesList = store.mapMenusManagerStore.wfsFeatureTypes ?? [];
// This object holds the data that used to generate menu items from templates.
- const dynamicMenuData: DynamicMenuData = useMemo(() => ({
- [ContextActionsGroupTemplates.ACTIVE_LAYERS_IN_POSITION]: activeLayersInPosition,
- [ContextActionsTemplates.WFS_QUERY_FEATURES]: wfsFeatureTypesList
- }), [activeLayersInPosition, wfsFeatureTypesList])
-
-
- const handleActionTemplates = (actionTemplateMenuItem: MenuItem): MenuItemsList => {
+ const dynamicMenuData: DynamicMenuData = useMemo(
+ () => ({
+ [ContextActionsGroupTemplates.ACTIVE_LAYERS_IN_POSITION]:
+ activeLayersInPosition,
+ [ContextActionsTemplates.WFS_QUERY_FEATURES]: wfsFeatureTypesList,
+ }),
+ [activeLayersInPosition, wfsFeatureTypesList]
+ );
+
+ const handleActionTemplates = (
+ actionTemplateMenuItem: MenuItem
+ ): MenuItemsList => {
switch (actionTemplateMenuItem.templateId) {
case ContextActionsTemplates.WFS_QUERY_FEATURES: {
- const wfsFeatureTypesList = dynamicMenuData[ContextActionsTemplates.WFS_QUERY_FEATURES] as string[];
- const wfsQueryMenuItems: MenuItem[] = wfsFeatureTypesList.map((feature) => {
- const featureConfig =
- store.mapMenusManagerStore.getFeatureConfig(feature);
- const featureTitle = featureConfig.translationId ?? feature;
-
- return {
- title: featureTitle,
- icon: featureConfig.icon,
- action: { ...actionTemplateMenuItem.action },
- payloadData: { feature }
- };
- });
+ const wfsFeatureTypesList = dynamicMenuData[
+ ContextActionsTemplates.WFS_QUERY_FEATURES
+ ] as string[];
+ const wfsQueryMenuItems: MenuItem[] = wfsFeatureTypesList.map(
+ (feature) => {
+ const featureConfig =
+ store.mapMenusManagerStore.getFeatureConfig(feature);
+ const featureTitle = featureConfig.translationId ?? feature;
+
+ return {
+ title: featureTitle,
+ icon: featureConfig.icon,
+ action: { ...actionTemplateMenuItem.action },
+ payloadData: { feature },
+ };
+ }
+ );
return wfsQueryMenuItems;
}
default:
return [actionTemplateMenuItem];
}
- }
+ };
- const handleGroupTemplates = (groupTemplateMenuItem: MenuItemsGroup): MenuItemsList => {
+ const handleGroupTemplates = (
+ groupTemplateMenuItem: MenuItemsGroup
+ ): MenuItemsList => {
const generatedGroups: MenuItemsList = [];
switch (groupTemplateMenuItem.templateId) {
case ContextActionsGroupTemplates.ACTIVE_LAYERS_IN_POSITION: {
- const activeLayersInPosition = dynamicMenuData[ContextActionsGroupTemplates.ACTIVE_LAYERS_IN_POSITION] as Record[];
+ const activeLayersInPosition = dynamicMenuData[
+ ContextActionsGroupTemplates.ACTIVE_LAYERS_IN_POSITION
+ ] as Record[];
const templateProps = groupTemplateMenuItem.groupProps;
- const MAX_ACTIVE_LAYERS_TO_PRESENT = CONFIG.CONTEXT_MENUS.MAP.MAX_ACTIVE_LAYERS_TO_PRESENT;
- const slicedActiveLayers = activeLayersInPosition.slice(0, MAX_ACTIVE_LAYERS_TO_PRESENT);
+ const MAX_ACTIVE_LAYERS_TO_PRESENT =
+ CONFIG.CONTEXT_MENUS.MAP.MAX_ACTIVE_LAYERS_TO_PRESENT;
+ const slicedActiveLayers = activeLayersInPosition.slice(
+ 0,
+ MAX_ACTIVE_LAYERS_TO_PRESENT
+ );
// Some pinkish color
const HOVERED_LAYER_HUE_FACTOR = 30;
- slicedActiveLayers.forEach(activeLayer => {
+ slicedActiveLayers.forEach((activeLayer) => {
const groupProp: ContextActionGroupProps = {
...templateProps,
id: templateProps.id + 1,
// @ts-ignore
- titleTranslationId: activeLayer.meta?.layerRecord?.productName as string,
+ titleTranslationId: activeLayer.meta?.layerRecord
+ ?.productName as string,
};
-
const mouseEnterAction: IDispatchAction = {
action: ContextActions.HIGHLIGHT_ACTIVE_LAYER,
- data: { ...activeLayer.meta as Record, hue: HOVERED_LAYER_HUE_FACTOR }
+ data: {
+ ...(activeLayer.meta as Record),
+ hue: HOVERED_LAYER_HUE_FACTOR,
+ },
};
const mouseLeaveAction: IDispatchAction = {
action: ContextActions.HIGHLIGHT_ACTIVE_LAYER,
- data: { ...activeLayer.meta as Record, hue: DEFAULT_LAYER_HUE_FACTOR }
+ data: {
+ ...(activeLayer.meta as Record),
+ hue: DEFAULT_LAYER_HUE_FACTOR,
+ },
};
const generatedGroup: MenuItemsGroup = {
...groupTemplateMenuItem,
groupProps: groupProp,
title: groupProp.titleTranslationId,
- items: groupTemplateMenuItem.items.map(item => {
+ items: groupTemplateMenuItem.items.map((item) => {
if (!isMenuItemGroup(item)) {
- return { ...item, payloadData: activeLayer.meta as Record };
+ return {
+ ...item,
+ payloadData: activeLayer.meta as Record,
+ };
}
return item;
}),
mouseEnterAction,
- mouseLeaveAction
+ mouseLeaveAction,
};
generatedGroups.push(generatedGroup);
@@ -126,17 +160,23 @@ export const useHandleMapMenuTemplates = (
// Check if group holds WFS actions by presence at least one such item
const wfsFeature = groupTemplateMenuItem.items.find((item) => {
const menuItem = item as MenuItem;
- return menuItem.action ? menuItem.action.action === ContextActions.QUERY_WFS_FEATURE : false;
+ return menuItem.action
+ ? menuItem.action.action === ContextActions.QUERY_WFS_FEATURE
+ : false;
});
if (wfsFeature) {
- tempGroup.groupProps.titleTranslationId = intl.formatMessage({
- id: tempGroup.groupProps.titleTranslationId,
- }, { extraInfo: `(${groupTemplateMenuItem.items.length}/${store.mapMenusManagerStore.total})` });
+ tempGroup.groupProps.titleTranslationId = intl.formatMessage(
+ {
+ id: tempGroup.groupProps.titleTranslationId,
+ },
+ {
+ extraInfo: `(${groupTemplateMenuItem.items.length}/${store.mapMenusManagerStore.total})`,
+ }
+ );
}
return [tempGroup];
}
-
- }
+ };
// Iterate through the menu (and sub-menu) properties and handle the templates logic based on the templateId.
// Returns the menu after the processing.
@@ -145,7 +185,6 @@ export const useHandleMapMenuTemplates = (
const itemsList = items ?? menuProperties?.itemsList;
itemsList?.forEach((item) => {
-
if (!isMenuItemGroup(item)) {
// Handle action templates
const generatedActions: MenuItemsList = handleActionTemplates(item);
@@ -155,21 +194,22 @@ export const useHandleMapMenuTemplates = (
// Handle group templates
const generatedGroups: MenuItemsList = handleGroupTemplates({
...item,
- items: getGeneratedMenu(item.items).itemsList
+ items: getGeneratedMenu(item.items).itemsList,
});
menuItems.push(...generatedGroups);
return;
-
}
-
});
return { ...menuProperties, itemsList: menuItems };
};
useEffect(() => {
- if (typeof menuProperties !== 'undefined' && typeof contextProps !== 'undefined') {
+ if (
+ typeof menuProperties !== 'undefined' &&
+ typeof contextProps !== 'undefined'
+ ) {
const newMenu = { ...getGeneratedMenu(), dynamicMenuData };
const arePrvMenuEqual = _.isEqual(newMenu, generatedMenuRef.current);
if (!arePrvMenuEqual) {
diff --git a/src/common/hooks/mapMenus/useHandleWfsGetFeatureRequests.ts b/src/common/hooks/mapMenus/useHandleWfsGetFeatureRequests.ts
index bad801924..91bcdde60 100644
--- a/src/common/hooks/mapMenus/useHandleWfsGetFeatureRequests.ts
+++ b/src/common/hooks/mapMenus/useHandleWfsGetFeatureRequests.ts
@@ -7,7 +7,9 @@ import {
} from '../../../discrete-layer/models';
import { WfsGetFeatureParams } from '../../../discrete-layer/models/RootStore.base';
-type HandlerGetFeatureOptions = WfsGetFeatureParams & { onDataResolved?: (data?: GetFeatureModelType) => void };
+type HandlerGetFeatureOptions = WfsGetFeatureParams & {
+ onDataResolved?: (data?: GetFeatureModelType) => void;
+};
const useHandleWfsGetFeatureRequests = (): {
data: { getFeature: GetFeatureModelType } | undefined;
@@ -16,7 +18,8 @@ const useHandleWfsGetFeatureRequests = (): {
setGetFeatureOptions: (options: HandlerGetFeatureOptions) => void;
} => {
const store = useStore();
- const [getFeatureOptions, setGetFeatureOptions] = useState();
+ const [getFeatureOptions, setGetFeatureOptions] =
+ useState();
const { data, loading, setQuery } = useQuery<{
getFeature: GetFeatureModelType;
@@ -24,11 +27,14 @@ const useHandleWfsGetFeatureRequests = (): {
useEffect(() => {
if (getFeatureOptions) {
-
- const featureConfig = store.mapMenusManagerStore.getFeatureConfig(getFeatureOptions.typeName);
+ const featureConfig = store.mapMenusManagerStore.getFeatureConfig(
+ getFeatureOptions.typeName
+ );
const dWithin = featureConfig.dWithin;
-
- setQuery(store.queryGetFeature({ data: { ...getFeatureOptions, dWithin } }));
+
+ setQuery(
+ store.queryGetFeature({ data: { ...getFeatureOptions, dWithin } })
+ );
}
}, [getFeatureOptions]);
@@ -43,7 +49,7 @@ const useHandleWfsGetFeatureRequests = (): {
store.mapMenusManagerStore.setCurrentWfsFeatureInfo(featureInfo);
getFeatureOptions.onDataResolved?.(featureInfo);
- }
+ }
//TODO: Handle Errors, how should we deal with them?
}, [data, loading]);
diff --git a/src/common/hooks/mapMenus/useHandleWfsPolygonPartsRequests.ts b/src/common/hooks/mapMenus/useHandleWfsPolygonPartsRequests.ts
index 5afa39f4e..7fcea1864 100644
--- a/src/common/hooks/mapMenus/useHandleWfsPolygonPartsRequests.ts
+++ b/src/common/hooks/mapMenus/useHandleWfsPolygonPartsRequests.ts
@@ -8,23 +8,34 @@ import {
} from '../../../discrete-layer/models';
import { WfsPolygonPartsGetFeatureParams } from '../../../discrete-layer/models/RootStore.base';
-type HandlerGetFeatureOptions = WfsPolygonPartsGetFeatureParams & { onDataResolved?: (data?: GetFeatureModelType) => void, shouldFlyToFeatures?: boolean };
+type HandlerGetFeatureOptions = WfsPolygonPartsGetFeatureParams & {
+ onDataResolved?: (data?: GetFeatureModelType) => void;
+ shouldFlyToFeatures?: boolean;
+};
const useHandleWfsPolygonPartsRequests = (): {
- data: { getPolygonPartsFeature: GetFeatureModelType} | undefined;
+ data: { getPolygonPartsFeature: GetFeatureModelType } | undefined;
loading: boolean;
getPolygonPartsFeatureOptions: WfsPolygonPartsGetFeatureParams | undefined;
setGetPolygonPartsFeatureOptions: (options: HandlerGetFeatureOptions) => void;
} => {
const store = useStore();
- const [getPolygonPartsFeatureOptions, setGetPolygonPartsFeatureOptions] = useState();
+ const [getPolygonPartsFeatureOptions, setGetPolygonPartsFeatureOptions] =
+ useState();
- const { data, loading, setQuery } = useQuery<{ getPolygonPartsFeature: GetFeatureModelType}>();
+ const { data, loading, setQuery } = useQuery<{
+ getPolygonPartsFeature: GetFeatureModelType;
+ }>();
useEffect(() => {
if (getPolygonPartsFeatureOptions) {
- const {onDataResolved, shouldFlyToFeatures, ...restPPOptions} = getPolygonPartsFeatureOptions;
- setQuery(store.queryGetPolygonPartsFeature({ data: { ...restPPOptions, count: 100 } }));
+ const { onDataResolved, shouldFlyToFeatures, ...restPPOptions } =
+ getPolygonPartsFeatureOptions;
+ setQuery(
+ store.queryGetPolygonPartsFeature({
+ data: { ...restPPOptions, count: 100 },
+ })
+ );
}
}, [getPolygonPartsFeatureOptions]);
@@ -38,26 +49,41 @@ const useHandleWfsPolygonPartsRequests = (): {
store.mapMenusManagerStore.setCurrentPolygonPartsInfo(featureInfo);
getPolygonPartsFeatureOptions.onDataResolved?.(featureInfo);
- }
+ }
//TODO: Handle Errors, how should we deal with them?
}, [data, loading]);
useEffect(() => {
// After data has been received, trigger side effect logics
- if (store.mapMenusManagerStore.currentPolygonPartsInfo && getPolygonPartsFeatureOptions) {
- const polygonPartsFeatures = store.mapMenusManagerStore.currentPolygonPartsInfo.features;
+ if (
+ store.mapMenusManagerStore.currentPolygonPartsInfo &&
+ getPolygonPartsFeatureOptions
+ ) {
+ const polygonPartsFeatures =
+ store.mapMenusManagerStore.currentPolygonPartsInfo.features;
const { shouldFlyToFeatures } = getPolygonPartsFeatureOptions;
-
- if (polygonPartsFeatures && polygonPartsFeatures.length > 0 && shouldFlyToFeatures) {
- const featuresBBox = bbox({ type: "FeatureCollection", features: polygonPartsFeatures });
+
+ if (
+ polygonPartsFeatures &&
+ polygonPartsFeatures.length > 0 &&
+ shouldFlyToFeatures
+ ) {
+ const featuresBBox = bbox({
+ type: 'FeatureCollection',
+ features: polygonPartsFeatures,
+ });
store.mapMenusManagerStore.setMultiplePolygonPartsBBox(featuresBBox);
}
}
-
}, [store.mapMenusManagerStore.currentPolygonPartsInfo]);
- return { data, loading, getPolygonPartsFeatureOptions, setGetPolygonPartsFeatureOptions };
+ return {
+ data,
+ loading,
+ getPolygonPartsFeatureOptions,
+ setGetPolygonPartsFeatureOptions,
+ };
};
export default useHandleWfsPolygonPartsRequests;
diff --git a/src/common/hooks/useClickOutside.ts b/src/common/hooks/useClickOutside.ts
index d2e8d3948..39cb55b70 100644
--- a/src/common/hooks/useClickOutside.ts
+++ b/src/common/hooks/useClickOutside.ts
@@ -14,12 +14,18 @@ function isDescendant(parent: Node, child: Node) {
highestParentAvailableTag = node?.nodeName ?? '';
node = node.parentNode;
}
-
- if (node === null && highestParentAvailableTag !== '#document') { return true; }
+
+ if (node === null && highestParentAvailableTag !== '#document') {
+ return true;
+ }
return false;
}
-export const useClickOutside = (ref: React.RefObject, onClickOutside: (e: MouseEvent) => void, shouldHandle = true) => {
+export const useClickOutside = (
+ ref: React.RefObject,
+ onClickOutside: (e: MouseEvent) => void,
+ shouldHandle = true
+) => {
const clickHandler = useCallback((e: MouseEvent) => {
if (ref.current) {
if (!isDescendant(ref.current, e.target as Node)) {
@@ -31,7 +37,7 @@ export const useClickOutside = (ref: React.RefObject,
useEffect(() => {
return () => {
document.removeEventListener('click', clickHandler);
- }
+ };
}, []);
useEffect(() => {
@@ -42,6 +48,5 @@ export const useClickOutside = (ref: React.RefObject,
document.addEventListener('click', clickHandler);
}, LISTENER_DELAY);
}
-
}, [shouldHandle]);
-}
\ No newline at end of file
+};
diff --git a/src/common/hooks/useDateNow.hook.ts b/src/common/hooks/useDateNow.hook.ts
index 81b18d30b..385b57d29 100644
--- a/src/common/hooks/useDateNow.hook.ts
+++ b/src/common/hooks/useDateNow.hook.ts
@@ -3,17 +3,17 @@ import { useEffect, useRef } from 'react';
const SECOND = 1000;
const useDateNow = () => {
- const dateNowRef = useRef(new Date());
-
- useEffect(() => {
- const interval = setInterval(() => {
- dateNowRef.current = new Date();
- }, SECOND);
-
- return () => clearInterval(interval);
- }, []);
-
- return dateNowRef;
- };
+ const dateNowRef = useRef(new Date());
-export default useDateNow;
\ No newline at end of file
+ useEffect(() => {
+ const interval = setInterval(() => {
+ dateNowRef.current = new Date();
+ }, SECOND);
+
+ return () => clearInterval(interval);
+ }, []);
+
+ return dateNowRef;
+};
+
+export default useDateNow;
diff --git a/src/common/hooks/useElementDimensions.hook.ts b/src/common/hooks/useElementDimensions.hook.ts
index e674b7bcf..1d84d49e3 100644
--- a/src/common/hooks/useElementDimensions.hook.ts
+++ b/src/common/hooks/useElementDimensions.hook.ts
@@ -5,7 +5,9 @@ export interface IDimensions {
height: number;
}
-export const useElementDimensions = (element: React.MutableRefObject): IDimensions | undefined => {
+export const useElementDimensions = (
+ element: React.MutableRefObject
+): IDimensions | undefined => {
const [dimensions, setDimensions] = useState();
useLayoutEffect(() => {
@@ -16,4 +18,4 @@ export const useElementDimensions = (element: React.MutableRefObject {
- const { enumsMap } = useContext(EnumsMapContext);
- const enums = enumsMap as IEnumsMapType;
- return enums;
-}
\ No newline at end of file
+ const { enumsMap } = useContext(EnumsMapContext);
+ const enums = enumsMap as IEnumsMapType;
+ return enums;
+};
diff --git a/src/common/hooks/useForceEntitySelection.hook.ts b/src/common/hooks/useForceEntitySelection.hook.ts
index dbdc5e7ed..9e1d85b45 100644
--- a/src/common/hooks/useForceEntitySelection.hook.ts
+++ b/src/common/hooks/useForceEntitySelection.hook.ts
@@ -1,6 +1,8 @@
import React, { useEffect, useState } from 'react';
-export const useForceEntitySelection = (dependencies: React.DependencyList): { entitySelected: boolean } => {
+export const useForceEntitySelection = (
+ dependencies: React.DependencyList
+): { entitySelected: boolean } => {
const RESELECTION_TIMEOUT = 0;
const [entitySelected, setEntitySelected] = useState(true);
@@ -13,4 +15,4 @@ export const useForceEntitySelection = (dependencies: React.DependencyList): { e
}, dependencies);
return { entitySelected };
-}
\ No newline at end of file
+};
diff --git a/src/common/hooks/useHeightFromTerrain.ts b/src/common/hooks/useHeightFromTerrain.ts
index 31bf5779e..fc4a5f1d8 100644
--- a/src/common/hooks/useHeightFromTerrain.ts
+++ b/src/common/hooks/useHeightFromTerrain.ts
@@ -1,6 +1,10 @@
import { useEffect, useRef, useState } from 'react';
import { isEmpty } from 'lodash';
-import { CesiumCartographic, cesiumSampleTerrainMostDetailed, useCesiumMap } from '@map-colonies/react-components';
+import {
+ CesiumCartographic,
+ cesiumSampleTerrainMostDetailed,
+ useCesiumMap,
+} from '@map-colonies/react-components';
import { is2dArray, isArrayEqual } from '../helpers/array';
export interface IPosition {
@@ -14,19 +18,27 @@ interface UseHeightFromTerrainProps {
interface IHeightFromTerrain {
newPositions?: CesiumCartographic[] | CesiumCartographic[][];
- setCoordinates: (pos: IPosition[] | IPosition[][]) => void;
+ setCoordinates: (pos: IPosition[] | IPosition[][]) => void;
isLoadingData: boolean;
}
-export const useHeightFromTerrain = (options?: UseHeightFromTerrainProps): IHeightFromTerrain => {
+export const useHeightFromTerrain = (
+ options?: UseHeightFromTerrainProps
+): IHeightFromTerrain => {
const mapViewer = useCesiumMap();
- const [newPositions, setNewPositions] = useState();
- const [coordinates, setCoordinates] = useState();
+ const [newPositions, setNewPositions] = useState<
+ CesiumCartographic[] | CesiumCartographic[][]
+ >();
+ const [coordinates, setCoordinates] = useState();
const [isLoadingData, setIsLoadingData] = useState(true);
const prevPositions = useRef();
useEffect(() => {
- if (options && (!prevPositions.current || !isArrayEqual(prevPositions.current, options.position))) {
+ if (
+ options &&
+ (!prevPositions.current ||
+ !isArrayEqual(prevPositions.current, options.position))
+ ) {
prevPositions.current = options.position;
setCoordinates(options.position);
}
@@ -36,24 +48,34 @@ export const useHeightFromTerrain = (options?: UseHeightFromTerrainProps): IHeig
if (coordinates) {
// @ts-ignore
const is2dArr = is2dArray(coordinates);
- const cartographicArr: CesiumCartographic[] | CesiumCartographic[][] | undefined = (is2dArr) ?
- coordinates.map((ring: any) => ring.map((coord: any) => CesiumCartographic.fromDegrees(coord.longitude, coord.latitude)))
- :
- coordinates.map((coord: any) => CesiumCartographic.fromDegrees(coord.longitude, coord.latitude));
-
+ const cartographicArr:
+ | CesiumCartographic[]
+ | CesiumCartographic[][]
+ | undefined = is2dArr
+ ? coordinates.map((ring: any) =>
+ ring.map((coord: any) =>
+ CesiumCartographic.fromDegrees(coord.longitude, coord.latitude)
+ )
+ )
+ : coordinates.map((coord: any) =>
+ CesiumCartographic.fromDegrees(coord.longitude, coord.latitude)
+ );
+
setIsLoadingData(true);
// const promises: Promise[] = [];
-
+
if (is2dArr) {
const promises: Promise[] = [];
-
- cartographicArr.forEach((ring: any): void => {
+
+ cartographicArr.forEach((ring: any): void => {
// @ts-ignore
- promises.push(cesiumSampleTerrainMostDetailed(
- mapViewer.terrainProvider,
- ring as CesiumCartographic[]
- ));
+ promises.push(
+ cesiumSampleTerrainMostDetailed(
+ mapViewer.terrainProvider,
+ ring as CesiumCartographic[]
+ )
+ );
});
Promise.all(promises)
@@ -70,9 +92,10 @@ export const useHeightFromTerrain = (options?: UseHeightFromTerrainProps): IHeig
});
} else {
void cesiumSampleTerrainMostDetailed(
- mapViewer.terrainProvider,
- cartographicArr as CesiumCartographic[]
- ).then(
+ mapViewer.terrainProvider,
+ cartographicArr as CesiumCartographic[]
+ )
+ .then(
(updatedPositions) => {
if (!isEmpty(updatedPositions)) {
setNewPositions([...updatedPositions] as CesiumCartographic[]);
@@ -81,7 +104,8 @@ export const useHeightFromTerrain = (options?: UseHeightFromTerrainProps): IHeig
() => {
setNewPositions(cartographicArr);
}
- ).finally(() => {
+ )
+ .finally(() => {
setIsLoadingData(false);
});
}
diff --git a/src/common/hooks/useSessionStoreWatcherDirectory.ts b/src/common/hooks/useSessionStoreWatcherDirectory.ts
index b53da280b..1dffc04d9 100644
--- a/src/common/hooks/useSessionStoreWatcherDirectory.ts
+++ b/src/common/hooks/useSessionStoreWatcherDirectory.ts
@@ -1,6 +1,9 @@
import { useEffect, useState } from 'react';
import { useIntl } from 'react-intl';
-import { getValidationMessage, ValidationMessage } from '../../discrete-layer/components/layer-details/utils';
+import {
+ getValidationMessage,
+ ValidationMessage,
+} from '../../discrete-layer/components/layer-details/utils';
import { SYNC_QUERY_NAME } from '../../syncHttpClientGql';
import { sessionStore } from '../helpers/storage';
@@ -29,7 +32,11 @@ const useSessionStoreWatcherDirectory = () => {
}
};
- sessionStore.watchMethods(['setItem', 'removeItem'], () => {}, callbackAfter);
+ sessionStore.watchMethods(
+ ['setItem', 'removeItem'],
+ () => {},
+ callbackAfter
+ );
return () => {
sessionStore.unWatchMethods();
@@ -39,4 +46,4 @@ const useSessionStoreWatcherDirectory = () => {
return validationWarn;
};
-export default useSessionStoreWatcherDirectory;
\ No newline at end of file
+export default useSessionStoreWatcherDirectory;
diff --git a/src/common/hooks/useSessionStoreWatcherForm.ts b/src/common/hooks/useSessionStoreWatcherForm.ts
index 128d16d9b..eb073ae1d 100644
--- a/src/common/hooks/useSessionStoreWatcherForm.ts
+++ b/src/common/hooks/useSessionStoreWatcherForm.ts
@@ -1,6 +1,9 @@
import { useEffect, useState } from 'react';
import { useIntl } from 'react-intl';
-import { getValidationMessage, ValidationMessage } from '../../discrete-layer/components/layer-details/utils';
+import {
+ getValidationMessage,
+ ValidationMessage,
+} from '../../discrete-layer/components/layer-details/utils';
import { SYNC_QUERY_NAME } from '../../syncHttpClientGql';
import { sessionStore } from '../helpers/storage';
@@ -30,8 +33,14 @@ const useSessionStoreWatcherForm = () => {
case key.includes(SYNC_QUERY_NAME.VALIDATE_SOURCE): {
switch (method) {
case 'setItem': {
- const data = sessionStore.getObject(SYNC_QUERY_NAME.VALIDATE_SOURCE);
- if (data && !data.isValid && !sessionStore.getObject(SYNC_QUERY_NAME.GET_PRODUCT)) {
+ const data = sessionStore.getObject(
+ SYNC_QUERY_NAME.VALIDATE_SOURCE
+ );
+ if (
+ data &&
+ !data.isValid &&
+ !sessionStore.getObject(SYNC_QUERY_NAME.GET_PRODUCT)
+ ) {
setValidationWarn(getValidationMessage(data, intl));
}
break;
@@ -48,7 +57,11 @@ const useSessionStoreWatcherForm = () => {
}
};
- sessionStore.watchMethods(['setItem', 'removeItem'], () => {}, callbackAfter);
+ sessionStore.watchMethods(
+ ['setItem', 'removeItem'],
+ () => {},
+ callbackAfter
+ );
return () => {
sessionStore.unWatchMethods();
diff --git a/src/common/hooks/useStaticHtml.ts b/src/common/hooks/useStaticHtml.ts
index 35d9798a6..19f8b1a4f 100644
--- a/src/common/hooks/useStaticHtml.ts
+++ b/src/common/hooks/useStaticHtml.ts
@@ -8,16 +8,21 @@ interface UseStaticHTMLProps {
props: T;
}
-function useStaticHTML({ FunctionalComp, props }: UseStaticHTMLProps): string {
+function useStaticHTML({
+ FunctionalComp,
+ props,
+}: UseStaticHTMLProps): string {
const [html, setHTML] = useState('');
useEffect(() => {
// @ts-ignore
- const htmlString = renderToStaticMarkup(React.createElement(FunctionalComp, {...props}));
+ const htmlString = renderToStaticMarkup(
+ React.createElement(FunctionalComp, { ...props })
+ );
setHTML(htmlString);
}, [FunctionalComp, props]);
return html;
}
-export default useStaticHTML;
\ No newline at end of file
+export default useStaticHTML;
diff --git a/src/common/hooks/useWfsPolygonPartsRequests.ts b/src/common/hooks/useWfsPolygonPartsRequests.ts
index 36d95fcd4..923f96ccd 100644
--- a/src/common/hooks/useWfsPolygonPartsRequests.ts
+++ b/src/common/hooks/useWfsPolygonPartsRequests.ts
@@ -18,17 +18,22 @@ const useWfsPolygonPartsRequests = (): {
setQueryPolygonPartsFeatureOptions: (options: GetFeatureOptions) => void;
} => {
const store = useStore();
- const [queryPolygonPartsFeatureOptions, setQueryPolygonPartsFeatureOptions] = useState();
+ const [queryPolygonPartsFeatureOptions, setQueryPolygonPartsFeatureOptions] =
+ useState();
- const { data, loading, setQuery } = useQuery<{ getPolygonPartsFeature: GetFeatureModelType }>();
+ const { data, loading, setQuery } = useQuery<{
+ getPolygonPartsFeature: GetFeatureModelType;
+ }>();
useEffect(() => {
if (queryPolygonPartsFeatureOptions) {
- setQuery(store.queryGetPolygonPartsFeature({
- data: {
- ...queryPolygonPartsFeatureOptions
- }
- }));
+ setQuery(
+ store.queryGetPolygonPartsFeature({
+ data: {
+ ...queryPolygonPartsFeatureOptions,
+ },
+ })
+ );
}
}, [queryPolygonPartsFeatureOptions]);
@@ -39,22 +44,31 @@ const useWfsPolygonPartsRequests = (): {
feature: queryPolygonPartsFeatureOptions.feature,
};
if (queryPolygonPartsFeatureOptions.startIndex === 0) {
- store.discreteLayersStore.setPolygonPartsInfo(featureInfo.features as Feature[]);
+ store.discreteLayersStore.setPolygonPartsInfo(
+ featureInfo.features as Feature[]
+ );
} else {
- store.discreteLayersStore.addPolygonPartsInfo(featureInfo.features as Feature[]);
+ store.discreteLayersStore.addPolygonPartsInfo(
+ featureInfo.features as Feature[]
+ );
}
if (data.getPolygonPartsFeature.numberReturned !== 0) {
const startIndex = queryPolygonPartsFeatureOptions.startIndex as number;
const nextPage = startIndex / CONFIG.POLYGON_PARTS.MAX.WFS_FEATURES + 1;
setQueryPolygonPartsFeatureOptions({
...queryPolygonPartsFeatureOptions,
- startIndex: nextPage * CONFIG.POLYGON_PARTS.MAX.WFS_FEATURES
+ startIndex: nextPage * CONFIG.POLYGON_PARTS.MAX.WFS_FEATURES,
});
}
- }
+ }
}, [data, loading]);
- return { data, loading, queryPolygonPartsFeatureOptions, setQueryPolygonPartsFeatureOptions };
+ return {
+ data,
+ loading,
+ queryPolygonPartsFeatureOptions,
+ setQueryPolygonPartsFeatureOptions,
+ };
};
-export default useWfsPolygonPartsRequests;
\ No newline at end of file
+export default useWfsPolygonPartsRequests;
diff --git a/src/common/hooks/useZoomLevels.ts b/src/common/hooks/useZoomLevels.ts
index f153828d7..85e1c5a23 100644
--- a/src/common/hooks/useZoomLevels.ts
+++ b/src/common/hooks/useZoomLevels.ts
@@ -1,19 +1,27 @@
import { get } from 'lodash';
import { useContext } from 'react';
-import lookupTablesContext, { ILookupOption } from '../contexts/lookupTables.context';
+import lookupTablesContext, {
+ ILookupOption,
+} from '../contexts/lookupTables.context';
export interface IZoomLevelData {
- resolutionDeg:number;
- resolutionMeter:number
+ resolutionDeg: number;
+ resolutionMeter: number;
}
-export const useZoomLevels = (): Record => {
- const zoomlevelresolutions = {} as Record;
+export const useZoomLevels = (): Record => {
+ const zoomlevelresolutions = {} as Record;
const { lookupTablesData } = useContext(lookupTablesContext);
- const lookupOptions = get(lookupTablesData?.dictionary, 'zoomlevelresolutions') as ILookupOption[] ?? [];
+ const lookupOptions =
+ (get(
+ lookupTablesData?.dictionary,
+ 'zoomlevelresolutions'
+ ) as ILookupOption[]) ?? [];
lookupOptions?.forEach((option) => {
- zoomlevelresolutions[option.value] = {...option.properties} as unknown as IZoomLevelData;
+ zoomlevelresolutions[option.value] = {
+ ...option.properties,
+ } as unknown as IZoomLevelData;
});
-
+
return zoomlevelresolutions;
-}
+};
diff --git a/src/common/i18n/en.json b/src/common/i18n/en.json
index 093962271..925ae19b5 100644
--- a/src/common/i18n/en.json
+++ b/src/common/i18n/en.json
@@ -267,7 +267,7 @@
"ingestion.job.validationTaskProgress": "Validation progress",
"ingestion.job.report": "Validation results",
"ingestion.job.report-in-progress": "Report in progress",
-
+
"validationReport.geometryValidity": "Invalid geometry",
"validationReport.vertices": "Polygons with too many vertices",
"validationReport.metadata": "Invalid metadata",
@@ -770,7 +770,7 @@
"Units.dms": "DMS",
"Units.arc_seconds": "ARC_SECONDS",
"Units.unknown": "UNKNOWN",
-
+
"UndulationModel.msl_egm96": "MSL_EGM96",
"UndulationModel.msl_egm2008": "MSL_EGM2008",
"UndulationModel.msl_dma10": "MSL_DMA10",
@@ -812,7 +812,7 @@
"lookupTable.hotAreas.sderot": "Sderot",
"lookupTable.hotAreas.syria": "Syria",
"lookupTable.hotAreas.telAviv": "Tel Aviv",
-
+
"Transparency.transparent": "Transparent",
"Transparency.opaque": "Opaque",
@@ -839,10 +839,10 @@
"export-layer.exportSuccessContainer.jobId.title": "Job ID",
"export-layer.export.button": "Export Layer",
"export-layer.preview.button": "Evaluate Export",
- "export-layer.selection-index.text":"Selection",
- "export-layer.generalFields.text":"General Fields",
- "export-layer.fileError.text":"Imported File",
- "export-layer.serviceError.text":"Service Error",
+ "export-layer.selection-index.text": "Selection",
+ "export-layer.generalFields.text": "General Fields",
+ "export-layer.fileError.text": "Imported File",
+ "export-layer.serviceError.text": "Service Error",
"export-layer.generalError.text": "General Error",
"export-layer.description.field": "Description",
"export-layer.zoomLevel.field": "Zoom Level",
diff --git a/src/common/i18n/grid.en.ts b/src/common/i18n/grid.en.ts
index 173e3a628..8aa253ac4 100644
--- a/src/common/i18n/grid.en.ts
+++ b/src/common/i18n/grid.en.ts
@@ -2,268 +2,268 @@
const AG_GRID_LOCALE_EN = {
// Set Filter
- "selectAll": '(Select All)',
- "selectAllSearchResults": '(Select All Search Results)',
- "searchOoo": 'Search...',
- "blanks": '(Blanks)',
- "noMatches": 'No matches',
+ selectAll: '(Select All)',
+ selectAllSearchResults: '(Select All Search Results)',
+ searchOoo: 'Search...',
+ blanks: '(Blanks)',
+ noMatches: 'No matches',
// Number Filter & Text Filter
- "filterOoo": 'Filter...',
- "equals": 'Equals',
- "notEqual": 'Not equal',
- "empty": 'Choose One',
+ filterOoo: 'Filter...',
+ equals: 'Equals',
+ notEqual: 'Not equal',
+ empty: 'Choose One',
// Number Filter
- "lessThan": 'Less than',
- "greaterThan": 'Greater than',
- "lessThanOrEqual": 'Less than or equal',
- "greaterThanOrEqual": 'Greater than or equal',
- "inRange": 'In range',
- "inRangeStart": 'to',
- "inRangeEnd": 'from',
+ lessThan: 'Less than',
+ greaterThan: 'Greater than',
+ lessThanOrEqual: 'Less than or equal',
+ greaterThanOrEqual: 'Greater than or equal',
+ inRange: 'In range',
+ inRangeStart: 'to',
+ inRangeEnd: 'from',
// Text Filter
- "contains": 'Contains',
- "notContains": 'Not contains',
- "startsWith": 'Starts with',
- "endsWith": 'Ends with',
+ contains: 'Contains',
+ notContains: 'Not contains',
+ startsWith: 'Starts with',
+ endsWith: 'Ends with',
// Date Filter
- "dateFormatOoo": 'yyyy-mm-dd',
+ dateFormatOoo: 'yyyy-mm-dd',
// Filter Conditions
- "andCondition": 'AND',
- "orCondition": 'OR',
+ andCondition: 'AND',
+ orCondition: 'OR',
// Filter Buttons
- "applyFilter": 'Apply',
- "resetFilter": 'Reset',
- "clearFilter": 'Clear',
- "cancelFilter": 'Cancel',
+ applyFilter: 'Apply',
+ resetFilter: 'Reset',
+ clearFilter: 'Clear',
+ cancelFilter: 'Cancel',
// Filter Titles
- "textFilter": 'Text Filter',
- "numberFilter": 'Number Filter',
- "dateFilter": 'Date Filter',
- "setFilter": 'Set Filter',
+ textFilter: 'Text Filter',
+ numberFilter: 'Number Filter',
+ dateFilter: 'Date Filter',
+ setFilter: 'Set Filter',
// Side Bar
- "columns": 'Columns',
- "filters": 'Filters',
+ columns: 'Columns',
+ filters: 'Filters',
// columns tool panel
- "pivotMode": 'Pivot Mode',
- "groups": 'Row Groups',
- "rowGroupColumnsEmptyMessage": 'Drag here to set row groups',
- "values": 'Values',
- "valueColumnsEmptyMessage": 'Drag here to aggregate',
- "pivots": 'Column Labels',
- "pivotColumnsEmptyMessage": 'Drag here to set column labels',
+ pivotMode: 'Pivot Mode',
+ groups: 'Row Groups',
+ rowGroupColumnsEmptyMessage: 'Drag here to set row groups',
+ values: 'Values',
+ valueColumnsEmptyMessage: 'Drag here to aggregate',
+ pivots: 'Column Labels',
+ pivotColumnsEmptyMessage: 'Drag here to set column labels',
// Header of the Default Group Column
- "group": 'Group',
+ group: 'Group',
// Other
- "loadingOoo": 'Loading...',
- "noRowsToShow": 'No Rows To Show',
- "enabled": 'Enabled',
+ loadingOoo: 'Loading...',
+ noRowsToShow: 'No Rows To Show',
+ enabled: 'Enabled',
// Menu
- "pinColumn": 'Pin Column',
- "pinLeft": 'Pin Left',
- "pinRight": 'Pin Right',
- "noPin": 'No Pin',
- "valueAggregation": 'Value Aggregation',
- "autosizeThiscolumn": 'Autosize This Column',
- "autosizeAllColumns": 'Autosize All Columns',
- "groupBy": 'Group by',
- "ungroupBy": 'Un-Group by',
- "resetColumns": 'Reset Columns',
- "expandAll": 'Expand All',
- "collapseAll": 'Close All',
- "copy": 'Copy',
- "ctrlC": 'Ctrl+C',
- "copyWithHeaders": 'Copy With Headers',
- "paste": 'Paste',
- "ctrlV": 'Ctrl+V',
- "export": 'Export',
- "csvExport": 'CSV Export',
- "excelExport": 'Excel Export',
+ pinColumn: 'Pin Column',
+ pinLeft: 'Pin Left',
+ pinRight: 'Pin Right',
+ noPin: 'No Pin',
+ valueAggregation: 'Value Aggregation',
+ autosizeThiscolumn: 'Autosize This Column',
+ autosizeAllColumns: 'Autosize All Columns',
+ groupBy: 'Group by',
+ ungroupBy: 'Un-Group by',
+ resetColumns: 'Reset Columns',
+ expandAll: 'Expand All',
+ collapseAll: 'Close All',
+ copy: 'Copy',
+ ctrlC: 'Ctrl+C',
+ copyWithHeaders: 'Copy With Headers',
+ paste: 'Paste',
+ ctrlV: 'Ctrl+V',
+ export: 'Export',
+ csvExport: 'CSV Export',
+ excelExport: 'Excel Export',
// Enterprise Menu Aggregation and Status Bar
- "sum": 'Sum',
- "min": 'Min',
- "max": 'Max',
- "none": 'None',
- "count": 'Count',
- "avg": 'Average',
- "filteredRows": 'Filtered',
- "selectedRows": 'Selected',
- "totalRows": 'Total Rows',
- "totalAndFilteredRows": 'Rows',
- "more": 'More',
- "to": 'to',
- "of": 'of',
- "page": 'Page',
- "nextPage": 'Next Page',
- "lastPage": 'Last Page',
- "firstPage": 'First Page',
- "previousPage": 'Previous Page',
+ sum: 'Sum',
+ min: 'Min',
+ max: 'Max',
+ none: 'None',
+ count: 'Count',
+ avg: 'Average',
+ filteredRows: 'Filtered',
+ selectedRows: 'Selected',
+ totalRows: 'Total Rows',
+ totalAndFilteredRows: 'Rows',
+ more: 'More',
+ to: 'to',
+ of: 'of',
+ page: 'Page',
+ nextPage: 'Next Page',
+ lastPage: 'Last Page',
+ firstPage: 'First Page',
+ previousPage: 'Previous Page',
// Enterprise Menu (Charts)
- "pivotChartAndPivotMode": 'Pivot Chart & Pivot Mode',
- "pivotChart": 'Pivot Chart',
- "chartRange": 'Chart Range',
+ pivotChartAndPivotMode: 'Pivot Chart & Pivot Mode',
+ pivotChart: 'Pivot Chart',
+ chartRange: 'Chart Range',
- "columnChart": 'Column',
- "groupedColumn": 'Grouped',
- "stackedColumn": 'Stacked',
- "normalizedColumn": '100% Stacked',
+ columnChart: 'Column',
+ groupedColumn: 'Grouped',
+ stackedColumn: 'Stacked',
+ normalizedColumn: '100% Stacked',
- "barChart": 'Bar',
- "groupedBar": 'Grouped',
- "stackedBar": 'Stacked',
- "normalizedBar": '100% Stacked',
+ barChart: 'Bar',
+ groupedBar: 'Grouped',
+ stackedBar: 'Stacked',
+ normalizedBar: '100% Stacked',
- "pieChart": 'Pie',
- "pie": 'Pie',
- "doughnut": 'Doughnut',
+ pieChart: 'Pie',
+ pie: 'Pie',
+ doughnut: 'Doughnut',
- "line": 'Line',
+ line: 'Line',
- "xyChart": 'X Y (Scatter)',
- "scatter": 'Scatter',
- "bubble": 'Bubble',
+ xyChart: 'X Y (Scatter)',
+ scatter: 'Scatter',
+ bubble: 'Bubble',
- "areaChart": 'Area',
- "area": 'Area',
- "stackedArea": 'Stacked',
- "normalizedArea": '100% Stacked',
+ areaChart: 'Area',
+ area: 'Area',
+ stackedArea: 'Stacked',
+ normalizedArea: '100% Stacked',
- "histogramChart": 'Histogram',
+ histogramChart: 'Histogram',
// Charts
- "pivotChartTitle": 'Pivot Chart',
- "rangeChartTitle": 'Range Chart',
- "settings": 'Settings',
- "data": 'Data',
- "format": 'Format',
- "categories": 'Categories',
- "defaultCategory": '(None)',
- "series": 'Series',
- "xyValues": 'X Y Values',
- "paired": 'Paired Mode',
- "axis": 'Axis',
- "navigator": 'Navigator',
- "color": 'Color',
- "thickness": 'Thickness',
- "xType": 'X Type',
- "automatic": 'Automatic',
- "category": 'Category',
- "number": 'Number',
- "time": 'Time',
- "xRotation": 'X Rotation',
- "yRotation": 'Y Rotation',
- "ticks": 'Ticks',
- "width": 'Width',
- "height": 'Height',
- "length": 'Length',
- "padding": 'Padding',
- "spacing": 'Spacing',
- "chart": 'Chart',
- "title": 'Title',
- "titlePlaceholder": 'Chart title - double click to edit',
- "background": 'Background',
- "font": 'Font',
- "top": 'Top',
- "right": 'Right',
- "bottom": 'Bottom',
- "left": 'Left',
- "labels": 'Labels',
- "size": 'Size',
- "minSize": 'Minimum Size',
- "maxSize": 'Maximum Size',
- "legend": 'Legend',
- "position": 'Position',
- "markerSize": 'Marker Size',
- "markerStroke": 'Marker Stroke',
- "markerPadding": 'Marker Padding',
- "itemSpacing": 'Item Spacing',
- "itemPaddingX": 'Item Padding X',
- "itemPaddingY": 'Item Padding Y',
- "layoutHorizontalSpacing": 'Horizontal Spacing',
- "layoutVerticalSpacing": 'Vertical Spacing',
- "strokeWidth": 'Stroke Width',
- "offset": 'Offset',
- "offsets": 'Offsets',
- "tooltips": 'Tooltips',
- "callout": 'Callout',
- "markers": 'Markers',
- "shadow": 'Shadow',
- "blur": 'Blur',
- "xOffset": 'X Offset',
- "yOffset": 'Y Offset',
- "lineWidth": 'Line Width',
- "normal": 'Normal',
- "bold": 'Bold',
- "italic": 'Italic',
- "boldItalic": 'Bold Italic',
- "predefined": 'Predefined',
- "fillOpacity": 'Fill Opacity',
- "strokeOpacity": 'Line Opacity',
- "histogramBinCount": 'Bin count',
- "columnGroup": 'Column',
- "barGroup": 'Bar',
- "pieGroup": 'Pie',
- "lineGroup": 'Line',
- "scatterGroup": 'X Y (Scatter)',
- "areaGroup": 'Area',
- "histogramGroup": 'Histogram',
- "groupedColumnTooltip": 'Grouped',
- "stackedColumnTooltip": 'Stacked',
- "normalizedColumnTooltip": '100% Stacked',
- "groupedBarTooltip": 'Grouped',
- "stackedBarTooltip": 'Stacked',
- "normalizedBarTooltip": '100% Stacked',
- "pieTooltip": 'Pie',
- "doughnutTooltip": 'Doughnut',
- "lineTooltip": 'Line',
- "groupedAreaTooltip": 'Area',
- "stackedAreaTooltip": 'Stacked',
- "normalizedAreaTooltip": '100% Stacked',
- "scatterTooltip": 'Scatter',
- "bubbleTooltip": 'Bubble',
- "histogramTooltip": 'Histogram',
- "noDataToChart": 'No data available to be charted.',
- "pivotChartRequiresPivotMode": 'Pivot Chart requires Pivot Mode enabled.',
- "chartSettingsToolbarTooltip": 'Menu',
- "chartLinkToolbarTooltip": 'Linked to Grid',
- "chartUnlinkToolbarTooltip": 'Unlinked from Grid',
- "chartDownloadToolbarTooltip": 'Download Chart',
+ pivotChartTitle: 'Pivot Chart',
+ rangeChartTitle: 'Range Chart',
+ settings: 'Settings',
+ data: 'Data',
+ format: 'Format',
+ categories: 'Categories',
+ defaultCategory: '(None)',
+ series: 'Series',
+ xyValues: 'X Y Values',
+ paired: 'Paired Mode',
+ axis: 'Axis',
+ navigator: 'Navigator',
+ color: 'Color',
+ thickness: 'Thickness',
+ xType: 'X Type',
+ automatic: 'Automatic',
+ category: 'Category',
+ number: 'Number',
+ time: 'Time',
+ xRotation: 'X Rotation',
+ yRotation: 'Y Rotation',
+ ticks: 'Ticks',
+ width: 'Width',
+ height: 'Height',
+ length: 'Length',
+ padding: 'Padding',
+ spacing: 'Spacing',
+ chart: 'Chart',
+ title: 'Title',
+ titlePlaceholder: 'Chart title - double click to edit',
+ background: 'Background',
+ font: 'Font',
+ top: 'Top',
+ right: 'Right',
+ bottom: 'Bottom',
+ left: 'Left',
+ labels: 'Labels',
+ size: 'Size',
+ minSize: 'Minimum Size',
+ maxSize: 'Maximum Size',
+ legend: 'Legend',
+ position: 'Position',
+ markerSize: 'Marker Size',
+ markerStroke: 'Marker Stroke',
+ markerPadding: 'Marker Padding',
+ itemSpacing: 'Item Spacing',
+ itemPaddingX: 'Item Padding X',
+ itemPaddingY: 'Item Padding Y',
+ layoutHorizontalSpacing: 'Horizontal Spacing',
+ layoutVerticalSpacing: 'Vertical Spacing',
+ strokeWidth: 'Stroke Width',
+ offset: 'Offset',
+ offsets: 'Offsets',
+ tooltips: 'Tooltips',
+ callout: 'Callout',
+ markers: 'Markers',
+ shadow: 'Shadow',
+ blur: 'Blur',
+ xOffset: 'X Offset',
+ yOffset: 'Y Offset',
+ lineWidth: 'Line Width',
+ normal: 'Normal',
+ bold: 'Bold',
+ italic: 'Italic',
+ boldItalic: 'Bold Italic',
+ predefined: 'Predefined',
+ fillOpacity: 'Fill Opacity',
+ strokeOpacity: 'Line Opacity',
+ histogramBinCount: 'Bin count',
+ columnGroup: 'Column',
+ barGroup: 'Bar',
+ pieGroup: 'Pie',
+ lineGroup: 'Line',
+ scatterGroup: 'X Y (Scatter)',
+ areaGroup: 'Area',
+ histogramGroup: 'Histogram',
+ groupedColumnTooltip: 'Grouped',
+ stackedColumnTooltip: 'Stacked',
+ normalizedColumnTooltip: '100% Stacked',
+ groupedBarTooltip: 'Grouped',
+ stackedBarTooltip: 'Stacked',
+ normalizedBarTooltip: '100% Stacked',
+ pieTooltip: 'Pie',
+ doughnutTooltip: 'Doughnut',
+ lineTooltip: 'Line',
+ groupedAreaTooltip: 'Area',
+ stackedAreaTooltip: 'Stacked',
+ normalizedAreaTooltip: '100% Stacked',
+ scatterTooltip: 'Scatter',
+ bubbleTooltip: 'Bubble',
+ histogramTooltip: 'Histogram',
+ noDataToChart: 'No data available to be charted.',
+ pivotChartRequiresPivotMode: 'Pivot Chart requires Pivot Mode enabled.',
+ chartSettingsToolbarTooltip: 'Menu',
+ chartLinkToolbarTooltip: 'Linked to Grid',
+ chartUnlinkToolbarTooltip: 'Unlinked from Grid',
+ chartDownloadToolbarTooltip: 'Download Chart',
// ARIA
- "ariaHidden": 'hidden',
- "ariaVisible": 'visible',
- "ariaChecked": 'checked',
- "ariaUnchecked": 'unchecked',
- "ariaIndeterminate":'indeterminate',
- "ariaColumnSelectAll": 'Toggle Select All Columns',
- "ariaInputEditor": 'Input Editor',
- "ariaDateFilterInput": 'Date Filter Input',
- "ariaFilterInput": 'Filter Input',
- "ariaFilterColumnsInput": 'Filter Columns Input',
- "ariaFilterValue": 'Filter Value',
- "ariaFilterFromValue": 'Filter from value',
- "ariaFilterToValue": 'Filter to value',
- "ariaFilteringOperator": 'Filtering Operator',
- "ariaColumnToggleVisibility": 'column toggle visibility',
- "ariaColumnGroupToggleVisibility": 'column group toggle visibility',
- "ariaRowSelect": 'Press SPACE to select this row',
- "ariaRowDeselect": 'Press SPACE to deselect this row',
- "ariaRowToggleSelection": 'Press Space to toggle row selection',
- "ariaRowSelectAll": 'Press Space to toggle all rows selection',
- "ariaSearch": 'Search',
- "ariaSearchFilterValues": 'Search filter values'
-}
-export default AG_GRID_LOCALE_EN;
\ No newline at end of file
+ ariaHidden: 'hidden',
+ ariaVisible: 'visible',
+ ariaChecked: 'checked',
+ ariaUnchecked: 'unchecked',
+ ariaIndeterminate: 'indeterminate',
+ ariaColumnSelectAll: 'Toggle Select All Columns',
+ ariaInputEditor: 'Input Editor',
+ ariaDateFilterInput: 'Date Filter Input',
+ ariaFilterInput: 'Filter Input',
+ ariaFilterColumnsInput: 'Filter Columns Input',
+ ariaFilterValue: 'Filter Value',
+ ariaFilterFromValue: 'Filter from value',
+ ariaFilterToValue: 'Filter to value',
+ ariaFilteringOperator: 'Filtering Operator',
+ ariaColumnToggleVisibility: 'column toggle visibility',
+ ariaColumnGroupToggleVisibility: 'column group toggle visibility',
+ ariaRowSelect: 'Press SPACE to select this row',
+ ariaRowDeselect: 'Press SPACE to deselect this row',
+ ariaRowToggleSelection: 'Press Space to toggle row selection',
+ ariaRowSelectAll: 'Press Space to toggle all rows selection',
+ ariaSearch: 'Search',
+ ariaSearchFilterValues: 'Search filter values',
+};
+export default AG_GRID_LOCALE_EN;
diff --git a/src/common/i18n/grid.he.ts b/src/common/i18n/grid.he.ts
index 1f2002539..f8a507412 100644
--- a/src/common/i18n/grid.he.ts
+++ b/src/common/i18n/grid.he.ts
@@ -2,23 +2,23 @@
const AG_GRID_LOCALE_HE = {
// Enterprise Menu Aggregation and Status Bar
- "sum": 'Sum',
- "min": 'Min',
- "max": 'Max',
- "none": 'None',
- "count": 'Count',
- "avg": 'Average',
- "filteredRows": 'סוננו',
- "selectedRows": 'נבחרו',
- "totalRows": "מס' כולל",
- "totalAndFilteredRows": 'רשומות',
- "more": 'עוד',
- "to": 'עד',
- "of": 'מ',
- "page": 'דף',
- "nextPage": 'דף הבא',
- "lastPage": 'דף אחרון',
- "firstPage": 'דף ראשון',
- "previousPage": 'דף קודם',
-}
-export default AG_GRID_LOCALE_HE;
\ No newline at end of file
+ sum: 'Sum',
+ min: 'Min',
+ max: 'Max',
+ none: 'None',
+ count: 'Count',
+ avg: 'Average',
+ filteredRows: 'סוננו',
+ selectedRows: 'נבחרו',
+ totalRows: "מס' כולל",
+ totalAndFilteredRows: 'רשומות',
+ more: 'עוד',
+ to: 'עד',
+ of: 'מ',
+ page: 'דף',
+ nextPage: 'דף הבא',
+ lastPage: 'דף אחרון',
+ firstPage: 'דף ראשון',
+ previousPage: 'דף קודם',
+};
+export default AG_GRID_LOCALE_HE;
diff --git a/src/common/i18n/he.json b/src/common/i18n/he.json
index 61fbcade5..ca930b056 100644
--- a/src/common/i18n/he.json
+++ b/src/common/i18n/he.json
@@ -172,7 +172,7 @@
"publish-unpublish.dialog.publish.action": "פרסום",
"publish-unpublish.dialog.unpublish.message": "הפעולה תוביל ל{action} המוצר ולהסתרתו
ועלולה להשפיע על מערכות הצורכות את המוצר",
"publish-unpublish.dialog.unpublish.action": "ביטול פרסום",
-
+
"delete.dialog.message": "הפעולה תוביל ל{action} המוצר וכל חומריו ועלולה להשפיע על מערכות הצורכות את המוצר",
"delete.dialog.action": "מחיקת",
"delete.dialog.checkbox": "אישור מחיקה",
@@ -770,7 +770,7 @@
"Units.dms": "DMS",
"Units.arc_seconds": "ARC_SECONDS",
"Units.unknown": "UNKNOWN",
-
+
"UndulationModel.msl_egm96": "MSL_EGM96",
"UndulationModel.msl_egm2008": "MSL_EGM2008",
"UndulationModel.msl_dma10": "MSL_DMA10",
@@ -812,7 +812,7 @@
"lookupTable.hotAreas.sderot": "שדרות",
"lookupTable.hotAreas.syria": "סוריה",
"lookupTable.hotAreas.telAviv": "תל אביב",
-
+
"Transparency.transparent": "Transparent",
"Transparency.opaque": "Opaque",
@@ -839,10 +839,10 @@
"export-layer.exportSuccessContainer.jobId.title": "מזהה משימה",
"export-layer.export.button": "ייצא שכבה",
"export-layer.preview.button": "שערך ייצוא",
- "export-layer.selection-index.text":"בחירה",
- "export-layer.generalFields.text":"שדות כלליים",
- "export-layer.fileError.text":"בחירה מקובץ",
- "export-layer.serviceError.text":"שגיאה מהשרת",
+ "export-layer.selection-index.text": "בחירה",
+ "export-layer.generalFields.text": "שדות כלליים",
+ "export-layer.fileError.text": "בחירה מקובץ",
+ "export-layer.serviceError.text": "שגיאה מהשרת",
"export-layer.generalError.text": "שגיאה כללית",
"export-layer.description.field": "תיאור",
"export-layer.zoomLevel.field": "רמת זום",
diff --git a/src/common/models/country.dictionary.ts b/src/common/models/country.dictionary.ts
index 7885f0d5b..829c9650c 100644
--- a/src/common/models/country.dictionary.ts
+++ b/src/common/models/country.dictionary.ts
@@ -2,225 +2,741 @@ import { IDictionary } from './dictionary';
/* eslint-disable @typescript-eslint/naming-convention */
export const CountryDictionary: IDictionary = {
- UGA: { en: "UGANDA", he: "אוגנדה", icon: "mc-icon-Close glow-missing-icon"},
- UZB: { en: "UZBEKISTAN", he: "אוזבקיסטן", icon: "mc-icon-Close glow-missing-icon"},
- AUT: { en: "AUSTRIA", he: "אוסטריה", icon: "mc-icon-Close glow-missing-icon"},
- AUS: { en: "AUSTRALIA", he: "אוסטרליה", icon: "mc-icon-Close glow-missing-icon"},
- UKR: { en: "UKRAINE", he: "אוקראינה", icon: "mc-icon-Close glow-missing-icon"},
- URY: { en: "URUGUAY", he: "אורגוואי", icon: "mc-icon-Close glow-missing-icon"},
- AZE: { en: "AZERBAIJAN", he: "אזרביג'אן", icon: "mc-icon-Close glow-missing-icon"},
- ARE: { en: "UNITED ARAB EMIR", he: "איחוד האמירויות הערבית", icon: "mc-icon-Close glow-missing-icon"},
- ITA: { en: "ITALY", he: "איטליה", icon: "mc-icon-Close glow-missing-icon"},
- VIR: { en: "VIRGIN ISLAND", he: "איי הבתולה", icon: "mc-icon-Close glow-missing-icon"},
- WLF: { en: "WALLIS FUTUNA ISL", he: "איי ווליס ופוטונה", icon: "mc-icon-Close glow-missing-icon"},
- TCA: { en: "TORKAS ISLAND", he: "איי טורקס וקייקוס", icon: "mc-icon-Close glow-missing-icon"},
- MHL: { en: "MARSHALL ISLANDS", he: "איי מרשל", icon: "mc-icon-Close glow-missing-icon"},
- NFK: { en: "NORFOLK ISLA", he: "איי נורפולק", icon: "mc-icon-Close glow-missing-icon"},
- SYC: { en: "SEYCHELLES", he: "איי סיישל", icon: "mc-icon-Close glow-missing-icon"},
- FLK: { en: "FALKLAND", he: "איי פוקלנד", icon: "mc-icon-Close glow-missing-icon"},
- FJI: { en: "FIJI", he: "איי פיגי", icon: "mc-icon-Close glow-missing-icon"},
- COM: { en: "COMOROS ISLANDS", he: "איי קומורו", icon: "mc-icon-Close glow-missing-icon"},
- COK: { en: "COOK ISL", he: "איי קוק", icon: "mc-icon-Close glow-missing-icon"},
- CYM: { en: "CAYMAN ISLANDS", he: "איי קיימן", icon: "mc-icon-Close glow-missing-icon"},
- CPV: { en: "CAPE VERDE ISLANDS", he: "איי קייפ וורדה", icon: "mc-icon-Close glow-missing-icon"},
- SLB: { en: "SOLOMON ISLANDS", he: "איי שלמה הבריטיים", icon: "mc-icon-Close glow-missing-icon"},
- IDN: { en: "INDONESIA", he: "אינדונזיה", icon: "mc-icon-Close glow-missing-icon"},
- ISL: { en: "ICELAND", he: "איסלנד", icon: "mc-icon-Close glow-missing-icon"},
- IRL: { en: "IRELAND", he: "אירלנד", icon: "mc-icon-Close glow-missing-icon"},
- IRN: { en: "IRAN", he: "אירן", icon: "mc-icon-Close glow-missing-icon"},
- SLV: { en: "EL SALVADOR", he: "אל סלבדור", icon: "mc-icon-Close glow-missing-icon"},
- ALB: { en: "ALBANIA", he: "אלבניה", icon: "mc-icon-Close glow-missing-icon"},
- DZA: { en: "ALGERIA", he: "אלג'יריה", icon: "mc-icon-Close glow-missing-icon"},
- AGO: { en: "ANGOLA", he: "אנגולה", icon: "mc-icon-Close glow-missing-icon"},
- AND: { en: "ANDORRA", he: "אנדורה", icon: "mc-icon-Close glow-missing-icon"},
- ATG: { en: "ANTIGUA AND BARBUDA", he: "אנטיגואה וברבודה", icon: "mc-icon-Close glow-missing-icon"},
- EST: { en: "ESTONIA", he: "אסטוניה", icon: "mc-icon-Close glow-missing-icon"},
- AFG: { en: "AFGHANISTAN", he: "אפגניסטן", icon: "mc-icon-Close glow-missing-icon"},
- ECU: { en: "ECUADOR", he: "אקוואדור", icon: "mc-icon-Close glow-missing-icon"},
- ARG: { en: "ARGENTINA", he: "ארגנטינה", icon: "mc-icon-Close glow-missing-icon"},
- ERI: { en: "ERITREA", he: "אריתראה", icon: "mc-icon-Close glow-missing-icon"},
- ARM: { en: "ARM ENIA", he: "ארמניה", icon: "mc-icon-Close glow-missing-icon"},
- USA: { en: "UNITED STATES", he: "ארצות הברית", icon: "mc-icon-Close glow-missing-icon"},
- ETH: { en: "ETHIOPIA", he: "אתיופיה", icon: "mc-icon-Close glow-missing-icon"},
- BHS: { en: "BAHAMAS", he: "בהמס", icon: "mc-icon-Close glow-missing-icon"},
- BTN: { en: "BHUTAN", he: "בוטן", icon: "mc-icon-Close glow-missing-icon"},
- BWA: { en: "BOTSWANA", he: "בוטסוואנה", icon: "mc-icon-Close glow-missing-icon"},
- BGR: { en: "BULGARIA", he: "בולגריה", icon: "mc-icon-Close glow-missing-icon"},
- BOL: { en: "BOLIVIA", he: "בוליביה", icon: "mc-icon-Close glow-missing-icon"},
- BIH: { en: "BOSNIA HERZEGOVINA", he: "בוסניה הרצגובינה", icon: "mc-icon-Close glow-missing-icon"},
- BDI: { en: "BURUNDI", he: "בורונדי", icon: "mc-icon-Close glow-missing-icon"},
- BFA: { en: "BURKINA FASSO", he: "בורקינה פאסו", icon: "mc-icon-Close glow-missing-icon"},
- BHR: { en: "BAHREIN", he: "בחריין", icon: "mc-icon-Close glow-missing-icon"},
- BLR: { en: "BELARUS", he: "בלורוסיה", icon: "mc-icon-Close glow-missing-icon"},
- BEL: { en: "BELGIUM", he: "בלגיה", icon: "mc-icon-Close glow-missing-icon"},
- BLZ: { en: "BELIZE", he: "בליז", icon: "mc-icon-Close glow-missing-icon"},
- BGD: { en: "BANGLADESH", he: "בנגלדש", icon: "mc-icon-Close glow-missing-icon"},
- BEN: { en: "BENIN DAHOMEY", he: "בנין דהומ", icon: "mc-icon-Close glow-missing-icon"},
- BRB: { en: "BARBADOS", he: "ברבדוס", icon: "mc-icon-Close glow-missing-icon"},
- BRN: { en: "BRUNEI", he: "ברוניי", icon: "mc-icon-Close glow-missing-icon"},
- BRA: { en: "BRAZIL", he: "ברזיל", icon: "mc-icon-Close glow-missing-icon"},
- BMU: { en: "BERMUDA", he: "ברמודה", icon: "mc-icon-Close glow-missing-icon"},
- GEO: { en: "GEORGIA", he: "גאורגיה", icon: "mc-icon-Close glow-missing-icon"},
- GHA: { en: "GHANA", he: "גאנה", icon: "mc-icon-Close glow-missing-icon"},
- GAB: { en: "GABON", he: "גבון", icon: "mc-icon-Close glow-missing-icon"},
- GLP: { en: "GUADELOUPE", he: "גואדאלופ", icon: "mc-icon-Close glow-missing-icon"},
- GUM: { en: "GUAM", he: "גואם", icon: "mc-icon-Close glow-missing-icon"},
- GTM: { en: "GUATEMALA", he: "גווטאמלה", icon: "mc-icon-Close glow-missing-icon"},
- GUY: { en: "GUYANA", he: "גויאנה", icon: "mc-icon-Close glow-missing-icon"},
- GUF: { en: "FRENCH GUIANA", he: "גויאנה הצרפתית", icon: "mc-icon-Close glow-missing-icon"},
- DJI: { en: "DJIBOUTI", he: "גיבוטי", icon: "mc-icon-Close glow-missing-icon"},
- GIB: { en: "GIBRALTAR", he: "גיברלטר", icon: "mc-icon-Close glow-missing-icon"},
- GIN: { en: "GUINEA", he: "גינאה", icon: "mc-icon-Close glow-missing-icon"},
- GNB: { en: "GUINEA BISSAU", he: "גינאה ביסאו", icon: "mc-icon-Close glow-missing-icon"},
- GNQ: { en: "GUINEA EQ", he: "גינאה המשוונית", icon: "mc-icon-Close glow-missing-icon"},
- GMB: { en: "GAMBIA", he: "גמביה", icon: "mc-icon-Close glow-missing-icon"},
- JAM: { en: "JAMAICA", he: "ג'מייקה", icon: "mc-icon-Close glow-missing-icon"},
- DEU: { en: "GERMANY", he: "גרמניה", icon: "mc-icon-Close glow-missing-icon"},
- GRD: { en: "GRENADA", he: "גרנדה", icon: "mc-icon-Close glow-missing-icon"},
- DMA: { en: "DOMINICA", he: "דומיניקה", icon: "mc-icon-Close glow-missing-icon"},
- DNK: { en: "DENMARK", he: "דנמרק", icon: "mc-icon-Close glow-missing-icon"},
- ZAF: { en: "SOUTH AFRICA", he: "דרום אפריקה", icon: "mc-icon-Close glow-missing-icon"},
- SSD: { en: "REPUBLIC OF SOUTH SUDAN", he: "דרום סודאן", icon: "mc-icon-Close glow-missing-icon"},
- HTI: { en: "HAITI", he: "האיטי", icon: "mc-icon-Close glow-missing-icon"},
- IND: { en: "INDIA", he: "הודו", icon: "mc-icon-Close glow-missing-icon"},
- NLD: { en: "NETHERLANDS", he: "הולנד", icon: "mc-icon-Close glow-missing-icon"},
- HKG: { en: "HONG KONG", he: "הונג קונג", icon: "mc-icon-Close glow-missing-icon"},
- HUN: { en: "HUNGARY", he: "הונגריה", icon: "mc-icon-Close glow-missing-icon"},
- HND: { en: "HONDURAS", he: "הונדורס", icon: "mc-icon-Close glow-missing-icon"},
- GBR: { en: "UNITED KINGDOM", he: "הממלכה המאוחדת", icon: "mc-icon-Close glow-missing-icon"},
- DOM: { en: "DOMINICAN REPUBLIC", he: "הרפובליקה הדומיניקנית", icon: "mc-icon-Close glow-missing-icon"},
- CAF: { en: "CENTRAL AFRICAN REPUBLIC", he: "הרפובליקה המרכז אפריקנית", icon: "mc-icon-Close glow-missing-icon"},
- AYOSH: { en: "PALESTINIAN AUTHORITY AYOSH", he: "הרשות הפלסטינית איוש", icon: "mc-icon-Close glow-missing-icon"},
- GAZA: { en: "PALESTINIAN AUTHORITY GAZA", he: "הרשות הפלסטינית עזה", icon: "mc-icon-Close glow-missing-icon"},
- VNM: { en: "VIETNAM", he: "ויטנאם", icon: "mc-icon-Close glow-missing-icon"},
- VUT: { en: "VANUATU", he: "ונואטו", icon: "mc-icon-Close glow-missing-icon"},
- VEN: { en: "VENEZUELA", he: "ונצואלה", icon: "mc-icon-Close glow-missing-icon"},
- ZWE: { en: "ZIMBABWE", he: "זימבאבווה", icon: "mc-icon-Close glow-missing-icon"},
- ZMB: { en: "ZAMBIA", he: "זמביה", icon: "mc-icon-Close glow-missing-icon"},
- CIV: { en: "IVORY COAST", he: "חוף השנהב", icon: "mc-icon-Close glow-missing-icon"},
- TJK: { en: "TAJIKISTAN", he: "טג'יקיסטאן", icon: "mc-icon-Close glow-missing-icon"},
- TUV: { en: "TUVALU", he: "טובלו", icon: "mc-icon-Close glow-missing-icon"},
- TGO: { en: "TOGO", he: "טוגו", icon: "mc-icon-Close glow-missing-icon"},
- TON: { en: "TONGA", he: "טונגה", icon: "mc-icon-Close glow-missing-icon"},
- TWN: { en: "TAIWAN", he: "טיוואן", icon: "mc-icon-Close glow-missing-icon"},
- TZA: { en: "TANZANIA", he: "טנזניה", icon: "mc-icon-Close glow-missing-icon"},
- TTO: { en: "TRINIDAD AND TOBAGO", he: "טרינידד וטובגו", icon: "mc-icon-Close glow-missing-icon"},
- SER: { en: "YUGOSLAVIA", he: "יוגוסלביה", icon: "mc-icon-Close glow-missing-icon"},
- GRC: { en: "GREECE", he: "יוון", icon: "mc-icon-Close glow-missing-icon"},
- JPN: { en: "JAPAN", he: "יפן", icon: "mc-icon-Close glow-missing-icon"},
- JOR: { en: "JORDAN", he: "ירדן", icon: "mc-icon-Close glow-missing-icon"},
- ISR: { en: "ISRAEL", he: "ישראל", icon: "mc-icon-Close glow-missing-icon"},
- KWT: { en: "KUWAIT", he: "כווית", icon: "mc-icon-Close glow-missing-icon"},
- UNKNOWN: { en: "UNKNOWN", he: "לא ידוע", icon: "mc-icon-Close glow-missing-icon"},
- LAO: { en: "LAOS", he: "לאוס", icon: "mc-icon-Close glow-missing-icon"},
- LBN: { en: "LEBANON", he: "לבנון", icon: "mc-icon-Close glow-missing-icon"},
- LBY: { en: "LIBYA", he: "לוב", icon: "mc-icon-Close glow-missing-icon"},
- LUX: { en: "LUXEMBOURG", he: "לוכסמבורג", icon: "mc-icon-Close glow-missing-icon"},
- LVA: { en: "LATVIA", he: "לטביה", icon: "mc-icon-Close glow-missing-icon"},
- LBR: { en: "LIBERIA", he: "ליבריה", icon: "mc-icon-Close glow-missing-icon"},
- LTU: { en: "LITHUANIA", he: "ליטא", icon: "mc-icon-Close glow-missing-icon"},
- LIE: { en: "LIECHTENSTEIN", he: "ליכטנשטיין", icon: "mc-icon-Close glow-missing-icon"},
- LSO: { en: "LESOTHO", he: "לסוטו", icon: "mc-icon-Close glow-missing-icon"},
- MRT: { en: "MAURITANIA", he: "מאוריטניה", icon: "mc-icon-Close glow-missing-icon"},
- MUS: { en: "MAURITIUS", he: "מאוריציוס", icon: "mc-icon-Close glow-missing-icon"},
- MLI: { en: "MALI", he: "מאלי", icon: "mc-icon-Close glow-missing-icon"},
- MDG: { en: "MADAGASCAR", he: "מדגסקר", icon: "mc-icon-Close glow-missing-icon"},
- MOZ: { en: "MOZAMBIQUE", he: "מוזמביק", icon: "mc-icon-Close glow-missing-icon"},
- MDA: { en: "MOLDOVA", he: "מולדובה", icon: "mc-icon-Close glow-missing-icon"},
- MNG: { en: "MONGOLIA", he: "מונגוליה", icon: "mc-icon-Close glow-missing-icon"},
- MNE: { en: "MONTENEGRO", he: "מונטנגרו", icon: "mc-icon-Close glow-missing-icon"},
- MSR: { en: "MONTSERRAT", he: "מונסרת", icon: "mc-icon-Close glow-missing-icon"},
- MCO: { en: "MONACO", he: "מונקו", icon: "mc-icon-Close glow-missing-icon"},
- TMP: { en: "EAST TIMOR", he: "מזרח טימור", icon: "mc-icon-Close glow-missing-icon"},
- MMR: { en: "MYANMAR BURMA", he: "מיאנמר בורמה", icon: "mc-icon-Close glow-missing-icon"},
- FSM: { en: "MICRONESIA", he: "מיקרונזיה", icon: "mc-icon-Close glow-missing-icon"},
- MWI: { en: "MALAWI", he: "מלאווי", icon: "mc-icon-Close glow-missing-icon"},
- MDV: { en: "MALADIVES", he: "מלדיבים", icon: "mc-icon-Close glow-missing-icon"},
- MYS: { en: "MALAYSIA", he: "מלזיה", icon: "mc-icon-Close glow-missing-icon"},
- MLT: { en: "MALTA", he: "מלטה", icon: "mc-icon-Close glow-missing-icon"},
- EGY: { en: "EGYPT", he: "מצרים", icon: "mc-icon-Close glow-missing-icon"},
- MAC: { en: "MACAO", he: "מקאו", icon: "mc-icon-Close glow-missing-icon"},
- MKD: { en: "MACEDONIA", he: "מקדוניה", icon: "mc-icon-Close glow-missing-icon"},
- MEX: { en: "MEXICO", he: "מקסיקו", icon: "mc-icon-Close glow-missing-icon"},
- MAR: { en: "MOROCCO", he: "מרוקו", icon: "mc-icon-Close glow-missing-icon"},
- MTQ: { en: "MARTINIQUE", he: "מרטיניק", icon: "mc-icon-Close glow-missing-icon"},
- NRU: { en: "NAURU", he: "נאורו", icon: "mc-icon-Close glow-missing-icon"},
- NOR: { en: "NORWAY", he: "נורבגיה", icon: "mc-icon-Close glow-missing-icon"},
- NER: { en: "NIGER", he: "ניגר", icon: "mc-icon-Close glow-missing-icon"},
- NGA: { en: "NIGERIA", he: "ניגריה", icon: "mc-icon-Close glow-missing-icon"},
- NZL: { en: "NEW ZEALAND", he: "ניו זילנד", icon: "mc-icon-Close glow-missing-icon"},
- NIC: { en: "NICARAGUA", he: "ניקרגואה", icon: "mc-icon-Close glow-missing-icon"},
- NAM: { en: "NAMIBIA", he: "נמיביה", icon: "mc-icon-Close glow-missing-icon"},
- NPL: { en: "NEPAL", he: "נפאל", icon: "mc-icon-Close glow-missing-icon"},
- STP: { en: "SAO TOME AND PRINCIP", he: "סאו טומה ופרינציפה", icon: "mc-icon-Close glow-missing-icon"},
- SDN: { en: "SUDAN", he: "סודן", icon: "mc-icon-Close glow-missing-icon"},
- SWZ: { en: "SWAZILAND", he: "סווזילנד", icon: "mc-icon-Close glow-missing-icon"},
- SOM: { en: "SOMALIA", he: "סומליה", icon: "mc-icon-Close glow-missing-icon"},
- SYR: { en: "SYRIA", he: "סוריה", icon: "mc-icon-Close glow-missing-icon"},
- SUR: { en: "SURINAME", he: "סורינם", icon: "mc-icon-Close glow-missing-icon"},
- SHN: { en: "ST HELENA", he: "סט הלנה", icon: "mc-icon-Close glow-missing-icon"},
- VCT: { en: "ST VINCENT", he: "סט וינסנט", icon: "mc-icon-Close glow-missing-icon"},
- LCA: { en: "ST LUCIA", he: "סט לוציה", icon: "mc-icon-Close glow-missing-icon"},
- KNA: { en: "ST KITTS NEVIS", he: "סט קיטס ונביס", icon: "mc-icon-Close glow-missing-icon"},
- SLE: { en: "SIERRA LEONE", he: "סיירה ליאונה", icon: "mc-icon-Close glow-missing-icon"},
- CHN: { en: "CHINA", he: "סין", icon: "mc-icon-Close glow-missing-icon"},
- SGP: { en: "SINGAPORE", he: "סינגפור", icon: "mc-icon-Close glow-missing-icon"},
- SIK: { en: "SIKKIM", he: "סיקים", icon: "mc-icon-Close glow-missing-icon"},
- SVN: { en: "SLOVENIA", he: "סלובניה", icon: "mc-icon-Close glow-missing-icon"},
- SVK: { en: "SLOVAKIA", he: "סלובקיה", icon: "mc-icon-Close glow-missing-icon"},
- WSM: { en: "SAMOA", he: "סמואה", icon: "mc-icon-Close glow-missing-icon"},
- ASM: { en: "AMERICAN SAMOA", he: "סמואה האמריקאי", icon: "mc-icon-Close glow-missing-icon"},
- SMR: { en: "SAN MARINO", he: "סן מרינו", icon: "mc-icon-Close glow-missing-icon"},
- SEN: { en: "SENEGAL", he: "סנגל", icon: "mc-icon-Close glow-missing-icon"},
- ESP: { en: "SPAIN", he: "ספרד", icon: "mc-icon-Close glow-missing-icon"},
- SRB: { en: "SERBIA", he: "סרביה", icon: "mc-icon-Close glow-missing-icon"},
- LKA: { en: "SRI-LANKA", he: "סרי לנקה צילו", icon: "mc-icon-Close glow-missing-icon"},
- OMN: { en: "OMAN", he: "עומן", icon: "mc-icon-Close glow-missing-icon"},
- IRQ: { en: "IRAQ", he: "עירק", icon: "mc-icon-Close glow-missing-icon"},
- SAU: { en: "SAUDI ARABIA", he: "ערב הסעודית", icon: "mc-icon-Close glow-missing-icon"},
- POL: { en: "POLAND", he: "פולין", icon: "mc-icon-Close glow-missing-icon"},
- PYF: { en: "FRENCH POLYNESIA", he: "פולינזיה הצרפתית", icon: "mc-icon-Close glow-missing-icon"},
- PRI: { en: "PUERTO RICO", he: "פורטו ריקו", icon: "mc-icon-Close glow-missing-icon"},
- PRT: { en: "PORTUGAL", he: "פורטוגל", icon: "mc-icon-Close glow-missing-icon"},
- PHL: { en: "PHILIPPINES", he: "פיליפינים", icon: "mc-icon-Close glow-missing-icon"},
- FIN: { en: "FINLAND", he: "פינלנד", icon: "mc-icon-Close glow-missing-icon"},
- PLW: { en: "PALAU", he: "פלאו", icon: "mc-icon-Close glow-missing-icon"},
- PAN: { en: "PANAMA", he: "פנמה", icon: "mc-icon-Close glow-missing-icon"},
- PNG: { en: "PAPUA NEW GUINEA", he: "פפואה גינאה החדשה", icon: "mc-icon-Close glow-missing-icon"},
- PAK: { en: "PAKISTAN", he: "פקיסטן", icon: "mc-icon-Close glow-missing-icon"},
- PRY: { en: "PARAGUAY", he: "פרגוואי", icon: "mc-icon-Close glow-missing-icon"},
- PER: { en: "PERU", he: "פרו", icon: "mc-icon-Close glow-missing-icon"},
- TCD: { en: "CHAD", he: "צ'אד", icon: "mc-icon-Close glow-missing-icon"},
- CHL: { en: "CHILE", he: "צ'ילה", icon: "mc-icon-Close glow-missing-icon"},
- CSK: { en: "CZECHOSLOVAKIA", he: "צ'כוסלובקיה", icon: "mc-icon-Close glow-missing-icon"},
- CZE: { en: "CZECH REPUBLIC", he: "צ'כיה", icon: "mc-icon-Close glow-missing-icon"},
- FRA: { en: "FRANCE", he: "צרפת", icon: "mc-icon-Close glow-missing-icon"},
- CUB: { en: "CUBA", he: "קובה", icon: "mc-icon-Close glow-missing-icon"},
- COL: { en: "COLOMBIA", he: "קולומביה", icon: "mc-icon-Close glow-missing-icon"},
- COG: { en: "CONGO DEMO REP", he: "קונגו רפובליקה דמוקרטית", icon: "mc-icon-Close glow-missing-icon"},
- CRI: { en: "COSTA RICA", he: "קוסטה ריקה", icon: "mc-icon-Close glow-missing-icon"},
- KOR: { en: "S KOREA", he: "קוריאה הדרומית", icon: "mc-icon-Close glow-missing-icon"},
- PRK: { en: "N KOREA", he: "קוריאה הצפונית", icon: "mc-icon-Close glow-missing-icon"},
- KAZ: { en: "KAZAKHSTAN", he: "קזחסטאן", icon: "mc-icon-Close glow-missing-icon"},
- QAT: { en: "QATAR", he: "קטר", icon: "mc-icon-Close glow-missing-icon"},
- KGZ: { en: "KIRGHIZSTAN", he: "קירגיזסטאן", icon: "mc-icon-Close glow-missing-icon"},
- KIR: { en: "KIRIBATI", he: "קיריבטי", icon: "mc-icon-Close glow-missing-icon"},
- NCL: { en: "NEW CALEDONIA", he: "קלדוניה החדשה", icon: "mc-icon-Close glow-missing-icon"},
- KHM: { en: "CAMBODIA", he: "קמבודיה", icon: "mc-icon-Close glow-missing-icon"},
- CMR: { en: "CAMEROON", he: "קמרון", icon: "mc-icon-Close glow-missing-icon"},
- CAN: { en: "CANADA", he: "קנדה", icon: "mc-icon-Close glow-missing-icon"},
- KEN: { en: "KENYA", he: "קניה", icon: "mc-icon-Close glow-missing-icon"},
- CYP: { en: "CYPRUS", he: "קפריסין", icon: "mc-icon-Close glow-missing-icon"},
- HRV: { en: "CROATIA", he: "קרואטיה", icon: "mc-icon-Close glow-missing-icon"},
- REU: { en: "REUNION", he: "ראוניון", icon: "mc-icon-Close glow-missing-icon"},
- RWA: { en: "RWANDA", he: "רואנדה", icon: "mc-icon-Close glow-missing-icon"},
- ROM: { en: "ROMANIA", he: "רומניה", icon: "mc-icon-Close glow-missing-icon"},
- RUS: { en: "RUSSIAN FEDERATION", he: "רוסיה", icon: "mc-icon-Close glow-missing-icon"},
- SWE: { en: "SWEDEN", he: "שוודיה", icon: "mc-icon-Close glow-missing-icon"},
- CHE: { en: "SWITZERLAND", he: "שוויץ", icon: "mc-icon-Close glow-missing-icon"},
- THA: { en: "THAILAND", he: "תאילנד", icon: "mc-icon-Close glow-missing-icon"},
- TUN: { en: "TUNISIA", he: "תוניסיה", icon: "mc-icon-Close glow-missing-icon"},
- TUR: { en: "TURKEY", he: "תורכיה", icon: "mc-icon-Close glow-missing-icon"},
- TKM: { en: "TURKMENISTAN", he: "תורכמניסטאן", icon: "mc-icon-Close glow-missing-icon"},
- YEM: { en: "YEMEN", he: "תימן", icon: "mc-icon-Close glow-missing-icon"}
-};
\ No newline at end of file
+ UGA: { en: 'UGANDA', he: 'אוגנדה', icon: 'mc-icon-Close glow-missing-icon' },
+ UZB: {
+ en: 'UZBEKISTAN',
+ he: 'אוזבקיסטן',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ AUT: {
+ en: 'AUSTRIA',
+ he: 'אוסטריה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ AUS: {
+ en: 'AUSTRALIA',
+ he: 'אוסטרליה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ UKR: {
+ en: 'UKRAINE',
+ he: 'אוקראינה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ URY: {
+ en: 'URUGUAY',
+ he: 'אורגוואי',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ AZE: {
+ en: 'AZERBAIJAN',
+ he: "אזרביג'אן",
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ ARE: {
+ en: 'UNITED ARAB EMIR',
+ he: 'איחוד האמירויות הערבית',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ ITA: { en: 'ITALY', he: 'איטליה', icon: 'mc-icon-Close glow-missing-icon' },
+ VIR: {
+ en: 'VIRGIN ISLAND',
+ he: 'איי הבתולה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ WLF: {
+ en: 'WALLIS FUTUNA ISL',
+ he: 'איי ווליס ופוטונה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ TCA: {
+ en: 'TORKAS ISLAND',
+ he: 'איי טורקס וקייקוס',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ MHL: {
+ en: 'MARSHALL ISLANDS',
+ he: 'איי מרשל',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ NFK: {
+ en: 'NORFOLK ISLA',
+ he: 'איי נורפולק',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ SYC: {
+ en: 'SEYCHELLES',
+ he: 'איי סיישל',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ FLK: {
+ en: 'FALKLAND',
+ he: 'איי פוקלנד',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ FJI: { en: 'FIJI', he: 'איי פיגי', icon: 'mc-icon-Close glow-missing-icon' },
+ COM: {
+ en: 'COMOROS ISLANDS',
+ he: 'איי קומורו',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ COK: {
+ en: 'COOK ISL',
+ he: 'איי קוק',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ CYM: {
+ en: 'CAYMAN ISLANDS',
+ he: 'איי קיימן',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ CPV: {
+ en: 'CAPE VERDE ISLANDS',
+ he: 'איי קייפ וורדה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ SLB: {
+ en: 'SOLOMON ISLANDS',
+ he: 'איי שלמה הבריטיים',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ IDN: {
+ en: 'INDONESIA',
+ he: 'אינדונזיה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ ISL: { en: 'ICELAND', he: 'איסלנד', icon: 'mc-icon-Close glow-missing-icon' },
+ IRL: { en: 'IRELAND', he: 'אירלנד', icon: 'mc-icon-Close glow-missing-icon' },
+ IRN: { en: 'IRAN', he: 'אירן', icon: 'mc-icon-Close glow-missing-icon' },
+ SLV: {
+ en: 'EL SALVADOR',
+ he: 'אל סלבדור',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ ALB: { en: 'ALBANIA', he: 'אלבניה', icon: 'mc-icon-Close glow-missing-icon' },
+ DZA: {
+ en: 'ALGERIA',
+ he: "אלג'יריה",
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ AGO: { en: 'ANGOLA', he: 'אנגולה', icon: 'mc-icon-Close glow-missing-icon' },
+ AND: { en: 'ANDORRA', he: 'אנדורה', icon: 'mc-icon-Close glow-missing-icon' },
+ ATG: {
+ en: 'ANTIGUA AND BARBUDA',
+ he: 'אנטיגואה וברבודה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ EST: {
+ en: 'ESTONIA',
+ he: 'אסטוניה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ AFG: {
+ en: 'AFGHANISTAN',
+ he: 'אפגניסטן',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ ECU: {
+ en: 'ECUADOR',
+ he: 'אקוואדור',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ ARG: {
+ en: 'ARGENTINA',
+ he: 'ארגנטינה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ ERI: {
+ en: 'ERITREA',
+ he: 'אריתראה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ ARM: {
+ en: 'ARM ENIA',
+ he: 'ארמניה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ USA: {
+ en: 'UNITED STATES',
+ he: 'ארצות הברית',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ ETH: {
+ en: 'ETHIOPIA',
+ he: 'אתיופיה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ BHS: { en: 'BAHAMAS', he: 'בהמס', icon: 'mc-icon-Close glow-missing-icon' },
+ BTN: { en: 'BHUTAN', he: 'בוטן', icon: 'mc-icon-Close glow-missing-icon' },
+ BWA: {
+ en: 'BOTSWANA',
+ he: 'בוטסוואנה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ BGR: {
+ en: 'BULGARIA',
+ he: 'בולגריה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ BOL: {
+ en: 'BOLIVIA',
+ he: 'בוליביה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ BIH: {
+ en: 'BOSNIA HERZEGOVINA',
+ he: 'בוסניה הרצגובינה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ BDI: {
+ en: 'BURUNDI',
+ he: 'בורונדי',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ BFA: {
+ en: 'BURKINA FASSO',
+ he: 'בורקינה פאסו',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ BHR: { en: 'BAHREIN', he: 'בחריין', icon: 'mc-icon-Close glow-missing-icon' },
+ BLR: {
+ en: 'BELARUS',
+ he: 'בלורוסיה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ BEL: { en: 'BELGIUM', he: 'בלגיה', icon: 'mc-icon-Close glow-missing-icon' },
+ BLZ: { en: 'BELIZE', he: 'בליז', icon: 'mc-icon-Close glow-missing-icon' },
+ BGD: {
+ en: 'BANGLADESH',
+ he: 'בנגלדש',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ BEN: {
+ en: 'BENIN DAHOMEY',
+ he: 'בנין דהומ',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ BRB: {
+ en: 'BARBADOS',
+ he: 'ברבדוס',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ BRN: { en: 'BRUNEI', he: 'ברוניי', icon: 'mc-icon-Close glow-missing-icon' },
+ BRA: { en: 'BRAZIL', he: 'ברזיל', icon: 'mc-icon-Close glow-missing-icon' },
+ BMU: { en: 'BERMUDA', he: 'ברמודה', icon: 'mc-icon-Close glow-missing-icon' },
+ GEO: {
+ en: 'GEORGIA',
+ he: 'גאורגיה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ GHA: { en: 'GHANA', he: 'גאנה', icon: 'mc-icon-Close glow-missing-icon' },
+ GAB: { en: 'GABON', he: 'גבון', icon: 'mc-icon-Close glow-missing-icon' },
+ GLP: {
+ en: 'GUADELOUPE',
+ he: 'גואדאלופ',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ GUM: { en: 'GUAM', he: 'גואם', icon: 'mc-icon-Close glow-missing-icon' },
+ GTM: {
+ en: 'GUATEMALA',
+ he: 'גווטאמלה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ GUY: { en: 'GUYANA', he: 'גויאנה', icon: 'mc-icon-Close glow-missing-icon' },
+ GUF: {
+ en: 'FRENCH GUIANA',
+ he: 'גויאנה הצרפתית',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ DJI: {
+ en: 'DJIBOUTI',
+ he: 'גיבוטי',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ GIB: {
+ en: 'GIBRALTAR',
+ he: 'גיברלטר',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ GIN: { en: 'GUINEA', he: 'גינאה', icon: 'mc-icon-Close glow-missing-icon' },
+ GNB: {
+ en: 'GUINEA BISSAU',
+ he: 'גינאה ביסאו',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ GNQ: {
+ en: 'GUINEA EQ',
+ he: 'גינאה המשוונית',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ GMB: { en: 'GAMBIA', he: 'גמביה', icon: 'mc-icon-Close glow-missing-icon' },
+ JAM: {
+ en: 'JAMAICA',
+ he: "ג'מייקה",
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ DEU: { en: 'GERMANY', he: 'גרמניה', icon: 'mc-icon-Close glow-missing-icon' },
+ GRD: { en: 'GRENADA', he: 'גרנדה', icon: 'mc-icon-Close glow-missing-icon' },
+ DMA: {
+ en: 'DOMINICA',
+ he: 'דומיניקה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ DNK: { en: 'DENMARK', he: 'דנמרק', icon: 'mc-icon-Close glow-missing-icon' },
+ ZAF: {
+ en: 'SOUTH AFRICA',
+ he: 'דרום אפריקה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ SSD: {
+ en: 'REPUBLIC OF SOUTH SUDAN',
+ he: 'דרום סודאן',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ HTI: { en: 'HAITI', he: 'האיטי', icon: 'mc-icon-Close glow-missing-icon' },
+ IND: { en: 'INDIA', he: 'הודו', icon: 'mc-icon-Close glow-missing-icon' },
+ NLD: {
+ en: 'NETHERLANDS',
+ he: 'הולנד',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ HKG: {
+ en: 'HONG KONG',
+ he: 'הונג קונג',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ HUN: {
+ en: 'HUNGARY',
+ he: 'הונגריה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ HND: {
+ en: 'HONDURAS',
+ he: 'הונדורס',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ GBR: {
+ en: 'UNITED KINGDOM',
+ he: 'הממלכה המאוחדת',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ DOM: {
+ en: 'DOMINICAN REPUBLIC',
+ he: 'הרפובליקה הדומיניקנית',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ CAF: {
+ en: 'CENTRAL AFRICAN REPUBLIC',
+ he: 'הרפובליקה המרכז אפריקנית',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ AYOSH: {
+ en: 'PALESTINIAN AUTHORITY AYOSH',
+ he: 'הרשות הפלסטינית איוש',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ GAZA: {
+ en: 'PALESTINIAN AUTHORITY GAZA',
+ he: 'הרשות הפלסטינית עזה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ VNM: { en: 'VIETNAM', he: 'ויטנאם', icon: 'mc-icon-Close glow-missing-icon' },
+ VUT: { en: 'VANUATU', he: 'ונואטו', icon: 'mc-icon-Close glow-missing-icon' },
+ VEN: {
+ en: 'VENEZUELA',
+ he: 'ונצואלה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ ZWE: {
+ en: 'ZIMBABWE',
+ he: 'זימבאבווה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ ZMB: { en: 'ZAMBIA', he: 'זמביה', icon: 'mc-icon-Close glow-missing-icon' },
+ CIV: {
+ en: 'IVORY COAST',
+ he: 'חוף השנהב',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ TJK: {
+ en: 'TAJIKISTAN',
+ he: "טג'יקיסטאן",
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ TUV: { en: 'TUVALU', he: 'טובלו', icon: 'mc-icon-Close glow-missing-icon' },
+ TGO: { en: 'TOGO', he: 'טוגו', icon: 'mc-icon-Close glow-missing-icon' },
+ TON: { en: 'TONGA', he: 'טונגה', icon: 'mc-icon-Close glow-missing-icon' },
+ TWN: { en: 'TAIWAN', he: 'טיוואן', icon: 'mc-icon-Close glow-missing-icon' },
+ TZA: {
+ en: 'TANZANIA',
+ he: 'טנזניה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ TTO: {
+ en: 'TRINIDAD AND TOBAGO',
+ he: 'טרינידד וטובגו',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ SER: {
+ en: 'YUGOSLAVIA',
+ he: 'יוגוסלביה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ GRC: { en: 'GREECE', he: 'יוון', icon: 'mc-icon-Close glow-missing-icon' },
+ JPN: { en: 'JAPAN', he: 'יפן', icon: 'mc-icon-Close glow-missing-icon' },
+ JOR: { en: 'JORDAN', he: 'ירדן', icon: 'mc-icon-Close glow-missing-icon' },
+ ISR: { en: 'ISRAEL', he: 'ישראל', icon: 'mc-icon-Close glow-missing-icon' },
+ KWT: { en: 'KUWAIT', he: 'כווית', icon: 'mc-icon-Close glow-missing-icon' },
+ UNKNOWN: {
+ en: 'UNKNOWN',
+ he: 'לא ידוע',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ LAO: { en: 'LAOS', he: 'לאוס', icon: 'mc-icon-Close glow-missing-icon' },
+ LBN: { en: 'LEBANON', he: 'לבנון', icon: 'mc-icon-Close glow-missing-icon' },
+ LBY: { en: 'LIBYA', he: 'לוב', icon: 'mc-icon-Close glow-missing-icon' },
+ LUX: {
+ en: 'LUXEMBOURG',
+ he: 'לוכסמבורג',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ LVA: { en: 'LATVIA', he: 'לטביה', icon: 'mc-icon-Close glow-missing-icon' },
+ LBR: { en: 'LIBERIA', he: 'ליבריה', icon: 'mc-icon-Close glow-missing-icon' },
+ LTU: { en: 'LITHUANIA', he: 'ליטא', icon: 'mc-icon-Close glow-missing-icon' },
+ LIE: {
+ en: 'LIECHTENSTEIN',
+ he: 'ליכטנשטיין',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ LSO: { en: 'LESOTHO', he: 'לסוטו', icon: 'mc-icon-Close glow-missing-icon' },
+ MRT: {
+ en: 'MAURITANIA',
+ he: 'מאוריטניה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ MUS: {
+ en: 'MAURITIUS',
+ he: 'מאוריציוס',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ MLI: { en: 'MALI', he: 'מאלי', icon: 'mc-icon-Close glow-missing-icon' },
+ MDG: {
+ en: 'MADAGASCAR',
+ he: 'מדגסקר',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ MOZ: {
+ en: 'MOZAMBIQUE',
+ he: 'מוזמביק',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ MDA: {
+ en: 'MOLDOVA',
+ he: 'מולדובה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ MNG: {
+ en: 'MONGOLIA',
+ he: 'מונגוליה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ MNE: {
+ en: 'MONTENEGRO',
+ he: 'מונטנגרו',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ MSR: {
+ en: 'MONTSERRAT',
+ he: 'מונסרת',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ MCO: { en: 'MONACO', he: 'מונקו', icon: 'mc-icon-Close glow-missing-icon' },
+ TMP: {
+ en: 'EAST TIMOR',
+ he: 'מזרח טימור',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ MMR: {
+ en: 'MYANMAR BURMA',
+ he: 'מיאנמר בורמה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ FSM: {
+ en: 'MICRONESIA',
+ he: 'מיקרונזיה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ MWI: { en: 'MALAWI', he: 'מלאווי', icon: 'mc-icon-Close glow-missing-icon' },
+ MDV: {
+ en: 'MALADIVES',
+ he: 'מלדיבים',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ MYS: { en: 'MALAYSIA', he: 'מלזיה', icon: 'mc-icon-Close glow-missing-icon' },
+ MLT: { en: 'MALTA', he: 'מלטה', icon: 'mc-icon-Close glow-missing-icon' },
+ EGY: { en: 'EGYPT', he: 'מצרים', icon: 'mc-icon-Close glow-missing-icon' },
+ MAC: { en: 'MACAO', he: 'מקאו', icon: 'mc-icon-Close glow-missing-icon' },
+ MKD: {
+ en: 'MACEDONIA',
+ he: 'מקדוניה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ MEX: { en: 'MEXICO', he: 'מקסיקו', icon: 'mc-icon-Close glow-missing-icon' },
+ MAR: { en: 'MOROCCO', he: 'מרוקו', icon: 'mc-icon-Close glow-missing-icon' },
+ MTQ: {
+ en: 'MARTINIQUE',
+ he: 'מרטיניק',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ NRU: { en: 'NAURU', he: 'נאורו', icon: 'mc-icon-Close glow-missing-icon' },
+ NOR: { en: 'NORWAY', he: 'נורבגיה', icon: 'mc-icon-Close glow-missing-icon' },
+ NER: { en: 'NIGER', he: 'ניגר', icon: 'mc-icon-Close glow-missing-icon' },
+ NGA: { en: 'NIGERIA', he: 'ניגריה', icon: 'mc-icon-Close glow-missing-icon' },
+ NZL: {
+ en: 'NEW ZEALAND',
+ he: 'ניו זילנד',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ NIC: {
+ en: 'NICARAGUA',
+ he: 'ניקרגואה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ NAM: { en: 'NAMIBIA', he: 'נמיביה', icon: 'mc-icon-Close glow-missing-icon' },
+ NPL: { en: 'NEPAL', he: 'נפאל', icon: 'mc-icon-Close glow-missing-icon' },
+ STP: {
+ en: 'SAO TOME AND PRINCIP',
+ he: 'סאו טומה ופרינציפה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ SDN: { en: 'SUDAN', he: 'סודן', icon: 'mc-icon-Close glow-missing-icon' },
+ SWZ: {
+ en: 'SWAZILAND',
+ he: 'סווזילנד',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ SOM: { en: 'SOMALIA', he: 'סומליה', icon: 'mc-icon-Close glow-missing-icon' },
+ SYR: { en: 'SYRIA', he: 'סוריה', icon: 'mc-icon-Close glow-missing-icon' },
+ SUR: {
+ en: 'SURINAME',
+ he: 'סורינם',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ SHN: {
+ en: 'ST HELENA',
+ he: 'סט הלנה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ VCT: {
+ en: 'ST VINCENT',
+ he: 'סט וינסנט',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ LCA: {
+ en: 'ST LUCIA',
+ he: 'סט לוציה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ KNA: {
+ en: 'ST KITTS NEVIS',
+ he: 'סט קיטס ונביס',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ SLE: {
+ en: 'SIERRA LEONE',
+ he: 'סיירה ליאונה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ CHN: { en: 'CHINA', he: 'סין', icon: 'mc-icon-Close glow-missing-icon' },
+ SGP: {
+ en: 'SINGAPORE',
+ he: 'סינגפור',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ SIK: { en: 'SIKKIM', he: 'סיקים', icon: 'mc-icon-Close glow-missing-icon' },
+ SVN: {
+ en: 'SLOVENIA',
+ he: 'סלובניה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ SVK: {
+ en: 'SLOVAKIA',
+ he: 'סלובקיה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ WSM: { en: 'SAMOA', he: 'סמואה', icon: 'mc-icon-Close glow-missing-icon' },
+ ASM: {
+ en: 'AMERICAN SAMOA',
+ he: 'סמואה האמריקאי',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ SMR: {
+ en: 'SAN MARINO',
+ he: 'סן מרינו',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ SEN: { en: 'SENEGAL', he: 'סנגל', icon: 'mc-icon-Close glow-missing-icon' },
+ ESP: { en: 'SPAIN', he: 'ספרד', icon: 'mc-icon-Close glow-missing-icon' },
+ SRB: { en: 'SERBIA', he: 'סרביה', icon: 'mc-icon-Close glow-missing-icon' },
+ LKA: {
+ en: 'SRI-LANKA',
+ he: 'סרי לנקה צילו',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ OMN: { en: 'OMAN', he: 'עומן', icon: 'mc-icon-Close glow-missing-icon' },
+ IRQ: { en: 'IRAQ', he: 'עירק', icon: 'mc-icon-Close glow-missing-icon' },
+ SAU: {
+ en: 'SAUDI ARABIA',
+ he: 'ערב הסעודית',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ POL: { en: 'POLAND', he: 'פולין', icon: 'mc-icon-Close glow-missing-icon' },
+ PYF: {
+ en: 'FRENCH POLYNESIA',
+ he: 'פולינזיה הצרפתית',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ PRI: {
+ en: 'PUERTO RICO',
+ he: 'פורטו ריקו',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ PRT: {
+ en: 'PORTUGAL',
+ he: 'פורטוגל',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ PHL: {
+ en: 'PHILIPPINES',
+ he: 'פיליפינים',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ FIN: { en: 'FINLAND', he: 'פינלנד', icon: 'mc-icon-Close glow-missing-icon' },
+ PLW: { en: 'PALAU', he: 'פלאו', icon: 'mc-icon-Close glow-missing-icon' },
+ PAN: { en: 'PANAMA', he: 'פנמה', icon: 'mc-icon-Close glow-missing-icon' },
+ PNG: {
+ en: 'PAPUA NEW GUINEA',
+ he: 'פפואה גינאה החדשה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ PAK: {
+ en: 'PAKISTAN',
+ he: 'פקיסטן',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ PRY: {
+ en: 'PARAGUAY',
+ he: 'פרגוואי',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ PER: { en: 'PERU', he: 'פרו', icon: 'mc-icon-Close glow-missing-icon' },
+ TCD: { en: 'CHAD', he: "צ'אד", icon: 'mc-icon-Close glow-missing-icon' },
+ CHL: { en: 'CHILE', he: "צ'ילה", icon: 'mc-icon-Close glow-missing-icon' },
+ CSK: {
+ en: 'CZECHOSLOVAKIA',
+ he: "צ'כוסלובקיה",
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ CZE: {
+ en: 'CZECH REPUBLIC',
+ he: "צ'כיה",
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ FRA: { en: 'FRANCE', he: 'צרפת', icon: 'mc-icon-Close glow-missing-icon' },
+ CUB: { en: 'CUBA', he: 'קובה', icon: 'mc-icon-Close glow-missing-icon' },
+ COL: {
+ en: 'COLOMBIA',
+ he: 'קולומביה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ COG: {
+ en: 'CONGO DEMO REP',
+ he: 'קונגו רפובליקה דמוקרטית',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ CRI: {
+ en: 'COSTA RICA',
+ he: 'קוסטה ריקה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ KOR: {
+ en: 'S KOREA',
+ he: 'קוריאה הדרומית',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ PRK: {
+ en: 'N KOREA',
+ he: 'קוריאה הצפונית',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ KAZ: {
+ en: 'KAZAKHSTAN',
+ he: 'קזחסטאן',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ QAT: { en: 'QATAR', he: 'קטר', icon: 'mc-icon-Close glow-missing-icon' },
+ KGZ: {
+ en: 'KIRGHIZSTAN',
+ he: 'קירגיזסטאן',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ KIR: {
+ en: 'KIRIBATI',
+ he: 'קיריבטי',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ NCL: {
+ en: 'NEW CALEDONIA',
+ he: 'קלדוניה החדשה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ KHM: {
+ en: 'CAMBODIA',
+ he: 'קמבודיה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ CMR: { en: 'CAMEROON', he: 'קמרון', icon: 'mc-icon-Close glow-missing-icon' },
+ CAN: { en: 'CANADA', he: 'קנדה', icon: 'mc-icon-Close glow-missing-icon' },
+ KEN: { en: 'KENYA', he: 'קניה', icon: 'mc-icon-Close glow-missing-icon' },
+ CYP: { en: 'CYPRUS', he: 'קפריסין', icon: 'mc-icon-Close glow-missing-icon' },
+ HRV: {
+ en: 'CROATIA',
+ he: 'קרואטיה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ REU: {
+ en: 'REUNION',
+ he: 'ראוניון',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ RWA: { en: 'RWANDA', he: 'רואנדה', icon: 'mc-icon-Close glow-missing-icon' },
+ ROM: { en: 'ROMANIA', he: 'רומניה', icon: 'mc-icon-Close glow-missing-icon' },
+ RUS: {
+ en: 'RUSSIAN FEDERATION',
+ he: 'רוסיה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ SWE: { en: 'SWEDEN', he: 'שוודיה', icon: 'mc-icon-Close glow-missing-icon' },
+ CHE: {
+ en: 'SWITZERLAND',
+ he: 'שוויץ',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ THA: {
+ en: 'THAILAND',
+ he: 'תאילנד',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ TUN: {
+ en: 'TUNISIA',
+ he: 'תוניסיה',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ TUR: { en: 'TURKEY', he: 'תורכיה', icon: 'mc-icon-Close glow-missing-icon' },
+ TKM: {
+ en: 'TURKMENISTAN',
+ he: 'תורכמניסטאן',
+ icon: 'mc-icon-Close glow-missing-icon',
+ },
+ YEM: { en: 'YEMEN', he: 'תימן', icon: 'mc-icon-Close glow-missing-icon' },
+};
diff --git a/src/common/models/country.enum.ts b/src/common/models/country.enum.ts
index 793215960..b1e84c6db 100644
--- a/src/common/models/country.enum.ts
+++ b/src/common/models/country.enum.ts
@@ -220,4 +220,4 @@ export enum Country {
TUR = 'TUR',
TKM = 'TKM',
YEM = 'YEM',
-};
\ No newline at end of file
+}
diff --git a/src/common/models/dictionary.ts b/src/common/models/dictionary.ts
index eae0a0476..db3a9ae3a 100644
--- a/src/common/models/dictionary.ts
+++ b/src/common/models/dictionary.ts
@@ -6,4 +6,4 @@ export interface IDictionaryValue {
export interface IDictionary {
[key: string]: IDictionaryValue;
-}
\ No newline at end of file
+}
diff --git a/src/common/models/domain.ts b/src/common/models/domain.ts
index 46246cb1a..0928394e2 100644
--- a/src/common/models/domain.ts
+++ b/src/common/models/domain.ts
@@ -6,4 +6,4 @@ export enum Domain {
'3D' = '3D',
DEM = 'DEM',
VECTOR = 'VECTOR',
-}
\ No newline at end of file
+}
diff --git a/src/common/models/job-errors-summary.raster.ts b/src/common/models/job-errors-summary.raster.ts
index 5f23b31de..fea6aba61 100644
--- a/src/common/models/job-errors-summary.raster.ts
+++ b/src/common/models/job-errors-summary.raster.ts
@@ -40,11 +40,11 @@ export type RasterErrorsSummary = {
smallGeometries: {
exceeded: boolean;
};
- }
+ };
};
// #endregion to be removed
export type RasterErrorCount = {
count?: number;
exceeded?: boolean;
-}
+};
diff --git a/src/common/models/link-type.enum.ts b/src/common/models/link-type.enum.ts
index 8a20f8940..3916dbd5b 100644
--- a/src/common/models/link-type.enum.ts
+++ b/src/common/models/link-type.enum.ts
@@ -14,5 +14,5 @@ export enum LinkType {
THUMBNAIL_L = 'THUMBNAIL_L',
LEGEND_DOC = 'LEGEND_DOC',
LEGEND_IMG = 'LEGEND_IMG',
- LEGEND = 'LEGEND'
-}
\ No newline at end of file
+ LEGEND = 'LEGEND',
+}
diff --git a/src/common/models/mode.enum.ts b/src/common/models/mode.enum.ts
index 19200eb42..d6668d732 100644
--- a/src/common/models/mode.enum.ts
+++ b/src/common/models/mode.enum.ts
@@ -4,5 +4,5 @@ export enum Mode {
EDIT = 'Edit',
UPDATE = 'Update',
EXPORT = 'Export',
- DELETE = 'Delete'
+ DELETE = 'Delete',
}
diff --git a/src/common/models/raster-ingestion-files-structure.ts b/src/common/models/raster-ingestion-files-structure.ts
index 5fc757c8b..bdde0e811 100644
--- a/src/common/models/raster-ingestion-files-structure.ts
+++ b/src/common/models/raster-ingestion-files-structure.ts
@@ -1,6 +1,6 @@
// RASTER GENERAL CONFIGURATION
-export type RasterFileTypeConfig = "data" | "product" | "shapeMetadata";
+export type RasterFileTypeConfig = 'data' | 'product' | 'shapeMetadata';
// FIELD selectablePattern can receive letters, and may optionally end with an '*' character,
// which acts as a wildcard to match any sequence of characters following the prefix in the file name.
@@ -12,4 +12,7 @@ interface IRasterFileGroupConfig {
selectablePattern: string;
}
-export type IRasterIngestionFilesStructureConfig = Record;
\ No newline at end of file
+export type IRasterIngestionFilesStructureConfig = Record<
+ RasterFileTypeConfig,
+ IRasterFileGroupConfig
+>;
diff --git a/src/common/models/raster-job.ts b/src/common/models/raster-job.ts
index 072343748..eadaebf86 100644
--- a/src/common/models/raster-job.ts
+++ b/src/common/models/raster-job.ts
@@ -1,5 +1,5 @@
export enum RasterIngestionJobType {
NEW = 'Ingestion_New',
UPDATE = 'Ingestion_Update',
- SWAP_UPDATE = 'Ingestion_Swap_Update'
-}
\ No newline at end of file
+ SWAP_UPDATE = 'Ingestion_Swap_Update',
+}
diff --git a/src/common/ui-descriptors/helper.ts b/src/common/ui-descriptors/helper.ts
index 863fe9436..6ebdc060e 100644
--- a/src/common/ui-descriptors/helper.ts
+++ b/src/common/ui-descriptors/helper.ts
@@ -2,6 +2,8 @@ import { LinkModelType } from '../../discrete-layer/models';
import { ILayerImage } from '../../discrete-layer/models/layerImage';
import { UiDescriptorsTypeName, UiFieldDescriptor } from './type';
-export const isUiDescriptor = (layerRecord?: ILayerImage | LinkModelType | null | UiFieldDescriptor): layerRecord is UiFieldDescriptor => {
+export const isUiDescriptor = (
+ layerRecord?: ILayerImage | LinkModelType | null | UiFieldDescriptor
+): layerRecord is UiFieldDescriptor => {
return layerRecord?.__typename === UiDescriptorsTypeName;
};
diff --git a/src/common/ui-descriptors/resolution/resolutionDegree.ts b/src/common/ui-descriptors/resolution/resolutionDegree.ts
index 6443cf4ab..e08371f1e 100644
--- a/src/common/ui-descriptors/resolution/resolutionDegree.ts
+++ b/src/common/ui-descriptors/resolution/resolutionDegree.ts
@@ -1,82 +1,82 @@
export const resolutionDegree = {
- "uiDescriptorFieldType": "resolution",
- "autocomplete": null,
- "lookupTable": "zoomlevelresolutions",
- "lookupExcludeFields": null,
- "fieldName": "resolutionDegree",
- "queryableName": "",
- "label": "field-names.raster.maxResolutionDeg",
- "order": 999,
- "fullWidth": null,
- "rows": null,
- "infoMsgCode": [
- "info-field-tooltip.maxResolutionDeg.tooltip",
- "info-general-tooltip.required",
- "info-field-tooltip.maxResolutionDeg.min",
- "info-field-tooltip.maxResolutionDeg.max"
+ uiDescriptorFieldType: 'resolution',
+ autocomplete: null,
+ lookupTable: 'zoomlevelresolutions',
+ lookupExcludeFields: null,
+ fieldName: 'resolutionDegree',
+ queryableName: '',
+ label: 'field-names.raster.maxResolutionDeg',
+ order: 999,
+ fullWidth: null,
+ rows: null,
+ infoMsgCode: [
+ 'info-field-tooltip.maxResolutionDeg.tooltip',
+ 'info-general-tooltip.required',
+ 'info-field-tooltip.maxResolutionDeg.min',
+ 'info-field-tooltip.maxResolutionDeg.max',
],
- "isManuallyEditable": null,
- "isSortable": null,
- "isRequired": false,
- "isAutoGenerated": null,
- "isLifecycleEnvolved": true,
- "isCopyable": null,
- "isDisabled": null,
- "isCreateEssential": null,
- "isUpdateEssential": null,
- "isMultiSelection": null,
- "dateGranularity": null,
- "shapeFileMapping": null,
- "updateRules": null,
- "enumValues": null,
- "subFields": null,
- "validation": [
+ isManuallyEditable: null,
+ isSortable: null,
+ isRequired: false,
+ isAutoGenerated: null,
+ isLifecycleEnvolved: true,
+ isCopyable: null,
+ isDisabled: null,
+ isCreateEssential: null,
+ isUpdateEssential: null,
+ isMultiSelection: null,
+ dateGranularity: null,
+ shapeFileMapping: null,
+ updateRules: null,
+ enumValues: null,
+ subFields: null,
+ validation: [
{
- "valueType": "FIELD",
- "errorMsgCode": "DUMMY_NOT_IN_USE",
- "min": null,
- "max": "resolutionDegreeMaxValue",
- "minLength": null,
- "maxLength": null,
- "pattern": null,
- "errorMsgTranslation": null,
- "required": null,
- "json": null
+ valueType: 'FIELD',
+ errorMsgCode: 'DUMMY_NOT_IN_USE',
+ min: null,
+ max: 'resolutionDegreeMaxValue',
+ minLength: null,
+ maxLength: null,
+ pattern: null,
+ errorMsgTranslation: null,
+ required: null,
+ json: null,
},
{
- "valueType": "VALUE",
- "errorMsgCode": "validation-field.maxResolutionDeg.min",
- "min": "1.67638063430786e-7",
- "max": null,
- "minLength": null,
- "maxLength": null,
- "pattern": null,
- "errorMsgTranslation": null,
- "required": null,
- "json": null
+ valueType: 'VALUE',
+ errorMsgCode: 'validation-field.maxResolutionDeg.min',
+ min: '1.67638063430786e-7',
+ max: null,
+ minLength: null,
+ maxLength: null,
+ pattern: null,
+ errorMsgTranslation: null,
+ required: null,
+ json: null,
},
{
- "valueType": "VALUE",
- "errorMsgCode": "validation-field.maxResolutionDeg.max",
- "min": null,
- "max": "0.703125",
- "minLength": null,
- "maxLength": null,
- "pattern": null,
- "errorMsgTranslation": null,
- "required": null,
- "json": null
- }
+ valueType: 'VALUE',
+ errorMsgCode: 'validation-field.maxResolutionDeg.max',
+ min: null,
+ max: '0.703125',
+ minLength: null,
+ maxLength: null,
+ pattern: null,
+ errorMsgTranslation: null,
+ required: null,
+ json: null,
+ },
],
- "isFilterable": null,
- "isBriefField": null,
- "isInfoTooltip": null,
- "lookupTableBinding": {
- "valueFromPropertyName": "resolutionDeg"
+ isFilterable: null,
+ isBriefField: null,
+ isInfoTooltip: null,
+ lookupTableBinding: {
+ valueFromPropertyName: 'resolutionDeg',
},
- "dependentField": {
- "name": "resolutionMeter",
- "valueFromPropertyName": "resolutionMeter"
+ dependentField: {
+ name: 'resolutionMeter',
+ valueFromPropertyName: 'resolutionMeter',
},
- "default": null
+ default: null,
};
diff --git a/src/common/ui-descriptors/resolution/resolutionMeter.ts b/src/common/ui-descriptors/resolution/resolutionMeter.ts
index d2c315b8a..646998505 100644
--- a/src/common/ui-descriptors/resolution/resolutionMeter.ts
+++ b/src/common/ui-descriptors/resolution/resolutionMeter.ts
@@ -1,66 +1,66 @@
export const resolutionMeter = {
- "uiDescriptorFieldType": "number",
- "autocomplete": null,
- "lookupTable": null,
- "lookupExcludeFields": null,
- "fieldName": "resolutionMeter",
- "queryableName": "",
- "label": "field-names.raster.maxResolutionMeter",
- "order": 999,
- "fullWidth": null,
- "rows": null,
- "infoMsgCode": [
- "info-general-tooltip.required",
- "info-field-tooltip.maxResolutionMeter.min",
- "info-field-tooltip.maxResolutionMeter.max"
+ uiDescriptorFieldType: 'number',
+ autocomplete: null,
+ lookupTable: null,
+ lookupExcludeFields: null,
+ fieldName: 'resolutionMeter',
+ queryableName: '',
+ label: 'field-names.raster.maxResolutionMeter',
+ order: 999,
+ fullWidth: null,
+ rows: null,
+ infoMsgCode: [
+ 'info-general-tooltip.required',
+ 'info-field-tooltip.maxResolutionMeter.min',
+ 'info-field-tooltip.maxResolutionMeter.max',
],
- "isManuallyEditable": null,
- "isSortable": null,
- "isRequired": false,
- "isAutoGenerated": null,
- "isLifecycleEnvolved": true,
- "isCopyable": null,
- "isDisabled": true,
- "isCreateEssential": null,
- "isUpdateEssential": null,
- "isMultiSelection": null,
- "dateGranularity": null,
- "shapeFileMapping": null,
- "updateRules": null,
- "enumValues": null,
- "subFields": null,
- "validation": [
+ isManuallyEditable: null,
+ isSortable: null,
+ isRequired: false,
+ isAutoGenerated: null,
+ isLifecycleEnvolved: true,
+ isCopyable: null,
+ isDisabled: true,
+ isCreateEssential: null,
+ isUpdateEssential: null,
+ isMultiSelection: null,
+ dateGranularity: null,
+ shapeFileMapping: null,
+ updateRules: null,
+ enumValues: null,
+ subFields: null,
+ validation: [
{
- "valueType": "VALUE",
- "errorMsgCode": "validation-field.maxResolutionMeter.min",
- "min": "0.0185",
- "max": null,
- "minLength": null,
- "maxLength": null,
- "pattern": null,
- "errorMsgTranslation": null,
- "required": null,
- "json": null
+ valueType: 'VALUE',
+ errorMsgCode: 'validation-field.maxResolutionMeter.min',
+ min: '0.0185',
+ max: null,
+ minLength: null,
+ maxLength: null,
+ pattern: null,
+ errorMsgTranslation: null,
+ required: null,
+ json: null,
},
{
- "valueType": "VALUE",
- "errorMsgCode": "validation-field.maxResolutionMeter.max",
- "min": null,
- "max": "78271.52",
- "minLength": null,
- "maxLength": null,
- "pattern": null,
- "errorMsgTranslation": null,
- "required": null,
- "json": null
- }
+ valueType: 'VALUE',
+ errorMsgCode: 'validation-field.maxResolutionMeter.max',
+ min: null,
+ max: '78271.52',
+ minLength: null,
+ maxLength: null,
+ pattern: null,
+ errorMsgTranslation: null,
+ required: null,
+ json: null,
+ },
],
- "isFilterable": null,
- "isBriefField": {
- "order": 7
+ isFilterable: null,
+ isBriefField: {
+ order: 7,
},
- "isInfoTooltip": true,
- "lookupTableBinding": null,
- "dependentField": null,
- "default": null
+ isInfoTooltip: true,
+ lookupTableBinding: null,
+ dependentField: null,
+ default: null,
};
diff --git a/src/common/ui-descriptors/type.ts b/src/common/ui-descriptors/type.ts
index 96a511e29..1af0e6b23 100644
--- a/src/common/ui-descriptors/type.ts
+++ b/src/common/ui-descriptors/type.ts
@@ -1,3 +1,3 @@
export const UiDescriptorsTypeName = 'UiDescriptors';
export type UiDescriptorsType = 'UiDescriptors';
-export type UiFieldDescriptor = { "__typename": UiDescriptorsType };
+export type UiFieldDescriptor = { __typename: UiDescriptorsType };
diff --git a/src/common/utils/geo.tools.ts b/src/common/utils/geo.tools.ts
index cd938cf59..61199c7cc 100644
--- a/src/common/utils/geo.tools.ts
+++ b/src/common/utils/geo.tools.ts
@@ -16,45 +16,53 @@ export const DEGREES_PER_METER = 0.00001;
export const ZERO_MERIDIAN = 0;
export const ANTI_MERIDIAN = 180;
-export type geoArgs = {name: string, value: any}[];
+export type geoArgs = { name: string; value: any }[];
export type geoCustomChecks = {
- validationFunc: ((value: string, args: geoArgs) => geoJSONValidation | undefined)[],
- validationFuncArgs: geoArgs
+ validationFunc: ((
+ value: string,
+ args: geoArgs
+ ) => geoJSONValidation | undefined)[];
+ validationFuncArgs: geoArgs;
};
const checkPolygon = (coordinates: Position[][], meridian: number) => {
- for (const ring of coordinates) {
- for (let i = 0; i < ring.length - 1; i++) {
- const start = ring[i];
- const end = ring[i + 1];
-
- // Check if one point is on one side of the meridian and the other point is on the other side
- if ((start[0] < meridian && end[0] > meridian) || (start[0] > meridian && end[0] < meridian)) {
- return true;
- }
- }
+ for (const ring of coordinates) {
+ for (let i = 0; i < ring.length - 1; i++) {
+ const start = ring[i];
+ const end = ring[i + 1];
+
+ // Check if one point is on one side of the meridian and the other point is on the other side
+ if (
+ (start[0] < meridian && end[0] > meridian) ||
+ (start[0] > meridian && end[0] < meridian)
+ ) {
+ return true;
+ }
}
- return false;
-}
-
-export const crossesMeridian = (geometry: Polygon | MultiPolygon, meridian: number) => {
- if (!geometry)
- return true;
-
- const type = geometry.type;
-
- if (type === 'Polygon') {
- return checkPolygon(geometry.coordinates, meridian);
- } else if (type === 'MultiPolygon') {
- for (const polygon of geometry.coordinates) {
- if (checkPolygon(polygon, meridian)) {
- return true;
- }
- }
+ }
+ return false;
+};
+
+export const crossesMeridian = (
+ geometry: Polygon | MultiPolygon,
+ meridian: number
+) => {
+ if (!geometry) return true;
+
+ const type = geometry.type;
+
+ if (type === 'Polygon') {
+ return checkPolygon(geometry.coordinates, meridian);
+ } else if (type === 'MultiPolygon') {
+ for (const polygon of geometry.coordinates) {
+ if (checkPolygon(polygon, meridian)) {
+ return true;
+ }
}
- return false;
-}
+ }
+ return false;
+};
/*
****** Current solution is using TURF MASK
@@ -71,104 +79,137 @@ There is 2 alternatives to get perimeter(outlined feature)
const convexHullFromUnion: Feature = convex(unitedPolygon.geometry);
*/
const QUANTIZATION_TOLERANCE = 1e6;
-const SIMPLIFY_TOLERANCE = 0.0001; // maximum allowed deviation(degrees) of simplified points from the original geometry
-// 0.0001 works good for geometries from ~200m(linear dimensions)
-// but for a large geometries number of vertices might be relatively big and not so relevant for UI
-export const getOutlinedFeature = (features: Feature[]) => {
- const masked = mask({
- type: 'FeatureCollection',
- features: applyTopology(features, QUANTIZATION_TOLERANCE)
- });
- // Remove whole world geometry
- masked.geometry.coordinates = masked.geometry.coordinates.slice(1);
-
- return simplify(
- polygonToLine(masked),
- {tolerance: SIMPLIFY_TOLERANCE, highQuality: false}
- );
-}
-
-export const applyTopology = (features: Feature[], quantization: number): Feature[] => {
- const polygons: Record = {};
- features.forEach((feat, idx) => {
- polygons[idx] = {
- ...feat.geometry
- } as unknown as Geometry;
- });
+const SIMPLIFY_TOLERANCE = 0.0001; // maximum allowed deviation(degrees) of simplified points from the original geometry
+// 0.0001 works good for geometries from ~200m(linear dimensions)
+// but for a large geometries number of vertices might be relatively big and not so relevant for UI
+export const getOutlinedFeature = (
+ features: Feature[]
+) => {
+ const masked = mask({
+ type: 'FeatureCollection',
+ features: applyTopology(features, QUANTIZATION_TOLERANCE),
+ });
+ // Remove whole world geometry
+ masked.geometry.coordinates = masked.geometry.coordinates.slice(1);
- const pp_topology = topology(polygons, quantization );
- const ret_features: Feature[] = [];
+ return simplify(polygonToLine(masked), {
+ tolerance: SIMPLIFY_TOLERANCE,
+ highQuality: false,
+ });
+};
- Object.entries(polygons).forEach(([key, val]) => {
- const topo_feat = feature(pp_topology, pp_topology.objects[key]);
- ret_features.push(topo_feat as never);
- });
+export const applyTopology = (
+ features: Feature[],
+ quantization: number
+): Feature[] => {
+ const polygons: Record = {};
+ features.forEach((feat, idx) => {
+ polygons[idx] = {
+ ...feat.geometry,
+ } as unknown as Geometry;
+ });
- return ret_features;
-}
+ const pp_topology = topology(polygons, quantization);
+ const ret_features: Feature[] = [];
-export const isGeometryPolygon = (geometry: Geometry) => geometry ? geometry.type === 'Polygon' : true;
+ Object.entries(polygons).forEach(([key, val]) => {
+ const topo_feat = feature(pp_topology, pp_topology.objects[key]);
+ ret_features.push(topo_feat as never);
+ });
-export const polygonVertexDensityFactor = (polygon: Feature, tolerance: number): number => {
- const vertices_org = explode(polygon as AllGeoJSON).features.map(f => f.geometry.coordinates);
- const vertices_simpl = explode(turf.simplify(
- polygon as AllGeoJSON,
- {tolerance, highQuality: false}
- ))
- .features.map(f => f.geometry.coordinates);
- console.log("simple vs org vertices count:", vertices_org.length, "to:", vertices_simpl.length, `(${vertices_simpl.length/vertices_org.length})`);
+ return ret_features;
+};
- return vertices_simpl.length/vertices_org.length;
-}
+export const isGeometryPolygon = (geometry: Geometry) =>
+ geometry ? geometry.type === 'Polygon' : true;
+
+export const polygonVertexDensityFactor = (
+ polygon: Feature,
+ tolerance: number
+): number => {
+ const vertices_org = explode(polygon as AllGeoJSON).features.map(
+ (f) => f.geometry.coordinates
+ );
+ const vertices_simpl = explode(
+ turf.simplify(polygon as AllGeoJSON, { tolerance, highQuality: false })
+ ).features.map((f) => f.geometry.coordinates);
+ console.log(
+ 'simple vs org vertices count:',
+ vertices_org.length,
+ 'to:',
+ vertices_simpl.length,
+ `(${vertices_simpl.length / vertices_org.length})`
+ );
+
+ return vertices_simpl.length / vertices_org.length;
+};
-export const isPolygonContainsPolygon = (polygon: Feature, polygonToCheck: Feature): boolean => {
- const polygonBBox = bbox(polygon);
- const polygonBBoxPolygon = bboxPolygon(polygonBBox);
+export const isPolygonContainsPolygon = (
+ polygon: Feature,
+ polygonToCheck: Feature
+): boolean => {
+ const polygonBBox = bbox(polygon);
+ const polygonBBoxPolygon = bboxPolygon(polygonBBox);
- const polygonToCheckBBox = bbox(polygonToCheck);
- const polygonToCheckBBoxPolygon = bboxPolygon(polygonToCheckBBox);
- return booleanContains(polygonBBoxPolygon, polygonToCheckBBoxPolygon);
+ const polygonToCheckBBox = bbox(polygonToCheck);
+ const polygonToCheckBBoxPolygon = bboxPolygon(polygonToCheckBBox);
+ return booleanContains(polygonBBoxPolygon, polygonToCheckBBoxPolygon);
};
export const getFirstPoint = (geojson: Geometry): Position => {
- // @ts-ignore
- const { type, coordinates } = geojson;
-
- switch (type) {
- case "Point":
- return coordinates;
-
- case "LineString":
- case "MultiPoint":
- return coordinates[0];
-
- case "Polygon":
- case "MultiLineString":
- return coordinates[0][0];
-
- case "MultiPolygon":
- return coordinates[0][0][0];
-
- default:
- throw new Error("Unsupported GeoJSON geometry type");
- }
-}
+ // @ts-ignore
+ const { type, coordinates } = geojson;
+
+ switch (type) {
+ case 'Point':
+ return coordinates;
+
+ case 'LineString':
+ case 'MultiPoint':
+ return coordinates[0];
+
+ case 'Polygon':
+ case 'MultiLineString':
+ return coordinates[0][0];
+
+ case 'MultiPolygon':
+ return coordinates[0][0][0];
+
+ default:
+ throw new Error('Unsupported GeoJSON geometry type');
+ }
+};
export const explode = (geometry: AllGeoJSON) => {
- return turf.explode(geometry)
-}
+ return turf.explode(geometry);
+};
export const area = (geometry: AllGeoJSON) => {
- return turf.area(geometry as unknown as Feature | FeatureCollection | turf.helpers.Geometry);
-}
+ return turf.area(
+ geometry as unknown as
+ | Feature
+ | FeatureCollection
+ | turf.helpers.Geometry
+ );
+};
-export const isSmallArea = (area: number, pixelAreaThreshold: number, resolutionMeter: number): boolean => {
+export const isSmallArea = (
+ area: number,
+ pixelAreaThreshold: number,
+ resolutionMeter: number
+): boolean => {
//IF($area > (sqrt(10) * to_real("resolution")) ^ 2 , 'Good', 'Small')
- return (area > Math.pow((Math.sqrt(pixelAreaThreshold) * resolutionMeter), 2)) ? false : true;
-}
+ return area > Math.pow(Math.sqrt(pixelAreaThreshold) * resolutionMeter, 2)
+ ? false
+ : true;
+};
// Function to detect small holes in Polygon and MultiPolygon
-export const countSmallHoles = (feature: Feature, threshold: number, resolution: number) => {
+export const countSmallHoles = (
+ feature: Feature,
+ threshold: number,
+ resolution: number
+) => {
let ret = 0;
const featureGeometry = feature.geometry ?? feature;
const type = featureGeometry.type;
@@ -183,13 +224,17 @@ export const countSmallHoles = (feature: Feature, threshold: number, resol
console.log('Feature is not a Polygon or MultiPolygon.');
}
- if (ret > 0){
+ if (ret > 0) {
console.log('Feature has holes', ret);
}
return ret;
-}
+};
-const countPolygonHoles = (coordinates: Position[][], threshold: number, resolution: number): number => {
+const countPolygonHoles = (
+ coordinates: Position[][],
+ threshold: number,
+ resolution: number
+): number => {
let ret = 0;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const [outerRing, ...holes] = coordinates;
@@ -201,25 +246,30 @@ const countPolygonHoles = (coordinates: Position[][], threshold: number, resolut
}
});
return ret;
-}
+};
export const getGapsByConvexHull = (polygonsData: {
- [x: string]: PolygonPartRecordModelType;
+ [x: string]: PolygonPartRecordModelType;
}) => {
- const polygonsCoordinates = Object.values(polygonsData).map(
- (poly: PolygonPartRecordModelType) => poly.footprint.coordinates);
- const turfPolygons = polygonsCoordinates.map(
- (coordinate) => turf.polygon(coordinate));
- const polygonsCollection = turf.featureCollection(turfPolygons);
- // @ts-ignore
- const mergedPolygons = polygonsCollection.features.reduce((acc, curr) => {
- return acc ? turf.union(acc, curr) : curr;
- }, null);
- const convexHull = turf.convex(polygonsCollection);
- return convexHull? turf.difference(convexHull, mergedPolygons): null;
+ const polygonsCoordinates = Object.values(polygonsData).map(
+ (poly: PolygonPartRecordModelType) => poly.footprint.coordinates
+ );
+ const turfPolygons = polygonsCoordinates.map((coordinate) =>
+ turf.polygon(coordinate)
+ );
+ const polygonsCollection = turf.featureCollection(turfPolygons);
+ // @ts-ignore
+ const mergedPolygons = polygonsCollection.features.reduce((acc, curr) => {
+ return acc ? turf.union(acc, curr) : curr;
+ }, null);
+ const convexHull = turf.convex(polygonsCollection);
+ return convexHull ? turf.difference(convexHull, mergedPolygons) : null;
};
-export const shrinkExtremeCoordinatesInOuterRing = (geometry: Geometry, factor = 0.99) => {
+export const shrinkExtremeCoordinatesInOuterRing = (
+ geometry: Geometry,
+ factor = 0.99
+) => {
const LAT_THRESHOLD = 84.9;
const LON_THRESHOLD = 179;
@@ -245,23 +295,26 @@ export const shrinkExtremeCoordinatesInOuterRing = (geometry: Geometry, factor =
return processed;
}
- if (geometry.type === "Polygon") {
+ if (geometry.type === 'Polygon') {
const [outer, ...holes] = geometry.coordinates;
return {
- type: "Polygon",
- coordinates: [processRing(outer), ...holes]
+ type: 'Polygon',
+ coordinates: [processRing(outer), ...holes],
} as Geometry;
}
- if (geometry.type === "MultiPolygon") {
+ if (geometry.type === 'MultiPolygon') {
return {
- type: "MultiPolygon",
- coordinates: geometry.coordinates.map(polygon => {
+ type: 'MultiPolygon',
+ coordinates: geometry.coordinates.map((polygon) => {
const [outer, ...holes] = polygon;
return [processRing(outer), ...holes];
- })
+ }),
} as Geometry;
}
- throw new Error("[shrinkExtremeCoordinatesInOuterRing] Unsupported geometry type: " + geometry.type);
-}
\ No newline at end of file
+ throw new Error(
+ '[shrinkExtremeCoordinatesInOuterRing] Unsupported geometry type: ' +
+ geometry.type
+ );
+};
diff --git a/src/common/utils/geojson.validation.ts b/src/common/utils/geojson.validation.ts
index 29e0c2ebc..501bf7f0b 100644
--- a/src/common/utils/geojson.validation.ts
+++ b/src/common/utils/geojson.validation.ts
@@ -6,8 +6,18 @@ import { Geometry, Position } from 'geojson';
import { geoCustomChecks } from './geo.tools';
const gpsi = require('geojson-polygon-self-intersections');
-export type severityLevel = 'TRACE' | 'DEBUG' | 'INFO' | 'WARN' | 'ERROR' | 'FATAL';
-export type geoJSONValidation = {valid: boolean, severity_level: severityLevel, reason: string};
+export type severityLevel =
+ | 'TRACE'
+ | 'DEBUG'
+ | 'INFO'
+ | 'WARN'
+ | 'ERROR'
+ | 'FATAL';
+export type geoJSONValidation = {
+ valid: boolean;
+ severity_level: severityLevel;
+ reason: string;
+};
export const EMPTY_JSON_STRING_VALUE = '{}';
const INTERSECTION_TOLLERANCE = 1e-11; // 0.01mm
@@ -18,17 +28,17 @@ const hasTooManyVerteces = (geom: Geometry): boolean => {
let totalVertices = 0;
if (isValidGeometryType(geom)) {
//@ts-ignore
- const polygons = (geom.type === 'Polygon') ? [geom.coordinates] : geom.coordinates;
+ const polygons =
+ geom.type === 'Polygon' ? [geom.coordinates] : geom.coordinates;
polygons.forEach((polygon: Position[][]) => {
- polygon.forEach(ring => {
+ polygon.forEach((ring) => {
totalVertices += ring.length;
});
});
-
}
- return totalVertices >= MAX_VERTECES ;
-}
+ return totalVertices >= MAX_VERTECES;
+};
// export const hasSelfIntersections = (json: Geometry): boolean => {
// return kinks(json as any).features.length > 0;
@@ -36,74 +46,108 @@ const hasTooManyVerteces = (geom: Geometry): boolean => {
export const hasSelfIntersections = (json: Geometry): boolean => {
//@ts-ignore
- const filterFunc = (isect, ring0, edge0, start0, end0, frac0, ring1, edge1, start1, end1, frac1, unique) => {
+ const filterFunc = (
+ isect,
+ ring0,
+ edge0,
+ start0,
+ end0,
+ frac0,
+ ring1,
+ edge1,
+ start1,
+ end1,
+ frac1,
+ unique
+ ) => {
const firstLine = lineString([start0, end0]);
const secondLine = lineString([start1, end1]);
- const isPointOnFirstLine = booleanPointOnLine(isect, firstLine, { epsilon: INTERSECTION_TOLLERANCE });
- const isPointOnSecondLine = booleanPointOnLine(isect, secondLine, { epsilon: INTERSECTION_TOLLERANCE });
+ const isPointOnFirstLine = booleanPointOnLine(isect, firstLine, {
+ epsilon: INTERSECTION_TOLLERANCE,
+ });
+ const isPointOnSecondLine = booleanPointOnLine(isect, secondLine, {
+ epsilon: INTERSECTION_TOLLERANCE,
+ });
if (isPointOnFirstLine && isPointOnSecondLine) {
console.log('Intersection point(by gpsi): ', isect);
- return { isect, ring0, edge0, start0, end0, frac0, ring1, edge1, start1, end1, frac1, unique };
+ return {
+ isect,
+ ring0,
+ edge0,
+ start0,
+ end0,
+ frac0,
+ ring1,
+ edge1,
+ start1,
+ end1,
+ frac1,
+ unique,
+ };
}
return undefined;
- }
+ };
const isects = gpsi(
{
- type: "Feature",
+ type: 'Feature',
geometry: json,
},
- filterFunc,
+ filterFunc
);
const isectsLength = isects.filter((obj: any) => obj !== undefined).length;
-
+
return isectsLength > 0;
-}
+};
const isValidGeometryType = (json: Geometry): boolean => {
- return json.type === 'Polygon' || json.type === 'MultiPolygon';
-}
+ return json.type === 'Polygon' || json.type === 'MultiPolygon';
+};
const isAllGeometryLinearRingsValid = (geom: Geometry): geoJSONValidation => {
if (isValidGeometryType(geom)) {
//@ts-ignore
- const polygons = (geom.type === 'Polygon') ? [geom.coordinates] : geom.coordinates;
-
+ const polygons =
+ geom.type === 'Polygon' ? [geom.coordinates] : geom.coordinates;
+
for (const polygon of polygons) {
for (const ring of polygon as Position[][]) {
if (ring.length < LINEARING_MIN_POSITIONS) {
return {
valid: false,
severity_level: 'ERROR',
- reason: 'geo_json-geometry-not-enough-points'
+ reason: 'geo_json-geometry-not-enough-points',
};
}
- if (ring[0][0] !== ring[ring.length - 1][0] || ring[0][1] !== ring[ring.length - 1][1]) {
- return {
+ if (
+ ring[0][0] !== ring[ring.length - 1][0] ||
+ ring[0][1] !== ring[ring.length - 1][1]
+ ) {
+ return {
valid: false,
severity_level: 'ERROR',
- reason: 'geo_json-geometry-not-closed-linear_ring'
+ reason: 'geo_json-geometry-not-closed-linear_ring',
};
}
}
}
- return {
+ return {
valid: true,
severity_level: 'INFO',
- reason: ''
+ reason: '',
};
} else {
return {
valid: false,
severity_level: 'ERROR',
- reason: 'geo_json-geometry-not-supported'
+ reason: 'geo_json-geometry-not-supported',
};
}
-}
+};
// Validate coordinates within the WGS84 range (-180 to 180 for longitude, -90 to 90 for latitude)
const isValidWGS84Coordinates = (geom: Geometry) => {
@@ -124,7 +168,7 @@ const isValidWGS84Coordinates = (geom: Geometry) => {
}
}
return true;
- }
+ };
if (geom && geom.type) {
if (geom.type === 'Polygon') {
@@ -140,16 +184,22 @@ const isValidWGS84Coordinates = (geom: Geometry) => {
}
}
- return true;
-}
+ return true;
+};
-export const validateGeoJSONString = (jsonValue: string, geoCustomChecks?: geoCustomChecks): geoJSONValidation => {
+export const validateGeoJSONString = (
+ jsonValue: string,
+ geoCustomChecks?: geoCustomChecks
+): geoJSONValidation => {
const res = {
- valid: jsonValue !== undefined && jsonValue !== EMPTY_JSON_STRING_VALUE && jsonValue !== '',
+ valid:
+ jsonValue !== undefined &&
+ jsonValue !== EMPTY_JSON_STRING_VALUE &&
+ jsonValue !== '',
severity_level: 'INFO',
- reason: ''
+ reason: '',
} as geoJSONValidation;
-
+
try {
if (res.valid) {
const geoJson = JSON.parse(jsonValue);
@@ -157,22 +207,22 @@ export const validateGeoJSONString = (jsonValue: string, geoCustomChecks?: geoCu
return {
valid: false,
severity_level: 'ERROR',
- reason: 'not-geo_json'
- }
+ reason: 'not-geo_json',
+ };
}
if (!isValidGeometryType(geoJson)) {
return {
valid: false,
severity_level: 'ERROR',
- reason: 'geo_json-geometry-not-supported'
- }
+ reason: 'geo_json-geometry-not-supported',
+ };
}
if (!isValidWGS84Coordinates(geoJson)) {
return {
valid: false,
severity_level: 'ERROR',
- reason: 'geo_json-geometry-coordinates-not-wgs84'
- }
+ reason: 'geo_json-geometry-coordinates-not-wgs84',
+ };
}
const linearRingsCheck = isAllGeometryLinearRingsValid(geoJson);
if (linearRingsCheck.severity_level !== 'INFO') {
@@ -182,34 +232,36 @@ export const validateGeoJSONString = (jsonValue: string, geoCustomChecks?: geoCu
return {
valid: true,
severity_level: 'WARN',
- reason: 'geo_json-too_many_verteces'
- }
+ reason: 'geo_json-too_many_verteces',
+ };
}
if (hasSelfIntersections(geoJson)) {
return {
valid: false,
severity_level: 'ERROR',
- reason: 'geo_json-has_self_intersections'
- }
+ reason: 'geo_json-has_self_intersections',
+ };
}
- let validationArr: geoJSONValidation[] = [] as unknown as geoJSONValidation[];
-
+ let validationArr: geoJSONValidation[] =
+ [] as unknown as geoJSONValidation[];
+
if (geoCustomChecks) {
- validationArr = geoCustomChecks.validationFunc.map((func) => func(geoJson, geoCustomChecks.validationFuncArgs)).filter(u => u !== undefined) as geoJSONValidation[];
+ validationArr = geoCustomChecks.validationFunc
+ .map((func) => func(geoJson, geoCustomChecks.validationFuncArgs))
+ .filter((u) => u !== undefined) as geoJSONValidation[];
}
if (validationArr && validationArr.length) {
return validationArr[0];
}
}
- }
- catch (e) {
+ } catch (e) {
return {
valid: false,
severity_level: 'ERROR',
- reason: 'not-json'
+ reason: 'not-json',
};
}
return res;
-};
\ No newline at end of file
+};
diff --git a/src/discrete-layer/components/bbox/bbox-corner-indicator.tsx b/src/discrete-layer/components/bbox/bbox-corner-indicator.tsx
index 31a8bc7f6..1bdaa5154 100644
--- a/src/discrete-layer/components/bbox/bbox-corner-indicator.tsx
+++ b/src/discrete-layer/components/bbox/bbox-corner-indicator.tsx
@@ -102,10 +102,10 @@ export const BBoxCorner: React.FC = ({
className,
}) => {
const classes = useStyle();
- const bboxCorner = useMemo(() => getCornerClass(classes, corner), [
- classes,
- corner,
- ]);
+ const bboxCorner = useMemo(
+ () => getCornerClass(classes, corner),
+ [classes, corner]
+ );
return (
);
diff --git a/src/discrete-layer/components/catalog-tree/catalog-tree.css b/src/discrete-layer/components/catalog-tree/catalog-tree.css
index f990bbfe4..b91cfba86 100644
--- a/src/discrete-layer/components/catalog-tree/catalog-tree.css
+++ b/src/discrete-layer/components/catalog-tree/catalog-tree.css
@@ -3,7 +3,9 @@
margin: 12px 12px 0 12px;
}
-body[dir='rtl'] .catalogContainer .ReactVirtualized__Grid__innerScrollContainer {
+body[dir='rtl']
+ .catalogContainer
+ .ReactVirtualized__Grid__innerScrollContainer {
margin-right: -12px;
}
diff --git a/src/discrete-layer/components/catalog-tree/catalog-tree.tsx b/src/discrete-layer/components/catalog-tree/catalog-tree.tsx
index 197afe770..ace458741 100644
--- a/src/discrete-layer/components/catalog-tree/catalog-tree.tsx
+++ b/src/discrete-layer/components/catalog-tree/catalog-tree.tsx
@@ -1,12 +1,7 @@
/* eslint-disable */
/* tslint:disable */
-import React, {
- useEffect,
- useState,
- useMemo,
- useCallback,
-} from 'react';
+import React, { useEffect, useState, useMemo, useCallback } from 'react';
import { observer } from 'mobx-react';
import {
changeNodeAtPath,
@@ -50,13 +45,14 @@ interface CatalogTreeComponentProps {
isFiltered: boolean;
}
-export const CatalogTreeComponent: React.FC = observer(
- ({ refresh, isFiltered }) => {
+export const CatalogTreeComponent: React.FC =
+ observer(({ refresh, isFiltered }) => {
const store = useStore();
const theme = useTheme();
const [hoveredNode, setHoveredNode] = useState();
const [isHoverAllowed, setIsHoverAllowed] = useState(true);
- const [isBestInEditDialogOpen, setBestInEditDialogOpen] = useState(false);
+ const [isBestInEditDialogOpen, setBestInEditDialogOpen] =
+ useState(false);
const intl = useIntl();
const {
isLoading: loading,
@@ -75,7 +71,10 @@ export const CatalogTreeComponent: React.FC = observe
),
});
@@ -94,10 +93,10 @@ export const CatalogTreeComponent: React.FC = observe
useEffect(() => {
void store.catalogTreeStore.initTree();
}, []);
-
+
const areActionsAllowed = (rowInfo: ExtendedNodeData) => {
return isValidLayerMetadata(rowInfo.node as LayerMetadataMixedUnion);
- }
+ };
const entityPermittedActions = useMemo(() => {
const entityActions: Record = {};
@@ -108,7 +107,8 @@ export const CatalogTreeComponent: React.FC = observe
'VectorBestRecord',
'QuantizedMeshBestRecord',
].forEach((entityName) => {
- const allGroupsActions = store.actionDispatcherStore.getEntityActionGroups(entityName);
+ const allGroupsActions =
+ store.actionDispatcherStore.getEntityActionGroups(entityName);
const permittedGroupsActions = allGroupsActions.map((actionGroup) => {
return {
titleTranslationId: actionGroup.titleTranslationId,
@@ -142,71 +142,75 @@ export const CatalogTreeComponent: React.FC = observe
});
const currentTreeData = useMemo(() => {
- return !isFiltered
- ? treeRawData
- : getFilteredCatalogTreeData().length > 0
- ? getFilteredCatalogTreeData()
- : treeRawData;
+ return !isFiltered
+ ? treeRawData
+ : getFilteredCatalogTreeData().length > 0
+ ? getFilteredCatalogTreeData()
+ : treeRawData;
}, [treeRawData, isFiltered]);
- const handleRowClick = useCallback((evt: MouseEvent, rowInfo: ExtendedNodeData) => {
- if (!rowInfo.node.isGroup) {
- let newTreeData = currentTreeData;
- if (!evt.ctrlKey) {
- // Remove prev selection
- const selection = find({
- treeData: newTreeData,
- getNodeKey: keyFromTreeIndex,
- searchMethod: (data) => data.node.isSelected,
- });
-
- selection.matches.forEach(match => {
- const selRowInfo = getNodeAtPath({
+ const handleRowClick = useCallback(
+ (evt: MouseEvent, rowInfo: ExtendedNodeData) => {
+ if (!rowInfo.node.isGroup) {
+ let newTreeData = currentTreeData;
+ if (!evt.ctrlKey) {
+ // Remove prev selection
+ const selection = find({
treeData: newTreeData,
- path: match.path,
getNodeKey: keyFromTreeIndex,
- // ignoreCollapsed: false,
+ searchMethod: (data) => data.node.isSelected,
});
- newTreeData = changeNodeAtPath({
- treeData: newTreeData,
- path: match.path,
- newNode: {
- ...selRowInfo?.node,
- isSelected: false
- },
- getNodeKey: keyFromTreeIndex
+ selection.matches.forEach((match) => {
+ const selRowInfo = getNodeAtPath({
+ treeData: newTreeData,
+ path: match.path,
+ getNodeKey: keyFromTreeIndex,
+ // ignoreCollapsed: false,
+ });
+
+ newTreeData = changeNodeAtPath({
+ treeData: newTreeData,
+ path: match.path,
+ newNode: {
+ ...selRowInfo?.node,
+ isSelected: false,
+ },
+ getNodeKey: keyFromTreeIndex,
+ });
});
+ }
+
+ newTreeData = changeNodeAtPath({
+ treeData: newTreeData,
+ path: rowInfo.path,
+ newNode: {
+ ...rowInfo.node,
+ isSelected: !rowInfo.node.isSelected,
+ },
+ getNodeKey: keyFromTreeIndex,
});
- }
- newTreeData = changeNodeAtPath({
- treeData: newTreeData,
- path: rowInfo.path,
- newNode: {
- ...rowInfo.node,
- isSelected: !rowInfo.node.isSelected
- },
- getNodeKey: keyFromTreeIndex
- });
+ // console.log('*** MOUSE ROW CLICK *****', (evt.target as any).className);
+ if (
+ evt.target !== null &&
+ actionDismissibleRegex.test((evt.target as any).className)
+ ) {
+ setHoveredNode(undefined);
+ setIsHoverAllowed(false);
+ }
- // console.log('*** MOUSE ROW CLICK *****', (evt.target as any).className);
- if (evt.target !== null && actionDismissibleRegex.test((evt.target as any).className)) {
- setHoveredNode(undefined);
- setIsHoverAllowed(false);
+ setCatalogTreeData(newTreeData, isFiltered);
+ store.discreteLayersStore.selectLayer(rowInfo.node as ILayerImage);
}
-
- setCatalogTreeData(newTreeData, isFiltered);
- store.discreteLayersStore.selectLayer(
- rowInfo.node as ILayerImage
- );
- }
- }, [treeRawData, isFiltered]);
+ },
+ [treeRawData, isFiltered]
+ );
const dispatchAction = (action: Record): void => {
store.actionDispatcherStore.dispatchAction({
action: action.action,
- data: action.data
+ data: action.data,
} as IDispatchAction);
};
@@ -215,7 +219,9 @@ export const CatalogTreeComponent: React.FC = observe
);
}
@@ -227,7 +233,7 @@ export const CatalogTreeComponent: React.FC = observe
{!loading && (
{
+ onChange={(treeData) => {
// console.log('****** UPDATE TREE DATA ******');
setCatalogTreeData(treeData, isFiltered);
}}
@@ -239,9 +245,9 @@ export const CatalogTreeComponent: React.FC = observe
return false;
// return !nextParent || nextParent.isDirectory
}}
- generateNodeProps={rowInfo => ({
+ generateNodeProps={(rowInfo) => ({
onClick: (e: MouseEvent) => {
- handleRowClick(e, rowInfo)
+ handleRowClick(e, rowInfo);
},
onMouseOver: (evt: MouseEvent) => {
if (!rowInfo.node.isGroup && isHoverAllowed) {
@@ -268,32 +274,48 @@ export const CatalogTreeComponent: React.FC = observe
setHoveredNode(undefined);
}
},
- style: rowInfo.node.isGroup ? (()=> {
- return (rowInfo?.node.children as ILayerImage[]).some((elem) => elem.footprintShown || elem.layerImageShown || (elem as any).polygonPartsShown ) ? {color: theme.primary, fontWeight: '600'} : {};
- })() : getTextStyle(rowInfo.node, 'color'),
+ style: rowInfo.node.isGroup
+ ? (() => {
+ return (rowInfo?.node.children as ILayerImage[]).some(
+ (elem) =>
+ elem.footprintShown ||
+ elem.layerImageShown ||
+ (elem as any).polygonPartsShown
+ )
+ ? { color: theme.primary, fontWeight: '600' }
+ : {};
+ })()
+ : getTextStyle(rowInfo.node, 'color'),
icons: rowInfo.node.isGroup
? []
: [
{
dispatchAction({
action: UserAction.SYSTEM_CALLBACK_SHOWFOOTPRINT,
- data: { selectedLayer: { ...data, footprintShown: value } }
+ data: {
+ selectedLayer: { ...data, footprintShown: value },
+ },
});
}}
/>,
{
dispatchAction({
action: UserAction.SYSTEM_CALLBACK_SHOWLAYERIMAGE,
- data: { selectedLayer: { ...data, layerImageShown: value } }
+ data: {
+ selectedLayer: {
+ ...data,
+ layerImageShown: value,
+ },
+ },
});
}}
/>,
= observe
onClick={(data: ILayerImage, value: boolean) => {
dispatchAction({
action: UserAction.SYSTEM_CALLBACK_SHOWPOLYGONPARTS,
- data: { selectedLayer: {...data, polygonPartsShown: value } }
+ data: {
+ selectedLayer: {
+ ...data,
+ polygonPartsShown: value,
+ },
+ },
});
}}
/>,
],
buttons: [
<>
- {
- areActionsAllowed(rowInfo) &&
+ {areActionsAllowed(rowInfo) &&
hoveredNode !== undefined &&
- hoveredNode.id === rowInfo.node.id &&
- hoveredNode.parentPath === rowInfo.path.slice(0, -1).toString() && (
+ hoveredNode.id === rowInfo.node.id &&
+ hoveredNode.parentPath ===
+ rowInfo.path.slice(0, -1).toString() && (
= observe
entity={rowInfo.node.__typename}
actionHandler={dispatchAction}
/>
- )
- }
+ )}
>,
],
})}
/>
)}
- {
- isBestInEditDialogOpen &&
+ {isBestInEditDialogOpen && (
- }
+ )}
>
);
- }
-);
+ });
diff --git a/src/discrete-layer/components/dialogs/best-in-edit.dialog.tsx b/src/discrete-layer/components/dialogs/best-in-edit.dialog.tsx
index 9bb5df029..02fca55ae 100644
--- a/src/discrete-layer/components/dialogs/best-in-edit.dialog.tsx
+++ b/src/discrete-layer/components/dialogs/best-in-edit.dialog.tsx
@@ -1,7 +1,13 @@
import React, { useCallback } from 'react';
import { FormattedMessage } from 'react-intl';
import { DialogContent } from '@material-ui/core';
-import { Button, Dialog, DialogActions, DialogTitle, IconButton } from '@map-colonies/react-core';
+import {
+ Button,
+ Dialog,
+ DialogActions,
+ DialogTitle,
+ IconButton,
+} from '@map-colonies/react-core';
import { Box } from '@map-colonies/react-components';
import './best-in-edit.dialog.css';
@@ -11,33 +17,41 @@ interface BestInEditDialogProps {
onSetOpen: (open: boolean) => void;
}
-export const BestInEditDialog: React.FC = ({ isOpen, onSetOpen }) => {
- const closeDialog = useCallback(
- () => {
- onSetOpen(false);
- },
- [onSetOpen]
- );
+export const BestInEditDialog: React.FC = ({
+ isOpen,
+ onSetOpen,
+}) => {
+ const closeDialog = useCallback(() => {
+ onSetOpen(false);
+ }, [onSetOpen]);
return (
diff --git a/src/discrete-layer/components/dialogs/close-without-save.dialog.tsx b/src/discrete-layer/components/dialogs/close-without-save.dialog.tsx
index 37f62a703..ed9c0eb88 100644
--- a/src/discrete-layer/components/dialogs/close-without-save.dialog.tsx
+++ b/src/discrete-layer/components/dialogs/close-without-save.dialog.tsx
@@ -2,7 +2,13 @@ import React, { useCallback } from 'react';
import { FormattedMessage } from 'react-intl';
import { observer } from 'mobx-react';
import { DialogContent } from '@material-ui/core';
-import { Button, Dialog, DialogActions, DialogTitle, IconButton } from '@map-colonies/react-core';
+import {
+ Button,
+ Dialog,
+ DialogActions,
+ DialogTitle,
+ IconButton,
+} from '@map-colonies/react-core';
import { Box } from '@map-colonies/react-components';
import { useStore } from '../../models';
@@ -13,41 +19,55 @@ interface CloseWithoutSaveDialogProps {
onSetOpen: (open: boolean) => void;
}
-export const CloseWithoutSaveDialog: React.FC = observer(({ isOpen, onSetOpen }) => {
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
- const store = useStore();
-
- const closeDialog = useCallback(() => {
- onSetOpen(false);
- }, [onSetOpen]);
+export const CloseWithoutSaveDialog: React.FC =
+ observer(({ isOpen, onSetOpen }) => {
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
+ const store = useStore();
- const closeWithoutSaving = useCallback(() => {
- onSetOpen(false);
- }, [onSetOpen]);
-
- return (
-
-
-
- );
-});
+ const closeDialog = useCallback(() => {
+ onSetOpen(false);
+ }, [onSetOpen]);
+
+ const closeWithoutSaving = useCallback(() => {
+ onSetOpen(false);
+ }, [onSetOpen]);
+
+ return (
+
+
+
+ );
+ });
diff --git a/src/discrete-layer/components/dialogs/file-picker.dialog.css b/src/discrete-layer/components/dialogs/file-picker.dialog.css
index c2a77d5c4..f5d72d2b1 100644
--- a/src/discrete-layer/components/dialogs/file-picker.dialog.css
+++ b/src/discrete-layer/components/dialogs/file-picker.dialog.css
@@ -32,10 +32,10 @@ body[dir='rtl'] #filePickerDialog .MuiPopover-root {
}
#filePickerDialog .buttons {
- display: flex;
- align-self: flex-start;
+ display: flex;
+ align-self: flex-start;
}
#filePickerDialog .mdc-dialog__actions {
justify-content: space-between;
-}
\ No newline at end of file
+}
diff --git a/src/discrete-layer/components/dialogs/file-picker.dialog.tsx b/src/discrete-layer/components/dialogs/file-picker.dialog.tsx
index 459c4dec5..5a224e84e 100644
--- a/src/discrete-layer/components/dialogs/file-picker.dialog.tsx
+++ b/src/discrete-layer/components/dialogs/file-picker.dialog.tsx
@@ -52,7 +52,10 @@ interface FilePickerDialogProps {
}
const getSuffixFromFolderChain = (folderChain: FileData[]): string => {
- return BASE_PATH_SUFFIX + folderChain.map((file) => normalizePath(file.name)).join('/');
+ return (
+ BASE_PATH_SUFFIX +
+ folderChain.map((file) => normalizePath(file.name)).join('/')
+ );
};
export const FilePickerDialog: React.FC = observer(
@@ -63,7 +66,7 @@ export const FilePickerDialog: React.FC = observer(
onFilesSelection,
selection: currentSelection,
fetchMetaData = true,
- rasterIngestionFilesTypeConfig = undefined
+ rasterIngestionFilesTypeConfig = undefined,
}) => {
const filePickerRef = useRef(null);
const [files, setFiles] = useState([]);
@@ -71,17 +74,27 @@ export const FilePickerDialog: React.FC = observer(
const [path, setPath] = useState(
getSuffixFromFolderChain(currentSelection.folderChain)
);
- const [graphQLError, setGraphQLError] = useState | null>(null);
+ const [graphQLError, setGraphQLError] = useState | null>(null);
const [selection, setSelection] = useState(currentSelection);
const store = useStore();
const queryDirectory = useCallback(
- () => useQuery<{ getDirectory: FileModelType[] }>(), [])();
+ () => useQuery<{ getDirectory: FileModelType[] }>(),
+ []
+ )();
const queryMetadata = useCallback(
- () => useQuery<{ getFile: LayerMetadataMixedUnion }>(), [])();
+ () => useQuery<{ getFile: LayerMetadataMixedUnion }>(),
+ []
+ )();
const intl = useIntl();
useEffect(() => {
- if (files.length === EMPTY || files.some((f: FileData | null) => f !== null)) {
+ if (
+ files.length === EMPTY ||
+ files.some((f: FileData | null) => f !== null)
+ ) {
setFiles(new Array(NUMBER_OF_TEMPLATE_FILES).fill(null));
}
queryDirectory.setQuery(
@@ -89,7 +102,7 @@ export const FilePickerDialog: React.FC = observer(
data: {
path,
type: recordType,
- rasterIngestionFilesTypeConfig
+ rasterIngestionFilesTypeConfig,
},
})
);
@@ -106,10 +119,12 @@ export const FilePickerDialog: React.FC = observer(
useEffect(() => {
if (queryDirectory.data) {
- const dirContent = cloneDeep(queryDirectory.data.getDirectory) as FileData[];
-
+ const dirContent = cloneDeep(
+ queryDirectory.data.getDirectory
+ ) as FileData[];
+
const shouldAutoSelectMountDir =
- AUTO_SELECT_SINGLE_MOUNT as boolean &&
+ (AUTO_SELECT_SINGLE_MOUNT as boolean) &&
path === BASE_PATH_SUFFIX &&
dirContent.length === 1 &&
(dirContent[0].isDir as boolean);
@@ -117,7 +132,7 @@ export const FilePickerDialog: React.FC = observer(
if (shouldAutoSelectMountDir) {
void filePickerRef.current?.requestFileAction(
FilePickerActions.OpenFiles,
- {targetFile: dirContent[0], files:[dirContent[0]]}
+ { targetFile: dirContent[0], files: [dirContent[0]] }
);
} else {
setFiles(dirContent);
@@ -161,7 +176,7 @@ export const FilePickerDialog: React.FC = observer(
useEffect(() => {
/* eslint-disable */
- if (!isEmpty(get(queryMetadata, "error"))) {
+ if (!isEmpty(get(queryMetadata, 'error'))) {
const metadataError = [
{
message: intl.formatMessage({
@@ -176,7 +191,7 @@ export const FilePickerDialog: React.FC = observer(
queryError.response.errors = metadataError;
const prevSelection = filePickerRef.current?.getFileSelection();
-
+
setSelection({
...prevSelection,
metadata: {
@@ -185,7 +200,7 @@ export const FilePickerDialog: React.FC = observer(
},
} as Selection);
}
- /* eslint-enable */
+ /* eslint-enable */
}, [queryMetadata.error]);
const closeDialog = useCallback(() => {
diff --git a/src/discrete-layer/components/export-layer/common/export-field-label.component.tsx b/src/discrete-layer/components/export-layer/common/export-field-label.component.tsx
index 0badfc8c4..5523bb38b 100644
--- a/src/discrete-layer/components/export-layer/common/export-field-label.component.tsx
+++ b/src/discrete-layer/components/export-layer/common/export-field-label.component.tsx
@@ -9,7 +9,11 @@ interface ExportFieldLabelProps {
required?: boolean;
}
-const ExportFieldLabel: React.FC = ({fieldName, fieldId, required}) => {
+const ExportFieldLabel: React.FC = ({
+ fieldName,
+ fieldId,
+ required,
+}) => {
const intl = useIntl();
const fieldLabel = intl.formatMessage({
@@ -17,11 +21,15 @@ const ExportFieldLabel: React.FC = ({fieldName, fieldId,
});
return (
-
+
{fieldLabel}
- { required as boolean && * }
+ {(required as boolean) && (
+
+ *
+
+ )}
);
};
diff --git a/src/discrete-layer/components/export-layer/common/fields/export-enum-selection-field.component.tsx b/src/discrete-layer/components/export-layer/common/fields/export-enum-selection-field.component.tsx
index 7825ec91c..4464111c3 100644
--- a/src/discrete-layer/components/export-layer/common/fields/export-enum-selection-field.component.tsx
+++ b/src/discrete-layer/components/export-layer/common/fields/export-enum-selection-field.component.tsx
@@ -29,7 +29,12 @@ const ExportEnumSelectionField: React.FC = ({
selectionIdx,
fieldName,
fieldValue,
- fieldInfo: { placeholderValue, helperTextValue, rhfValidation, validationAgainstField },
+ fieldInfo: {
+ placeholderValue,
+ helperTextValue,
+ rhfValidation,
+ validationAgainstField,
+ },
type,
}) => {
const intl = useIntl();
@@ -39,49 +44,60 @@ const ExportEnumSelectionField: React.FC = ({
const [innerValue, setInnerValue] = useState(fieldValue);
const enums = enumsMap as IEnumsMapType;
const locale = CONFIG.I18N.DEFAULT_LANGUAGE;
-
+
const getFormFieldId = (name: string): string => {
- return `${selectionIdx}_${name}_${selectionId}`
- }
+ return `${selectionIdx}_${name}_${selectionId}`;
+ };
const fieldId = getFormFieldId(fieldName);
-
+
useEffect(() => {
const registerValidation = {
...(rhfValidation ?? {}),
validate: {
- ...((rhfValidation?.validate) ?? {}),
- validationAgainstField: (value: unknown): string | boolean |undefined => {
+ ...(rhfValidation?.validate ?? {}),
+ validationAgainstField: (
+ value: unknown
+ ): string | boolean | undefined => {
if (typeof validationAgainstField !== 'undefined') {
- return validationAgainstField.validate(value, formMethods.watch(getFormFieldId(validationAgainstField.watch)));
+ return validationAgainstField.validate(
+ value,
+ formMethods.watch(getFormFieldId(validationAgainstField.watch))
+ );
}
- }
+ },
},
};
-
- formMethods.register(fieldId, {...registerValidation});
-
+
+ formMethods.register(fieldId, { ...registerValidation });
+
// Mitigate errors on init
- formMethods.setValue(fieldId, fieldValue, { shouldValidate: fieldValue.length > NONE });
+ formMethods.setValue(fieldId, fieldValue, {
+ shouldValidate: fieldValue.length > NONE,
+ });
// Revalidate fields
void formMethods.trigger();
-
+
return (): void => {
formMethods.unregister(fieldId);
- }
+ };
}, [fieldId]);
return (
-
+
-
+
);
};
diff --git a/src/discrete-layer/components/export-layer/common/fields/export-general-field.component.tsx b/src/discrete-layer/components/export-layer/common/fields/export-general-field.component.tsx
index 645c7a571..5f215b9c5 100644
--- a/src/discrete-layer/components/export-layer/common/fields/export-general-field.component.tsx
+++ b/src/discrete-layer/components/export-layer/common/fields/export-general-field.component.tsx
@@ -18,38 +18,50 @@ const ExportGeneralFieldComponent: React.FC = ({
selectionIdx,
fieldName,
fieldValue,
- fieldInfo: {placeholderValue, helperTextValue, rhfValidation, validationAgainstField, rows, maxLength},
+ fieldInfo: {
+ placeholderValue,
+ helperTextValue,
+ rhfValidation,
+ validationAgainstField,
+ rows,
+ maxLength,
+ },
type,
isLoading,
}) => {
const store = useStore();
const formMethods = useFormContext();
-
+
const getFormFieldId = (name: string): string => {
- return `${selectionIdx}_${name}_${selectionId}`
- }
+ return `${selectionIdx}_${name}_${selectionId}`;
+ };
const fieldId = getFormFieldId(fieldName);
-
- const placeholderVal = useMemo(() =>
- typeof placeholderValue !== 'undefined'
- ? typeof placeholderValue === 'string'
- ? placeholderValue
- : placeholderValue()
- : '',
+
+ const placeholderVal = useMemo(
+ () =>
+ typeof placeholderValue !== 'undefined'
+ ? typeof placeholderValue === 'string'
+ ? placeholderValue
+ : placeholderValue()
+ : '',
[placeholderValue]
);
- const handleOnChange = useCallback((e: React.ChangeEvent): void => {
- const newFieldVal = rhfValidation?.valueAsNumber as boolean ? e.target.valueAsNumber : e.target.value;
+ const handleOnChange = useCallback(
+ (e: React.ChangeEvent): void => {
+ const newFieldVal = (rhfValidation?.valueAsNumber as boolean)
+ ? e.target.valueAsNumber
+ : e.target.value;
- store.exportStore.setSelectionProperty(
- selectionId,
- fieldName,
- newFieldVal
- );
-
- }, [store.exportStore.setSelectionProperty, selectionId, fieldName])
+ store.exportStore.setSelectionProperty(
+ selectionId,
+ fieldName,
+ newFieldVal
+ );
+ },
+ [store.exportStore.setSelectionProperty, selectionId, fieldName]
+ );
const [innerValue, handleFieldChange] = useDebounceField(
{ handleChange: handleOnChange } as EntityFormikHandlers,
@@ -61,29 +73,35 @@ const ExportGeneralFieldComponent: React.FC = ({
const registerValidation = {
...(rhfValidation ?? {}),
validate: {
- ...((rhfValidation?.validate) ?? {}),
- validationAgainstField: (value: unknown): string | boolean |undefined => {
+ ...(rhfValidation?.validate ?? {}),
+ validationAgainstField: (
+ value: unknown
+ ): string | boolean | undefined => {
if (typeof validationAgainstField !== 'undefined') {
- return validationAgainstField.validate(value, formMethods.watch(getFormFieldId(validationAgainstField.watch)));
+ return validationAgainstField.validate(
+ value,
+ formMethods.watch(getFormFieldId(validationAgainstField.watch))
+ );
}
- }
+ },
},
};
-
- formMethods.register(fieldId, {...registerValidation});
-
+
+ formMethods.register(fieldId, { ...registerValidation });
+
// Mitigate errors on init
- formMethods.setValue(fieldId, fieldValue, { shouldValidate: fieldValue.length > NONE });
+ formMethods.setValue(fieldId, fieldValue, {
+ shouldValidate: fieldValue.length > NONE,
+ });
// Revalidate fields
void formMethods.trigger();
-
+
return (): void => {
formMethods.unregister(fieldId);
- }
+ };
}, [fieldId]);
-
return (
= ({
invalid={!isEmpty(formMethods.errors[fieldId])}
/>
-
+
);
};
diff --git a/src/discrete-layer/components/export-layer/common/fields/export-options-field.component.tsx b/src/discrete-layer/components/export-layer/common/fields/export-options-field.component.tsx
index 9d0301f57..68438ca16 100644
--- a/src/discrete-layer/components/export-layer/common/fields/export-options-field.component.tsx
+++ b/src/discrete-layer/components/export-layer/common/fields/export-options-field.component.tsx
@@ -23,54 +23,74 @@ const ExportOptionsField: React.FC = ({
selectionIdx,
fieldName,
fieldValue,
- fieldInfo: { placeholderValue, helperTextValue, rhfValidation, validationAgainstField },
+ fieldInfo: {
+ placeholderValue,
+ helperTextValue,
+ rhfValidation,
+ validationAgainstField,
+ },
valueToPresentPredicate = (value): string => value,
}) => {
const store = useStore();
const formMethods = useFormContext();
- const [innerValue, setInnerValue] = useState(isEmpty(fieldValue) ? defaultValue ?? '' : fieldValue);
+ const [innerValue, setInnerValue] = useState(
+ isEmpty(fieldValue) ? defaultValue ?? '' : fieldValue
+ );
const getFormFieldId = (name: string): string => {
- return `${selectionIdx}_${name}_${selectionId}`
- }
+ return `${selectionIdx}_${name}_${selectionId}`;
+ };
const fieldId = getFormFieldId(fieldName);
useEffect(() => {
const registerValidation = {
...(rhfValidation ?? {}),
validate: {
- ...((rhfValidation?.validate) ?? {}),
- validationAgainstField: (value: unknown): string | boolean |undefined => {
+ ...(rhfValidation?.validate ?? {}),
+ validationAgainstField: (
+ value: unknown
+ ): string | boolean | undefined => {
if (typeof validationAgainstField !== 'undefined') {
- return validationAgainstField.validate(value, formMethods.watch(getFormFieldId(validationAgainstField.watch)));
+ return validationAgainstField.validate(
+ value,
+ formMethods.watch(getFormFieldId(validationAgainstField.watch))
+ );
}
- }
+ },
},
};
-
- formMethods.register(fieldId, {...registerValidation});
-
+
+ formMethods.register(fieldId, { ...registerValidation });
+
// Mitigate errors on init
- formMethods.setValue(fieldId, innerValue, { shouldValidate: innerValue.length > NONE });
+ formMethods.setValue(fieldId, innerValue, {
+ shouldValidate: innerValue.length > NONE,
+ });
// Revalidate fields
void formMethods.trigger();
return (): void => {
formMethods.unregister(fieldId);
- }
+ };
}, [fieldId]);
return (
-
+
-
+
);
};
diff --git a/src/discrete-layer/components/export-layer/constants.ts b/src/discrete-layer/components/export-layer/constants.ts
index 99f5d5b23..d7b781704 100644
--- a/src/discrete-layer/components/export-layer/constants.ts
+++ b/src/discrete-layer/components/export-layer/constants.ts
@@ -1,6 +1,6 @@
export const GENERAL_FIELDS_IDX = 0;
-export const GENERAL_FIELDS_ID = "0";
+export const GENERAL_FIELDS_ID = '0';
export const DEBOUNCE_PERIOD_EXPORT_FIELDS = 1000;
-export const SELECTION_ERROR_CLASSNAME = 'erroredSelection';
\ No newline at end of file
+export const SELECTION_ERROR_CLASSNAME = 'erroredSelection';
diff --git a/src/discrete-layer/components/export-layer/export-drawing-handler.component.tsx b/src/discrete-layer/components/export-layer/export-drawing-handler.component.tsx
index fd6430d93..199f959b1 100644
--- a/src/discrete-layer/components/export-layer/export-drawing-handler.component.tsx
+++ b/src/discrete-layer/components/export-layer/export-drawing-handler.component.tsx
@@ -14,7 +14,9 @@ import { useStore } from '../../models';
import { applyFactor } from '../helpers/layersUtils';
const DRAWING_MATERIAL_OPACITY = 0.5;
-const DRAWING_MATERIAL_COLOR = CesiumColor.CYAN.withAlpha(DRAWING_MATERIAL_OPACITY);
+const DRAWING_MATERIAL_COLOR = CesiumColor.CYAN.withAlpha(
+ DRAWING_MATERIAL_OPACITY
+);
export interface IDrawingState {
drawing: boolean;
@@ -25,7 +27,7 @@ const ExportDrawingHandler: React.FC = observer(() => {
const store = useStore();
const cesiumViewer = useCesiumMap();
const { drawing, type } = store.exportStore.drawingState as IDrawingState;
-
+
useEffect(() => {
return (): void => {
store.exportStore.resetDrawingState();
@@ -35,8 +37,8 @@ const ExportDrawingHandler: React.FC = observer(() => {
useEffect(() => {
if (store.exportStore.hasExportPreviewed) {
const selectedRoi = store.exportStore.geometrySelectionsCollection;
- const features = [ ...selectedRoi.features ];
-
+ const features = [...selectedRoi.features];
+
// ***********************************************************************************************************
// ***** Currentlty exported layer footprint not added to calculation of export preview, might be reconsidered
// ***********************************************************************************************************
diff --git a/src/discrete-layer/components/export-layer/export-entity-selections-fields/dem-selection-field.component.tsx b/src/discrete-layer/components/export-layer/export-entity-selections-fields/dem-selection-field.component.tsx
index 996e29b82..59136cc14 100644
--- a/src/discrete-layer/components/export-layer/export-entity-selections-fields/dem-selection-field.component.tsx
+++ b/src/discrete-layer/components/export-layer/export-entity-selections-fields/dem-selection-field.component.tsx
@@ -1,5 +1,7 @@
import React, { useContext } from 'react';
-import EnumsMapContext, { IEnumsMapType } from '../../../../common/contexts/enumsMap.context';
+import EnumsMapContext, {
+ IEnumsMapType,
+} from '../../../../common/contexts/enumsMap.context';
import { useStore } from '../../../models';
import ExportGeneralFieldComponent from '../common/fields/export-general-field.component';
import ExportOptionsField from '../common/fields/export-options-field.component';
@@ -10,7 +12,9 @@ import { ExportFieldProps } from '../types/interfaces';
const DemSelectionField: React.FC = (props) => {
const { fieldName, selectionIdx } = props;
- const {exportStore: { layerToExport, geometrySelectionsCollection }} = useStore();
+ const {
+ exportStore: { layerToExport, geometrySelectionsCollection },
+ } = useStore();
const { enumsMap } = useContext(EnumsMapContext);
const enums = enumsMap as IEnumsMapType;
@@ -23,62 +27,71 @@ const DemSelectionField: React.FC = (props) => {
);
}
case 'projection': {
- const PROJECTION_OPTIONS = [DEMExportProjection.WGS84, DEMExportProjection.UTM];
+ const PROJECTION_OPTIONS = [
+ DEMExportProjection.WGS84,
+ DEMExportProjection.UTM,
+ ];
const DEFAULT_PROJECTION = DEMExportProjection.WGS84;
- const valueFromEntityProps = (get(
- geometrySelectionsCollection.features[selectionIdx - 1],
- `properties.projection`
- ) as number | undefined)?.toString();
+ const valueFromEntityProps = (
+ get(
+ geometrySelectionsCollection.features[selectionIdx - 1],
+ `properties.projection`
+ ) as number | undefined
+ )?.toString();
return (
<>
-
+
>
- )
+ );
}
case 'resampleMethod': {
- const options = getEnumRealValues(enums, "ResamplingMethod");
+ const options = getEnumRealValues(enums, 'ResamplingMethod');
const defaultResamplingMethod = 'near';
- const valueFromEntityProps = (get(
- geometrySelectionsCollection.features[selectionIdx - 1],
- `properties.resampleMethod`
- ) as number | undefined)?.toString();
+ const valueFromEntityProps = (
+ get(
+ geometrySelectionsCollection.features[selectionIdx - 1],
+ `properties.resampleMethod`
+ ) as number | undefined
+ )?.toString();
return (
<>
-
+
>
- )
+ );
}
case 'dataType': {
- const options = getEnumRealValues(enums, "DEMDataType");
+ const options = getEnumRealValues(enums, 'DEMDataType');
const defaultValueFromLayer = get(layerToExport, 'dataType') as string;
const defaultValue = get(enums, defaultValueFromLayer).realValue;
- const valueFromEntityProps = (get(
- geometrySelectionsCollection.features[selectionIdx - 1],
- `properties.dataType`
- ) as number | undefined)?.toString();
-
+ const valueFromEntityProps = (
+ get(
+ geometrySelectionsCollection.features[selectionIdx - 1],
+ `properties.dataType`
+ ) as number | undefined
+ )?.toString();
+
return (
<>
-
+
>
- )
+ );
}
case 'description': {
return (
diff --git a/src/discrete-layer/components/export-layer/export-entity-selections-fields/raster-selection-field.component.tsx b/src/discrete-layer/components/export-layer/export-entity-selections-fields/raster-selection-field.component.tsx
index bd8ad7a83..a9e3e764c 100644
--- a/src/discrete-layer/components/export-layer/export-entity-selections-fields/raster-selection-field.component.tsx
+++ b/src/discrete-layer/components/export-layer/export-entity-selections-fields/raster-selection-field.component.tsx
@@ -17,23 +17,26 @@ const RasterSelectionField: React.FC = (props) => {
switch (fieldName) {
case 'minResolutionDeg': {
- const currentRes = (get(
- exportStore.geometrySelectionsCollection.features[selectionIdx - 1],
- `properties.minResolutionDeg`
- ) as number | undefined)?.toString();
+ const currentRes = (
+ get(
+ exportStore.geometrySelectionsCollection.features[selectionIdx - 1],
+ `properties.minResolutionDeg`
+ ) as number | undefined
+ )?.toString();
- const maxResFromLayer = (get(
- exportStore.layerToExport,
- `maxResolutionDeg`
- ) as number | undefined)?.toString();
+ const maxResFromLayer = (
+ get(exportStore.layerToExport, `maxResolutionDeg`) as number | undefined
+ )?.toString();
const getValidResolutions = (): string[] => {
return Object.values(ZOOM_LEVELS_TABLE)
- .map((res) => res.toString())
- .filter((res) => {
- return typeof maxResFromLayer !== 'undefined' ? +res >= +maxResFromLayer : res;
- })
- }
+ .map((res) => res.toString())
+ .filter((res) => {
+ return typeof maxResFromLayer !== 'undefined'
+ ? +res >= +maxResFromLayer
+ : res;
+ });
+ };
const options = getValidResolutions();
@@ -46,52 +49,75 @@ const RasterSelectionField: React.FC = (props) => {
const [integers, decimals] = value.split('.');
const substrStart = 0;
const numberOfDecimals = 8;
- const resString = `${integers}.${decimals.substring(substrStart, numberOfDecimals)}`;
- const zoomLevel = degreesPerPixelToZoomLevel(Number.parseFloat(value));
- return `${resString.padEnd(MAX_PADDING_LENGTH + (MAX_VALUE_LENGTH - resString.length),' ')}${zoomLevel}`;
+ const resString = `${integers}.${decimals.substring(
+ substrStart,
+ numberOfDecimals
+ )}`;
+ const zoomLevel = degreesPerPixelToZoomLevel(
+ Number.parseFloat(value)
+ );
+ return `${resString.padEnd(
+ MAX_PADDING_LENGTH + (MAX_VALUE_LENGTH - resString.length),
+ ' '
+ )}${zoomLevel}`;
}}
- {...props} />
+ {...props}
+ />
>
- )
+ );
}
case 'maxResolutionDeg': {
- const currentRes = (get(
- exportStore.layerToExport,
- fieldInfo.defaultsFromEntityField as LayerMetadataMixedUnionKeys
- ) as number).toString();
+ const currentRes = (
+ get(
+ exportStore.layerToExport,
+ fieldInfo.defaultsFromEntityField as LayerMetadataMixedUnionKeys
+ ) as number
+ ).toString();
- const resFromEntityProps = (get(
- exportStore.geometrySelectionsCollection.features[selectionIdx - 1],
- `properties.maxResolutionDeg`
- ) as number | undefined)?.toString();
+ const resFromEntityProps = (
+ get(
+ exportStore.geometrySelectionsCollection.features[selectionIdx - 1],
+ `properties.maxResolutionDeg`
+ ) as number | undefined
+ )?.toString();
const getValidResolutions = (): string[] => {
return Object.values(ZOOM_LEVELS_TABLE)
- .map((res) => res.toString())
- .filter((res) => {
- const resolutionPrecision = currentRes.split('.')[1].length;
- const samePrecisionResFromTable = Number(res).toFixed(
- resolutionPrecision
- );
-
- return Number(currentRes) <= Number(samePrecisionResFromTable);
- })
- }
+ .map((res) => res.toString())
+ .filter((res) => {
+ const resolutionPrecision = currentRes.split('.')[1].length;
+ const samePrecisionResFromTable =
+ Number(res).toFixed(resolutionPrecision);
+
+ return Number(currentRes) <= Number(samePrecisionResFromTable);
+ });
+ };
return (
<>
- {
const [integers, decimals] = value.split('.');
const substrStart = 0;
const numberOfDecimals = 8;
- const resString = `${integers}.${decimals.substring(substrStart, numberOfDecimals)}`;
- const zoomLevel = degreesPerPixelToZoomLevel(Number.parseFloat(value));
- return `${resString.padEnd(MAX_PADDING_LENGTH + (MAX_VALUE_LENGTH - resString.length),' ')}${zoomLevel}`;
+ const resString = `${integers}.${decimals.substring(
+ substrStart,
+ numberOfDecimals
+ )}`;
+ const zoomLevel = degreesPerPixelToZoomLevel(
+ Number.parseFloat(value)
+ );
+ return `${resString.padEnd(
+ MAX_PADDING_LENGTH + (MAX_VALUE_LENGTH - resString.length),
+ ' '
+ )}${zoomLevel}`;
}}
- {...props} />
+ {...props}
+ />
>
);
}
diff --git a/src/discrete-layer/components/export-layer/export-layer-footer.component.tsx b/src/discrete-layer/components/export-layer/export-layer-footer.component.tsx
index 68d85e01e..df83c132d 100644
--- a/src/discrete-layer/components/export-layer/export-layer-footer.component.tsx
+++ b/src/discrete-layer/components/export-layer/export-layer-footer.component.tsx
@@ -22,8 +22,8 @@ interface ExportLayerFooterProps {
}
export enum ExportMode {
- PREVIEW = "preview",
- EXPORT = "export",
+ PREVIEW = 'preview',
+ EXPORT = 'export',
}
const NONE = 0;
@@ -32,18 +32,32 @@ const SERVICE_ERROR_IDX = -2;
const GENERAL_ERROR_IDX = -3;
const NOT_AVAILABLE_TEXT = 'N/A';
-const ExportFormValidationErrors: React.FC<{errors: FieldErrors>}> = ({errors}) => {
+const ExportFormValidationErrors: React.FC<{
+ errors: FieldErrors>;
+}> = ({ errors }) => {
const intl = useIntl();
- const [validationErrors, setValidationErrors] = useState