unclean SPARC
This commit is contained in:
@@ -0,0 +1,88 @@
|
||||
class ICMPController extends EICController {
|
||||
|
||||
constructor(params) {
|
||||
super(params)
|
||||
app.meta.add('icmp-techdd-status', app.Assets.Store.json['icmp-techdd-status']);
|
||||
app.meta.add('icmp-fundings', app.Assets.Store.json['icmp-fundings']);
|
||||
app.meta.add('icmp-countries', app.Assets.Store.json['icmp-countries']);
|
||||
app.meta.add('icmp-instruments', app.Assets.Store.json['icmp-instruments']);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns
|
||||
*/
|
||||
Dashboard() {
|
||||
console.log('here')
|
||||
ui.lock();
|
||||
|
||||
app.User.getBusinessPermissions([ '/icmp/projects' ])
|
||||
.then(async payload => {
|
||||
|
||||
ui.unlock();
|
||||
|
||||
if(payload['/icmp/projects'].permissions.length > 0) {
|
||||
let models = {
|
||||
projects: new ICMPProjectsModel(payload['/icmp/projects'].permissions)
|
||||
};
|
||||
|
||||
if(app.User.hasRole('PROJECT_PO') || app.User.hasRole('PROJECT_FIO')) {
|
||||
this.loadWindow(
|
||||
'projects/icmp/ProjectFundingPODashboardView',
|
||||
{ title: 'ICMP', static: true, expanded: true },
|
||||
{ models: models } );
|
||||
return;
|
||||
}
|
||||
|
||||
if(app.User.hasRole('PROJECT_TechDDExpert')) {
|
||||
this.loadWindow(
|
||||
'projects/icmp/ProjectFundingExpertDashboardView',
|
||||
{ title: 'ICMP', static: true, expanded: true },
|
||||
{ models: models } );
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
ui.growl.append('You don\'t have access to this resource', 'danger' );
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {*} options
|
||||
*/
|
||||
project(options) {
|
||||
|
||||
let number = options.params.number
|
||||
let node = options.params.node
|
||||
let nodeId = options.params.nodeId
|
||||
|
||||
ui.lock();
|
||||
|
||||
app.User.getBusinessPermissions([`/icmp/projects/${number}`])
|
||||
.then(async payload => {
|
||||
|
||||
if(payload[`/icmp/projects/${number}`].permissions.length > 0) {
|
||||
ui.unlock();
|
||||
|
||||
let models = {
|
||||
project: new ICMPProjectModel(payload[`/icmp/projects/${number}`].permissions)
|
||||
};
|
||||
|
||||
this.loadWindow(
|
||||
'projects/icmp/ProjectFundingProjectView',
|
||||
{ title: 'Project sheet', static: true, expanded: true },
|
||||
{
|
||||
models: models,
|
||||
projectNumber: number,
|
||||
node: node,
|
||||
nodeId: nodeId,
|
||||
});
|
||||
} else {
|
||||
ui.growl.append('You don\'t have access to this resource', 'danger' );
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
app.registerClass('ICMPController', ICMPController);
|
||||
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"routes": [],
|
||||
"models": [
|
||||
"projects/icmp/ProjectFundingModel",
|
||||
"projects/icmp/ICMPProjectsModel",
|
||||
"projects/icmp/ICMPProjectModel",
|
||||
"projects/icmp/ICMPProjectNodeModel"
|
||||
],
|
||||
"views": [
|
||||
"projects/icmp/ProjectFundingPODashboardView",
|
||||
"projects/icmp/ProjectFundingExpertDashboardView",
|
||||
"projects/icmp/ProjectFundingProjectView",
|
||||
"projects/icmp/project/ProjectFundingInfoView",
|
||||
"projects/icmp/project/ProjectFundingTechDDView",
|
||||
"projects/icmp/project/ProjectFundingTeamView",
|
||||
"projects/icmp/project/ProjectFundingHistoryView",
|
||||
"projects/icmp/project/ProjectFundingDocumentsView",
|
||||
"projects/icmp/project/dialogs/ICMPNodeActionConfirmDialog",
|
||||
{"view":"projects/icmp/project/forms/ICMPFormTechddV1FullView", "dependencies": ["projects/icmp/project/forms/ICMPFormTechddV1View"]},
|
||||
{"view":"projects/icmp/project/forms/ICMPFormTechddV1EnhancedView", "dependencies": ["projects/icmp/project/forms/ICMPFormTechddV1View"]}
|
||||
|
||||
],
|
||||
"controllerDependencies": [
|
||||
"/thirdparty/eicui/plugins/SVG/SVG",
|
||||
"/thirdparty/eicui/plugins/NodeMap/NodeMap"
|
||||
],
|
||||
"assets": {
|
||||
"styles": [
|
||||
{"path": "/app/thirdparty/eicui/plugins/SVG", "name":"/SVG.css" },
|
||||
{"path": "/app/thirdparty/eicui/plugins/NodeMap", "name":"/NodeMap.css" }
|
||||
],
|
||||
"json": [
|
||||
{ "id": "icmp-techdd-status", "name": "meta/icmp-techdd-statuses.json" },
|
||||
{ "id": "icmp-fundings", "name": "meta/project-funding-types.json" },
|
||||
{ "id": "icmp-countries", "name": "meta/coaching-countries.json" },
|
||||
{ "id": "icmp-instruments", "name": "meta/project-funding-instruments.json" }
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user