diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index bf859af17d8..3bb5ae7f5a1 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -19,10 +19,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Echo PR info
+ env:
+ ACTOR: ${{ github.actor }}
+ ACTION: ${{ github.event.action }}
+ MERGE: ${{ github.event.pull_request.merged }}
+ HEAD: ${{ github.head_ref }}
run: |
- echo User ${{ github.actor }} is about to ${{ github.event.action }} this Pull Request.
- echo The PR is merged: ${{ github.event.pull_request.merged }}
- echo The PR head reference: ${{ github.head_ref }}
+ echo 'User $ACTOR is about to $ACTION this Pull Request.'
+ echo 'The PR is merged: $MERGE.'
+ echo 'The PR head reference: $HEAD.'
echo '${{ toJSON(github) }}'
- name: Check if contributor is an org member
diff --git a/packages/geoview-core/src/core/components/data-grid/data-grid-api.ts b/packages/geoview-core/src/core/components/data-grid/data-grid-api.ts
index c8809db3407..64fba6182ac 100644
--- a/packages/geoview-core/src/core/components/data-grid/data-grid-api.ts
+++ b/packages/geoview-core/src/core/components/data-grid/data-grid-api.ts
@@ -4,6 +4,7 @@ import { AbstractGeoViewVector, api } from '../../../app';
import { getLocalizedValue } from '../../utils/utilities';
import { LayerDataGrid } from './layer-data-grid';
+import { TypeDisplayLanguage } from '../../../geo/map/map-schema-types';
export interface TypeLayerDataGridProps {
layerId: string;
@@ -18,6 +19,8 @@ export interface TypeLayerDataGridProps {
export class DataGridAPI {
mapId!: string;
+ displayLanguage!: TypeDisplayLanguage;
+
/**
* initialize the data grid api
*
@@ -25,6 +28,7 @@ export class DataGridAPI {
*/
constructor(mapId: string) {
this.mapId = mapId;
+ this.displayLanguage = api.map(mapId).displayLanguage;
}
/**
@@ -48,6 +52,7 @@ export class DataGridAPI {
headerName: columnHeader[i],
width: 150,
type: 'string',
+ hide: columnHeader[i] === 'featureKey',
});
}
@@ -63,6 +68,8 @@ export class DataGridAPI {
pageSize: 50,
rowsPerPageOptions: [25, 50, 100],
autoHeight: true,
+ rowId: 'featureKey',
+ displayLanguage: this.displayLanguage,
}),
]);
};
diff --git a/packages/geoview-core/src/core/components/data-grid/layer-data-grid.tsx b/packages/geoview-core/src/core/components/data-grid/layer-data-grid.tsx
index ffc0598f1e7..293292b4707 100644
--- a/packages/geoview-core/src/core/components/data-grid/layer-data-grid.tsx
+++ b/packages/geoview-core/src/core/components/data-grid/layer-data-grid.tsx
@@ -1,4 +1,7 @@
-import { DataGrid, DataGridProps } from '@mui/x-data-grid';
+import { DataGrid, DataGridProps, gridClasses, GridToolbar, GridCellParams, frFR, enUS } from '@mui/x-data-grid';
+
+import { TypeDisplayLanguage } from '../../../geo/map/map-schema-types';
+import { Tooltip } from '../../../ui';
/**
* Create a data grid (table) component for a lyer features all request
@@ -6,14 +9,96 @@ import { DataGrid, DataGridProps } from '@mui/x-data-grid';
* @param {DataGridProps} props table properties
* @returns {JSX.Element} returns table component
*/
-export function LayerDataGrid(props: DataGridProps) {
+
+// extend the DataGridProps to include the key row element
+interface CustomDataGridProps extends DataGridProps {
+ rowId: string;
+ displayLanguage: TypeDisplayLanguage;
+}
+
+const sxClasses = {
+ DataGrid: {
+ boxShadow: 2,
+ border: 2,
+ borderColor: 'primary.light',
+ '& .MuiDataGrid-cell:hover': {
+ color: 'text.primary',
+ },
+ [`& div.even.${gridClasses.row}`]: {
+ backgroundColor: 'grey.200',
+ '&:hover, &.Mui-hovered': {
+ backgroundColor: 'action.hoverRow',
+ '@media (hover: none)': {
+ backgroundColor: 'transparent',
+ },
+ },
+ '&.Mui-selected': {
+ backgroundColor: 'action.selectedRow',
+ '&:hover, &.Mui-hovered': {
+ backgroundColor: 'action.hoverRow',
+ // Reset on touch devices, it doesn't add specificity
+ '@media (hover: none)': {
+ backgroundColor: 'action.selectedRow',
+ },
+ },
+ },
+ },
+ [`& .${gridClasses.row}`]: {
+ '&:hover, &.Mui-hovered': {
+ backgroundColor: 'action.hoverRow',
+ '@media (hover: none)': {
+ backgroundColor: 'transparent',
+ },
+ },
+ '&.Mui-selected': {
+ backgroundColor: 'action.selectedRow',
+ '&:hover, &.Mui-hovered': {
+ backgroundColor: 'action.hoverRow',
+ // Reset on touch devices, it doesn't add specificity
+ '@media (hover: none)': {
+ backgroundColor: 'action.selectedRow',
+ },
+ },
+ },
+ },
+ },
+};
+
+export function LayerDataGrid(props: CustomDataGridProps) {
+ const { rowId, displayLanguage, columns } = props;
+
+ // tooltip implementation for column content
+ // TODO: works only with hover and add tooltips even when not needed. need improvement
+ columns.forEach((column) => {
+ // eslint-disable-next-line no-param-reassign
+ column.renderCell = (params: GridCellParams) => (
+