Skip to content

Commit acccc0d

Browse files
committed
Fix lint errors
1 parent 37956c3 commit acccc0d

File tree

4 files changed

+104
-102
lines changed

4 files changed

+104
-102
lines changed

frontend/src/modules/auth/auth-socket.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,13 @@ export const connectSocket = (token) => {
6565
});
6666

6767
socketIoClient.on(SocketEvents.memberUnmerge, (data) => {
68-
if(!data.success){
68+
if (!data.success) {
6969
return;
7070
}
7171
console.info('Member unmerge done', data);
72-
const {primaryDisplayName, secondaryDisplayName, primaryId, secondaryId} = data;
72+
const {
73+
primaryDisplayName, secondaryDisplayName, primaryId, secondaryId,
74+
} = data;
7375

7476
const primaryMember = h(
7577
'router-link',
@@ -104,7 +106,7 @@ export const connectSocket = (token) => {
104106
{},
105107
[secondaryMember, between, primaryMember],
106108
), {
107-
title: `Contributors merged successfully`,
109+
title: 'Contributors merged successfully',
108110
});
109111
});
110112

frontend/src/modules/member/components/member-dropdown-content.vue

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<template>
22
<template v-if="identities.length > 1 && !props.hideUnmerge">
33
<button
4-
class="h-10 el-dropdown-menu__item w-full"
5-
:disabled="isEditLockedForSampleData"
6-
type="button"
7-
@click="handleCommand({
8-
action: Actions.UNMERGE_IDENTITY,
9-
member,
10-
})"
4+
class="h-10 el-dropdown-menu__item w-full"
5+
:disabled="isEditLockedForSampleData"
6+
type="button"
7+
@click="handleCommand({
8+
action: Actions.UNMERGE_IDENTITY,
9+
member,
10+
})"
1111
>
1212
<i class="ri-link-unlink-m text-base mr-2" /><span class="text-xs">Unmerge identity</span>
1313
</button>

frontend/src/modules/member/components/member-unmerge-dialog.vue

