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

Change type of binding to allow changes to mergetabs during runtime #3508

Merged
merged 3 commits into from Feb 13, 2018

Conversation

pfirpfel
Copy link
Contributor

see: GEO-977

Tested with desktop_alt. Changes to the bound object during runtime will be reflected in a new search.
This should not break existing code as long the feature is used like in the desktop_alt.

@pfirpfel pfirpfel added this to the 2.2 milestone Feb 12, 2018
@pfirpfel pfirpfel self-assigned this Feb 12, 2018
@@ -90,7 +90,7 @@ gmf.displayquerygridComponent = {
'removeEmptyColumnsFn': '&?gmfDisplayquerygridRemoveemptycolumns',
'maxResultsFn': '&?gmfDisplayquerygridMaxresults',
'maxRecenterZoomFn': '&?gmfDisplayquerygridMaxrecenterzoom',
'mergeTabsFn': '&?gmfDisplayquerygridMergetabs'
'mergeTabs': '=?gmfDisplayquerygridMergetabs'
Copy link
Member

Choose a reason for hiding this comment

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

< is better than = in this case. Because the change can only be from the main controller to this controller, never in the other way. So that's useless to watch the change in this controller.

@@ -274,7 +274,7 @@ gmf.DisplayquerygridController = function($injector, $scope, ngeoQueryResult, ng
gmf.DisplayquerygridController.prototype.$onInit = function() {
this.removeEmptyColumns_ = this['removeEmptyColumnsFn'] ? this['removeEmptyColumnsFn']() === true : false;
this.maxRecenterZoom = this['maxRecenterZoomFn'] ? this['maxRecenterZoomFn']() : undefined;
this.mergeTabs_ = this['mergeTabsFn'] ? this['mergeTabsFn']() : {};
this.mergeTabs_ = this['mergeTabs'] ? this['mergeTabs'] : {};
Copy link
Member

Choose a reason for hiding this comment

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

You can remove this line and change the line 217 from:

   /**
    * @type {!gmfx.GridMergeTabs}
    * @private
    */
   this.mergeTabs_ = {};

to

   /**
    * @type {!gmfx.GridMergeTabs}
    */
   this.mergeTabs = {};

Then, adapt all this.mergeTabs_ to this.mergeTabs;

@@ -274,7 +273,7 @@ gmf.DisplayquerygridController = function($injector, $scope, ngeoQueryResult, ng
gmf.DisplayquerygridController.prototype.$onInit = function() {
this.removeEmptyColumns_ = this['removeEmptyColumnsFn'] ? this['removeEmptyColumnsFn']() === true : false;
this.maxRecenterZoom = this['maxRecenterZoomFn'] ? this['maxRecenterZoomFn']() : undefined;
this.mergeTabs_ = this['mergeTabs'] ? this['mergeTabs'] : {};
this.mergeTabs = this['mergeTabs'] ? this['mergeTabs'] : {};
Copy link
Member

Choose a reason for hiding this comment

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

Now you can completely remove this line. If nothing set the property, it will be the property declared in the constructor (so {}).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

true

@pfirpfel pfirpfel force-pushed the allow-changes-to-mergetabs-2.2 branch from 0a921c7 to 5e32ae1 Compare February 12, 2018 16:06
@pfirpfel pfirpfel merged commit b8ad5bd into camptocamp:2.2 Feb 13, 2018
@pfirpfel pfirpfel deleted the allow-changes-to-mergetabs-2.2 branch February 13, 2018 13:32
@sbrunner sbrunner modified the milestones: 2.2, 2.3 Apr 13, 2018
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