Revision 59465
Added by Konstantina Galouni over 3 years ago
divIds.component.ts | ||
---|---|---|
58 | 58 |
_id: '', |
59 | 59 |
name: ['', Validators.required], |
60 | 60 |
pages: this.pagesCtrl, |
61 |
openaire: true, |
|
62 |
connect: false, |
|
63 |
communities: true |
|
61 |
portalType: ['', Validators.required] |
|
64 | 62 |
}); |
65 | 63 |
|
66 | 64 |
this.route.data |
... | ... | |
199 | 197 |
_id: divId._id, |
200 | 198 |
name: [divId.name,Validators.required], |
201 | 199 |
pages: this.pagesCtrl, |
202 |
openaire: divId.openaire, |
|
203 |
connect: divId.connect, |
|
204 |
communities: divId.communities |
|
200 |
portalType: [divId.portalType, Validators.required] |
|
205 | 201 |
}); |
202 |
this.myForm.controls['portalType'].disable(); |
|
203 |
|
|
206 | 204 |
for(let i = 0; i < divId.pages.length; i++) { |
207 | 205 |
this.pagesCtrl.push(this._fb.control(divId.pages[i])); |
208 | 206 |
} |
... | ... | |
213 | 211 |
} |
214 | 212 |
|
215 | 213 |
public newDivId() { |
214 |
this.myForm.controls['portalType'].enable(); |
|
215 |
|
|
216 | 216 |
this.pagesCtrl = this._fb.array([]); |
217 | 217 |
this.myForm = this._fb.group({ |
218 | 218 |
_id: '', |
219 | 219 |
name: ['', Validators.required], |
220 | 220 |
pages: this.pagesCtrl, |
221 |
openaire: this._fb.control(true), |
|
222 |
connect: false, |
|
223 |
communities: true |
|
221 |
//openaire: this._fb.control(true), |
|
222 |
portalType: ['', Validators.required] |
|
224 | 223 |
}); |
225 | 224 |
this.filteredPages = this.pageSearchCtrl.valueChanges.pipe(startWith(''), |
226 | 225 |
map(page => this._filter(page))); |
... | ... | |
257 | 256 |
} else { |
258 | 257 |
console.log(this.myForm.value) |
259 | 258 |
if (this.myForm.value['_id'].length == 0) { |
259 |
this.myForm.controls['portalType'].enable(); |
|
260 |
|
|
260 | 261 |
this.modalErrorMessage = ""; |
261 | 262 |
|
262 | 263 |
this._helpContentService.saveDivId(<DivId>this.myForm.value, this.properties.adminToolsAPIURL).subscribe( |
... | ... | |
300 | 301 |
} |
301 | 302 |
|
302 | 303 |
public filterDivIds(divId: DivId): boolean { |
303 |
let textFlag = this.searchText.toString() == '' || (divId.name).match(this.searchText) != null; |
|
304 |
let textFlag = this.searchText.toString() == '' || (divId.name + ' ' + divId.portalType).match(this.searchText) != null;
|
|
304 | 305 |
return textFlag; |
305 | 306 |
} |
306 | 307 |
|
Also available in: Unified diff
[Trunk | Library]: Merging branch 'use-UoaAdminToolsLibrary' into trunk for revisions 58402:59464