You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pinot.apache.org by GitBox <gi...@apache.org> on 2019/01/28 21:20:11 UTC

[GitHub] harleyjj commented on a change in pull request #3715: Email share

harleyjj commented on a change in pull request #3715: Email share
URL: https://github.com/apache/incubator-pinot/pull/3715#discussion_r251597573
 
 

 ##########
 File path: thirdeye/thirdeye-frontend/app/pods/home/share-dashboard/controller.js
 ##########
 @@ -409,58 +342,56 @@ export default Controller.extend({
     const customizeEmail1 = document.getElementById('customizeEmail1').value;
     const customizeEmail2 = document.getElementById('customizeEmail2').value;
 
-    const sibingValue = type === 'one' ? customizeEmail2 : customizeEmail1;
-    this.toggleProperty(`show${sibingValue}`);
+    const siblingValue = type === 'one' ? customizeEmail2 : customizeEmail1;
+    this._toggleTreeProperty(`show${siblingValue}`);
 
     //Calculates colspan Number
     const showCustomizeEmailTemplate = get(this, 'showCustomizeEmailTemplate');
     if(showCustomizeEmailTemplate && (customizeEmail1 === 'Nothing' || customizeEmail2 === 'Nothing')) {
-      set(this, 'colspanNum', 5);
+      set(this, 'tree.firstObject.colspanNum', 5);
     } else if (showCustomizeEmailTemplate) {
-      set(this, 'colspanNum', 6);
+      set(this, 'tree.firstObject.colspanNum', 6);
     } else {
-      set(this, 'colspanNum', 4);
+      set(this, 'tree.firstObject.colspanNum', 4);
     }
 
+    let limitedSelfOptions = this._selectOption([ ...CUSTOMIZE_OPTIONS], option);
+    let limitedSiblingOptions = this._selectOption([ ...CUSTOMIZE_OPTIONS], siblingValue);
+
     //limited sibling list to selected choice
-    const limitedSiblingOptions = CUSTOMIZE_OPTIONS.filter(function(item){
+    limitedSiblingOptions = limitedSiblingOptions.filter(function(item){
       return item.value !== option;
     });
     //limited current list to sibling's existing selected
-    const limitedSelfOptions = CUSTOMIZE_OPTIONS.filter(function(item){
-      return item.value !== sibingValue;
+    limitedSelfOptions = limitedSelfOptions.filter(function(item){
+      return item.value !== siblingValue;
     });
 
-    if (type === 'one') {
-      set(this, 'options_two', limitedSiblingOptions);
-      set(this, 'options', limitedSelfOptions);
-    } else {
-      set(this, 'options', limitedSiblingOptions);
-      set(this, 'options_two', limitedSelfOptions);
-    }
-
-    // fetch base on offset
-    if (option !== 'Nothing') {
-      this._getOffsets();
-    }
-
     switch(option) {
       case 'Nothing':
         //hide accordingly
         break;
       case 'Wow':
         //show wow column and it's sibling
-        this.toggleProperty('showWow');
+        this._toggleTreeProperty('showWow');
 
 Review comment:
   Yes, I needed to toggle the property in the tree so that the state gets passed across sessions.  The props just read from the tree now.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pinot.apache.org
For additional commands, e-mail: dev-help@pinot.apache.org