apply initial changes base odn new community API

This commit is contained in:
argirok 2023-07-14 11:43:27 +03:00
parent 500dd61f9b
commit 662b514ab5
11 changed files with 31 additions and 35 deletions

@ -1 +1 @@
Subproject commit 8d8eda416b4873c50f689db54444f135396db56d
Subproject commit 3ee4129c7e76cc7f4c8dcfcf27c135ce873f8f0d

View File

@ -113,6 +113,7 @@ export class AffiliationsComponent implements OnInit, OnDestroy {
deleteAffiliationOpen(index: number) {
this.index = index;
let affiliation: Affiliation = this.affiliations[index];
console.log(index, affiliation)
this.removeAffiliationModal.alertTitle = 'Delete Organization';
this.removeAffiliationModal.message = 'Do you want to remove <b>' +
affiliation.name + '</b> from Organizations?';
@ -164,7 +165,8 @@ export class AffiliationsComponent implements OnInit, OnDestroy {
removeAffiliation() {
this.loading = true;
this.affiliationService.deleteAffiliation(this.properties.communityAPI + this.community.communityId + '/organizations',
console.log(this.index, this.affiliations[this.index].id)
this.affiliationService.deleteAffiliation(this.properties.communityAPI + this.community.communityId + '/organizations?organizationName='+this.affiliations[this.index].name,
this.affiliations[this.index].id).subscribe((deleteOK) => {
this.affiliations.splice(this.index, 1);
if (this.currentPage.length === 0) {

View File

@ -81,7 +81,8 @@ export class RemoveContentProvidersComponent implements OnInit {
}
public confirmedDeleteContentProvider() {
this.subscriptions.push(this._manageCommunityContentProvidersService.removeContentProvider(this.properties, this.community.communityId, this.selectedCommunityContentProvider.id).subscribe(
console.log(this.selectedCommunityContentProvider)
this.subscriptions.push(this._manageCommunityContentProvidersService.removeContentProvider(this.properties, this.community.communityId, this.selectedCommunityContentProvider.openaireId).subscribe(
() => {
let index = this.communityContentProviders.indexOf(this.selectedCommunityContentProvider);
this.communityContentProviders.splice(index, 1);

View File

@ -133,7 +133,7 @@ export class RemoveProjectsComponent implements OnInit {
}
public confirmedDeleteProject(data: any) {
this.subscriptions.push(this._manageCommunityProjectsService.removeProject(this.properties, this.community.communityId, this.selectedCommunityProject.id).subscribe(
this.subscriptions.push(this._manageCommunityProjectsService.removeProject(this.properties, this.community.communityId, this.selectedCommunityProject.openaireId).subscribe(
data => {
let index = this.communityProjects.indexOf(this.selectedCommunityProject);
this.communityProjects.splice(index, 1);
@ -189,7 +189,7 @@ export class RemoveProjectsComponent implements OnInit {
this.subscriptions.push(this._searchCommunityProjectsService.searchProjects(this.properties, this.community.communityId).subscribe(
data => {
this.communityProjects = data;
this.communityProjects = data.content;
this.previewCommunityProjects = this.communityProjects;
this.sort();

View File

@ -88,7 +88,7 @@ export class ManageZenodoCommunitiesComponent implements OnInit, OnDestroy {
}
public confirmedDeleteCommunity(data: any) {
this.subscriptions.push(this._manageZenodoCommunitiesService.removeZCommunity(this.properties, this.community.communityId, this.selectedToDelete.openaireId).subscribe(
this.subscriptions.push(this._manageZenodoCommunitiesService.removeZCommunity(this.properties, this.community.communityId, this.selectedToDelete.id).subscribe(
data => {
var pos = -1;
for (var i = 0; i < this.selectedCommunities.length; i++) {

View File

@ -65,8 +65,7 @@ export class ZenodoCommunitiesComponent implements OnInit, OnDestroy {
this.masterZenodoCommunityId = this.community.zenodoCommunity;
if (this.masterZenodoCommunityId) {
this.subscriptions.push(this._zenodoCommunitieService.getZenodoCommunityById(this.properties,
this.properties.zenodoCommunities + this.masterZenodoCommunityId,
null).subscribe(
this.properties.zenodoCommunities + this.masterZenodoCommunityId).subscribe(
result => {
this.masterZenodoCommunity = result;
this.selectedCommunities.unshift(this.masterZenodoCommunity);
@ -81,25 +80,24 @@ export class ZenodoCommunitiesComponent implements OnInit, OnDestroy {
}
this.zenodoSearchUtils.status = this.errorCodes.LOADING;
this.zenodoSearchUtils.status = this.errorCodes.LOADING;
this._searchZenodoCommunitiesService.searchZCommunities(this.properties, this.community.communityId).subscribe(
result => {
this.selectedCommunityIds = result;
// this._searchZenodoCommunitiesService.searchZCommunities(this.properties, this.community.communityId).subscribe(
// result => {
this.selectedCommunityIds = this.community.otherZenodoCommunities;
this.zenodoSearchUtils.totalResults = this.selectedCommunityIds.length;
if (this.selectedCommunityIds.length === 0) {
this.zenodoSearchUtils.status = this.errorCodes.NONE;
}
for (let i = 0; i < this.selectedCommunityIds.length; i++) {
this.getZenodoCommunityById(
this.selectedCommunityIds[i]['zenodoid'],
this.selectedCommunityIds[i]['id']);
this.selectedCommunityIds[i]);
}
},
error => {
console.log('list of zenodo communities couldn\'t be loaded');
this.zenodoSearchUtils.status = this.errorCodes.DONE;
}
);
// },
// error => {
// console.log('list of zenodo communities couldn\'t be loaded');
// this.zenodoSearchUtils.status = this.errorCodes.DONE;
// }
// );
})
);
@ -116,9 +114,9 @@ export class ZenodoCommunitiesComponent implements OnInit, OnDestroy {
});
}
getZenodoCommunityById(zenodoid, openaireId) {
getZenodoCommunityById(zenodoid) {
this.subscriptions.push(this._zenodoCommunitieService.getZenodoCommunityById(this.properties,
this.properties.zenodoCommunities + zenodoid, openaireId).subscribe(
this.properties.zenodoCommunities + zenodoid).subscribe(
result => {
this.selectedCommunities.push(result);
this.zenodocommunitiesloadedCount++;
@ -131,7 +129,6 @@ export class ZenodoCommunitiesComponent implements OnInit, OnDestroy {
error => {
const emptyCommunity: ZenodoCommunityInfo = new ZenodoCommunityInfo();
emptyCommunity.id = zenodoid;
emptyCommunity.openaireId = openaireId;
emptyCommunity.title = zenodoid;
this.selectedCommunities.push(emptyCommunity);
this.zenodocommunitiesloadedCount++;

View File

@ -11,7 +11,7 @@ export class ManageCommunityContentProvidersService {
removeContentProvider(properties: EnvProperties, pid: string, id: string): any {
let headers = new HttpHeaders({'Content-Type': 'application/json', 'accept': 'application/json'});
let url = properties.communityAPI + pid + '/contentproviders';
let url = properties.communityAPI + pid + '/contentproviders?contentproviderId=' +id;
return this.http.request('delete', url, {body: id, headers: headers});
}

View File

@ -12,9 +12,9 @@ export class ManageCommunityProjectsService {
let headers = new HttpHeaders({'Content-Type': 'application/json', 'accept': 'application/json'});
let url = properties.communityAPI+pid+"/projects";
let url = properties.communityAPI+pid+"/projects?projectId="+id;
//return this.http.delete(url, options)
return this.http.request('delete', url, { body: id, headers: headers})
return this.http.request('delete', url, { headers: headers})
}
addProject(properties:EnvProperties, pid: string, project: any) {

View File

@ -11,10 +11,10 @@ export class ManageZenodoCommunitiesService {
//let options = new RequestOptions({headers: headers, body: id});
let headers = new HttpHeaders({'Content-Type': 'application/json', 'accept': 'application/json'});
let url = properties.communityAPI + pid + "/zenodocommunities";
let url = properties.communityAPI + pid + "/zenodocommunities?zenodocommunity="+id;
//return this.http.delete(url, options);
return this.http.request('delete', url, { body: id, headers: headers})
return this.http.request('delete', url, { headers: headers})
}
addZCommunity(properties:EnvProperties, pid: string,zenodoid: string) {
@ -23,13 +23,9 @@ export class ManageZenodoCommunitiesService {
let headers = new HttpHeaders({'Content-Type': 'application/json'});
let url = properties.communityAPI+pid+"/zenodocommunities";
var zCommunity: any = {
"communityId": pid,
let url = properties.communityAPI+pid+"/zenodocommunities?zenodocommunity="+zenodoid;
"zenodoid": zenodoid
};
return this.http.post<any>(url, JSON.stringify(zCommunity), {headers: headers});
return this.http.post<any>(url, headers);
//.map(res => <any> res.json())
}

@ -1 +1 @@
Subproject commit 39cb4e56d0320975fbd08fb5e9c68b87b0c82a10
Subproject commit 2fd57843f85125e54adfb95b35776755037ea359

@ -1 +1 @@
Subproject commit 1e06310b8b2b56f131754eaded615b6cf32c5848
Subproject commit 2fffe0fa672adcf5577461d10c30e34b00308c85