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
[Maps] Register GeoJson upload with integrations page #126350
Conversation
@thomasneirynck would you like to review this PR? |
x-pack/plugins/maps/public/classes/layers/wizards/load_layer_wizards.ts
Outdated
Show resolved
Hide resolved
...s/public/classes/layers/wizards/solution_layers/observability/observability_layer_wizard.tsx
Outdated
Show resolved
Hide resolved
...lugins/maps/public/classes/layers/wizards/solution_layers/security/security_layer_wizard.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/maps/public/routes/map_page/saved_map/get_open_layer_wizard_url_param.ts
Show resolved
Hide resolved
x-pack/plugins/maps/public/routes/map_page/saved_map/get_open_layer_wizard_url_param.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/maps/public/routes/map_page/saved_map/get_open_layer_wizard_url_param.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/maps/public/classes/layers/wizards/layer_wizard_registry.ts
Outdated
Show resolved
Hide resolved
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.
I think that layerWizardId
needs to be renamed to something more specific. As is, layerWizardId
is very misleading as it conveys that it's the redux state for any open layer wizard and this is not the case. In AddLayerPanel, selecting a layer wizard only updates component state and does not update redux state. I think renaming layerWizardId
to something like autoOpenLayerWizardId
will avoid confusion.
x-pack/plugins/maps/public/classes/layers/wizards/file_upload_wizard/config.tsx
Outdated
Show resolved
Hide resolved
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.
Can you add a functional test to ensure the URL works. https://github.com/elastic/kibana/blob/main/x-pack/test/functional/apps/maps/discover.js is a good example of testing linking to maps
x-pack/plugins/maps/public/classes/layers/wizards/layer_wizard_registry.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/maps/public/connected_components/add_layer_panel/index.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/maps/public/connected_components/add_layer_panel/index.ts
Outdated
Show resolved
Hide resolved
@elasticmachine merge upstream |
Pinging @elastic/kibana-gis (Team:Geo) |
x-pack/plugins/maps/public/connected_components/add_layer_panel/view.tsx
Outdated
Show resolved
Hide resolved
defaultMessage: 'Upload GeoJson with Elastic Maps.', | ||
}), | ||
uiInternalPath: core.http.basePath.prepend( | ||
getFullPath(`?${OPEN_LAYER_WIZARD}=${WIZARD_ID.GEO_FILE}`) |
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.
The signature of getFullPath
expects a saved object id. We are kind of hijacking the method here. Plus the URL is not quite right and when followed produces URLs like http://localhost:5601/qni/app/maps/map?openLayerWizard=uploadGeoFile#?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-15m,to:now))&_a=(filters:!(),query:(language:kuery,query:''))
Notice there are 2 ?
which is wrong.
You can change to the below. It looks like core.http.basePath.prepend
is not needed. Also notice #
character added. Query parameters need to be after #
character.
uiInternalPath: `${getFullPath()}#?${OPEN_LAYER_WIZARD}=${WIZARD_ID.GEO_FILE}`
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.
Did you mean getFullPath('')
? Because this function requires an id
or undefined
.
@elasticmachine merge upstream |
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. Lets get copy review from @gchaps before merging
code review, tested in chrome
💚 Build SucceededMetrics [docs]Module Count
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
* elastic#116653 - added GeoJson upload for Intergrations page * 116653 - refactoring for messages * 116653 - fixed Checks and api tests * 116653 - fixed checks * 116653 - refactoring; Added constants and registrations for shapefile * 116653 - fixed api test * 116653 - added method for getting selected wizard * 116653 - refactoring * 116653 - refactoring; Added constants, variables renamed * 116653 - prettier fixes * 116653 - refactoring; functional test added * 116653 - test file extension changed to TS * 116653 - refactoring * 116653 - refactoring; test updated * 116653 - refactoring Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Closes: #116653
Added cards on Integration page to upload GeoJson. Links to Maps app with
upload_geojson
parameter in url now opens layer sidebar with expanded wizard.