74 lines
2.2 KiB
JavaScript
74 lines
2.2 KiB
JavaScript
|
|
class SoeController extends EICController {
|
|
|
|
constructor() {
|
|
super();
|
|
|
|
app.meta.add('soe-fundings', app.Assets.Store.json['soe-fundings']);
|
|
app.meta.add('soe-countries', app.Assets.Store.json['coaching-countries']);
|
|
}
|
|
|
|
/**
|
|
* Entrypoint for FastTrack Managers
|
|
*/
|
|
dashboard() {
|
|
|
|
app.User.getBusinessPermissions(['/soe'])
|
|
.then(payload => {
|
|
|
|
if(payload['/soe'].permissions.length > 0) {
|
|
let models = {
|
|
soe: new SoeModel(payload['/soe'].permissions)
|
|
}
|
|
|
|
let scope = payload['/soe'].profile.country ? app.meta.getItem('soe-countries', payload['/soe'].profile.country).label: 'Monitoring';
|
|
|
|
this.loadWindow(
|
|
'projects/soe/SoeDashboardView',
|
|
{ title: 'SoE ' + scope, static: true, expanded: true },
|
|
{
|
|
models: models,
|
|
scope : scope
|
|
}
|
|
);
|
|
} else {
|
|
ui.growl.append('Sorry, you do not have access to this resource!', 'danger')
|
|
}
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
feedbacks(options) {
|
|
|
|
let pic = options.params.pic
|
|
let number = options.params.number
|
|
|
|
app.User.getBusinessPermissions([`/soe/organisations/${pic}/projects/${number}/fundings`])
|
|
.then(payload => {
|
|
let scope = payload[`/soe/organisations/${pic}/projects/${number}/fundings`]
|
|
if(scope.permissions.length > 0) {
|
|
|
|
let models = { soe: new SoeModel(scope.permissions) }
|
|
|
|
this.loadWindow(
|
|
'projects/soe/SoeFeedbacksView',
|
|
{ title: `Project ${number} (SoE)`, static: true, expanded: true },
|
|
{
|
|
pic: pic,
|
|
number: number,
|
|
models: models
|
|
}
|
|
);
|
|
} else {
|
|
ui.growl.append('Sorry, you do not have access to this resource', 'danger')
|
|
}
|
|
});
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
app.registerClass('SoeController', SoeController); |