Skip to content

Feature/marker click event#13

Open
jseremba wants to merge 12 commits intomasterfrom
feature/marker-click-event
Open

Feature/marker click event#13
jseremba wants to merge 12 commits intomasterfrom
feature/marker-click-event

Conversation

@jseremba
Copy link
Copy Markdown

@jseremba jseremba commented May 7, 2018

  • Add marker click events
  • Update webmodeler visibility props
  • Update widget icon

Comment thread src/GoogleMapsContext.xml
<caption>API key</caption>
<category>General</category>
<description>The Google Maps Javascript API v3 does not require an API key to function correctly. However, Google strongly encourages you to load the Maps API using an APIs key</description>
<description>The Google Maps Javascript API v3 requires an API key.</description>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the full stop

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the DEPRECATED older version of Google Maps

Comment thread src/GoogleMaps.xml Outdated
<property key="onClickMicroflow" type="microflow" required="false" entityProperty="locationsEntity">
<caption>On click microflow</caption>
<category>Markers</category>
<description>The microflow that will be executed when a marker is click </description>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'click' should be 'clicked'

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment thread src/GoogleMaps.xml Outdated
<property key="onClickNanoflow" type="nanoflow" required="false" entityProperty="locationsEntity">
<caption>On click nanoflow</caption>
<category>Markers</category>
<description>The nanoflow that will be executed when a marker is click </description>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment thread src/GoogleMaps.xml Outdated
<property key="page" type="form" required="false">
<caption>Page</caption>
<category>Markers</category>
<description>The page that will be opened when a marker is click</description>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment thread src/components/GoogleMapContainer.ts Outdated
return errorMessage;
}

private executeOnClickAction = (data: LatLng) => {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this function do creates an object 'and' also executes an action, Function should do one thing. separate this => createOnclickObject , executeOnClick

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment thread tests/mocks/Mendix.ts
_args?: {
location?: "content" | "popup" | "modal",
domNode?: HTMLElement,
location?: "content" | "popup" | "modal" | "node",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is node used anywhere or just in code

Copy link
Copy Markdown
Author

@jseremba jseremba May 16, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added node because the mendix client typings API openForm was updated and argument location changed to "content" | "popup" | "modal" | "node"

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

Comment thread src/components/GoogleMapContainer.ts Outdated
error: error => window.mx.ui.error(`Error while executing the on change nanoflow: ${error.message}`)
});
} else if (onClickEvent === "showPage" && page) {
context.setContext(object.getEntity(), object.getGuid());
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this to the line after creating the context or in the new function after separating
const context = new mendix.lib.MxContext();
context.setContext(object.getEntity(), object.getGuid());

Comment thread src/components/GoogleMapContainer.ts Outdated
public static validateProps(props: GoogleMapContainerProps): string {
let errorMessage = "";
if (props.onClickEvent === "callMicroflow" && !props.onClickMicroflow) {
errorMessage = "A 'Microflow' is required for 'Markers' 'Call a microflow'";
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A 'Microflow' is required for on click 'Marker' event 'Call a Microflow'

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment thread src/components/GoogleMapContainer.ts Outdated
} else if (props.onClickEvent === "callNanoflow" && !props.onClickNanoflow.nanoflow) {
errorMessage = "A 'Nanoflow' is required for 'Markers' 'Call a nanoflow'";
} else if (props.onClickEvent === "showPage" && !props.page) {
errorMessage = "A 'Page' is required for 'Markers' 'Show a page'";
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment thread src/components/GoogleMapContainer.ts Outdated
if (props.onClickEvent === "callMicroflow" && !props.onClickMicroflow) {
errorMessage = "A 'Microflow' is required for 'Markers' 'Call a microflow'";
} else if (props.onClickEvent === "callNanoflow" && !props.onClickNanoflow.nanoflow) {
errorMessage = "A 'Nanoflow' is required for 'Markers' 'Call a nanoflow'";
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@jseremba jseremba force-pushed the feature/marker-click-event branch from 1d11feb to 522d43e Compare May 17, 2018 07:09
@codecov-io
Copy link
Copy Markdown

codecov-io commented May 17, 2018

Codecov Report

Merging #13 into master will decrease coverage by 0.9%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #13      +/-   ##
==========================================
- Coverage    82.5%   81.59%   -0.91%     
==========================================
  Files           3        3              
  Lines         160      163       +3     
  Branches       42       43       +1     
==========================================
+ Hits          132      133       +1     
- Misses         28       30       +2
Impacted Files Coverage Δ
src/components/Marker.ts 100% <ø> (ø) ⬆️
src/components/Map.ts 79.59% <66.66%> (-0.97%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b485fb2...2ee9c24. Read the comment docs.

@jseremba jseremba force-pushed the feature/marker-click-event branch from 522d43e to e1518d9 Compare May 17, 2018 07:45
@jseremba jseremba force-pushed the feature/marker-click-event branch from 3416a75 to 179806e Compare May 23, 2018 11:20
Copy link
Copy Markdown

@djkwagala djkwagala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When onClick === "DoNothing" atleast we should have a onhover to show the coordinates. (this is the same case with charts.
This option can be disabled via xml-configs
This is to deal with situations where the google-maps interpreted the location via its "Address" and the coordinates were missing or "0,0".

@jseremba jseremba force-pushed the feature/marker-click-event branch 3 times, most recently from 8ebc13a to f1f3dab Compare June 8, 2018 13:56
@jseremba jseremba force-pushed the feature/marker-click-event branch from f1f3dab to 2ee9c24 Compare June 8, 2018 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants