Revision 59297
Added by Konstantina Galouni over 3 years ago
communities.component.ts | ||
---|---|---|
169 | 169 |
public editCommunity(i: number) { |
170 | 170 |
const community: Community = this.checkboxes[i].community; |
171 | 171 |
this.formGroup.patchValue(community); |
172 |
this.formGroup.controls['type'].disable(); |
|
172 | 173 |
// this.updateModal.showModal(); |
173 | 174 |
this.modalErrorMessage = ''; |
174 | 175 |
this.communitiesModalOpen(this.alertModalUpdateCommunity, 'Update', 'Update Community'); |
175 | 176 |
} |
176 | 177 |
|
177 | 178 |
public newCommunity() { |
178 |
this.formComponent.reset(); |
|
179 |
this.modalErrorMessage = ''; |
|
180 |
this.communitiesModalOpen(this.alertModalSaveCommunity, 'Save', 'Add a new Community'); |
|
179 |
this.formGroup.controls['type'].enable(); |
|
180 |
this.formComponent.reset(); |
|
181 |
this.modalErrorMessage = ''; |
|
182 |
this.communitiesModalOpen(this.alertModalSaveCommunity, 'Save', 'Add a new Community'); |
|
181 | 183 |
} |
182 | 184 |
|
183 | 185 |
private communitiesModalOpen(modal: any, title: string, yesBtn: string) { |
... | ... | |
223 | 225 |
this.communitiesModalOpen(this.alertModalUpdateCommunity, 'Update', 'Update Community'); |
224 | 226 |
this.modalErrorMessage = 'Please fill in all required fields marked with *'; |
225 | 227 |
} else { |
228 |
this.formGroup.controls['type'].enable(); |
|
226 | 229 |
this._helpContentService.updateCommunity(<Community> this.formGroup.value, |
227 | 230 |
this.properties.adminToolsAPIURL).subscribe( |
228 | 231 |
community => { |
... | ... | |
257 | 260 |
} |
258 | 261 |
|
259 | 262 |
public filterCommunities(community: Community): boolean { |
260 |
const textFlag = this.searchText.toString() === '' || (community.name).match(this.searchText) != null; |
|
263 |
const textFlag = this.searchText.toString() === '' || (community.name || community.type).match(this.searchText) != null;
|
|
261 | 264 |
return textFlag; |
262 | 265 |
} |
263 | 266 |
|
Also available in: Unified diff
[use-UoaAdminToolsLibrary | Admin]
1. package.json: Upgrade version of @types/nodes.
2. app.component.html: [Bug fix] Remove "dark" property.
3. app.component.ts & dashboard.component.ts: Call method "ConnectHelper.setPortalTypeFromPid()" to set portal type according to pid.
4. community.ts: Add property "type".
5. div-help-content.ts & page-help-content.ts & page-help-content-form.component.ts & page-help-contents.component.html & div-help-content-form.component.ts: Property "community" renamed to "portal".
6. divId.ts & page.ts & page-form.component.ts & divId-form.component.ts: Removed properties "openaire", "connect", "community" and added "portalType".
7. communities.component.html: Add column "type" | In <community-form> add input "update" set to true when opening update modal.
8. communities.component.ts: In "editCommunity()" disable "type" in form | In "filterCommunities()" search by type too.
9. community-form.component.html: Add select for portal type | Replace word community with portal.
10. community-form.component.ts: Add input property "update" set to false | "type" added in form.
11. div-help-contents.component.ts & edit-div-help-content.component.ts & new-div-help-content.component.ts &
edit-page-help-content.component.ts & new-page-help-content.component.ts & page-help-contents.component.ts:
Redirect when properties.adminToolsPortalType != page.portalType.
12. page-form.component.html & divId-form.component.html: Checkboxes became radio buttons for portal type selection.
13. pages.component.html: Add "portalType" column when no specific community is selected.
14. divIds.component.html: Add "portalType" column.
15. pages.component.ts:
a. In "editPage()" disable "portalType" in form and in "newPage()" and "pageUpdateConfirmed()" (before updating) enable it.
b. In "filterPages()" search by portal type too.
16. divIds.component.ts:
a. In "editDivId()" disable "portalType" in form and in "newDivId()" and "divIdUpdateConfirmed()" (before updating) enable it.
b. In "filterDivIds()" search by portalType too.
17. help-content.service.ts:
a. Rename "community" parameters to "portal".
b. In API paths replace "community" with "{{properties.adminToolsPortalType}}" (in "saveCommunity() and "updateCommunity()" use "community.type").
18. environment.ts & environment.beta.ts & environment.prod.ts: Add property: adminToolsPortalType: "community".