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

feat: #560 google map web component #622

Merged
merged 19 commits into from
Mar 26, 2020

Conversation

trankhacvy
Copy link
Contributor

No description provided.

@trankhacvy trankhacvy force-pushed the feat/560-Google-Map-web-component branch from 7ba9ffc to d0da1d3 Compare March 17, 2020 06:44
@github-actions github-actions bot requested a review from duong-se March 17, 2020 06:44
@trankhacvy trankhacvy force-pushed the feat/560-Google-Map-web-component branch from d0da1d3 to 9a940e9 Compare March 17, 2020 07:54
Copy link
Contributor

@willmcvay willmcvay left a comment

Choose a reason for hiding this comment

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

Much better than v1 - just needs a bit of tidy up and a few tests. Good work though, appreciate it's a new thing and not necessarily clear what the best patterns are yet

functions: 90,
lines: 98,
statements: 97,
functions: 70,
Copy link
Contributor

Choose a reason for hiding this comment

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

That's a big drop in test coverage - we should work on this

Go: 4,
},
BicyclingLayer: jest.fn().mockImplementation(function() {
// @ts-ignore
Copy link
Contributor

Choose a reason for hiding this comment

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

Why all the ts-ignores - surely the mock should conform to the type?

price: string
}

export const getContent = ({
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this not make sense as a svelte component? I get why you wouldn't when it was a React component but Svelte is just HTML and CSS - we could get rid of the inline styles too

@@ -0,0 +1,34 @@
import svelte from 'rollup-plugin-svelte'
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't think this file is needed anymore

import GoogleMap from '../google-map.svelte'
import { render } from '@testing-library/svelte'
import { get } from 'svelte/store'
// import { loader } from '../../../../common/utils/loader'
Copy link
Contributor

Choose a reason for hiding this comment

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

Can be removed

let mapLoading: boolean = false

const unsubscribeSearchWidgetStore = searchWidgetStore.subscribe(store => {
if (map && storeInstance && storeInstance.properties !== store.properties) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a note to me - I am not sure this is the best solution but will try and come up with something better - leave for now!

createMockFuncsFromArray(instance, ['bindTo', 'get', 'notify', 'set', 'setValues', 'unbind', 'unbindAll'])
}

const maps = {
Copy link
Contributor

Choose a reason for hiding this comment

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

This mock gets loaded in the jest-setup file at the root of the project - might be not necessary at all!

searchType?: SearchType
searchKeyword?: string
markers: google.maps.Marker[]
mapLoading: boolean
Copy link
Contributor

Choose a reason for hiding this comment

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

I think mapLoading is not now referenced in the code, if not, we can remove

expect(createMarker).toHaveBeenCalledTimes(1)
})

// it('should return correctly when no properties', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

See my comment about tests - we should test this function better - it is quite complex - recommend as a start point breaking down into blocks and testing them separately. Happy to help with this

import { SearchWidgetStore } from '../core/store'
import { Writable } from 'svelte/store'

export const showPropertiesMarker = (
Copy link
Contributor

Choose a reason for hiding this comment

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

See my previous - it's quite complex!

@github-actions github-actions bot requested a review from willmcvay March 19, 2020 05:39
@duong-se duong-se changed the title Feat/560 google map web component feat: 560 google map web component Mar 20, 2020
@duong-se duong-se changed the title feat: 560 google map web component feat: #560 google map web component Mar 20, 2020
@willmcvay willmcvay force-pushed the feat/560-Google-Map-web-component branch from 2770f45 to 09deee5 Compare March 24, 2020 21:22
@github-actions github-actions bot requested a review from leXuanNha March 25, 2020 08:09
@willmcvay willmcvay force-pushed the feat/560-Google-Map-web-component branch from c642ef4 to 5cff980 Compare March 25, 2020 13:52
@github-actions github-actions bot added aml-checklist Relates to Anti-money laundering app cognito-auth Issue relates to Cognito Auth NPM package cognito-custom-mail-lambda elements Relates to Elements components and utilities geo-diary Relates to GEO Diary app graphql-server lifetime-legal Relates to Lifetime Legal App marketplace Relates to the Marketplace react-app-scaffolder Relates to React App Scaffolder package smb-onboarder Relates to Small Medium Business onboarding app labels Mar 25, 2020
Copy link
Contributor

@duong-se duong-se left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@willmcvay willmcvay left a comment

Choose a reason for hiding this comment

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

Ready to go now 👍

@trankhacvy trankhacvy merged commit 50a8162 into master Mar 26, 2020
@trankhacvy trankhacvy deleted the feat/560-Google-Map-web-component branch March 26, 2020 10:18
nphivu414 pushed a commit that referenced this pull request Apr 29, 2020
* feat: Create Google Map web component
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aml-checklist Relates to Anti-money laundering app cognito-auth Issue relates to Cognito Auth NPM package cognito-custom-mail-lambda elements Relates to Elements components and utilities geo-diary Relates to GEO Diary app graphql-server lifetime-legal Relates to Lifetime Legal App marketplace Relates to the Marketplace react-app-scaffolder Relates to React App Scaffolder package smb-onboarder Relates to Small Medium Business onboarding app web-components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants