Revision 58172
Added by Konstantina Galouni about 4 years ago
project.service.ts | ||
---|---|---|
105 | 105 |
this.projectInfo.id = data[3]; |
106 | 106 |
} |
107 | 107 |
|
108 |
// ['result']['metadata']['oaf:entity']['oaf:project'] |
|
109 |
if(data[0] != null) { |
|
110 |
this.projectInfo.acronym = data[0].acronym; |
|
111 |
this.projectInfo.title = Array.isArray(data[0]['title']) ? data[0].title[0] : data[0].title; |
|
112 |
this.projectInfo.funding.code = data[0].code; |
|
113 |
if(data[0].startdate) { |
|
114 |
let date: number = Date.parse(data[0].startdate); |
|
115 |
this.projectInfo.startDate = (date ? date : null); |
|
116 |
} |
|
117 |
if(data[0].enddate) { |
|
118 |
let date: number = Date.parse(data[0].enddate); |
|
119 |
this.projectInfo.endDate = (date ? date : null); |
|
120 |
} |
|
121 |
if(this.projectInfo.endDate || this.projectInfo.startDate) { |
|
122 |
let todayDate = Date.parse(new Date().toString()); |
|
123 |
this.projectInfo.currentDate = todayDate; |
|
124 |
console.info("today: "+new Date().toString()+" - "+todayDate); |
|
125 |
if(this.projectInfo.startDate) { |
|
126 |
let startDate = +(this.projectInfo.startDate); |
|
127 |
console.info("startDate: "+this.projectInfo.startDate+" - "+startDate); |
|
128 |
if (todayDate < startDate) { |
|
129 |
this.projectInfo.status = "Not started"; |
|
130 |
} |
|
131 |
} |
|
132 |
if(this.projectInfo.endDate && !this.projectInfo.status) { |
|
133 |
let endDate = +(this.projectInfo.endDate); |
|
134 |
console.info("endDate: "+this.projectInfo.endDate+" - "+endDate); |
|
135 |
if (todayDate <= endDate) { |
|
136 |
this.projectInfo.status = "On going"; |
|
137 |
} else { |
|
138 |
this.projectInfo.status = "Closed"; |
|
139 |
} |
|
140 |
} |
|
141 |
} |
|
142 |
this.projectInfo.openAccessMandatePublications = data[0].oamandatepublications; |
|
143 |
this.projectInfo.specialClause39 = data[0].ecsc39; |
|
144 |
this.projectInfo.openAccessMandateDatasets = data[0].ecarticle29_3; |
|
145 |
this.projectInfo.description = data[0]['summary']; |
|
146 |
} |
|
147 |
|
|
148 | 108 |
// ['result']['metadata']['oaf:entity']['oaf:project']['fundingtree'] |
149 | 109 |
if(data[1] != null) { |
150 | 110 |
let funding: {"funderName": string, "funderShortname": string, "stream": string}; |
... | ... | |
158 | 118 |
if(funding.stream) { |
159 | 119 |
this.projectInfo.funding.fundingStream = funding.stream; |
160 | 120 |
} |
121 |
} |
|
122 |
|
|
123 |
// ['result']['metadata']['oaf:entity']['oaf:project'] |
|
124 |
if(data[0] != null) { |
|
125 |
this.projectInfo.acronym = data[0].acronym; |
|
126 |
this.projectInfo.title = Array.isArray(data[0]['title']) ? data[0].title[0] : data[0].title; |
|
127 |
this.projectInfo.funding.code = data[0].code; |
|
128 |
if(data[0].startdate) { |
|
129 |
let date: number = Date.parse(data[0].startdate); |
|
130 |
this.projectInfo.startDate = (date ? date : null); |
|
161 | 131 |
} |
132 |
if(data[0].enddate) { |
|
133 |
let date: number = Date.parse(data[0].enddate); |
|
134 |
this.projectInfo.endDate = (date ? date : null); |
|
135 |
} |
|
136 |
if(this.projectInfo.endDate || this.projectInfo.startDate) { |
|
137 |
let todayDate = Date.parse(new Date().toString()); |
|
138 |
this.projectInfo.currentDate = todayDate; |
|
139 |
if(this.projectInfo.startDate) { |
|
140 |
let startDate = +(this.projectInfo.startDate); |
|
141 |
if (todayDate < startDate) { |
|
142 |
this.projectInfo.status = "Not started"; |
|
143 |
} |
|
144 |
} |
|
145 |
if(this.projectInfo.endDate && !this.projectInfo.status) { |
|
146 |
let endDate = +(this.projectInfo.endDate); |
|
147 |
if (todayDate <= endDate) { |
|
148 |
this.projectInfo.status = "On going"; |
|
149 |
} else { |
|
150 |
this.projectInfo.status = "Closed"; |
|
151 |
} |
|
152 |
} |
|
153 |
} |
|
154 |
if(this.projectInfo.funding && this.projectInfo.funding.funderShortName == "EC") { |
|
155 |
this.projectInfo.openAccessMandatePublications = data[0].oamandatepublications; |
|
156 |
this.projectInfo.specialClause39 = data[0].ecsc39; |
|
157 |
this.projectInfo.openAccessMandateDatasets = data[0].ecarticle29_3; |
|
158 |
} |
|
159 |
this.projectInfo.description = data[0]['summary']; |
|
160 |
} |
|
162 | 161 |
|
163 | 162 |
// ['result']['metadata']['oaf:entity']['oaf:project']['rels']['rel'] |
164 | 163 |
if(data[2] != null) { |
Also available in: Unified diff
[Library | Landing Redesign]:
1. htmlProjectReport: no "size" parameter in getHTML().
2. project.component: Entity selections (on the right column), use material selection (mat-select) | Similar code for selections merged.
3. project.service: Parse ".oamandatepublications", "ecsc39" and "ecarticle29_3", only when funder is "EC".