+89-88
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,20 @@
77
custom-class="p-0"
88
>
99
<template #header>
10-
<h3 class="text-lg font-semibold">Unmerge identity</h3>
10+
<h3 class="text-lg font-semibold">
11+
Unmerge identity
12+
</h3>
1113
</template>
1214
<template #headerActions>
1315
<div class="flex justify-end -my-1">
1416
<el-button class="btn btn--bordered btn--md mr-4" @click="emit('update:modelValue', null)">
1517
Cancel
1618
</el-button>
1719
<el-button
18-
class="btn btn--primary btn--md"
19-
:disabled="!selectedIdentity || !preview"
20-
@click="unmerge()"
21-
:loading="unmerging"
20+
class="btn btn--primary btn--md"
21+
:disabled="!selectedIdentity || !preview"
22+
:loading="unmerging"
23+
@click="unmerge()"
2224
>
2325
Unmerge identity
2426
</el-button>
@@ -35,83 +37,87 @@
3537
:compare-member="preview"
3638
:is-primary="true"
3739
>
38-
<template #header>
39-
<div class="h-13 flex justify-between items-start">
40-
<div
41-
class="bg-brand-500 rounded-full py-0.5 px-2 text-white inline-block text-xs leading-5 font-medium"
42-
>
43-
Current contact
44-
</div>
45-
</div>
46-
</template>
40+
<template #header>
41+
<div class="h-13 flex justify-between items-start">
42+
<div
43+
class="bg-brand-500 rounded-full py-0.5 px-2 text-white inline-block text-xs leading-5 font-medium"
44+
>
45+
Current contact
46+
</div>
47+
</div>
48+
</template>
4749
</app-member-suggestions-details>
4850
<app-member-suggestions-details
4951
v-else-if="preview"
5052
:member="preview.primary"
5153
:compare-member="preview.secondary"
5254
:is-primary="true"
5355
>
54-
<template #header>
55-
<div class="h-13 flex justify-between items-start">
56-
<div
57-
class="bg-brand-500 rounded-full py-0.5 px-2 text-white inline-block text-xs leading-5 font-medium"
58-
>
59-
Updated contact
60-
</div>
61-
</div>
62-
</template>
56+
<template #header>
57+
<div class="h-13 flex justify-between items-start">
58+
<div
59+
class="bg-brand-500 rounded-full py-0.5 px-2 text-white inline-block text-xs leading-5 font-medium"
60+
>
61+
Updated contact
62+
</div>
63+
</div>
64+
</template>
6365
</app-member-suggestions-details>
6466
</div>
6567
<div class="w-1/2 px-3">
6668
<!-- Loading preview -->
67-
<div class="flex items-center justify-center h-full w-full" v-if="fetchingPreview">
69+
<div v-if="fetchingPreview" class="flex items-center justify-center h-full w-full">
6870
<cr-spinner />
6971
</div>
7072
<!-- Unmerge preview -->
7173
<div v-else-if="preview">
7274
<app-member-suggestions-details
73-
:member="preview.secondary"
74-
:compare-member="props.modelValue"
75+
:member="preview.secondary"
76+
:compare-member="props.modelValue"
7577
>
7678
<template #header>
7779
<div class="h-13">
7880
<div class="flex justify-between items-start">
7981
<div
80-
class="bg-gray-100 rounded-full py-0.5 px-2 text-gray-600 inline-block text-xs leading-5 font-medium"
82+
class="bg-gray-100 rounded-full py-0.5 px-2 text-gray-600 inline-block text-xs leading-5 font-medium"
8183
>
8284
<i class="ri-link-unlink-m mr-1" />Unmerged contributor
8385
</div>
8486
<el-dropdown
85-
placement="bottom-end"
86-
trigger="click"
87+
placement="bottom-end"
88+
trigger="click"
8789
>
8890
<button
89-
class="btn btn--link"
90-
type="button"
91-
@click.stop
91+
class="btn btn--link"
92+
type="button"
93+
@click.stop
9294
>
9395
Change identity
9496
</button>
9597
<template #dropdown>
96-
<template v-for="i of identities"
97-
:key="`${i.platform}:${i.username}`">
98+
<template
99+
v-for="i of identities"
100+
:key="`${i.platform}:${i.username}`"
101+
>
98102
<el-dropdown-item
99-
v-if="`${i.platform}:${i.username}` !== selectedIdentity"
100-
:value="`${i.platform}:${i.username}`"
101-
:label="i.username"
102-
@click="fetchPreview(`${i.platform}:${i.username}`)"
103+
v-if="`${i.platform}:${i.username}` !== selectedIdentity"
104+
:value="`${i.platform}:${i.username}`"
105+
:label="i.username"
106+
@click="fetchPreview(`${i.platform}:${i.username}`)"
103107
>
104-
<img class="h-5 w-5 mr-2"
105-
v-if="platformDetails(i.platform)" :alt="platformDetails(i.platform)?.name" :src="platformDetails(i.platform)?.image" />
106-
<span>{{i.username}}</span>
108+
<img
109+
v-if="platformDetails(i.platform)"
110+
class="h-5 w-5 mr-2"
111+
:alt="platformDetails(i.platform)?.name"
112+
:src="platformDetails(i.platform)?.image"
113+
/>
114+
<span>{{ i.username }}</span>
107115
</el-dropdown-item>
108116
</template>
109-
110117
</template>
111118
</el-dropdown>
112119
</div>
113120
</div>
114-
115121
</template>
116122
</app-member-suggestions-details>
117123
</div>
@@ -125,19 +131,23 @@
125131
</p>
126132
<div class="pt-4">
127133
<el-select
128-
placeholder="Select identity"
129-
class="w-full"
130-
@update:modelValue="fetchPreview($event)"
134+
placeholder="Select identity"
135+
class="w-full"
136+
@update:model-value="fetchPreview($event)"
131137
>
132138
<el-option
133-
v-for="i of identities"
134-
:key="`${i.platform}:${i.username}`"
135-
:value="`${i.platform}:${i.username}`"
136-
:label="i.username"
139+
v-for="i of identities"
140+
:key="`${i.platform}:${i.username}`"
141+
:value="`${i.platform}:${i.username}`"
142+
:label="i.username"
137143
>
138-
<img class="h-5 w-5 mr-2"
139-
v-if="platformDetails(i.platform)" :alt="platformDetails(i.platform)?.name" :src="platformDetails(i.platform)?.image" />
140-
{{i.username}}
144+
<img
145+
v-if="platformDetails(i.platform)"
146+
class="h-5 w-5 mr-2"
147+
:alt="platformDetails(i.platform)?.name"
148+
:src="platformDetails(i.platform)?.image"
149+
/>
150+
{{ i.username }}
141151
</el-option>
142152
</el-select>
143153
</div>
@@ -151,17 +161,13 @@
151161

