Revision 60977
Added by Konstantina Galouni almost 3 years ago
add-content-providers.component.ts | ||
---|---|---|
136 | 136 |
} |
137 | 137 |
}); |
138 | 138 |
} else { |
139 |
let contentProviderId: string = this.getCommunityContentProviderId(contentProvider); |
|
139 |
let communityContentProvider = this.getCommunityContentProvider(contentProvider); |
|
140 |
let contentProviderId: string = communityContentProvider['id']; |
|
140 | 141 |
this.subscriptions.push(this._manageCommunityContentProvidersService.removeContentProvider(this.properties, this.community, contentProviderId).subscribe( |
141 | 142 |
data => { |
142 |
let index = this.communityContentProviders.indexOf(contentProviderId);
|
|
143 |
let index = this.communityContentProviders.indexOf(communityContentProvider);
|
|
143 | 144 |
this.communityContentProviders.splice(index, 1); |
144 | 145 |
UIkit.notification('Content Provider successfully removed!', { |
145 | 146 |
status: 'success', |
... | ... | |
158 | 159 |
} |
159 | 160 |
} |
160 | 161 |
|
161 |
public getCommunityContentProviderId(contentProvider: any): string {
|
|
162 |
public getCommunityContentProvider(contentProvider: any): string { |
|
162 | 163 |
let index: number = 0; |
163 | 164 |
for (let communityContentProvider of this.communityContentProviders) { |
164 | 165 |
if (communityContentProvider.openaireId == contentProvider.id) { |
165 |
return communityContentProvider.id;
|
|
166 |
return communityContentProvider; |
|
166 | 167 |
} |
167 | 168 |
index++; |
168 | 169 |
} |
Also available in: Unified diff
[new-UI | Admin]:
1. remove-projects.component.html: [Bug fix] When there is no openaireId or no (grantId and funder), show name of project without a link.
2. remove-content-providers.component.ts & remove-projects.component.ts: [Bug fix] In method for filtering by keyword, match all fields with search text.
3. add-content-providers.component.ts & add-projects.component.ts:
a. getCommunityProjectId() --> getCommunityProject() and getCommunityContentProviderId() --> getCommunityContentProvider().
b. [Bug fix] call getCommunityProject() and getCommunityContentProvider() in remove method, to find index and splice deleted project/ content provider.
4. add-content-providers.component.html & add-projects.component.html: Call updated getCommunityProject() and getCommunityContentProvider().