-
Notifications
You must be signed in to change notification settings - Fork 917
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
Enable users to select custom vector map for visualization #1718
Enable users to select custom vector map for visualization #1718
Conversation
Signed-off-by: Shivam Dhar <[email protected]>
Signed-off-by: Shivam Dhar <[email protected]>
Signed-off-by: Shivam Dhar <[email protected]>
…ions Signed-off-by: Shivam Dhar <[email protected]>
…ction Signed-off-by: Shivam Dhar <[email protected]>
Signed-off-by: Shivam Dhar <[email protected]>
Signed-off-by: Shivam Dhar <[email protected]>
Signed-off-by: Shivam Dhar <[email protected]>
Signed-off-by: Shivam Dhar <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #1718 +/- ##
==========================================
- Coverage 67.52% 67.51% -0.01%
==========================================
Files 3067 3073 +6
Lines 58973 59067 +94
Branches 8944 8961 +17
==========================================
+ Hits 39822 39880 +58
- Misses 16972 17004 +32
- Partials 2179 2183 +4
Continue to review full report at Codecov.
|
src/plugins/region_map/public/components/map_choice_options.tsx
Outdated
Show resolved
Hide resolved
src/plugins/region_map/public/components/map_choice_options.tsx
Outdated
Show resolved
Hide resolved
src/plugins/region_map/public/components/map_choice_options.tsx
Outdated
Show resolved
Hide resolved
Can we also add some tests for all the new code introduced? |
Signed-off-by: Shivam Dhar <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Shivam! LGTM
describe('map_choice_options', () => { | ||
it('renders the MapChoiceOptions based on the props provided', async () => { | ||
const props = jest.mock; | ||
const vis = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: since most of the fields here remain the same across the tests, you can set a default one and only override the props you need to be different for each test so that reading the tests is a lot easier.
e.g.
const DEFAULT = {
colorSchema: {},
outlineWeight: {},
...
}
// And in test 1
const viz = {
...DEFAULT,
...{
customProp: something
}
}
The same comment goes for the other tests too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
enable users to select custom vector map for visualization Signed-off-by: Shivam Dhar <[email protected]> (cherry picked from commit dfbfec4)
…1865) enable users to select custom vector map for visualization Signed-off-by: Shivam Dhar <[email protected]>
…h-project#1718) (opensearch-project#1865) enable users to select custom vector map for visualization Signed-off-by: Shivam Dhar <[email protected]>
Description
In case custom maps are uploaded by the user, the layer options tab provides a choice for users to either select default or custom map for visualization. The PR adds logic for custom map selection and projection via leaflet.
Fig. showing choice of selection between custom and default vector maps (in case custom map is uploaded by user)
Fig. showing us counties visualized on base map (based on custom vector map selected)
Issues Resolved
#1408
Task - Allow users to select index as custom vector map for visualization
Check List
yarn test:jest
yarn test:jest_integration
yarn test:ftr