Skip to content

Commit ffe7098

Browse files
authored
Merge branch 'remove-linkedin-identities' of 'https://github.com/evamillan/grimoirelab-sortinghat'
Merges #1012 Closes #1012 Fixes #1008
2 parents 062567f + dc57f1d commit ffe7098

File tree

2 files changed

+22
-7
lines changed

2 files changed

+22
-7
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: Remove multiple LinkedIn identities
3+
category: fixed
4+
author: Eva Millán <[email protected]>
5+
issue: 1008
6+
notes: >
7+
The user interface became stuck when multiple individuals
8+
were removed using the option 'Remove Linkedin profile' on the
9+
individuals view.

ui/src/views/Individual.vue

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,6 @@ export default {
499499
result(result) {
500500
if (result.data.individuals.entities.length === 1) {
501501
this.updateIndividual(result.data.individuals.entities);
502-
// this.getChangelog(this.mk);
503502
} else if (result.errors) {
504503
this.error = this.$getErrorMessage(result.errors[0]);
505504
} else {
@@ -769,7 +768,7 @@ export default {
769768
770769
this.individual = formatIndividual(newData[0]);
771770
this.socialProfiles = this.getSocialProfiles(newData[0]);
772-
this.changelog = newData[0].changelog;
771+
this.changelog = newData[0].changelog ?? this.changelog;
773772
774773
Object.assign(this.form, {
775774
name: this.individual.name,
@@ -900,11 +899,18 @@ export default {
900899
},
901900
async removeLinkedInProfile() {
902901
try {
903-
const uuid = this.socialProfiles.find(
904-
(identity) => identity.source === "linkedin"
905-
)?.uuid;
906-
const response = await deleteIdentity(this.$apollo, uuid);
907-
this.updateIndividual(response.data.deleteIdentity.individual);
902+
const linkedin = "linkedin";
903+
const identities = this.individual.identities.find(
904+
(source) => source.name.toLowerCase() === linkedin
905+
)?.identities;
906+
const responses = await Promise.all(
907+
identities.map((identity) =>
908+
deleteIdentity(this.$apollo, identity.uuid)
909+
)
910+
);
911+
this.updateIndividual(
912+
responses[responses.length - 1]?.data.deleteIdentity.individual
913+
);
908914
this.closeDialog();
909915
} catch (error) {
910916
this.dialog = {

0 commit comments

Comments
 (0)