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

Feature/marker click event #13

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Conversation

jseremba
Copy link

@jseremba jseremba commented May 7, 2018

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

<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>

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
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

<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>

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
Author

Choose a reason for hiding this comment

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

Done

<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>

Choose a reason for hiding this comment

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

Same here

Copy link
Author

Choose a reason for hiding this comment

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

Done

<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>

Choose a reason for hiding this comment

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

Same here

Copy link
Author

Choose a reason for hiding this comment

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

Done

return errorMessage;
}

private executeOnClickAction = (data: LatLng) => {

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
Author

Choose a reason for hiding this comment

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

Done

@@ -59,8 +59,8 @@ class MxUiMock implements mx.ui {
openForm(
_path: string,
_args?: {
location?: "content" | "popup" | "modal",
domNode?: HTMLElement,
location?: "content" | "popup" | "modal" | "node",

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
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
Author

Choose a reason for hiding this comment

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

Removed

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());

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());

public static validateProps(props: GoogleMapContainerProps): string {
let errorMessage = "";
if (props.onClickEvent === "callMicroflow" && !props.onClickMicroflow) {
errorMessage = "A 'Microflow' is required for 'Markers' 'Call a microflow'";

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
Author

Choose a reason for hiding this comment

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

Done

} 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'";

Choose a reason for hiding this comment

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

same here

Copy link
Author

Choose a reason for hiding this comment

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

Done

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'";

Choose a reason for hiding this comment

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

Same here

Copy link
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

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

@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