Revision 61429
Added by John Balasis almost 3 years ago
modules/uoa-repository-dashboard-gui/branches/cookie/src/app/shared/reusablecomponents/sources-forms/datasource-update-form.component.ts | ||
---|---|---|
1 |
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; |
|
2 |
import { formErrorRequiredFields, formErrorWasntSaved, formSubmitting, formSuccessUpdatedRepo, loadingRepoError, |
|
3 |
loadingRepoMessage, noServiceMessage } from '../../../domain/shared-messages'; |
|
4 |
import { RepositoryService } from '../../../services/repository.service'; |
|
5 |
import { AbstractControl, FormBuilder, FormGroup, Validators } from '@angular/forms'; |
|
6 |
import { Country, Repository, Timezone, Typology } from '../../../domain/typeScriptClasses'; |
|
7 |
import { Description, softwarePlatformDesc, platformNameDesc, officialNameDesc, repoDescriptionDesc, countryDesc, |
|
8 |
longtitudeDesc, latitudeDesc, websiteUrlDesc, institutionNameDesc, englishNameDesc, logoUrlDesc, timezoneDesc, |
|
9 |
datasourceTypeDesc, adminEmailDesc, lissnDesc, eissnDesc, issnDesc } from '../../../domain/oa-description'; |
|
10 |
import { AuthenticationService } from '../../../services/authentication.service'; |
|
11 |
import {SharedService} from "../../../services/shared.service"; |
|
12 |
|
|
13 |
@Component ({ |
|
14 |
selector: 'datasource-update-form', |
|
15 |
templateUrl: './datasource-update-form.component.html' |
|
16 |
}) |
|
17 |
|
|
18 |
export class DatasourceUpdateFormComponent implements OnInit { |
|
19 |
|
|
20 |
errorMessage: string; |
|
21 |
successMessage: string; |
|
22 |
loadingMessage: string; |
|
23 |
|
|
24 |
typologies: Typology[] = []; |
|
25 |
timezones: Timezone[] = []; |
|
26 |
countries: Country[] = []; |
|
27 |
datasourceClasses: Map<string, string> = new Map<string, string>(); |
|
28 |
classCodes: string[] = []; |
|
29 |
|
|
30 |
/* in sources/register (in literature or data mode) the updated repository is emitted */ |
|
31 |
@Output() emittedInfo: EventEmitter<Repository> = new EventEmitter(); |
|
32 |
|
|
33 |
@Input() selectedRepo: Repository; |
|
34 |
|
|
35 |
@Input() showButton: boolean; |
|
36 |
|
|
37 |
repoId: string; |
|
38 |
formSubmitted = false; |
|
39 |
updateGroup: FormGroup; |
|
40 |
readonly updateGroupDefinition = { |
|
41 |
softwarePlatform : '', |
|
42 |
platformName : '', |
|
43 |
officialName : ['', Validators.required], |
|
44 |
issn : ['', [Validators.pattern('^\\d{4}-\\d{3}[\\dxX]$')] ], |
|
45 |
eissn : ['', Validators.pattern('^\\d{4}-\\d{3}[\\dxX]$') ], |
|
46 |
lissn : ['', Validators.pattern('^\\d{4}-\\d{3}[\\dxX]$') ], |
|
47 |
repoDescription : ['', Validators.required], |
|
48 |
country : '', |
|
49 |
longtitude : '', |
|
50 |
latitude : '', |
|
51 |
websiteUrl : [''], |
|
52 |
institutionName : ['', Validators.required], |
|
53 |
englishName: ['', Validators.required], |
|
54 |
logoUrl: ['', Validators.pattern('^(http:\\/\\/www\\.|https:\\/\\/www\\.|http:\\/\\/|https:\\/\\/)?[a-z0-9]+([\\-\\.]{1}[a-z0-9]+)*\\.[a-z]{2,5}(:[0-9]{1,5})?(\\/.*)?$') ], |
|
55 |
timezone: ['', Validators.required], |
|
56 |
datasourceType: ['', Validators.required], |
|
57 |
adminEmail: ['', [Validators.required, Validators.email]] |
|
58 |
}; |
|
59 |
|
|
60 |
softwarePlatformDesc: Description = softwarePlatformDesc; |
|
61 |
platformNameDesc: Description = platformNameDesc; |
|
62 |
officialNameDesc: Description = officialNameDesc; |
|
63 |
issnDesc: Description = issnDesc; |
|
64 |
eissnDesc: Description = eissnDesc; |
|
65 |
lissnDesc: Description = lissnDesc; |
|
66 |
repoDescriptionDesc: Description = repoDescriptionDesc; |
|
67 |
countryDesc: Description = countryDesc; |
|
68 |
longtitudeDesc: Description = longtitudeDesc; |
|
69 |
latitudeDesc: Description = latitudeDesc; |
|
70 |
websiteUrlDesc: Description = websiteUrlDesc; |
|
71 |
institutionNameDesc: Description = institutionNameDesc; |
|
72 |
englishNameDesc: Description = englishNameDesc; |
|
73 |
logoUrlDesc: Description = logoUrlDesc; |
|
74 |
timezoneDesc: Description = timezoneDesc; |
|
75 |
datasourceTypeDesc: Description = datasourceTypeDesc; |
|
76 |
adminEmailDesc: Description = adminEmailDesc; |
|
77 |
|
|
78 |
constructor( |
|
79 |
private fb: FormBuilder, |
|
80 |
private repoService: RepositoryService, |
|
81 |
private sharedService: SharedService, |
|
82 |
private authService: AuthenticationService |
|
83 |
) {} |
|
84 |
|
|
85 |
ngOnInit() { |
|
86 |
this.loadForm(); |
|
87 |
} |
|
88 |
|
|
89 |
loadForm() { |
|
90 |
if (this.selectedRepo) { |
|
91 |
this.repoId = this.selectedRepo.id.split('::')[1]; |
|
92 |
this.loadingMessage = loadingRepoMessage; |
|
93 |
this.updateGroup = this.fb.group(this.updateGroupDefinition, {validator: checkPlatform}); |
|
94 |
this.getDatasourceClasses(); |
|
95 |
} else { |
|
96 |
this.errorMessage = loadingRepoError; |
|
97 |
} |
|
98 |
} |
|
99 |
|
|
100 |
setupUpdateForm() { |
|
101 |
if (this.selectedRepo) { |
|
102 |
console.log(`my datasource type is: ${this.selectedRepo.datasourceType}`); |
|
103 |
|
|
104 |
this.updateGroup.setValue({ |
|
105 |
softwarePlatform: this.selectedRepo.typology, |
|
106 |
platformName: '', |
|
107 |
officialName: this.selectedRepo.officialName, |
|
108 |
issn: '', |
|
109 |
eissn: '', |
|
110 |
lissn: '', |
|
111 |
repoDescription: this.selectedRepo.description, |
|
112 |
country: this.selectedRepo.countryCode, |
|
113 |
longtitude: this.selectedRepo.longitude, |
|
114 |
latitude: this.selectedRepo.latitude, |
|
115 |
websiteUrl: this.selectedRepo.websiteUrl, |
|
116 |
institutionName: this.selectedRepo.organization, |
|
117 |
englishName: this.selectedRepo.englishName, |
|
118 |
logoUrl: this.selectedRepo.logoUrl, |
|
119 |
timezone: this.selectedRepo.timezone, |
|
120 |
datasourceType: this.selectedRepo.datasourceClass, |
|
121 |
adminEmail: this.selectedRepo.contactEmail |
|
122 |
}); |
|
123 |
|
|
124 |
if ( this.selectedRepo.typology === '' || !this.typologies.some(x => x.value === this.selectedRepo.typology) ) { |
|
125 |
this.updateGroup.get('softwarePlatform').setValue(''); |
|
126 |
this.updateGroup.get('platformName').setValue(this.selectedRepo.typology); |
|
127 |
} |
|
128 |
|
|
129 |
if ((this.selectedRepo.datasourceType === 'opendoar') || |
|
130 |
(this.selectedRepo.datasourceType === 're3data')) { |
|
131 |
|
|
132 |
// this.updateGroup.get('officialName').disable(); |
|
133 |
this.updateGroup.get('country').disable(); |
|
134 |
// this.updateGroup.get('longtitude').disable(); |
|
135 |
// this.updateGroup.get('latitude').disable(); |
|
136 |
// this.updateGroup.get('websiteUrl').disable(); |
|
137 |
// this.updateGroup.get('institutionName').disable(); |
|
138 |
|
|
139 |
} |
|
140 |
|
|
141 |
if (this.selectedRepo.datasourceType === 'journal') { |
|
142 |
|
|
143 |
let ssnToShow = this.selectedRepo.issn.slice(0, 4) + '-' + this.selectedRepo.issn.toString().slice(4); |
|
144 |
this.updateGroup.get('issn').setValue(ssnToShow); |
|
145 |
this.updateGroup.get('issn').clearValidators(); |
|
146 |
this.updateGroup.get('issn').setValidators([Validators.required, Validators.pattern('^\\d{4}-\\d{3}[\\dxX]$')]); |
|
147 |
|
|
148 |
if (this.selectedRepo.eissn.trim().length) { |
|
149 |
ssnToShow = this.selectedRepo.eissn.slice(0, 4) + '-' + this.selectedRepo.eissn.toString().slice(4); |
|
150 |
this.updateGroup.get('eissn').setValue(ssnToShow); |
|
151 |
} |
|
152 |
|
|
153 |
if (this.selectedRepo.lissn.trim().length) { |
|
154 |
ssnToShow = this.selectedRepo.lissn.slice(0, 4) + '-' + this.selectedRepo.lissn.toString().slice(4); |
|
155 |
this.updateGroup.get('lissn').setValue(ssnToShow); |
|
156 |
} |
|
157 |
|
|
158 |
/* it was decided that all fields will be open, 21-12-2018 */ |
|
159 |
/*this.updateGroup.get('issn').disable(); |
|
160 |
this.updateGroup.get('eissn').disable(); |
|
161 |
this.updateGroup.get('lissn').disable();*/ |
|
162 |
} |
|
163 |
/*this.getDatasourceClasses();*/ |
|
164 |
} |
|
165 |
} |
|
166 |
|
|
167 |
getDatasourceClasses() { |
|
168 |
this.repoService.getDatasourceClasses(this.selectedRepo.datasourceType).subscribe( |
|
169 |
classes => this.datasourceClasses = classes, |
|
170 |
error => { |
|
171 |
this.loadingMessage = ''; |
|
172 |
this.errorMessage = noServiceMessage; |
|
173 |
console.log(error); |
|
174 |
}, |
|
175 |
() => { |
|
176 |
for (const key of Object.keys(this.datasourceClasses)) { |
|
177 |
this.classCodes.push(key); |
|
178 |
} |
|
179 |
this.getCountries(); |
|
180 |
} |
|
181 |
); |
|
182 |
} |
|
183 |
|
|
184 |
getCountries() { |
|
185 |
this.repoService.getCountries() |
|
186 |
.subscribe( |
|
187 |
countries => this.countries = countries.sort( function(a, b) { |
|
188 |
if (a.name < b.name) { |
|
189 |
return -1; |
|
190 |
} else if (a.name > b.name) { |
|
191 |
return 1; |
|
192 |
} else { |
|
193 |
return 0; |
|
194 |
} |
|
195 |
} ), |
|
196 |
error => { |
|
197 |
this.loadingMessage = ''; |
|
198 |
this.errorMessage = noServiceMessage; |
|
199 |
console.log(error); |
|
200 |
}, () => { |
|
201 |
this.getTypologies(); |
|
202 |
}); |
|
203 |
} |
|
204 |
|
|
205 |
getTypologies() { |
|
206 |
this.repoService.getTypologies().subscribe( |
|
207 |
types => this.typologies = types, |
|
208 |
error => { |
|
209 |
this.loadingMessage = ''; |
|
210 |
console.log(error); |
|
211 |
}, |
|
212 |
() => { |
|
213 |
this.getTimezones(); |
|
214 |
} |
|
215 |
); |
|
216 |
} |
|
217 |
|
|
218 |
getTimezones() { |
|
219 |
this.repoService.getTimezones().subscribe( |
|
220 |
zones => this.timezones = zones, |
|
221 |
error => { |
|
222 |
this.loadingMessage = ''; |
|
223 |
console.log(error); |
|
224 |
}, |
|
225 |
() => { |
|
226 |
this.loadingMessage = ''; |
|
227 |
this.setupUpdateForm(); |
|
228 |
} |
|
229 |
); |
|
230 |
} |
|
231 |
|
|
232 |
updateRepo() { |
|
233 |
this.formSubmitted = true; |
|
234 |
this.errorMessage = ''; |
|
235 |
this.successMessage = ''; |
|
236 |
window.scroll(1, 1); |
|
237 |
|
|
238 |
if (this.updateGroup.valid) { |
|
239 |
if ( this.selectedRepo.datasourceType !== 'journal' || this.updateGroup.get('issn').value ) { |
|
240 |
this.refreshSelectedRepo(); |
|
241 |
|
|
242 |
/* |
|
243 |
call the api only if the current page is sources/update |
|
244 |
[otherwise the repository will be updated during the registration procedure, after the first interface is saved] |
|
245 |
*/ |
|
246 |
if (this.showButton) { |
|
247 |
this.loadingMessage = formSubmitting; |
|
248 |
this.errorMessage = ''; |
|
249 |
// this.repoService.up |
|
250 |
this.repoService.updateRepository(this.selectedRepo).subscribe( |
|
251 |
response => { |
|
252 |
if (response) { |
|
253 |
this.selectedRepo = response; |
|
254 |
console.log(`updateRepository responded: ${JSON.stringify(response)}`); |
|
255 |
} |
|
256 |
}, |
|
257 |
error => { |
|
258 |
console.log(error); |
|
259 |
this.loadingMessage = ''; |
|
260 |
this.errorMessage = formErrorWasntSaved; |
|
261 |
}, |
|
262 |
() => { |
|
263 |
this.loadingMessage = ''; |
|
264 |
if (!this.selectedRepo) { |
|
265 |
this.errorMessage = formErrorWasntSaved; |
|
266 |
} else { |
|
267 |
this.successMessage = formSuccessUpdatedRepo; |
|
268 |
} |
|
269 |
//fixme is this the place to update the subject?? |
|
270 |
this.sharedService.setRepository(this.selectedRepo); |
|
271 |
} |
|
272 |
); |
|
273 |
} |
|
274 |
} else { |
|
275 |
this.errorMessage = formErrorRequiredFields; |
|
276 |
} |
|
277 |
} else { |
|
278 |
this.errorMessage = formErrorRequiredFields; |
|
279 |
} |
|
280 |
} |
|
281 |
|
|
282 |
refreshSelectedRepo() { |
|
283 |
if (this.updateGroup.get('softwarePlatform').value ) { |
|
284 |
this.selectedRepo.typology = this.updateGroup.get('softwarePlatform').value; |
|
285 |
} else if (this.updateGroup.get('platformName').value) { |
|
286 |
this.selectedRepo.typology = this.updateGroup.get('platformName').value; |
|
287 |
} |
|
288 |
this.selectedRepo.officialName = this.updateGroup.get('officialName').value.toString(); |
|
289 |
this.selectedRepo.description = this.updateGroup.get('repoDescription').value.toString(); |
|
290 |
this.selectedRepo.countryCode = this.updateGroup.get('country').value; |
|
291 |
this.selectedRepo.countryName = this.countries.filter(x => x.code === this.updateGroup.get('country').value)[0].name; |
|
292 |
this.selectedRepo.longitude = this.updateGroup.get('longtitude').value; |
|
293 |
this.selectedRepo.latitude = this.updateGroup.get('latitude').value; |
|
294 |
this.selectedRepo.websiteUrl = this.updateGroup.get('websiteUrl').value; |
|
295 |
this.selectedRepo.organization = this.updateGroup.get('institutionName').value.toString(); |
|
296 |
this.selectedRepo.englishName = this.updateGroup.get('englishName').value.toString(); |
|
297 |
this.selectedRepo.logoUrl = this.updateGroup.get('logoUrl').value; |
|
298 |
this.selectedRepo.timezone = this.updateGroup.get('timezone').value; |
|
299 |
this.selectedRepo.datasourceClass = this.updateGroup.get('datasourceType').value; |
|
300 |
this.selectedRepo.contactEmail = this.updateGroup.get('adminEmail').value; |
|
301 |
if (this.selectedRepo.datasourceType === 'journal') { |
|
302 |
let ssnParts = this.updateGroup.get('issn').value.split('-'); |
|
303 |
let correctSSN = ssnParts[0] + ssnParts[1]; |
|
304 |
this.selectedRepo.issn = correctSSN; |
|
305 |
if ( this.updateGroup.get('eissn').value ) { |
|
306 |
ssnParts = this.updateGroup.get('eissn').value.split('-'); |
|
307 |
correctSSN = ssnParts[0] + ssnParts[1]; |
|
308 |
this.selectedRepo.eissn = correctSSN; |
|
309 |
} |
|
310 |
if ( this.updateGroup.get('lissn').value ) { |
|
311 |
ssnParts = this.updateGroup.get('lissn').value.split('-'); |
|
312 |
correctSSN = ssnParts[0] + ssnParts[1]; |
|
313 |
this.selectedRepo.lissn = correctSSN; |
|
314 |
} |
|
315 |
} |
|
316 |
if (!this.showButton) { |
|
317 |
this.selectedRepo.registeredBy = this.authService.getUserEmail(); |
|
318 |
this.selectedRepo.registered = true; |
|
319 |
this.selectedRepo.registrationDate = new Date(Date.now()); // NOT NEEDED ?? |
|
320 |
this.emittedInfo.emit(this.selectedRepo); |
|
321 |
} |
|
322 |
} |
|
323 |
|
|
324 |
} |
|
325 |
|
|
326 |
export function checkPlatform(c: AbstractControl) { |
|
327 |
if ( c.get('softwarePlatform').value || c.get('platformName').value ) { |
|
328 |
return null; |
|
329 |
} |
|
330 |
return 'invalid'; |
|
331 |
} |
|
0 | 332 |
modules/uoa-repository-dashboard-gui/branches/cookie/src/app/shared/reusablecomponents/403-forbidden-page.component.html | ||
---|---|---|
1 |
<div id="page_content"> |
|
2 |
<div id="page_content_inner"> |
|
3 |
<h2 class="heading_b uk-margin-bottom uk-margin-large-top uk-text-center">Error: 403 Forbidden</h2> |
|
4 |
|
|
5 |
<!-- TOP HELP CONTENT --> |
|
6 |
<help-content #topHelperContent [position]="'top'" |
|
7 |
[ngClass]="topHelperContent.isPresent()?'uk-margin-medium-top uk-margin-medium-bottom':'clear-style'"> |
|
8 |
</help-content> |
|
9 |
|
|
10 |
<div class="uk-grid"> |
|
11 |
|
|
12 |
<!-- LEFT HELP CONTENT --> |
|
13 |
<aside-help-content #leftHelperContent [position]="'left'" |
|
14 |
[ngClass]="leftHelperContent.isPresent()?'tm-sidebar uk-width-1-4@m uk-first-column':'clear-style'"> |
|
15 |
</aside-help-content> |
|
16 |
|
|
17 |
<!-- MIDDLE --> |
|
18 |
<div class=" uk-width-expand@m"> |
|
19 |
|
|
20 |
<div style="font-size: 180px; color: #28beFF; line-height: 1.2;" class="uk-text-center"> |
|
21 |
<strong>403</strong> |
|
22 |
</div> |
|
23 |
|
|
24 |
<div class="uk-text-center"> |
|
25 |
Sorry, access to this resource on the server is forbidden.<br> |
|
26 |
Either check the URL or <a href="/home">go home</a> |
|
27 |
</div> |
|
28 |
|
|
29 |
</div> |
|
30 |
|
|
31 |
<!-- RIGHT HELP CONTENT --> |
|
32 |
<aside-help-content #rightHelperContent [position]="'right'" |
|
33 |
[ngClass]="rightHelperContent.isPresent()?'tm-sidebar uk-width-1-4@m uk-first-column':'clear-style'"> |
|
34 |
</aside-help-content> |
|
35 |
|
|
36 |
</div> |
|
37 |
|
|
38 |
<!-- BOTTOM HELP CONTENT --> |
|
39 |
<help-content #bottomHelperContent [position]="'bottom'" |
|
40 |
[ngClass]="bottomHelperContent.isPresent()?'uk-margin-medium-top uk-margin-medium-bottom':'clear-style'"> |
|
41 |
</help-content> |
|
42 |
|
|
43 |
</div> |
|
44 |
</div> |
|
0 | 45 |
modules/uoa-repository-dashboard-gui/branches/cookie/src/app/shared/reusablecomponents/repository-tiles.component.html | ||
---|---|---|
1 |
<div> |
|
2 |
<div class="uk-width-1-1 uk-grid"> |
|
3 |
<div class="uk-width-1-1"> |
|
4 |
<div *ngIf="errorMessage" class="uk-alert uk-alert-danger">{{ errorMessage }}</div> |
|
5 |
<div *ngIf="warningMessage" class="uk-alert uk-alert-warning">{{ warningMessage }}</div> |
|
6 |
<div *ngIf="loadingMessage" class="loading-big"> |
|
7 |
<div class="loader-big" style="text-align: center; padding-top: 170px; color: rgb(47, 64, 80); font-weight: bold;"> |
|
8 |
{{ loadingMessage }} |
|
9 |
</div> |
|
10 |
<div class="transparentFilm"></div> |
|
11 |
</div> |
|
12 |
|
|
13 |
|
|
14 |
<div id="list_grid" *ngIf="reposOfUser && reposOfUser.length>0" |
|
15 |
class="uk-grid uk-grid-match uk-grid-medium uk-child-width-1-2@s uk-child-width-1-3@m uk-child-width-1-4@l {{tilesView ? 'grid_view' : 'list_view'}}"> |
|
16 |
<div *ngFor="let repo of reposOfUser" class="uk-margin-medium-top"> |
|
17 |
|
|
18 |
<a class="md-card" [routerLink]="[getLinkToNext(repo)]"> |
|
19 |
<div > |
|
20 |
<div class="md-card-head uk-text-center uk-position-relative"> |
|
21 |
<div *ngIf="parent === 'metrics'" class="{{getBadgeCSS(repo)}} uk-position-absolute uk-position-top-left uk-margin-left uk-margin-top"> |
|
22 |
{{getBadgeText(repo)}} |
|
23 |
</div> |
|
24 |
<img *ngIf="!repo.logoUrl" class="md-card-head-img dense-image dense-ready" src="../../../assets/imgs/yourLogoHere.jpg" alt="" data-dense-cap="2"> |
|
25 |
<img *ngIf="repo.logoUrl" class="md-card-head-img dense-image dense-ready" src="{{repo.logoUrl}}" alt="" data-dense-cap="2"> |
|
26 |
</div> |
|
27 |
<div class="md-card-content"> |
|
28 |
<h4 class="heading_c uk-margin-bottom">{{repo.officialname}}</h4> |
|
29 |
<p>{{repo.description}}</p> |
|
30 |
<!--<a class="md-btn md-btn-small md-btn-success" [routerLink]="[getLinkToNext(repo)]">Add to Cart</a>--> |
|
31 |
</div> |
|
32 |
</div> |
|
33 |
</a> |
|
34 |
|
|
35 |
</div> |
|
36 |
</div> |
|
37 |
|
|
38 |
</div> |
|
39 |
|
|
40 |
</div> |
|
41 |
</div> |
|
0 | 42 |
modules/uoa-repository-dashboard-gui/branches/cookie/src/app/shared/reusablecomponents/cookie-law/icons.ts | ||
---|---|---|
1 |
/** |
|
2 |
* angular2-cookie-law |
|
3 |
* |
|
4 |
* Copyright 2016-2017, @andreasonny83, All rights reserved. |
|
5 |
* |
|
6 |
* @author: @andreasonny83 <andreasonny83@gmail.com> |
|
7 |
*/ |
|
8 |
|
|
9 |
export const closeIcon: string = ` |
|
10 |
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"> |
|
11 |
<path d="M377.047 184.198q0 8.26-6.037 14.297L313.505 256l57.505 57.505q6.037 6.037 6.037 14.297 0 8.578-6.037 14.615l-28.593 28.593q-6.037 6.037-14.615 6.037-8.26 0-14.297-6.037L256 313.505l-57.505 57.505q-6.037 6.037-14.297 6.037-8.578 0-14.615-6.037l-28.593-28.593q-6.037-6.037-6.037-14.615 0-8.26 6.037-14.297L198.495 256l-57.505-57.505q-6.037-6.037-6.037-14.297 0-8.578 6.037-14.615l28.593-28.593q6.037-6.037 14.615-6.037 8.26 0 14.297 6.037L256 198.495l57.505-57.505q6.037-6.037 14.297-6.037 8.578 0 14.615 6.037l28.593 28.593q6.037 6.037 6.037 14.615zM500 256q0-66.401-32.724-122.477-32.724-56.075-88.799-88.799Q322.401 12 256 12q-66.401 0-122.477 32.724-56.075 32.724-88.799 88.799Q12 189.599 12 256q0 66.401 32.724 122.477 32.724 56.075 88.799 88.799Q189.599 500 256 500q66.401 0 122.477-32.724 56.075-32.724 88.799-88.799Q500 322.401 500 256z"></path> |
|
12 |
</svg> |
|
13 |
`; |
|
0 | 14 |
modules/uoa-repository-dashboard-gui/branches/cookie/src/app/shared/reusablecomponents/forms/my-form.directive.ts | ||
---|---|---|
1 |
/** |
|
2 |
* Created by stefanos on 15/5/2017. |
|
3 |
*/ |
|
4 |
import { AfterViewInit, Directive, TemplateRef, ViewContainerRef } from '@angular/core'; |
|
5 |
|
|
6 |
@Directive({ |
|
7 |
selector: '[my-form]', |
|
8 |
}) |
|
9 |
export class MyFormDirective implements AfterViewInit { |
|
10 |
|
|
11 |
constructor(public viewContainerRef: ViewContainerRef, public templateRef: TemplateRef<any>) {} |
|
12 |
|
|
13 |
ngAfterViewInit(): void { |
|
14 |
this.viewContainerRef.createEmbeddedView(this.templateRef); |
|
15 |
} |
|
16 |
} |
|
0 | 17 |
modules/uoa-repository-dashboard-gui/branches/cookie/src/app/shared/reusablecomponents/confirmation-dialog.component.html | ||
---|---|---|
1 |
<!--<div *ngIf="isModalShown" [config]="{ show: true }" (onHidden)="onHidden()" bsModal #autoShownModal="bs-modal"--> |
|
2 |
<!--class="modal in fade" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static">--> |
|
3 |
<!--<div class="modal-dialog">--> |
|
4 |
<!--<div class="modal-content">--> |
|
5 |
<!--<div class="modal-body">--> |
|
6 |
<!--<div>--> |
|
7 |
<!--<div>--> |
|
8 |
<!--<h2 class="uk-modal-title">{{title}}</h2>--> |
|
9 |
<!--<ng-content></ng-content>--> |
|
10 |
<!--</div>--> |
|
11 |
<!--<div class="uk-text-right">--> |
|
12 |
<!--<button (click)="hideModal()" class="uk-button uk-button-default uk-margin-small-right" type="button">{{ hideModalButton }}</button>--> |
|
13 |
<!--<button *ngIf="confirmActionButton" (click)="confirmedAction()" class="uk-button uk-button-primary" type="button">{{confirmActionButton}}</button>--> |
|
14 |
<!--</div>--> |
|
15 |
<!--</div>--> |
|
16 |
<!--</div>--> |
|
17 |
<!--</div>--> |
|
18 |
<!--</div>--> |
|
19 |
<!--</div>--> |
|
20 |
|
|
21 |
|
|
22 |
<div *ngIf="isModalShown" class="uk-modal {{isModalShown ? 'uk-open' : ''}}" bsModal #autoShownModal="bs-modal" (onHidden)="onHidden()" aria-hidden="false" |
|
23 |
[ngStyle]="{'display': isModalShown ? 'block' : 'none'}" style="overflow-y: auto"> |
|
24 |
<div class="uk-modal-dialog" style="top: 95.5px;"> |
|
25 |
<div class="uk-modal-header"> |
|
26 |
<h3 class="uk-modal-title">{{title}} |
|
27 |
<!--<i class="material-icons" data-uk-tooltip="{pos:'top'}" title="headline tooltip"></i>--> |
|
28 |
</h3> |
|
29 |
</div> |
|
30 |
<ng-content></ng-content> |
|
31 |
<div class="uk-modal-footer uk-text-right"> |
|
32 |
<button (click)="hideModal()" type="button" class="md-btn md-btn-flat uk-modal-close">{{ hideModalButton }}</button> |
|
33 |
<button *ngIf="confirmActionButton" (click)="confirmedAction()" type="button" class="md-btn md-btn-flat md-btn-flat-primary">{{confirmActionButton}}</button> |
|
34 |
<button *ngIf="confirmButNotCloseButton" (click)="confirmedButNotCloseAction()" type="button" class="md-btn md-btn-flat md-btn-flat-primary">{{confirmButNotCloseButton}}</button> |
|
35 |
</div> |
|
36 |
</div> |
|
37 |
</div> |
|
38 |
|
|
39 |
|
|
40 |
<!-- old-ui shelved Terms of Use modal version --> |
|
41 |
|
|
42 |
<!--<div *ngIf="isModalShown" [config]="{ show: true }" (onHidden)="onHidden()" bsModal #autoShownModal="bs-modal"--> |
|
43 |
<!-- class="modal in fade" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static">--> |
|
44 |
<!-- <div class="modal-dialog">--> |
|
45 |
<!-- <h2 class="uk-modal-title uk-margin-top uk-margin-left">{{title}}</h2>--> |
|
46 |
<!-- <div class="modal-content">--> |
|
47 |
<!-- <div class="modal-body">--> |
|
48 |
<!-- <div>--> |
|
49 |
<!-- <ng-content></ng-content>--> |
|
50 |
<!-- </div>--> |
|
51 |
<!-- </div>--> |
|
52 |
<!-- <div class="uk-text-right uk-margin-bottom uk-margin-right">--> |
|
53 |
<!-- <button (click)="hideModal()" class="uk-button uk-button-default uk-margin-small-right" type="button">{{hideModalButton}}</button>--> |
|
54 |
<!-- <button *ngIf="confirmActionButton" (click)="confirmedAction()" class="uk-button uk-button-primary" type="button">{{confirmActionButton}}</button>--> |
|
55 |
<!-- </div>--> |
|
56 |
<!-- </div>--> |
|
57 |
<!-- </div>--> |
|
58 |
<!--</div>--> |
|
0 | 59 |
modules/uoa-repository-dashboard-gui/branches/cookie/src/app/shared/reusablecomponents/sources-forms/datasource-new-interface-form.component.html | ||
---|---|---|
1 |
<div> |
|
2 |
<div *ngIf="loadingMessage" class="loading-big"> |
|
3 |
|
|
4 |
<div class="md-class-content"> |
|
5 |
<div class="loader-big" style="text-align: center; padding-top: 170px; color: rgb(47, 64, 80); font-weight: bold;"> |
|
6 |
{{ loadingMessage }} |
|
7 |
</div> |
|
8 |
<div class="whiteFilm"></div> |
|
9 |
</div> |
|
10 |
|
|
11 |
</div> |
|
12 |
<div *ngIf="repoInterfaceForm && (!loadingMessage || (loadingMessage===''))" [formGroup]="repoInterfaceForm"> |
|
13 |
|
|
14 |
<div class="md-card-toolbar"> |
|
15 |
<div class="md-card-toolbar-actions"> |
|
16 |
<a *ngIf="!inRegister" (click)="saveInterface()" class="uk-margin-small-right"><i class="md-icon material-icons">save</i></a> |
|
17 |
<a (click)="removeInterface()" class="uk-margin-small-left"><i class="md-icon material-icons">clear</i></a> |
|
18 |
</div> |
|
19 |
<!--<h3 class="md-card-toolbar-heading-text"> Card Heading </h3>--> |
|
20 |
</div> |
|
21 |
|
|
22 |
<!--<div class="md-card-toolbar interfaceActionsPanel">--> |
|
23 |
<!--<a *ngIf="!inRegister" (click)="saveInterface()" class="uk-margin-small-right"><i class="far fa-save fa-lg"></i></a>--> |
|
24 |
<!--<a (click)="removeInterface()" class="uk-margin-small-left"><i class="fas fa-times fa-lg"></i></a>--> |
|
25 |
<!--</div>--> |
|
26 |
|
|
27 |
<div class="md-card-content"> |
|
28 |
<div *ngIf="successMessage" class="uk-alert uk-alert-success" style="clear: both">{{ successMessage }}</div> |
|
29 |
<div *ngIf="errorMessage" class="uk-alert" [ngClass]="{'uk-alert-warning': errorMessage == invalidCustomBaseUrl, |
|
30 |
'uk-alert-danger': errorMessage != invalidCustomBaseUrl}" style="clear: both">{{ errorMessage }}</div> |
|
31 |
|
|
32 |
<div class="md-input-wrapper uk-margin-medium-top {{ (repoInterfaceForm.get('baseUrl') != null) ? 'md-input-filled' : '' }}"> |
|
33 |
<label class="" for="baseUrl" title="{{ baseUrlDesc.desc }}">Base OAI-PMH URL (*)</label> |
|
34 |
<span *ngIf="showIdentifiedBaseUrl" class="help-block inline" style="margin-top: 8px; margin-bottom: 0px; padding-left: 10px; display: block;"> |
|
35 |
Identified |
|
36 |
</span> |
|
37 |
<input id="baseUrl" type="text" class="md-input" formControlName="baseUrl" (blur)="getInterfaceInfo()"> |
|
38 |
<span class="md-input-bar"></span> |
|
39 |
</div> |
|
40 |
|
|
41 |
|
|
42 |
<!--<div class="form-group has-success">--> |
|
43 |
<!--<label class="control-label" for="baseUrl" title="{{ baseUrlDesc.desc }}">Base OAI-PMH URL (*)</label>--> |
|
44 |
<!--<span *ngIf="identifiedBaseUrl" class="help-block inline" style="margin-top: 0px; margin-bottom: 0px; padding-left: 10px;">--> |
|
45 |
<!--Identified--> |
|
46 |
<!--</span>--> |
|
47 |
<!--<input id="baseUrl" type="text" class="form-control" formControlName="baseUrl" (blur)="getInterfaceInfo()">--> |
|
48 |
<!--</div>--> |
|
49 |
|
|
50 |
|
|
51 |
<div class="radioButtonForm uk-margin-top"> |
|
52 |
<label class="control-label">Validation Set</label> |
|
53 |
|
|
54 |
<div class="form-group"> |
|
55 |
<label for="selectRadio{{interfaceID}}" title="{{ existingValSetDesc.desc }}" |
|
56 |
class="uk-button uk-link-muted visible_uk_links" |
|
57 |
style="display: block; text-align: left;"> |
|
58 |
<input id="selectRadio{{interfaceID}}" value="select" name="validationSet{{interfaceID}}" type="radio" |
|
59 |
(change)="chooseValSet(true)" checked > |
|
60 |
<span class="uk-margin-small-left">Choose existing</span> |
|
61 |
</label> |
|
62 |
</div> |
|
63 |
<div class="md-input-wrapper"> |
|
64 |
<!--<label class="">Select repository's country</label>--> |
|
65 |
<select class="md-input" id="selectValidationSet{{interfaceID}}" formControlName="selectValidationSet" (change)="checkIfValid()"> |
|
66 |
<option value="" selected>-- none selected --</option> |
|
67 |
<option *ngFor="let set of valsetList" value="{{set}}">{{set}}</option> |
|
68 |
</select> |
|
69 |
<span class="md-input-bar"></span> |
|
70 |
</div> |
|
71 |
<div class="form-group"> |
|
72 |
<label for="customRadio{{interfaceID}}" title="{{ customValSetDesc.desc }}" |
|
73 |
class="uk-button uk-link-muted visible_uk_links" |
|
74 |
style="display: block; text-align: left;"> |
|
75 |
<input id="customRadio{{interfaceID}}" value="custom" name="validationSet{{interfaceID}}" type="radio" |
|
76 |
(change)="chooseValSet(false)"> |
|
77 |
<span class="uk-margin-small-left">or a custom one</span> |
|
78 |
</label> |
|
79 |
</div> |
|
80 |
<div class="md-input-wrapper"> |
|
81 |
<input id="customValidationSet{{interfaceID}}" formControlName="customValidationSet" |
|
82 |
class="md-input" type="text" (keyup)="checkIfValid()"> |
|
83 |
<span class="md-input-bar"></span> |
|
84 |
</div> |
|
85 |
|
|
86 |
</div> |
|
87 |
|
|
88 |
|
|
89 |
<!--<div class="form-group">--> |
|
90 |
<!--<label class="control-label">Validation Set</label>--> |
|
91 |
<!--<div>--> |
|
92 |
<!--<label class="uk-button validationSetRadio" for="selectRadio{{interfaceID}}" title="{{ existingValSetDesc.desc }}">--> |
|
93 |
<!--<input id="selectRadio{{interfaceID}}" value="select" name="validationSet{{interfaceID}}" type="radio"--> |
|
94 |
<!--(change)="chooseValSet(true)" checked >--> |
|
95 |
<!--<span class="uk-margin-small-left">Choose existing</span>--> |
|
96 |
<!--</label>--> |
|
97 |
<!--</div>--> |
|
98 |
<!--<select id="selectValidationSet{{interfaceID}}" formControlName="selectValidationSet"--> |
|
99 |
<!--class="form-control" (change)="checkIfValid()">--> |
|
100 |
<!--<option value="" selected>-- none selected --</option>--> |
|
101 |
<!--<option *ngFor="let set of valsetList" value="{{set}}">{{set}}</option>--> |
|
102 |
<!--</select>--> |
|
103 |
<!--<div>--> |
|
104 |
<!--<label class="uk-button validationSetRadio" for="customRadio{{interfaceID}}" title="{{ customValSetDesc.desc }}">--> |
|
105 |
<!--<input id="customRadio{{interfaceID}}" value="custom" name="validationSet{{interfaceID}}" type="radio"--> |
|
106 |
<!--(change)="chooseValSet(false)">--> |
|
107 |
<!--<span class="uk-margin-small-left">or a custom one</span>--> |
|
108 |
<!--</label>--> |
|
109 |
<!--</div>--> |
|
110 |
<!--<input id="customValidationSet{{interfaceID}}" formControlName="customValidationSet"--> |
|
111 |
<!--class="form-control" type="text" (keyup)="checkIfValid()">--> |
|
112 |
<!--</div>--> |
|
113 |
|
|
114 |
<div class="md-input-wrapper md-input-filled uk-margin-medium-top"> |
|
115 |
<label style="top: -16px" class="" for="compLvl" title="{{ compatibilityLevelDesc.desc }}">Desired Compatibility Level (*)</label> |
|
116 |
<select class="md-input" id="compLvl" formControlName="compatibilityLevel" (change)="checkIfValid()"> |
|
117 |
<option value="">-- none selected --</option> |
|
118 |
<option *ngFor="let key of classCodes" value="{{key}}">{{compClasses[key]}}</option> |
|
119 |
</select> |
|
120 |
<span class="md-input-bar"></span> |
|
121 |
</div> |
|
122 |
|
|
123 |
<!--<div class="form-group">--> |
|
124 |
<!--<label class="control-label" for="compLvl" title="{{ compatibilityLevelDesc.desc }}">Desired Compatibility Level (*)</label>--> |
|
125 |
<!--<select class="form-control" id="compLvl" formControlName="compatibilityLevel" (change)="checkIfValid()">--> |
|
126 |
<!--<option value="">-- none selected --</option>--> |
|
127 |
<!--<option *ngFor="let key of classCodes" value="{{key}}">{{compClasses[key]}}</option>--> |
|
128 |
<!--</select>--> |
|
129 |
<!--</div>--> |
|
130 |
|
|
131 |
<div class=""> |
|
132 |
<label class="">Current Compatibility Level</label> |
|
133 |
<div *ngIf="existingCompLevel">{{ existingCompLevel ? existingCompLevel : 'not available' }}</div> |
|
134 |
</div> |
|
135 |
|
|
136 |
<!--<div>--> |
|
137 |
<!--<label class="uk-form-controls-text control-label">Current Compatibility Level</label>--> |
|
138 |
<!--<div *ngIf="existingCompLevel">{{ existingCompLevel ? existingCompLevel : 'not available' }}</div>--> |
|
139 |
<!--</div>--> |
|
140 |
|
|
141 |
<div class="uk-margin-medium-top"> |
|
142 |
<label class="" for="comment" title="{{ commentDesc.desc }}">Comments (What else do we need to know?)</label> |
|
143 |
<textarea id="comment" class="uk-textarea" rows="3" formControlName="comment" (blur)="checkIfValid()"></textarea> |
|
144 |
</div> |
|
145 |
|
|
146 |
</div> |
|
147 |
|
|
148 |
</div> |
|
149 |
</div> |
modules/uoa-repository-dashboard-gui/branches/cookie/src/app/shared/reusablecomponents/sources-forms/datasource-update-terms-form.component.html | ||
---|---|---|
1 |
<div *ngIf="loadingMessage" class="loading-big"> |
|
2 |
<div class="loader-big" style="text-align: center; padding-top: 170px; color: rgb(47, 64, 80); font-weight: bold;"> |
|
3 |
{{ loadingMessage }} |
|
4 |
</div> |
|
5 |
<div class="whiteFilm"></div> |
|
6 |
</div> |
|
7 |
<div *ngIf="errorMessage" class="uk-alert uk-alert-danger">{{ errorMessage }}</div> |
|
8 |
<div *ngIf="successMessage" class="uk-alert uk-alert-success">{{ successMessage }}</div> |
|
9 |
|
|
10 |
<form *ngIf="selectedRepo && !loadingMessage" [formGroup]="agreementForm"> |
|
11 |
<br> |
|
12 |
<!-- {{agreementForm.get('acceptTerms').value}}--> |
|
13 |
<form-inline> |
|
14 |
<label><input formControlName="acceptTerms" class="uk-checkbox" type="checkbox" checked> I Agree with the </label> |
|
15 |
<a href="https://zenodo.org/record/1446384#.XiGIAdmxU5n" target="_blank">OpenAIRE's Terms of Agreement for Content Providers</a> |
|
16 |
</form-inline> |
|
17 |
<!-- {{agreementForm.get('optOut').value}}--> |
|
18 |
<form-inline> |
|
19 |
<label><input formControlName="optOut" class="uk-checkbox" type="checkbox"> I would like to opt out from "data mining of Open Access publications in my repository"</label> |
|
20 |
</form-inline> |
|
21 |
<br> |
|
22 |
<div *ngIf="showButton" class="form-group"> |
|
23 |
<button class="uk-button uk-button-primary updateRepoInfoButton" type="button" (click)="updateRepo()">Update Information</button> |
|
24 |
</div> |
|
25 |
</form> |
modules/uoa-repository-dashboard-gui/branches/cookie/src/app/shared/reusablecomponents/sources-forms/datasource-update-form.component.html | ||
---|---|---|
1 |
<div *ngIf="loadingMessage" class="loading-big"> |
|
2 |
<div class="loader-big" style="text-align: center; padding-top: 170px; color: rgb(47, 64, 80); font-weight: bold;"> |
|
3 |
{{ loadingMessage }} |
|
4 |
</div> |
|
5 |
<div class="whiteFilm"></div> |
|
6 |
</div> |
|
7 |
<div *ngIf="errorMessage" class="uk-alert uk-alert-danger">{{ errorMessage }}</div> |
|
8 |
<div *ngIf="successMessage" class="uk-alert uk-alert-success">{{ successMessage }}</div> |
|
9 |
<form *ngIf="selectedRepo && !loadingMessage" [formGroup]="updateGroup" class="uk-margin-medium-bottom"> |
|
10 |
<div> |
|
11 |
<h4 class="uk-h4 uk-text-primary uk-scrollspy-inview uk-animation-slide-top-medium" uk-scrollspy-class=""> |
|
12 |
Basic information |
|
13 |
</h4> |
|
14 |
</div> |
|
15 |
<div *ngIf="selectedRepo.datasourceType === 'opendoar'" class="uk-alert uk-alert-info"> |
|
16 |
The following fields are completed by OpenDOAR.<br> |
|
17 |
If you want to edit them, you can do it by using this |
|
18 |
<a target="_blank" href="{{ 'http://v2.sherpa.ac.uk/id/repository/' + repoId }}">OpenDOAR link</a> |
|
19 |
</div> |
|
20 |
<div *ngIf="selectedRepo.datasourceType === 're3data'" class="uk-alert uk-alert-info"> |
|
21 |
The following fields are completed by Re3data.<br> |
|
22 |
If you want to edit them, you can do it by using this |
|
23 |
<a target="_blank" href="{{ 'http://service.re3data.org/repository/' + repoId }}">Re3data link</a> |
|
24 |
</div> |
|
25 |
|
|
26 |
<div data-dynamic-fields="d_field_wizard" class="uk-grid" data-uk-grid-margin="" dynamic-fields-counter="0"> |
|
27 |
<div class="uk-width-medium-1-1 parsley-row form_section uk-row-first"> |
|
28 |
<div class="md-input-wrapper {{ (updateGroup.get('softwarePlatform') != null) ? 'md-input-filled' : '' }}"> |
|
29 |
<form-inline [description]="softwarePlatformDesc" [valid]="updateGroup.get('softwarePlatform').valid"> |
|
30 |
<select formControlName="softwarePlatform" class="md-input"> |
|
31 |
<!-- <option value="" selected>[Other] (enter name below)</option> RESTORE AFTER getTypologies begins to work--> |
|
32 |
<option *ngFor="let platform of typologies" value="{{ platform.value }}">{{ platform.name }}</option> |
|
33 |
</select> |
|
34 |
</form-inline> |
|
35 |
</div> |
|
36 |
</div> |
|
37 |
</div> |
|
38 |
|
|
39 |
<div data-dynamic-fields="d_field_wizard" class="uk-grid" data-uk-grid-margin="" dynamic-fields-counter="0"> |
|
40 |
<div class="uk-width-medium-1-1 parsley-row form_section uk-row-first"> |
|
41 |
<div class="md-input-wrapper {{(updateGroup.get('platformName') != null) ? 'md-input-filled' : '' }}"> |
|
42 |
<form-inline [description]="platformNameDesc" [valid]="updateGroup.get('platformName').valid"> |
|
43 |
<span *ngIf="updateGroup.get('platformName').touched && updateGroup.get('platformName').value" |
|
44 |
class="help-block inline" |
|
45 |
style="margin-top: 0px; margin-bottom: 0px; font-style: italic">This value will be used as the platform for your repository</span> |
|
46 |
<input formControlName="platformName" class="md-input" style="" type="text"> |
|
47 |
</form-inline> |
|
48 |
</div> |
|
49 |
</div> |
|
50 |
</div> |
|
51 |
|
|
52 |
<div data-dynamic-fields="d_field_wizard" class="uk-grid" data-uk-grid-margin="" dynamic-fields-counter="0"> |
|
53 |
<div class="uk-width-medium-1-1 parsley-row form_section uk-row-first"> |
|
54 |
<div class="md-input-wrapper {{ (updateGroup.get('officialName') != null) ? 'md-input-filled' : '' }}"> |
|
55 |
<form-inline [description]="officialNameDesc" [valid]="updateGroup.get('officialName').valid"> |
|
56 |
<input formControlName="officialName" class="md-input" style="" type="text"> |
|
57 |
</form-inline> |
|
58 |
</div> |
|
59 |
</div> |
|
60 |
</div> |
|
61 |
|
|
62 |
<div *ngIf="selectedRepo.datasourceType == 'journal'"> |
|
63 |
<div data-dynamic-fields="d_field_wizard" class="uk-grid" data-uk-grid-margin="" dynamic-fields-counter="0"> |
|
64 |
<div class="uk-width-medium-1-1 parsley-row form_section uk-row-first"> |
|
65 |
<div class="md-input-wrapper {{ (updateGroup.get('issn') != null) ? 'md-input-filled' : '' }}"> |
|
66 |
<form-inline [description]="issnDesc" [valid]="updateGroup.get('issn').valid"> |
|
67 |
<span *ngIf="updateGroup.get('issn').invalid && updateGroup.get('issn').touched && updateGroup.get('issn').dirty" |
|
68 |
class="help-block inline uk-text-danger" |
|
69 |
style="margin-top: 0px; margin-bottom: 0px; padding-left: 10px;">Issn needs to be of the form: "1111-1111" or "1111-111X"</span> |
|
70 |
<input formControlName="issn" class="md-input" type="text" |
|
71 |
(focus)="updateGroup.get('issn').markAsUntouched()" (blur)="updateGroup.get('issn').updateValueAndValidity()"> |
|
72 |
</form-inline> |
|
73 |
</div> |
|
74 |
</div> |
|
75 |
</div> |
|
76 |
|
|
77 |
<div data-dynamic-fields="d_field_wizard" class="uk-grid" data-uk-grid-margin="" dynamic-fields-counter="0"> |
|
78 |
<div class="uk-width-medium-1-1 parsley-row form_section uk-row-first"> |
|
79 |
<div class="md-input-wrapper {{ (updateGroup.get('eissn') != null) ? 'md-input-filled' : '' }}"> |
|
80 |
<form-inline [description]="eissnDesc" [valid]="updateGroup.get('eissn').valid"> |
|
81 |
<span *ngIf="updateGroup.get('eissn').invalid && updateGroup.get('eissn').touched && updateGroup.get('eissn').dirty" |
|
82 |
class="help-block inline uk-text-danger" |
|
83 |
style="margin-top: 0px; margin-bottom: 0px; padding-left: 10px;">Eissn needs to be of the form: "1111-1111" or "1111-111X"</span> |
|
84 |
<input formControlName="eissn" class="md-input" type="text" |
|
85 |
(focus)="updateGroup.get('eissn').markAsUntouched()" (blur)="updateGroup.get('eissn').updateValueAndValidity()"> |
|
86 |
</form-inline> |
|
87 |
</div> |
|
88 |
</div> |
|
89 |
</div> |
|
90 |
|
|
91 |
<div data-dynamic-fields="d_field_wizard" class="uk-grid" data-uk-grid-margin="" dynamic-fields-counter="0"> |
|
92 |
<div class="uk-width-medium-1-1 parsley-row form_section uk-row-first"> |
|
93 |
<div class="md-input-wrapper {{ (updateGroup.get('lissn') != null) ? 'md-input-filled' : '' }}"> |
|
94 |
<form-inline [description]="lissnDesc" [valid]="updateGroup.get('lissn').valid"> |
|
95 |
<span *ngIf="updateGroup.get('lissn').invalid && updateGroup.get('lissn').touched && updateGroup.get('lissn').dirty" |
|
96 |
class="help-block inline uk-text-danger" |
|
97 |
style="margin-top: 0px; margin-bottom: 0px; padding-left: 10px;">Lissn needs to be of the form: "1111-1111" or "1111-111X"</span> |
|
98 |
<input formControlName="lissn" class="md-input" type="text" |
|
99 |
(focus)="updateGroup.get('lissn').markAsUntouched()" (blur)="updateGroup.get('lissn').updateValueAndValidity()"> |
|
100 |
</form-inline> |
|
101 |
</div> |
|
102 |
</div> |
|
103 |
</div> |
|
104 |
|
|
105 |
</div> |
|
106 |
|
|
107 |
<div data-dynamic-fields="d_field_wizard" class="uk-grid" data-uk-grid-margin="" dynamic-fields-counter="0"> |
|
108 |
<div class="uk-width-medium-1-1 parsley-row form_section uk-row-first"> |
|
109 |
<div class="md-input-wrapper {{ (updateGroup.get('repoDescription') != null) ? 'md-input-filled' : '' }}"> |
|
110 |
<form-inline [description]="repoDescriptionDesc" [valid]="updateGroup.get('repoDescription').valid"> |
|
111 |
<textarea formControlName="repoDescription" class="md-input"></textarea> |
|
112 |
</form-inline> |
|
113 |
</div> |
|
114 |
</div> |
|
115 |
</div> |
|
116 |
|
|
117 |
<div data-dynamic-fields="d_field_wizard" class="uk-grid" data-uk-grid-margin="" dynamic-fields-counter="0"> |
|
118 |
<div class="uk-width-medium-1-1 parsley-row form_section uk-row-first"> |
|
119 |
<div class="md-input-wrapper {{ (updateGroup.get('country') != null) ? 'md-input-filled' : '' }}"> |
|
120 |
<form-inline [description]="countryDesc" [valid]="updateGroup.get('country')"> |
|
121 |
<select formControlName="country" class="md-input"> |
|
122 |
<option value="">-- none selected --</option> |
|
123 |
<option *ngFor="let country of countries" value="{{country.code}}" title="{{country.name}}">{{ country.name }}</option> |
|
124 |
</select> |
|
125 |
</form-inline> |
|
126 |
</div> |
|
127 |
</div> |
|
128 |
</div> |
|
129 |
|
|
130 |
<div data-dynamic-fields="d_field_wizard" class="uk-grid" data-uk-grid-margin="" dynamic-fields-counter="0"> |
|
131 |
<div class="uk-width-medium-1-1 parsley-row form_section uk-row-first"> |
|
132 |
<div class="md-input-wrapper {{ (updateGroup.get('longtitude') != null) ? 'md-input-filled' : '' }}"> |
|
133 |
<form-inline [description]="longtitudeDesc" [valid]="updateGroup.get('longtitude').valid"> |
|
134 |
<input formControlName="longtitude" type="text" class="md-input"> |
|
135 |
</form-inline> |
|
136 |
</div> |
|
137 |
</div> |
|
138 |
</div> |
|
139 |
|
|
140 |
<div data-dynamic-fields="d_field_wizard" class="uk-grid" data-uk-grid-margin="" dynamic-fields-counter="0"> |
|
141 |
<div class="uk-width-medium-1-1 parsley-row form_section uk-row-first"> |
|
142 |
<div class="md-input-wrapper {{ (updateGroup.get('latitude') != null) ? 'md-input-filled' : '' }}"> |
|
143 |
<form-inline [description]="latitudeDesc" [valid]="updateGroup.get('latitude').valid"> |
|
144 |
<input formControlName="latitude" type="text" class="md-input"> |
|
145 |
</form-inline> |
|
146 |
</div> |
|
147 |
</div> |
|
148 |
</div> |
|
149 |
|
|
150 |
<div data-dynamic-fields="d_field_wizard" class="uk-grid" data-uk-grid-margin="" dynamic-fields-counter="0"> |
|
151 |
<div class="uk-width-medium-1-1 parsley-row form_section uk-row-first"> |
|
152 |
<div class="md-input-wrapper {{ (updateGroup.get('websiteUrl') != null) ? 'md-input-filled' : '' }}"> |
|
153 |
<form-inline [description]="websiteUrlDesc" [valid]="updateGroup.get('websiteUrl').valid"> |
|
154 |
<input formControlName="websiteUrl" class="md-input" type="text"> |
|
155 |
</form-inline> |
|
156 |
</div> |
|
157 |
</div> |
|
158 |
</div> |
|
159 |
|
|
160 |
<div data-dynamic-fields="d_field_wizard" class="uk-grid" data-uk-grid-margin="" dynamic-fields-counter="0"> |
|
161 |
<div class="uk-width-medium-1-1 parsley-row form_section uk-row-first"> |
|
162 |
<div class="md-input-wrapper {{ (updateGroup.get('institutionName') != null) ? 'md-input-filled' : '' }}"> |
|
163 |
<form-inline [description]="institutionNameDesc" [valid]="updateGroup.get('institutionName').valid"> |
|
164 |
<input formControlName="institutionName" class="md-input" type="text"> |
|
165 |
</form-inline> |
|
166 |
</div> |
|
167 |
</div> |
|
168 |
</div> |
|
169 |
|
|
170 |
<h4 class="uk-h4 uk-text-primary uk-scrollspy-inview uk-animation-slide-top-medium" |
|
171 |
uk-scrollspy-class="">Extra Information</h4> |
|
172 |
|
|
173 |
<div data-dynamic-fields="d_field_wizard" class="uk-grid" data-uk-grid-margin="" dynamic-fields-counter="0"> |
|
174 |
<div class="uk-width-medium-1-1 parsley-row form_section uk-row-first"> |
|
175 |
<div class="md-input-wrapper {{ (updateGroup.get('englishName') != null) ? 'md-input-filled' : '' }}"> |
|
176 |
<form-inline [description]="englishNameDesc" [valid]="updateGroup.get('englishName').valid"> |
|
177 |
<input formControlName="englishName" class="md-input" type="text"> |
|
178 |
</form-inline> |
|
179 |
</div> |
|
180 |
</div> |
|
181 |
</div> |
|
182 |
|
|
183 |
<div data-dynamic-fields="d_field_wizard" class="uk-grid" data-uk-grid-margin="" dynamic-fields-counter="0"> |
|
184 |
<div class="uk-width-medium-1-1 parsley-row form_section uk-row-first"> |
|
185 |
<div class="md-input-wrapper {{ (updateGroup.get('logoUrl') != null) ? 'md-input-filled' : '' }}"> |
|
186 |
<form-inline [description]="logoUrlDesc" [valid]="updateGroup.get('logoUrl').valid"> |
|
187 |
<span *ngIf="updateGroup.get('logoUrl').invalid && updateGroup.get('logoUrl').touched && updateGroup.get('logoUrl').dirty" |
|
188 |
class="help-block inline uk-text-danger" |
|
189 |
style="margin-top: 0px; margin-bottom: 0px; ">The url you entered is not valid</span> |
|
190 |
<input formControlName="logoUrl" class="md-input" type="text" |
|
191 |
(focus)="updateGroup.get('logoUrl').markAsUntouched()" |
|
192 |
(blur)="updateGroup.get('logoUrl').updateValueAndValidity()"> |
|
193 |
<div class="comment fontItalic"> |
|
194 |
Please make sure that the maximum size of the uploaded image is width=360px, height=240px |
|
195 |
</div> |
|
196 |
</form-inline> |
|
197 |
</div> |
|
198 |
</div> |
|
199 |
</div> |
|
200 |
|
|
201 |
<div data-dynamic-fields="d_field_wizard" class="uk-grid" data-uk-grid-margin="" dynamic-fields-counter="0"> |
|
202 |
<div class="uk-width-medium-1-1 parsley-row form_section uk-row-first"> |
|
203 |
<div class="md-input-wrapper {{ (updateGroup.get('timezone') != null) ? 'md-input-filled' : '' }}"> |
|
204 |
<form-inline [description]="timezoneDesc" [valid]="updateGroup.get('timezone').valid"> |
|
205 |
<select formControlName="timezone" class="md-input"> |
|
206 |
<option value="">-- none selected --</option> |
|
207 |
<option *ngFor="let timezone of timezones" value="{{ timezone.offset }}">{{ timezone.name }}</option> |
|
208 |
</select> |
|
209 |
</form-inline> |
|
210 |
</div> |
|
211 |
</div> |
|
212 |
</div> |
|
213 |
|
|
214 |
<div data-dynamic-fields="d_field_wizard" class="uk-grid" data-uk-grid-margin="" dynamic-fields-counter="0"> |
|
215 |
<div class="uk-width-medium-1-1 parsley-row form_section uk-row-first"> |
|
216 |
<div class="md-input-wrapper {{ (updateGroup.get('datasourceType') != null) ? 'md-input-filled' : '' }}"> |
|
217 |
<form-inline [description]="datasourceTypeDesc" [valid]="updateGroup.get('datasourceType').valid"> |
|
218 |
<select formControlName="datasourceType" class="md-input"> |
|
219 |
<option value="">-- none selected --</option> |
|
220 |
<option *ngFor="let key of classCodes" value="{{key}}">{{ datasourceClasses[key] }}</option> |
|
221 |
</select> |
|
222 |
</form-inline> |
|
223 |
</div> |
|
224 |
</div> |
|
225 |
</div> |
|
226 |
|
|
227 |
<h4 class="uk-h4 uk-text-primary uk-scrollspy-inview uk-animation-slide-top-medium" |
|
228 |
uk-scrollspy-class="">Administrator & contact information</h4> |
|
229 |
|
|
230 |
<div data-dynamic-fields="d_field_wizard" class="uk-grid" data-uk-grid-margin="" dynamic-fields-counter="0"> |
|
231 |
<div class="uk-width-medium-1-1 parsley-row form_section uk-row-first"> |
|
232 |
<div class="md-input-wrapper {{ (updateGroup.get('adminEmail') != null) ? 'md-input-filled' : '' }}"> |
|
233 |
<form-inline [description]="adminEmailDesc" [valid]="updateGroup.get('adminEmail').valid"> |
|
234 |
<span *ngIf="updateGroup.get('adminEmail').invalid && updateGroup.get('adminEmail').touched && updateGroup.get('adminEmail').dirty" |
|
235 |
class="help-block inline" |
|
236 |
style="margin-top: 0px; margin-bottom: 0px; ">You need to enter a valid email address</span> |
|
237 |
<input formControlName="adminEmail" class="md-input" type="text" (focus)="updateGroup.get('adminEmail').markAsUntouched()" (blur)="updateGroup.get('adminEmail').updateValueAndValidity()"> |
|
238 |
</form-inline> |
|
239 |
</div> |
|
240 |
</div> |
|
241 |
</div> |
|
242 |
|
|
243 |
<div *ngIf="showButton" class="form-group uk-margin-medium-top"> |
|
244 |
<button class="uk-button uk-button-primary updateRepoInfoButton" type="button" (click)="updateRepo()">Update Information</button> |
|
245 |
</div> |
|
246 |
</form> |
|
247 |
|
|
0 | 248 |
modules/uoa-repository-dashboard-gui/branches/cookie/src/app/shared/reusablecomponents/cookie-law/cookie-law.html | ||
---|---|---|
1 |
<div class="cookie-law-wrapper" |
|
2 |
[ngStyle]="currentStyles" |
|
3 |
*ngIf="!cookieLawSeen" |
|
4 |
[@state]="animation" |
|
5 |
(@state.done)="afterDismissAnimation($event)"> |
|
6 |
|
|
7 |
<div class="copy"> |
|
8 |
<span #ref><ng-content></ng-content></span> |
|
9 |
<span *ngIf="ref.childNodes.length == 0"> |
|
10 |
By continuing to browse the site, you're agreeing to our use of cookies. |
|
11 |
<span *ngIf="learnMore"> |
|
12 |
Learn more in our <a [href]="learnMore" [target]="target">privacy policy</a>. |
|
13 |
</span> |
|
14 |
</span> |
|
15 |
|
|
16 |
<a href="#" role="button" class="dismiss" (click)="dismiss($event)"> |
|
17 |
<span class="clickable uk-icon"> |
|
18 |
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="close" ratio="1"> |
|
19 |
<path fill="none" stroke="#000" stroke-width="1.06" d="M16,16 L4,4"></path> |
|
20 |
<path fill="none" stroke="#000" stroke-width="1.06" d="M16,4 L4,16"></path> |
|
21 |
</svg> |
|
22 |
</span> |
|
23 |
</a> |
|
24 |
</div> |
|
25 |
</div> |
|
0 | 26 |
modules/uoa-repository-dashboard-gui/branches/cookie/src/app/shared/reusablecomponents/sources-forms/datasource-create-form.component.ts | ||
---|---|---|
1 |
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; |
|
2 |
import { Country, Repository, Timezone, Typology } from '../../../domain/typeScriptClasses'; |
|
3 |
import { FormBuilder, FormGroup, Validators } from '@angular/forms'; |
|
4 |
import { |
|
5 |
adminEmailDesc, |
|
6 |
countryDesc, |
|
7 |
datasourceTypeDesc, |
|
8 |
Description, |
|
9 |
eissnDesc, |
|
10 |
englishNameDesc, |
|
11 |
institutionNameDesc, |
|
12 |
issnDesc, |
|
13 |
latitudeDesc, |
|
14 |
lissnDesc, |
|
15 |
logoUrlDesc, |
|
16 |
longtitudeDesc, |
|
17 |
officialNameDesc, |
|
18 |
platformNameDesc, |
|
19 |
repoDescriptionDesc, |
|
20 |
softwarePlatformDesc, |
|
21 |
timezoneDesc, |
|
22 |
websiteUrlDesc |
|
23 |
} from '../../../domain/oa-description'; |
|
24 |
import { ActivatedRoute } from '@angular/router'; |
|
25 |
import { RepositoryService } from '../../../services/repository.service'; |
|
26 |
import { AuthenticationService } from '../../../services/authentication.service'; |
|
27 |
import { formErrorRequiredFields, noServiceMessage } from '../../../domain/shared-messages'; |
|
28 |
|
|
29 |
@Component ({ |
|
30 |
selector: 'datasource-create-form', |
|
31 |
templateUrl: './datasource-create-form.component.html' |
|
32 |
}) |
|
33 |
|
|
34 |
export class DatasourceCreateFormComponent implements OnInit { |
|
35 |
errorMessage: string; |
|
36 |
successMessage: string; |
|
37 |
loadingMessage: string; |
|
38 |
|
|
39 |
typologies: Typology[] = []; |
|
40 |
timezones: Timezone[] = []; |
|
41 |
countries: Country[] = []; |
|
42 |
datasourceClasses: Map<string, string> = new Map<string, string>(); |
|
43 |
classCodes: string[] = []; |
|
44 |
|
|
45 |
@Input() mode: string; |
|
46 |
|
|
47 |
@Output() emittedInfo: EventEmitter<Repository> = new EventEmitter(); |
|
48 |
|
|
49 |
@Input() selectedRepo: Repository; |
|
50 |
|
|
51 |
formSubmitted = false; |
|
52 |
group: FormGroup; |
|
53 |
|
|
54 |
// old issn regex |
|
55 |
// issn : ['', [Validators.pattern('^\\d\\d\\d\\d[-]\\d\\d\\d\\d$')] ], |
|
56 |
readonly groupDefinition = { |
|
57 |
softwarePlatform : ['', Validators.required], |
|
58 |
platformName : '', |
|
59 |
officialName : ['', Validators.required], |
|
60 |
issn : ['', [Validators.pattern('^\\d{4}-\\d{3}[\\dxX]$')] ], |
|
61 |
eissn : ['', Validators.pattern('^\\d{4}-\\d{3}[\\dxX]$') ], |
|
62 |
lissn : ['', Validators.pattern('^\\d{4}-\\d{3}[\\dxX]$') ], |
|
63 |
repoDescription : ['', Validators.required], |
|
64 |
country : ['', Validators.required], |
|
65 |
longtitude : ['', [Validators.required, Validators.min(-180), Validators.max(180)] ], |
|
66 |
latitude : ['', [Validators.required, Validators.min(-90), Validators.max(90)] ], |
|
67 |
websiteUrl : ['', [Validators.required, Validators.pattern('^(http:\\/\\/www\\.|https:\\/\\/www\\.|http:\\/\\/|https:\\/\\/)?[a-z0-9]+([\\-\\.]{1}[a-z0-9]+)*\\.[a-z]{2,5}(:[0-9]{1,5})?(\\/.*)?$')] ], |
|
68 |
institutionName : ['', Validators.required], |
|
69 |
englishName: ['', Validators.required], |
|
70 |
logoUrl: ['', Validators.pattern('^(http:\\/\\/www\\.|https:\\/\\/www\\.|http:\\/\\/|https:\\/\\/)?[a-z0-9]+([\\-\\.]{1}[a-z0-9]+)*\\.[a-z]{2,5}(:[0-9]{1,5})?(\\/.*)?$') ], |
|
71 |
timezone: ['', Validators.required], |
|
72 |
datasourceType: ['', Validators.required], |
|
73 |
adminEmail: ['', [Validators.required, Validators.email] ] |
|
74 |
}; |
|
75 |
|
|
76 |
softwarePlatformDesc: Description = softwarePlatformDesc; |
|
77 |
platformNameDesc: Description = platformNameDesc; |
|
78 |
officialNameDesc: Description = officialNameDesc; |
|
79 |
issnDesc: Description = issnDesc; |
|
80 |
eissnDesc: Description = eissnDesc; |
|
81 |
lissnDesc: Description = lissnDesc; |
|
82 |
repoDescriptionDesc: Description = repoDescriptionDesc; |
|
83 |
countryDesc: Description = countryDesc; |
|
84 |
longtitudeDesc: Description = longtitudeDesc; |
|
85 |
latitudeDesc: Description = latitudeDesc; |
|
86 |
websiteUrlDesc: Description = websiteUrlDesc; |
|
87 |
institutionNameDesc: Description = institutionNameDesc; |
|
88 |
englishNameDesc: Description = englishNameDesc; |
|
89 |
logoUrlDesc: Description = logoUrlDesc; |
|
90 |
timezoneDesc: Description = timezoneDesc; |
|
91 |
datasourceTypeDesc: Description = datasourceTypeDesc; |
|
92 |
adminEmailDesc: Description = adminEmailDesc; |
|
93 |
|
|
94 |
constructor( |
|
95 |
private fb: FormBuilder, |
|
96 |
private route: ActivatedRoute, |
|
97 |
private repoService: RepositoryService, |
|
98 |
private authService: AuthenticationService |
|
99 |
) {} |
|
100 |
|
|
101 |
ngOnInit() { |
|
102 |
this.loadForm(); |
|
103 |
} |
|
104 |
|
|
105 |
loadForm() { |
|
106 |
if (!this.mode) { |
|
107 |
this.mode = this.route.snapshot.url[0].path.toString(); |
|
108 |
console.log(`my mode is ${this.mode}`); |
|
109 |
} |
|
110 |
this.group = this.fb.group(this.groupDefinition); |
|
111 |
if (this.mode === 'journal') { |
|
112 |
this.group.get('issn').clearValidators(); |
|
113 |
this.group.get('issn').setValidators([Validators.required, Validators.pattern('^\\d{4}-\\d{3}[\\dxX]$')]); |
|
114 |
} |
|
115 |
this.getTypologies(); |
|
116 |
this.getTimezones(); |
|
117 |
this.getCountries(); |
|
118 |
this.getDatasourceClasses(); |
|
119 |
|
|
120 |
if (this.selectedRepo) { |
|
121 |
this.setupForm(); |
|
122 |
} |
|
123 |
} |
|
124 |
|
|
125 |
setupForm() { |
|
126 |
if (this.selectedRepo) { |
|
127 |
console.log(`my datasource type is: ${this.selectedRepo.datasourceType}`); |
|
128 |
|
|
129 |
this.group.setValue({ |
|
130 |
softwarePlatform: this.selectedRepo.typology, |
|
131 |
platformName: '', |
|
132 |
officialName: this.selectedRepo.officialName, |
|
133 |
issn: '', |
|
134 |
eissn: '', |
|
135 |
lissn: '', |
|
136 |
repoDescription: this.selectedRepo.description, |
|
137 |
country: this.selectedRepo.countryCode, |
|
138 |
longtitude: this.selectedRepo.longitude, |
|
139 |
latitude: this.selectedRepo.latitude, |
|
140 |
websiteUrl: this.selectedRepo.websiteUrl, |
|
141 |
institutionName: this.selectedRepo.organization, |
|
142 |
englishName: this.selectedRepo.englishName, |
|
143 |
logoUrl: this.selectedRepo.logoUrl, |
|
144 |
timezone: this.selectedRepo.timezone, |
|
145 |
datasourceType: this.selectedRepo.datasourceClass, |
|
146 |
adminEmail: this.selectedRepo.contactEmail |
|
147 |
}); |
|
148 |
|
|
149 |
if (this.selectedRepo.datasourceType === 'journal') { |
|
150 |
|
|
151 |
let ssnToShow = this.selectedRepo.issn.slice(0, 4) + '-' + this.selectedRepo.issn.toString().slice(4); |
|
152 |
this.group.get('issn').setValue(ssnToShow); |
|
153 |
|
|
154 |
if (this.selectedRepo.eissn.trim().length) { |
|
155 |
ssnToShow = this.selectedRepo.eissn.slice(0, 4) + '-' + this.selectedRepo.eissn.toString().slice(4); |
|
156 |
this.group.get('eissn').setValue(ssnToShow); |
|
157 |
} |
|
158 |
|
|
159 |
if (this.selectedRepo.lissn.trim().length) { |
|
160 |
ssnToShow = this.selectedRepo.lissn.slice(0, 4) + '-' + this.selectedRepo.lissn.toString().slice(4); |
|
161 |
this.group.get('lissn').setValue(ssnToShow); |
|
162 |
} |
|
163 |
|
|
164 |
} |
|
165 |
} |
|
166 |
} |
|
167 |
|
|
168 |
getCountries() { |
|
169 |
this.repoService.getCountries() |
|
170 |
.subscribe( |
|
171 |
countries => this.countries = countries.sort( function(a, b) { |
|
172 |
if (a.name < b.name) { |
|
173 |
return -1; |
|
174 |
} else if (a.name > b.name) { |
|
175 |
return 1; |
|
176 |
} else { |
|
177 |
return 0; |
|
178 |
} |
|
179 |
} ), |
|
180 |
error => { |
|
181 |
this.errorMessage = noServiceMessage; |
|
182 |
console.log(error); |
|
183 |
}); |
|
184 |
} |
|
185 |
|
|
186 |
getDatasourceClasses() { |
|
187 |
this.repoService.getDatasourceClasses(this.mode).subscribe( |
|
188 |
classes => this.datasourceClasses = classes, |
|
189 |
error => { |
|
190 |
this.errorMessage = noServiceMessage; |
|
191 |
console.log(error); |
|
192 |
}, |
|
193 |
() => { |
|
194 |
for (const key of Object.keys(this.datasourceClasses)) { |
|
195 |
this.classCodes.push(key); |
|
196 |
} |
|
197 |
} |
|
198 |
); |
|
199 |
} |
|
200 |
|
|
201 |
getTypologies() { |
|
202 |
this.repoService.getTypologies().subscribe( |
|
203 |
types => this.typologies = types, |
|
204 |
error => console.log(error) |
|
205 |
); |
|
206 |
} |
|
207 |
|
|
208 |
getTimezones() { |
|
209 |
this.repoService.getTimezones().subscribe( |
|
210 |
zones => this.timezones = zones, |
|
211 |
error => console.log(error) |
|
212 |
); |
|
213 |
} |
|
214 |
|
|
215 |
registerDatasource() { |
|
216 |
this.formSubmitted = true; |
|
217 |
this.errorMessage = ''; |
|
218 |
this.successMessage = ''; |
|
219 |
window.scroll(1, 1); |
|
220 |
|
|
221 |
if (this.group.valid) { |
|
222 |
this.selectedRepo = this.createNewRepository(); |
|
223 |
this.emittedInfo.emit(this.selectedRepo); |
|
224 |
} else { |
|
225 |
this.errorMessage = formErrorRequiredFields; |
|
226 |
} |
|
227 |
} |
|
228 |
|
|
229 |
createNewRepository(): Repository { |
|
230 |
const newRepo: Repository = new Repository(); |
|
231 |
newRepo.officialName = this.group.get('officialName').value.toString(); |
|
232 |
newRepo.englishName = this.group.get('englishName').value.toString(); |
|
233 |
newRepo.websiteUrl = this.group.get('websiteUrl').value; |
|
234 |
newRepo.logoUrl = this.group.get('logoUrl').value; |
|
235 |
newRepo.contactEmail = this.group.get('adminEmail').value; |
|
236 |
newRepo.countryName = this.countries.filter(x => x.code === this.group.get('country').value)[0].name; |
|
237 |
newRepo.countryCode = this.group.get('country').value; |
|
238 |
newRepo.organization = this.group.get('institutionName').value.toString(); |
|
239 |
newRepo.latitude = this.group.get('latitude').value; |
|
240 |
newRepo.longitude = this.group.get('longtitude').value; |
|
241 |
newRepo.timezone = this.group.get('timezone').value; |
|
242 |
newRepo.datasourceClass = this.group.get('datasourceType').value; |
|
243 |
if (this.group.get('softwarePlatform').value ) { |
|
244 |
newRepo.typology = this.group.get('softwarePlatform').value; |
|
245 |
} else if (this.group.get('platformName').value) { |
|
246 |
newRepo.typology = this.group.get('platformName').value; |
|
247 |
} |
|
248 |
// newRepo.typology = this.group.get('softwarePlatform').value; |
|
249 |
newRepo.description = this.group.get('repoDescription').value.toString(); |
|
250 |
newRepo.issn = ''; |
|
251 |
newRepo.eissn = ''; |
|
252 |
newRepo.lissn = ''; |
|
253 |
|
|
254 |
if ( this.group.get('issn').value ) { |
|
255 |
let ssnParts = this.group.get('issn').value.split('-'); |
|
256 |
let correctSSN = ssnParts[0] + ssnParts[1]; |
|
257 |
newRepo.issn = correctSSN; |
|
258 |
if ( this.group.get('eissn').value ) { |
|
259 |
ssnParts = this.group.get('eissn').value.split('-'); |
|
260 |
correctSSN = ssnParts[0] + ssnParts[1]; |
|
261 |
newRepo.eissn = correctSSN; |
|
262 |
} |
|
263 |
if ( this.group.get('lissn').value ) { |
|
264 |
ssnParts = this.group.get('lissn').value.split('-'); |
|
265 |
correctSSN = ssnParts[0] + ssnParts[1]; |
|
266 |
newRepo.lissn = correctSSN; |
|
267 |
} |
|
268 |
} |
|
269 |
|
|
270 |
newRepo.registeredBy = this.authService.getUserEmail(); |
|
271 |
|
|
272 |
/* THE BELOW FIELDS ARE NOT SET IN GWT CODE*/ |
|
273 |
newRepo.datasourceType = this.mode; |
|
274 |
newRepo.dateOfCreation = new Date(Date.now()); // NOT NEEDED ?? |
|
275 |
newRepo.registered = true; |
|
276 |
newRepo.registrationDate = new Date(Date.now()); // NOT NEEDED ?? |
|
277 |
|
|
278 |
return newRepo; |
|
279 |
} |
|
280 |
|
|
281 |
|
|
282 |
} |
|
0 | 283 |
modules/uoa-repository-dashboard-gui/branches/cookie/src/app/shared/reusablecomponents/reusable-components.module.ts | ||
---|---|---|
1 |
/** |
|
2 |
* Created by stefania on 4/6/17. |
|
3 |
*/ |
|
4 |
import { InlineFormWrapper, MyGroup } from './forms/my-group.interface'; |
|
5 |
import { MyArray, MyArrayInline, MyArrayWrapper, MyInlineArrayWrapper } from './forms/my-array.interface'; |
|
6 |
import { MyFormDirective } from './forms/my-form.directive'; |
|
7 |
import { NgModule } from '@angular/core'; |
|
8 |
import { CommonModule } from '@angular/common'; |
|
9 |
import { RouterModule } from '@angular/router'; |
|
10 |
import { FormsModule, ReactiveFormsModule } from '@angular/forms'; |
|
11 |
import { HttpClientModule } from '@angular/common/http'; |
|
12 |
import { AsideHelpContentComponent, HelpContentComponent } from './help-content.component'; |
|
13 |
import { ConfirmationDialogComponent } from './confirmation-dialog.component'; |
|
14 |
import { RepositoryTilesComponent } from './repository-tiles.component'; |
|
15 |
import { ForbiddenPageComponent } from './403-forbidden-page.component'; |
|
16 |
import { HelpContentService } from '../../services/help-content.service'; |
|
17 |
import { ModalModule, TabsModule } from 'ngx-bootstrap'; |
|
18 |
import { TopmenuLandingComponent } from '../topmenulanding/topmenu-landing.component'; |
|
19 |
import { FooterComponent } from '../footer/footer.component'; |
|
20 |
import { ReadMoreComponent, ReadMoreTextComponent } from './read-more.component'; |
|
21 |
import { SideMenuComponent } from "../sidemenu/sidemenu.component"; |
|
22 |
import { TopmenuDashboardComponent} from "../topmenudashboard/topmenu-dashboard.component"; |
|
23 |
import { DatasourceUpdateFormComponent } from "./sources-forms/datasource-update-form.component"; |
|
24 |
import { DatasourceCreateFormComponent } from "./sources-forms/datasource-create-form.component"; |
|
25 |
import { DatasourceNewInterfaceFormComponent } from "./sources-forms/datasource-new-interface-form.component"; |
|
26 |
|
|
27 |
const myGroups = [ |
|
28 |
MyGroup, |
|
29 |
MyArray, |
|
30 |
MyArrayWrapper, |
|
31 |
MyArrayInline, |
|
32 |
MyFormDirective, |
|
33 |
MyInlineArrayWrapper, |
|
34 |
InlineFormWrapper |
|
35 |
]; |
|
36 |
|
|
37 |
@NgModule({ |
|
38 |
imports: [ |
|
39 |
CommonModule, |
|
40 |
RouterModule, |
|
41 |
TabsModule.forRoot(), |
|
42 |
ModalModule.forRoot(), |
|
43 |
FormsModule, |
|
44 |
ReactiveFormsModule, |
|
45 |
HttpClientModule, |
|
46 |
], |
|
47 |
entryComponents : [ |
|
48 |
MyArrayWrapper |
|
49 |
], |
|
50 |
declarations: [ |
|
51 |
HelpContentComponent, |
|
52 |
AsideHelpContentComponent, |
|
53 |
ConfirmationDialogComponent, |
|
54 |
TopmenuLandingComponent, |
|
55 |
TopmenuDashboardComponent, |
|
56 |
SideMenuComponent, |
|
57 |
FooterComponent, |
|
58 |
RepositoryTilesComponent, |
|
59 |
ForbiddenPageComponent, |
|
60 |
ReadMoreComponent, |
|
61 |
ReadMoreTextComponent, |
|
62 |
DatasourceUpdateFormComponent, |
|
63 |
DatasourceCreateFormComponent, |
|
64 |
DatasourceNewInterfaceFormComponent, |
|
65 |
...myGroups |
|
66 |
], |
|
67 |
exports: [ |
|
68 |
HelpContentComponent, |
|
69 |
AsideHelpContentComponent, |
|
70 |
ConfirmationDialogComponent, |
|
71 |
TopmenuLandingComponent, |
|
72 |
TopmenuDashboardComponent, |
|
73 |
SideMenuComponent, |
|
74 |
FooterComponent, |
|
75 |
RepositoryTilesComponent, |
|
76 |
ForbiddenPageComponent, |
|
77 |
...myGroups, |
|
78 |
ReadMoreComponent, |
|
79 |
ReadMoreTextComponent, |
|
80 |
DatasourceUpdateFormComponent, |
|
81 |
DatasourceCreateFormComponent, |
|
82 |
DatasourceNewInterfaceFormComponent, |
|
83 |
], |
|
84 |
providers: [ |
|
85 |
HelpContentService |
|
86 |
], |
|
87 |
}) |
|
88 |
|
|
89 |
export class ReusableComponentsModule { |
|
90 |
} |
|
0 | 91 |
modules/uoa-repository-dashboard-gui/branches/cookie/src/app/shared/footer/footer.component.html | ||
---|---|---|
1 |
<div class="uk-section-primary uk-section uk-section-small uk-padding-remove-bottom"> |
|
2 |
<div class="uk-container uk-container-expand"> |
|
3 |
<div class="uk-container uk-container-expand uk-margin-small"> |
|
4 |
<div class="uk-grid-collapse uk-grid" uk-grid=""> |
|
5 |
<div id="footer#3" class="uk-width-expand@s uk-first-column"> |
|
6 |
<div class="uk-margin-small uk-margin-remove-top uk-text-left@s uk-text-center"> |
|
7 |
<img src="../../../assets/imgs/Logo_Horizontal_white_small-74927fe1.png" data-width="126" data-height="30" class="el-image" alt="OpenAIRE"> |
|
8 |
</div> |
|
9 |
<!--div id="footer#5" class="uk-margin uk-text-left@s uk-text-center"> |
|
10 |
<img src="assets/commission.jpg" sizes="(min-width: 50px) 50px" data-width="427" data-height="285" class="el-image" alt="European Commission"> |
|
11 |
</div--> |
|
12 |
<div class="uk-margin"><img style="margin-right: 8px; float: left;" src="../../../assets/imgs/commission.jpg" alt="flag black white low" width="50" height="33"><span style="font-size: 8pt; line-height: 0.7!important;">OpenAIRE-Advance receives funding from the European Union's Horizon 2020 Research and Innovation programme under Grant Agreement No. 777541.</span></div> |
|
13 |
<div id="footer#6" class="newsletter uk-margin uk-margin-remove-bottom uk-text-left@s uk-text-center uk-panel"> |
|
14 |
|
|
15 |
|
|
16 |
<div class="uk-child-width-expand uk-grid-small uk-grid" uk-grid=""> |
|
17 |
<div class="uk-width-auto@m uk-first-column"><a class="el-link" href="/newsletter/listing"> |
|
18 |
<span class="el-image uk-icon" uk-icon="icon: rss; ratio: 1;"> |
|
19 |
<!--<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"> <circle cx="3.12" cy="16.8" r="1.85"></circle> <path fill="none" stroke="#000" stroke-width="1.1" d="M1.5,8.2 C1.78,8.18 2.06,8.16 2.35,8.16 C7.57,8.16 11.81,12.37 11.81,17.57 C11.81,17.89 11.79,18.19 11.76,18.5"></path> <path fill="none" stroke="#000" stroke-width="1.1" d="M1.5,2.52 C1.78,2.51 2.06,2.5 2.35,2.5 C10.72,2.5 17.5,9.24 17.5,17.57 C17.5,17.89 17.49,18.19 17.47,18.5"></path></svg>--> |
|
20 |
</span></a></div> <div> |
|
21 |
|
|
22 |
|
|
23 |
|
|
24 |
<h5 class="el-title uk-margin uk-h5"> Newsletter </h5> |
|
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
</div> |
|
30 |
</div> |
|
31 |
|
|
32 |
|
|
33 |
</div> |
|
34 |
<div id="footer#7" class="newsletter uk-margin-small uk-margin-remove-top uk-text-left@s uk-text-center uk-panel"> |
|
35 |
|
|
36 |
<div class="acymailing_module" id="acymailing_module_formAcymailing60611"> |
|
37 |
<div class="acymailing_mootoolsbutton" id="acymailing_toggle_formAcymailing60611"> |
|
38 |
<p><a class="acymailing_togglemodule" id="acymailing_togglemodule_formAcymailing60611" target="_blank" href="https://www.openaire.eu/past-newsletters/listing">Subscribe</a></p> |
|
39 |
|
|
40 |
</div> |
|
41 |
</div> |
|
42 |
</div> |
|
43 |
<div class="uk-margin-small uk-margin-remove-top uk-text-left@s uk-text-center"> |
|
44 |
<div class="uk-child-width-auto uk-grid-small uk-flex-left@s uk-flex-center uk-grid" uk-grid=""> |
|
45 |
<div class="uk-first-column"> |
Also available in: Unified diff
Creating a branh from trunk