Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fix crash on tab change #2548

1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use nix
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,5 @@ common/config/rush/pnpm-lock.yaml

**/packages/geoview-core/types
packages/geoview-core/public/docs/

.direnv/
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ $ cd geoview
$ npm install -g @microsoft/rush
```

* Note: you can also use the included `shell.nix` to setup your dev environment if you are on Mac/Linux/WSL.

### Install dependencies

It's always recommended to run the below command if you pull any changes.
Expand Down
12 changes: 0 additions & 12 deletions common/config/rush/command-line.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@
"summary": "Serves the page locally with hot-reload.",
"shellCommand": "npm run --prefix packages/geoview-core serve"
},
{
"commandKind": "global",
"name": "serve:mac",
"summary": "Serves the page locally with hot-reload for Mac users",
"shellCommand": "npm run --prefix packages/geoview-core serveMac"
},
{
"commandKind": "global",
"name": "host",
Expand All @@ -25,12 +19,6 @@
"summary": "Build the packages and move them to the dist directory",
"shellCommand": "npm run --prefix packages/geoview-core build"
},
{
"commandKind": "global",
"name": "build:mac",
"summary": "Build the packages and move them to the dist directory",
"shellCommand": "npm run --prefix packages/geoview-core buildMac"
},
{
"commandKind": "bulk",
"name": "build",
Expand Down
11 changes: 3 additions & 8 deletions packages/geoview-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,13 @@
"scripts": {
"serve": "npm run format && npm run fix && webpack serve --progress --color --config webpack.dev.js",
"build": "npm run format && npm run fix && npm run doc && webpack --progress --color --config webpack.prod.js && npm run generate.d.ts",
"serveMac": "npm run formatMac && npm run fixMac && webpack serve --progress --color --config webpack.dev.js",
"buildMac": "npm run formatMac && npm run fixMac && npm run doc && webpack --progress --color --config webpack.prod.js && npm run generate.d.ts",
"doc": "typedoc src/app.tsx --logLevel Error --out public/docs",
"deploy": "gh-pages -d dist",
"test": "jest",
"update_test": "jest --updateSnapshot",
"format": "prettier --write ../geoview-**/src/**/*.{ts,tsx,js}",
"lint": "eslint ../geoview-**/src/**/*.{ts,tsx,js}",
"fix": "eslint ../geoview-**/src/**/*.{ts,tsx,js} --fix",
"formatMac": "prettier --write '../geoview-**/src/**/*.{ts,tsx,js}'",
"lintMac": "eslint '../geoview-**/src/**/*.{ts,tsx,js}'",
"fixMac": "eslint '../geoview-**/src/**/*.{ts,tsx,js}' --fix",
"format": "prettier --write \"../geoview-**/src/**/*.{ts,tsx,js}\"",
"lint": "eslint \"../geoview-**/src/**/*.{ts,tsx,js}\"",
"fix": "eslint \"../geoview-**/src/**/*.{ts,tsx,js}\" --fix",
"generate.d.ts": "tsc --noEmit false --skipLibCheck true --declaration --allowJs --emitDeclarationOnly --outDir types"
},
"dependencies": {
Expand Down
12 changes: 6 additions & 6 deletions packages/geoview-core/public/locales/en/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ _Note: Some tools in the Side Bar are also available as tabs in the Footer Bar,
| <img src="{{assetsURL}}/img/guide/sidebar/legend.svg" width="30"/> | Legend | Legend of map icons (_see Footer Bar section for help_) |
| <img src="{{assetsURL}}/img/guide/sidebar/details.svg" width="30"/> | Details | Details for selected features (_see Footer Bar section for help_) |
| <img src="{{assetsURL}}/img/guide/sidebar/guide.svg" width="30"/> | Guide | Help guide |
| <img src="{{assetsURL}}/img/guide/sidebar/export.svg" width="30"/> | Export | Download a PNG file of the map |
| <img src="{{assetsURL}}/img/guide/sidebar/export.svg" width="30"/> | Download | Download a PNG file of the map |
| <img src="{{assetsURL}}/img/guide/sidebar/notifications.svg" width="30"/> | Notifications | Display messages and notifications for the map |
| <img src="{{assetsURL}}/img/guide/sidebar/about.svg" width="30"/> | About Geoview | Display information about Geoview viewer |

Expand Down Expand Up @@ -152,13 +152,13 @@ The basemap selector modifies the underlying basemap to provide a variety of geo
<br>
=2!export=

### ![]({{assetsURL}}/img/guide/sidebar/export_30.svg) Export
### ![]({{assetsURL}}/img/guide/sidebar/export_30.svg) Download

You can export an image of the map and its visible layers along with a legend, title, north arrow, scalebar, and a timestamp.
You can download an image of the map and its visible layers along with a legend, title, north arrow, scalebar, and a timestamp.

Once **Export** button is clicked, a dialog will appear with an image of the map, and an option to enter a map title if desired.
Once **Download** button is clicked, a dialog will appear with an image of the map, and an option to enter a map title if desired.

Click on the Export button at the bottom to get the final generated map image.
Click on the **Download** button at the bottom to get the final generated map image.

=1!footerPanel=

Expand Down Expand Up @@ -330,7 +330,7 @@ _Note: Some options may not be available or are preselected depending on various
| <img src="{{assetsURL}}/img/guide/datatable/filter.png" width="30"/> | Filter switch | Apply filters to the map |
| <img src="{{assetsURL}}/img/guide/datatable/column_show.svg" width="30"/> | Display Columns | Allows you to choose which columns you want visible and to pin columns to the left or right of the table |
| <img src="{{assetsURL}}/img/guide/datatable/density.svg" width="30"/> | Density | Toggle the height of the rows in the data table |
| <img src="{{assetsURL}}/img/guide/datatable/export.svg" width="30"/> | Export | Export data table as CSV or GeoJSON. May not work as intended on mobile due to limitations with downloading files |
| <img src="{{assetsURL}}/img/guide/datatable/export.svg" width="30"/> | Download | Download data table as CSV or GeoJSON. May not work as intended on mobile due to limitations with downloading files |

The first three columns of the data table are Icon, Zoom and Details. The remaining columns vary depending on the layer selected.

Expand Down
9 changes: 5 additions & 4 deletions packages/geoview-core/public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"crosshair": "Use <strong>Arrows</strong>, <strong>+</strong> and <strong>-</strong> keys to navigate the map, <strong>Enter</strong> to select and <strong>Shift+Arrow</strong> <strong>Up</strong> or <strong>Down</strong> to modify the pan value."
},
"appbar": {
"export": "Export",
"export": "Download map",
"notifications": "Notification",
"no_notifications_available": "No notifications available",
"layers": "Layers",
Expand Down Expand Up @@ -172,9 +172,9 @@
"invalidConfig": "Invalid JSON config, default configuration applied."
},
"exportModal": {
"title": "Export map as PNG",
"title": "Download map as PNG",
"cancelBtn": "Cancel",
"exportBtn": "Export",
"exportBtn": "Download",
"exportTitle": "Title",
"approx": "approx"
},
Expand All @@ -195,11 +195,12 @@
"icon": "ICON",
"zoom": "ZOOM",
"details": "DETAILS",
"exportBtn": "Export",
"exportBtn": "Download",
"jsonExportBtn": "Download GeoJSON",
"downloadAsCSV": "Download CSV",
"filterMap": "Filter map",
"stopFilterMap": "Stop filter map",
"clearFilters": "Clear filters",
"rowsSelected": "{rowsSelected} of {totalRows} row(s) selected",
"rowsFiltered": "{rowsFiltered} of {totalRows} row(s) filtered",
"enlargeBtn": "Enlarge",
Expand Down
12 changes: 6 additions & 6 deletions packages/geoview-core/public/locales/fr/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ _N.B.&nbsp;: Certains outils dans la barre latérale se trouvent aussi sous form
| <img src="{{assetsURL}}/img/guide/sidebar/legend.svg" width="30"/>| Légende| Légende des icônes de la carte (_voir la section sur le pied de page pour en savoir plus_).|
| <img src="{{assetsURL}}/img/guide/sidebar/details.svg" width="30"/>| Détails| Information détaillée des éléments sélectionnés (_voir la section sur le pied de page pour en savoir plus_).|
| <img src="{{assetsURL}}/img/guide/sidebar/guide.svg" width="30"/>| Guide| Guide d’aide|
| <img src="{{assetsURL}}/img/guide/sidebar/export.svg" width="30"/>| Exporter| Pour télécharger la carte en fichier PNG.|
| <img src="{{assetsURL}}/img/guide/sidebar/export.svg" width="30"/>| Télécharger| Pour télécharger la carte en fichier PNG.|
| <img src="{{assetsURL}}/img/guide/sidebar/notifications.svg" width="30"/>| Notification| Présente les messages et les notifications pour la carte.|
| <img src="{{assetsURL}}/img/guide/sidebar/about.svg" width="30"/>| À propos de GéoView| Affiche les renseignements sur le visualiseur GéoView.|

Expand Down Expand Up @@ -146,13 +146,13 @@ Le sélecteur permet de modifier la carte de base pour obtenir différents conte

<br>
=2!export=
### ![]({{assetsURL}}/img/guide/sidebar/export_30.svg) Exporter
### ![]({{assetsURL}}/img/guide/sidebar/export_30.svg) Télécharger

Vous pouvez exporter une image de la carte avec ses couches visibles, la légende, le titre, la flèche du nord, la barre d’échelle et un horodatage.
Vous pouvez télécharger une image de la carte avec ses couches visibles, la légende, le titre, la flèche du nord, la barre d’échelle et un horodatage.

Lorsque vous cliquez sur le bouton **Exporter**, une fenêtre de dialogue s’ouvre contenant l’image de la carte et un champ où vous pouvez entrer un titre.
Lorsque vous cliquez sur le bouton **Télécharger**, une fenêtre de dialogue s’ouvre contenant l’image de la carte et un champ où vous pouvez entrer un titre.

Cliquez sur le bouton **Exporter** au bas de la fenêtre pour générer l’image finale de la carte.
Cliquez sur le bouton **Télécharger** au bas de la fenêtre pour générer l’image finale de la carte.

=1!footerPanel=

Expand Down Expand Up @@ -320,7 +320,7 @@ _N.B.&nbsp;: Selon différents facteurs, certaines options sont désactivées ou
| <img src="{{assetsURL}}/img/guide/datatable/filter.png" width="30"/>| Interrupteur de filtres| Appliquer les filtres à la carte.|
| <img src="{{assetsURL}}/img/guide/datatable/column_show.svg" width="30"/>| Afficher/masquer les colonnes| Choisir les colonnes visibles et épingler des colonnes à gauche ou à droite du tableau.|
| <img src="{{assetsURL}}/img/guide/datatable/density.svg" width="30"/>| Densité| Modifier la hauteur des lignes du tableau de données.|
| <img src="{{assetsURL}}/img/guide/datatable/export.svg" width="30"/>| Exporter| Exporter le tableau en format CSV ou GeoJSON. Pourrait échouer sur un appareil mobile en raison des restrictions de téléchargement de fichiers.|
| <img src="{{assetsURL}}/img/guide/datatable/export.svg" width="30"/>| Télécharger| Télécharger le tableau en format CSV ou GeoJSON. Pourrait échouer sur un appareil mobile en raison des restrictions de téléchargement de fichiers.|

Les trois premières colonnes du tableau de données sont **Icône**, **Zoom** et **Détails**. Les autres colonnes varient selon la couche sélectionnée.

Expand Down
10 changes: 5 additions & 5 deletions packages/geoview-core/public/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"crosshair": "Utiliser les touches <strong>fléchées</strong>, <strong>+</strong> et <strong>-</strong> pour naviguer sur la carte, <strong>Entrée</strong> pour sélectionner et <strong>Shift+fléchées</strong> <strong>Haut</strong> et <strong>Bas</strong> pour modfier le déplacement."
},
"appbar": {
"export": "Exporter",
"export": "Télécharger la carte",
"notifications": "Notification",
"no_notifications_available": "Aucune notification disponible",
"layers": "Couches",
Expand Down Expand Up @@ -172,9 +172,9 @@
"invalidConfig": "Configuration JSON non valide, configuration par défaut appliquée."
},
"exportModal": {
"title": "Exporter la carte en PNG",
"title": "Télécharger la carte en PNG",
"cancelBtn": "Annuler",
"exportBtn": "Exporter",
"exportBtn": "Télécharger",
"exportTitle": "Titre",
"approx": "approx"
},
Expand All @@ -195,11 +195,11 @@
"icon": "ICÔNE",
"zoom": "ZOOM",
"details": "DÉTAILS",
"exportBtn": "Exporter",
"exportBtn": "Télécharger",
"jsonExportBtn": "Télécharger GeoJSON",
"downloadAsCSV": "Télécharger CSV",
"filterMap": "Filtrer la carte",
"stopFilterMap": "Arrêt des filtres",
"clearFilters": "Effacer les filtres",
"rowsSelected": "{rowsSelected} sur {totalRows} ligne(s) sélectionnée(s)",
"rowsFiltered": "{rowsFiltered} sur {totalRows} ligne(s) filtrée(s)",
"enlargeBtn": "Agrandir",
Expand Down
10 changes: 5 additions & 5 deletions packages/geoview-core/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,19 @@ async function fetchConfigFile(configUrl: string): Promise<string> {

/**
* Function to get a configuration from a div element who contains attributes to read from.
* If the div has one of the folllowing atttributes data-config, data-config-url or data-shared,
* it will try to get a valide configuration from the attribute content. If there is no such attributes,
* If the div has one of the following atttributes data-config, data-config-url or data-shared,
* it will try to get a valid configuration from the attribute content. If there is no such attributes,
* it will return a default config. If the data-geocore is present, it will inject the layer in the
* consifuration automatically
* configuration automatically.
*
* @param {Element} mapElement - Div map element with attributes
* @returns {Promise<TypeMapFeaturesConfig>} A promise who contains the caonfiguration to use
* @returns {Promise<TypeMapFeaturesConfig>} A promise that contains the configuration to use
*/
async function getMapConfig(mapElement: Element): Promise<TypeMapFeaturesConfig> {
// get language in wich we need to have the config file (if not provided, default to English)
const lang = mapElement.hasAttribute('data-lang') ? (mapElement.getAttribute('data-lang')! as TypeDisplayLanguage) : 'en';

// create a new config object and apply default
const lang = mapElement.hasAttribute('data-lang') ? (mapElement.getAttribute('data-lang')! as TypeDisplayLanguage) : 'en';
let mapConfig: MapFeatureConfig = api.config.getDefaultMapFeatureConfig(lang);

// check what type of config is provided (data-config, data-config-url or data-shared)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const getSxClasses = (theme: Theme) =>
letterSpacing: '0.01071em',
display: 'flex',
padding: '6px',
alignItems: 'center',
},
selectedRowsDirection: {
display: 'flex',
Expand All @@ -36,6 +37,11 @@ export const getSxClasses = (theme: Theme) =>
color: theme.palette.geoViewColor.grey.dark[900],
},
},
tableHead: {
'& th:nth-of-type(-n+3)': {
justifyContent: 'end',
},
},
tableHeadCell: {
'& .MuiCollapse-wrapperInner': {
'& .MuiBox-root': {
Expand Down
Loading
Loading