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

Remote main #13

Merged
merged 4 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 45 additions & 4 deletions .github/workflows/unit-tests-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,53 @@ on:
env:
OPENSEARCH_DASHBOARDS_BRANCH: 'main'
jobs:
tests:
Get-CI-Image-Tag:
uses: opensearch-project/opensearch-build/.github/workflows/get-ci-image-tag.yml@main
with:
product: opensearch-dashboards

tests-linux:
needs: Get-CI-Image-Tag
name: Run unit tests
runs-on: ubuntu-latest
container:
# using the same image which is used by opensearch-build team to build the OpenSearch Distribution
# this image tag is subject to change as more dependencies and updates will arrive over time
image: ${{ needs.Get-CI-Image-Tag.outputs.ci-image-version-linux }}
# need to switch to root so that github actions can install runner binary on container without permission issues.
options: --user root

steps:
- name: Checkout Plugin
uses: actions/checkout@v3
with:
path: dashboards-maps

- name: Checkout OpenSearch Dashboards
uses: actions/checkout@v3
with:
repository: opensearch-project/OpenSearch-Dashboards
ref: ${{ env.OPENSEARCH_DASHBOARDS_BRANCH }}
path: OpenSearch-Dashboards

- name: Move plugin to OpenSearch-Dashboard Plugins Directory
run: mv dashboards-maps OpenSearch-Dashboards/plugins/dashboards-maps

- name: Bootstrap plugin
run: |
chown -R 1000:1000 `pwd`
cd ./OpenSearch-Dashboards/
su `id -un 1000` -c "source $NVM_DIR/nvm.sh && nvm use && node -v && yarn -v &&
cd ./plugins/dashboards-maps &&
whoami && yarn osd bootstrap && yarn run test:jest --coverage"

- name: Uploads coverage
uses: codecov/codecov-action@v1

tests-windows-macos:
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
os: [ windows-latest, macos-latest ]

name: Run unit tests
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -70,5 +113,3 @@ jobs:

- name: Uploads coverage
uses: codecov/codecov-action@v1


1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ cypress/videos/
cypress/screenshots/
yarn-error.log
.DS_Store
.idea
12 changes: 2 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Maintenance
### Refactoring

## [Unreleased 2.x](https://github.com/opensearch-project/dashboards-maps/compare/2.9...2.x)
## [Unreleased 2.x](https://github.com/opensearch-project/dashboards-maps/compare/2.11...2.x)
### Features
* Allow filtering geo_shape fields around map extent ([#452](https://github.com/opensearch-project/dashboards-maps/pull/452))
* Support dark mode in maps-dashboards([#455](https://github.com/opensearch-project/dashboards-maps/pull/455))

### Enhancements

### Bug Fixes

* Fixed maps tooltip display at dark mode[#564](https://github.com/opensearch-project/dashboards-maps/pull/564)
### Infrastructure

### Documentation

### Maintenance
* Bump cypress version to ^13.1.0 ([#462](https://github.com/opensearch-project/dashboards-maps/pull/462))

### Refactoring
35 changes: 35 additions & 0 deletions public/components/tooltip/create_tooltip.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

.mapTooltip {
div.maplibregl-popup-content.mapboxgl-popup-content {
padding: 0;
background: none;
}
}

.maplibregl-popup-anchor-top {
.maplibregl-popup-tip {
border-bottom-color:lightOrDarkTheme($ouiColorEmptyShade, $ouiColorLightestShade) !important;
}
}

.maplibregl-popup-anchor-bottom {
.maplibregl-popup-tip {
border-top-color:lightOrDarkTheme($ouiColorEmptyShade, $ouiColorLightestShade) !important;
}
}

.maplibregl-popup-anchor-left {
.maplibregl-popup-tip {
border-right-color:lightOrDarkTheme($ouiColorEmptyShade, $ouiColorLightestShade) !important;
}
}

.maplibregl-popup-anchor-right {
.maplibregl-popup-tip {
border-left-color:lightOrDarkTheme($ouiColorEmptyShade, $ouiColorLightestShade) !important;
}
}
2 changes: 2 additions & 0 deletions public/components/tooltip/create_tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Popup, MapGeoJSONFeature, LngLat } from 'maplibre-gl';
import { MapLayerSpecification, DocumentLayerSpecification } from '../../model/mapLayerType';
import { FeatureGroupItem, TooltipContainer } from './tooltipContainer';
import { MAX_LONGITUDE } from '../../../common';
import './create_tooltip.scss';

interface Options {
features: MapGeoJSONFeature[];
Expand Down Expand Up @@ -76,6 +77,7 @@ export function createPopup({
closeButton: false,
closeOnClick: false,
maxWidth: 'max-content',
className: 'mapTooltip',
});

const featureGroup = groupFeaturesByLayers(features, layers);
Expand Down
15 changes: 9 additions & 6 deletions public/components/tooltip/tooltipTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,16 @@ import {
} from '@elastic/eui';
import React, { useState, Fragment, useCallback, useEffect, useMemo } from 'react';

export type RowData = {
export interface RowData {
key: string;
value: string;
};
}
export type PageData = RowData[];
export type TableData = PageData[];
type Table = { table: TableData; layer: string };
interface Table {
table: TableData;
layer: string;
}

export const ALL_LAYERS = -1;

Expand Down Expand Up @@ -66,7 +69,7 @@ const TooltipTable = ({
showPagination = true,
showLayerSelection = true,
}: Props) => {
const [selectedLayers, setSelectedLayers] = useState<EuiComboBoxOptionOption<number>[]>([
const [selectedLayers, setSelectedLayers] = useState<Array<EuiComboBoxOptionOption<number>>>([
{
label: tables[0]?.layer ?? '',
value: 0,
Expand Down Expand Up @@ -103,7 +106,7 @@ const TooltipTable = ({
};

const handleLayerChange = useCallback(
(layerSelections: EuiComboBoxOptionOption<number>[]) => {
(layerSelections: Array<EuiComboBoxOptionOption<number>>) => {
if (tables.length === 0) {
return;
}
Expand Down Expand Up @@ -152,7 +155,7 @@ const TooltipTable = ({
return (
<Fragment>
<EuiFlexGroup responsive={false}>
<EuiFlexItem style={{ overflow: 'scroll', maxHeight: 300 }}>
<EuiFlexItem style={{ overflow: 'auto', maxHeight: 300 }}>
<EuiBasicTable
isSelectable={false}
items={pageItems}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## Version 2.10.0.0 Release Notes
Compatible with OpenSearch and OpenSearch Dashboards Version 2.10.0

### Features
* Allow filtering geo_shape fields around map extent ([#452](https://github.com/opensearch-project/dashboards-maps/pull/452))
* Support dark mode in maps-dashboards([#455](https://github.com/opensearch-project/dashboards-maps/pull/455))

### Maintenance
* Bump cypress version to ^13.1.0 ([#462](https://github.com/opensearch-project/dashboards-maps/pull/462))
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Version 2.11.0.0 Release Notes
Compatible with OpenSearch and OpenSearch Dashboards Version 2.11.0

### Maintenance
* Increment version to 2.11.0.0 ([#476](https://github.com/opensearch-project/dashboards-maps/pull/476))
Loading