Last active
August 1, 2017 07:32
-
-
Save kumkanillam/77853a0da29f25eca9633a1a019949d2 to your computer and use it in GitHub Desktop.
test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
userConfig: Ember.inject.service(), | |
didReceiveAttrs(){ | |
console.log(' didReceiveAttrs in report-prereq'); | |
let prerequisiteCategory = this.get('userConfig').isReportPrerequisiteNeeded(this.get('reportId')); | |
if(prerequisiteCategory){ | |
if(prerequisiteCategory === 'sharepoint-report-permission'){ | |
//request the server ajax request | |
Ember.RSVP.resolve('getJSON').then((result)=>{ | |
//logic check autoAddPermission false && siteCollection is there without permission | |
this.set('showSharePointReportPermission',true); | |
}); | |
} | |
} | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
userConfig:Ember.inject.service(), | |
currentRouteNameChanged: Ember.observer('currentRouteName', function() { | |
this.set('userConfig.currentRouteName', this.get('currentRouteName')); | |
}), | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
import config from './config/environment'; | |
const Router = Ember.Router.extend({ | |
location: 'none', | |
rootURL: config.rootURL | |
}); | |
Router.map(function() { | |
this.route('reports',{path:'reports/:reportId'}); | |
}); | |
export default Router; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Route.extend({ | |
model({reportId}){ | |
return {reportId}; | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Service.extend({ | |
currentRouteName:'', | |
isSharePointReports:Ember.computed('currentRouteName',function(){ | |
return this.get('currentRouteName') === 'reports' ? true: false; | |
}), | |
isExchangeAuditReports:Ember.computed('currentRouteName',function(){ | |
return true; | |
}), | |
isReportPrerequisiteNeeded(reportId){ | |
if(this.get('isSharePointReports') && this.get('reportId') == 1){ | |
return 'sharepoint-report-permission' | |
} | |
/* | |
if(this.get('isExchangeAuditReports')){ | |
return 'exchange-audit-reports-permission'; | |
} | |
*/ | |
return false; | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.12.1", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "2.12.0", | |
"ember-template-compiler": "2.12.0", | |
"ember-testing": "2.12.0" | |
}, | |
"addons": { | |
"ember-data": "2.12.1" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment