unclean SPARC
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
<style>
|
||||
.proposal-access { min-width:40vw; }
|
||||
.proposal-access .list .row {
|
||||
grid-template-columns: auto 170px 240px;
|
||||
}
|
||||
.proposal-access .list .cell:nth-child(3),
|
||||
.proposal-access .list .cell:nth-child(4) {
|
||||
text-align: center;
|
||||
}
|
||||
.proposal-access .list .cell:nth-child(4) button {
|
||||
margin: 0 var(--eicui-base-spacing-xs);
|
||||
}
|
||||
</style>
|
||||
<div class="proposal-access">
|
||||
<div eicdatagrid class="list"></div>
|
||||
</div>
|
||||
@@ -0,0 +1,128 @@
|
||||
class SubmissionFormAccessDialog extends EICDialogContent {
|
||||
|
||||
actions = [
|
||||
{
|
||||
label: 'close',
|
||||
onclick: this.cancel.bind(this),
|
||||
severity: 'secondary',
|
||||
role: 'cancel'
|
||||
}
|
||||
]
|
||||
|
||||
DOMContentLoaded(options) {
|
||||
this.mode = options.mode ? options.mode: 'read';
|
||||
for(let model in options.models) this[model] = options.models[model];
|
||||
|
||||
this.pic = options.pic;
|
||||
this.number = options.number;
|
||||
|
||||
this.list = new DataGrid(this.find('.list'), {
|
||||
height: '320px',
|
||||
headers: [
|
||||
{label:'member'},
|
||||
{label:'status'},
|
||||
]
|
||||
});
|
||||
|
||||
this.refreshList();
|
||||
}
|
||||
|
||||
refreshList() {
|
||||
this.list.loading = true;
|
||||
|
||||
let queue = [
|
||||
this.organisation.list(this.pic),
|
||||
this.proposal.list(this.pic, this.number)
|
||||
]
|
||||
|
||||
Promise.allSettled(queue)
|
||||
.then((results) => {
|
||||
this.fill();
|
||||
});
|
||||
}
|
||||
|
||||
fill() {
|
||||
this.list.clear();
|
||||
this.list.loading = false;
|
||||
console.log('', this.proposal.contributors)
|
||||
for(let item of this.organisation.members) {
|
||||
let report = this.checkContribution(item.uid);
|
||||
let row = this.list.addRow(item.uid, [
|
||||
`${item.firstname} ${item.lastname}`,
|
||||
report.label
|
||||
])
|
||||
console.log('',report)
|
||||
for(let button of report.actions) {
|
||||
row.querySelector('.cell:last-child').append(button.el)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
checkContribution(uid) {
|
||||
let contributor = this.proposal.contributors.find(person => person.uid == uid);
|
||||
let button;
|
||||
let report = {
|
||||
status: '',
|
||||
label: 'not contributing',
|
||||
actions: []
|
||||
};
|
||||
|
||||
if(!contributor) {
|
||||
button = new Button(null, {label:'add', size:'xsmall', severity:'primary'});
|
||||
button.el.dataset.uid = uid;
|
||||
button.addEventListener('click', this.grant.bind(this));
|
||||
report.actions.push(button);
|
||||
} else {
|
||||
report.status = contributor.status;
|
||||
switch(contributor.status) {
|
||||
case 'active':
|
||||
report.label = 'contributing';
|
||||
button = new Button(null, {label:'revoke', size:'xsmall', severity:'danger'});
|
||||
button.el.dataset.uid = uid;
|
||||
button.addEventListener('click', this.revoke.bind(this));
|
||||
if(uid == app.User.identity.uuid) {
|
||||
button.disabled = true;
|
||||
}
|
||||
report.actions.push(button);
|
||||
break;
|
||||
case 'pending':
|
||||
report.label = 'requesting access';
|
||||
button = new Button(null, {label:'reject', size:'xsmall', severity:'danger'});
|
||||
button.el.dataset.uid = uid;
|
||||
button.addEventListener('click', this.revoke.bind(this));
|
||||
report.actions.push(button);
|
||||
button = new Button(null, {label:'accept', size:'xsmall', severity:'success'});
|
||||
button.el.dataset.uid = uid;
|
||||
button.addEventListener('click', this.grant.bind(this));
|
||||
report.actions.push(button);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return report;
|
||||
}
|
||||
|
||||
grant(event) {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
|
||||
let button = new Button(event.currentTarget);
|
||||
button.loading = true;
|
||||
|
||||
this.proposal.grant(this.pic, this.number, button.el.dataset.uid)
|
||||
.then(async payload => { this.refreshList(); })
|
||||
}
|
||||
|
||||
revoke(event) {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
|
||||
let button = new Button(event.currentTarget);
|
||||
button.loading = true;
|
||||
|
||||
this.proposal.revoke(this.pic, this.number, button.el.dataset.uid)
|
||||
.then(async payload => { this.refreshList(); })
|
||||
}
|
||||
}
|
||||
|
||||
app.registerClass('SubmissionFormAccessDialog', SubmissionFormAccessDialog);
|
||||
@@ -0,0 +1,15 @@
|
||||
<div class="complaint-form">
|
||||
<p>You may complain about the experts' "NO GO" recommendation of your Step1 short application on a limited number of grounds:</p>
|
||||
<ul bulleted>
|
||||
<li>A factual mistake of one or more experts. But remember that a fact is not an opinion.</li>
|
||||
<li>A manifest error of appreciation as to the purpose and scope of the Accelerator.
|
||||
E.g. considering that scaling-up an innovation already deployed means that it is not innovative anymore; considering a proposal as too risky; considering that since an innovation already exists outside the EU it should not be developed in the EU.
|
||||
</li>
|
||||
<li>Asking for detailed information or documents you were not deemed to submit at Step 1, but only later your Step 2 full application. Remember, you are still requested to provide sufficient information to enable evaluators to assess each criterion.
|
||||
E.g. asking for a detailed budget of the action
|
||||
</li>
|
||||
</ul>
|
||||
<p>These are very specific grounds. Be precise (which criteria, which expert(s), which ground(s)) and concise when filling this complaint form. Be straight to the point. A complaint only discussing experts’ opinions will not be taken into consideration.</p>
|
||||
<p>We will then let you know within 5 working days if your claim is rejected and the initial experts’ recommendation confirmed, or accepted. If accepted, we will send your complaint to the concerned experts, who will have 5 working days to assess it and deliver their final recommendation to the EIC, which will then be communicated to you.</p>
|
||||
<textarea eictextarea name="content" data-path="" maxlen="10000" class="required"></textarea>
|
||||
</div>
|
||||
@@ -0,0 +1,53 @@
|
||||
class SubmissionFormComplaintDialog extends EICDialogContent {
|
||||
actions = [
|
||||
{
|
||||
label: 'cancel',
|
||||
onclick: this.cancel.bind(this),
|
||||
severity: 'secondary',
|
||||
role: 'cancel'
|
||||
},
|
||||
{
|
||||
label: 'File complaint',
|
||||
onclick: this.complain.bind(this),
|
||||
severity: 'primary',
|
||||
role: 'save'
|
||||
}
|
||||
]
|
||||
|
||||
DOMContentLoaded(options) {
|
||||
ui.eicfy(this.el);
|
||||
this.form = new Form(this.el);
|
||||
this.pic = options.pic;
|
||||
this.number = options.number;
|
||||
this.proposal = options.proposal
|
||||
}
|
||||
|
||||
async complain(event) {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
|
||||
if(this.form.validate()) {
|
||||
console.log('form valid', this.form.value)
|
||||
this.actions.find(o => o.role == 'save').button.loading = true;
|
||||
this.actions.find(o => o.role == 'cancel').button.disabled = true;
|
||||
|
||||
this.proposal.complain(this.pic, this.number, this.form.value)
|
||||
.then(
|
||||
async payload => {
|
||||
ui.growl.append('Your complaint has been filed', 'success');
|
||||
this.actions.find(o => o.role == 'save').button.loading = false;
|
||||
this.actions.find(o => o.role == 'cancel').button.disabled = false;
|
||||
this.commit(true);
|
||||
},
|
||||
async () => {
|
||||
ui.growl.append('Your complaint could not be filed', 'danger');
|
||||
this.actions.find(o => o.role == 'save').button.loading = false;
|
||||
this.actions.find(o => o.role == 'cancel').button.disabled = false;
|
||||
this.commit(false);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
app.registerClass('SubmissionFormComplaintDialog', SubmissionFormComplaintDialog);
|
||||
@@ -0,0 +1,4 @@
|
||||
<div eicalert warning>
|
||||
<p>We detected that this proposal is currently already opened by <span class="contributor"></span> for editing.</p>
|
||||
<p>You may safely open this proposal in read-only mode for consultation purpose and try again a bit later to open it for editing.</p>
|
||||
</div>
|
||||
@@ -0,0 +1,27 @@
|
||||
class SubmissionFormConcurrencyDialog extends EICDialogContent {
|
||||
actions = [
|
||||
{
|
||||
label: 'cancel',
|
||||
onclick: this.cancel.bind(this),
|
||||
severity: 'secondary',
|
||||
role: 'cancel'
|
||||
},
|
||||
{
|
||||
label: 'Open in read-only mode (safe)',
|
||||
onclick: this.continue.bind(this),
|
||||
severity: 'primary',
|
||||
role: 'save'
|
||||
}
|
||||
]
|
||||
|
||||
DOMContentLoaded(options) {
|
||||
this.find('.contributor').innerHTML =
|
||||
options.contributor.uid == app.User.identity.uuid ?
|
||||
'you':
|
||||
`${options.contributor.firstname} ${options.contributor.lastname}`;
|
||||
}
|
||||
|
||||
continue() { this.commit(true); }
|
||||
}
|
||||
|
||||
app.registerClass('SubmissionFormConcurrencyDialog', SubmissionFormConcurrencyDialog);
|
||||
@@ -0,0 +1,45 @@
|
||||
<div class="member">
|
||||
<input eicinput type="hidden" data-path="" name="id" value="" />
|
||||
<div class="cols-3">
|
||||
<div>
|
||||
<label>Gender</label>
|
||||
<select eicselect name="gender" data-path="" data-type="text" class="required">
|
||||
<option></option>
|
||||
<option value="F">Female</option>
|
||||
<option value="M">Male</option>
|
||||
<option value="I">I prefer not to declare</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label>First name</label>
|
||||
<input eicinput name="firstname" data-path="" data-type="text" maxlen="100" class="required" />
|
||||
</div>
|
||||
<div>
|
||||
<label>Last name</label>
|
||||
<input eicinput name="lastname" data-path="" data-type="text" maxlen="100" class="required" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="cols-2">
|
||||
<div>
|
||||
<label>email</label>
|
||||
<input eicinput type="email" name="email" data-path="" data-type="text" maxlen="100" />
|
||||
</div>
|
||||
<div>
|
||||
<label>Phone</label>
|
||||
<input eicinput type="tel" name="phone" data-path="" data-type="text" maxlen="100" />
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<label>Position</label>
|
||||
<select eicselect lookup name="position" data-path="" data-type="text" class="required"></select>
|
||||
</div>
|
||||
<div>
|
||||
<label>Domain(s) of expertise</label>
|
||||
<select eicselect editable name="expertises" data-path="" data-type="array" class="required" placeholder="Type in your keyword and press enter"></select>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label>Why is this person fitted to work on this project ?</label>
|
||||
<textarea eictextarea name="justification" data-path="" data-type="text" maxlen="150" class="required"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,87 @@
|
||||
class SubmissionFormTeamMemberDialog extends EICDialogContent {
|
||||
|
||||
actions = [
|
||||
{
|
||||
label: 'Cancel',
|
||||
onclick: this.cancel.bind(this),
|
||||
severity: 'secondary',
|
||||
role: 'cancel'
|
||||
},
|
||||
{
|
||||
label: 'Save',
|
||||
onclick: this.save.bind(this),
|
||||
severity: 'primary',
|
||||
role: 'save',
|
||||
disabled: false
|
||||
},
|
||||
]
|
||||
|
||||
DOMContentLoaded(options) {
|
||||
this.mode = options.mode ? options.mode: 'create';
|
||||
this.model = options.model;
|
||||
this.member = options.member;
|
||||
this.pic = options.pic;
|
||||
this.number = options.number;
|
||||
let components = ui.eicfy(this.el);
|
||||
|
||||
let position = this.find('select[name="position"]');
|
||||
app.meta.toOptions('organisation-functions', null, true).forEach(item => position.append(item));
|
||||
|
||||
position.addEventListener('change', this.onPositionChanged.bind(this));
|
||||
|
||||
this.form = new Form(this.el);
|
||||
if(this.member) this.form.fill(components,this.member);
|
||||
}
|
||||
|
||||
onPositionChanged(event) {
|
||||
let value = event.currentTarget.value;
|
||||
|
||||
if(value.indexOf('CEO') == 0) {
|
||||
this.find('input[name="email"]').classList.add('required')
|
||||
} else {
|
||||
this.find('input[name="email"]').classList.remove('required')
|
||||
}
|
||||
}
|
||||
|
||||
save(event) {
|
||||
|
||||
if(this.form.validate()) {
|
||||
this.actions.find(o => o.role == 'save').button.loading = true;
|
||||
this.actions.find(o => o.role == 'cancel').button.disabled = true;
|
||||
|
||||
if(this.mode == 'create') {
|
||||
this.model.create(this.pic, this.number, this.form.value)
|
||||
.then(async payload => {
|
||||
this.find('[name="id"]').value = payload.id
|
||||
this.commit(this.form.value);
|
||||
this.actions.find(o => o.role == 'save').button.loading = false;
|
||||
this.actions.find(o => o.role == 'cancel').button.disabled = false;
|
||||
},
|
||||
failed => {
|
||||
this.actions.find(o => o.role == 'save').button.loading = false;
|
||||
this.actions.find(o => o.role == 'cancel').button.disabled = false;
|
||||
this.abort();
|
||||
})
|
||||
}
|
||||
if(this.mode == 'update') {
|
||||
this.model.update(this.pic, this.number, this.form.value)
|
||||
.then(async payload => {
|
||||
this.commit(this.form.value)
|
||||
this.actions.find(o => o.role == 'save').button.loading = false;
|
||||
this.actions.find(o => o.role == 'cancel').button.disabled = false;
|
||||
},
|
||||
failed => {
|
||||
this.actions.find(o => o.role == 'save').button.loading = false;
|
||||
this.actions.find(o => o.role == 'cancel').button.disabled = false;
|
||||
this.abort();
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
app.registerClass('SubmissionFormTeamMemberDialog', SubmissionFormTeamMemberDialog);
|
||||
@@ -0,0 +1,3 @@
|
||||
<div class="upload-selector">
|
||||
<div eicfileupload class="file_uploader"></div>
|
||||
</div>
|
||||
@@ -0,0 +1,48 @@
|
||||
class SubmissionFormUploadDialog extends EICDialogContent {
|
||||
|
||||
actions = [
|
||||
{
|
||||
label: 'Cancel',
|
||||
onclick: this.cancel.bind(this),
|
||||
severity: 'secondary',
|
||||
role: 'cancel'
|
||||
},
|
||||
]
|
||||
|
||||
DOMContentLoaded(options) {
|
||||
this.filename = options.filename
|
||||
this.pic = options.pic
|
||||
this.pid = options.pid
|
||||
this.fileUploader = this.find('.file_uploader')
|
||||
this.AwsFileUpload = new AwsFileUpload(this.fileUploader, {
|
||||
getSignedUrl : options.getSignedUrl,
|
||||
getSignedMethod : options.getSignedMethod,
|
||||
uploadUrl: options.UploadUrl, // Still needed ??
|
||||
uploadMethod: options.UploadMethod, // Still needed ??
|
||||
allowedExtensions: options.allowedExtensions,
|
||||
allowedMimes: options.allowedMimes,
|
||||
allowDrop: true,
|
||||
maxFiles: 1,
|
||||
minFiles: 1,
|
||||
maxSize: 1024*1024*1024,
|
||||
dndLabel: options.message,
|
||||
|
||||
filename: options.filename,
|
||||
pic: options.pic,
|
||||
pid: options.pid,
|
||||
});
|
||||
this.AwsFileUpload.onWrongFileType = (file) => {
|
||||
ui.growl.append('You file is either of an unsupported format, or is too heavy (more than 1GB).', 'warning');
|
||||
}
|
||||
this.AwsFileUpload.onUploadOneEnd = this.finishedUpload.bind(this)
|
||||
}
|
||||
|
||||
finishedUpload(fileObj) {
|
||||
this.commit({
|
||||
fileName: this.AwsFileUpload.filename,
|
||||
pitchName: fileObj.name
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
app.registerClass('SubmissionFormUploadDialog', SubmissionFormUploadDialog);
|
||||
Reference in New Issue
Block a user