152162
<script setup>
153163
import { computed, ref } from 'vue';
154-
import { useRoute, useRouter } from 'vue-router';
155164
156165
import { MemberService } from '@/modules/member/member-service';
157166
import Message from '@/shared/message/message';
158-
import { mapActions } from '@/shared/vuex/vuex.helpers';
159-
import { useMemberStore } from '@/modules/member/store/pinia';
160-
import AppMemberSelectionDropdown from './member-selection-dropdown.vue';
161-
import AppMemberSuggestionsDetails from './suggestions/member-merge-suggestions-details.vue';
162167
import AppDialog from '@/shared/dialog/dialog.vue';
163168
import CrSpinner from '@/ui-kit/spinner/Spinner.vue';
164169
import { CrowdIntegrations } from '@/integrations/integrations-config';
170+
import AppMemberSuggestionsDetails from './suggestions/member-merge-suggestions-details.vue';
165171
166172
const props = defineProps({
167173
modelValue: {
@@ -172,11 +178,10 @@ const props = defineProps({
172178
173179
const emit = defineEmits(['update:modelValue']);
174180
175-
176181
const unmerging = ref(false);
177182
const fetchingPreview = ref(false);
178183
const preview = ref(null);
179-
const selectedIdentity = ref(null)
184+
const selectedIdentity = ref(null);
180185
181186
const isModalOpen = computed({
182187
get() {
@@ -191,34 +196,30 @@ const isModalOpen = computed({
191196
});
192197
193198
const identities = computed(() => {
194-
if(!props.modelValue?.username){
199+
if (!props.modelValue?.username) {
195200
return [];
196201
}
197-
return Object.entries(props.modelValue.username).reduce((arr, [platform, idents]) => {
198-
return [...arr, ...idents.map((i) => ({username: i, platform}))];
199-
}, [])
200-
})
201-
202-
const platformDetails = (platform) => {
203-
return CrowdIntegrations.getConfig(platform);
204-
}
202+
return Object.entries(props.modelValue.username)
203+
.reduce((arr, [platform, idents]) => [...arr, ...idents.map((i) => ({ username: i, platform }))], []);
204+
});
205205
206+
const platformDetails = (platform) => CrowdIntegrations.getConfig(platform);
206207
207208
const fetchPreview = (identity) => {
208209
if (fetchingPreview.value) {
209210
return;
210211
}
211212
212-
selectedIdentity.value=identity;
213+
selectedIdentity.value = identity;
213214
fetchingPreview.value = true;
214215
215216
const [platform, username] = identity.split(':');
216-
MemberService.unmergePreview( props.modelValue?.id, platform, username)
217+
MemberService.unmergePreview(props.modelValue?.id, platform, username)
217218
.then((res) => {
218-
preview.value = res
219+
preview.value = res;
219220
})
220221
.catch((error) => {
221-
Message.error('There was an error fetching unmerge preview');
222+
Message.error('There was an error fetching unmerge preview');
222223
})
223224
.finally(() => {
224225
fetchingPreview.value = false;
@@ -233,21 +234,21 @@ const unmerge = () => {
233234
unmerging.value = true;
234235
235236
MemberService.unmerge(props.modelValue?.id, preview.value)
236-
.then(() => {
237-
Message.info(
238-
"We’re syncing all activities of the unmerged contributor. We will let you know once the process is completed.",
239-
{
240-
title: 'Contributors unmerging in progress',
241-
},
242-
);
243-
emit('update:modelValue', null);
244-
})
245-
.catch((error) => {
246-
Message.error('There was an error unmerging contact');
247-
})
248-
.finally(() => {
249-
unmerging.value = false;
250-
});
237+
.then(() => {
238+
Message.info(
239+
'We’re syncing all activities of the unmerged contributor. We will let you know once the process is completed.',
240+
{
241+
title: 'Contributors unmerging in progress',
242+
},
243+
);
244+
emit('update:modelValue', null);
245+
})
246+
.catch((error) => {
247+
Message.error('There was an error unmerging contact');
248+
})
249+
.finally(() => {
250+
unmerging.value = false;
251+
});
251252
};
252253
253254
</script>

frontend/src/shared/dialog/dialog.vue

+3-4
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,16 @@
5252
<slot name="actionBtn" />
5353
<div class="ml-3">
5454
<el-button
55-
class="btn btn--transparent btn--xs w-8 !h-8"
56-
@click="close"
55+
class="btn btn--transparent btn--xs w-8 !h-8"
56+
@click="close"
5757
>
5858
<i
59-
class="ri-close-line text-lg text-gray-400"
59+
class="ri-close-line text-lg text-gray-400"
6060
/>
6161
</el-button>
6262
</div>
6363
</div>
6464
</slot>
65-
6665
</div>
6766
</template>
6867
<slot name="content" />

0 commit comments

Comments
 (0)