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

Even more typecheck fixes for gmf #4588

Merged
merged 4 commits into from Feb 6, 2019
Merged

Conversation

adube
Copy link
Contributor

@adube adube commented Feb 4, 2019

As title says.

I noticed that the getter/setters filterCondition for ngeo/datasource/OGC have been removed. Why?

@adube adube requested review from fredj and sbrunner February 4, 2019 19:22
Copy link
Member

@sbrunner sbrunner left a comment

Choose a reason for hiding this comment

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

I noticed that the getter/setters filterCondition for ngeo/datasource/OGC have been removed. Why?

Probably by error ...

contribs/gmf/src/datasource/OGC.js Show resolved Hide resolved
contribs/gmf/src/layertree/component.js Show resolved Hide resolved
* @return {string} Filter condition
* @export
*/
get filterCondition() {
Copy link
Member

Choose a reason for hiding this comment

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

why do we need to have getter and setter for this variable ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. This variable needs to be changed. In the filter component, one can set OR instead of AND, which affect this variable, thus it needs a setter
  2. It needs a getter because we bind UI components to it
  3. If you look around the other properties of the data source classes, you'll notice that they have getters/setters as well and those we're removed. If this one was removed, then why not the others?
  4. Back then, when this was first implemented, it was my first time writing ES6 classes, and the use of getters/setters seemed quite nice and it was working with Angular well. This was a good choice.
  5. The typecheck complains that there is not a filterCondition property set. Is this because inner properties can't be accessed?

Please, comment. Thanks.

Copy link
Member

Choose a reason for hiding this comment

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

ok, so it was changed ("simple" public variable to getter / setter) for the typecheck ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know why it was changed. It was using a getter/setter before and it was working fine.

@adube adube force-pushed the fix-types-gmf branch 2 times, most recently from 9df77f7 to 8a4d6fc Compare February 5, 2019 18:08
@adube
Copy link
Contributor Author

adube commented Feb 6, 2019

Please, let me know if I can merge this. Thanks.

Copy link
Member

@sbrunner sbrunner left a comment

Choose a reason for hiding this comment

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

Looks good, thanks :-)

@adube adube merged commit 8f1a3a6 into camptocamp:master Feb 6, 2019
@adube adube deleted the fix-types-gmf branch February 6, 2019 13:46
@sbrunner sbrunner added this to the 2.4 milestone Feb 28, 2019
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.

None yet

3 participants