Skip to content

Commit 8f89129

Browse files
malek10xdevJ43fura
andauthored
fix cluttered ui (#2005)
* set progress bar color to primary * remove enrich from stepper * remove notification when enrich started * add success icon when step is done * show table only when there is contacts * remove border * delete enrich panel * change button to outlined with red border * fix google credentials & redirect url * fix formatting, linting * Update frontend/src/components/Mining/Buttons/RemoveContactButton.vue Co-authored-by: Jaafoura <73950268+J43fura@users.noreply.github.com> * refactored by @J43fura Co-authored-by: Jaafoura <73950268+J43fura@users.noreply.github.com> * collapse stepper when cleaning is done * fix linting * revert: collapse stepper when cleaning is done --------- Co-authored-by: Jaafoura <73950268+J43fura@users.noreply.github.com>
1 parent 34c4815 commit 8f89129

File tree

11 files changed

+15
-219
lines changed

11 files changed

+15
-219
lines changed

frontend/src/components/Mining/Buttons/EnrichButton.vue

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -214,11 +214,6 @@ async function enrichPerson(
214214
updateEmptyFieldsOnly: boolean,
215215
contacts: Partial<Contact>,
216216
) {
217-
showNotification(
218-
'success',
219-
t('notification.summary'),
220-
t('notification.enrichment_started_one', { toEnrich: 1 }),
221-
);
222217
totalTasks.value = 1;
223218
await $api<EnrichContactResponse>('/enrich/person/', {
224219
method: 'POST',

frontend/src/components/Mining/Buttons/RemoveContactButton.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
icon="pi pi-times"
88
:label="$screenStore.size.md ? t('remove') : undefined"
99
severity="danger"
10+
outlined
1011
:disabled="isRemoveDisabled"
1112
:loading="isRemovingContacts"
1213
@click="showWarning()"

frontend/src/components/Mining/MiningStepper.vue

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@
6060
<StepPanel v-slot="{ active }" :value="3">
6161
<CleanPanel v-if="active" />
6262
</StepPanel>
63-
<StepPanel v-slot="{ active }" :value="4">
64-
<EnrichPanel v-if="active" />
65-
</StepPanel>
6663
</StepPanels>
6764
</Stepper>
6865
</Panel>
@@ -85,9 +82,6 @@ const MinePanel = defineAsyncComponent(
8582
const CleanPanel = defineAsyncComponent(
8683
() => import('./StepperPanels/CleanPanel.vue'),
8784
);
88-
const EnrichPanel = defineAsyncComponent(
89-
() => import('./StepperPanels/EnrichPanel.vue'),
90-
);
9185
9286
const StepWithPopover = defineAsyncComponent(
9387
() => import('./StepperPanels/StepWithPopover.vue'),
@@ -118,9 +112,6 @@ const spinnerText = computed(() => {
118112
if (!$leadminerStore.cleaningFinished) {
119113
return t('cleaning');
120114
}
121-
if ($leadminerStore.activeEnrichment) {
122-
return t('enriching');
123-
}
124115
return undefined;
125116
});
126117
@@ -143,15 +134,13 @@ onNuxtReady(() => {
143134
"source": "Source",
144135
"mining": "Mining",
145136
"cleaning": "Cleaning",
146-
"enriching": "Enriching",
147137
"retrieving_mailboxes": "Retrieving mailboxes..."
148138
},
149139
"fr": {
150140
"mine_contacts": "Extraire, nettoyer et enrichir vos contacts",
151141
"source": "Source",
152142
"mining": "Extraction",
153143
"cleaning": "Nettoyage",
154-
"enriching": "Enrichissement",
155144
"retrieving_mailboxes": "Récupération des boîtes aux lettres..."
156145
}
157146
}

frontend/src/components/Mining/StepperPanels/CleanPanel.vue

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<div class="flex flex-col gap-2 pt-6 justify-end md:flex-row">
2020
<Button
2121
v-if="activeTask"
22-
class="w-full md:w-max border-solid border-2 border-black"
22+
class="w-full md:w-max"
2323
severity="contrast"
2424
icon="pi pi-stop"
2525
icon-pos="right"
@@ -33,21 +33,6 @@
3333
:label="t('start_new_mining')"
3434
@click="startNewMining"
3535
/>
36-
<Button
37-
v-tooltip="t('enrich_button_tooltip')"
38-
class="w-full md:w-max border-solid border-2 border-black"
39-
severity="contrast"
40-
:label="t('enrich_contacts', $contactsStore.selectedContactsCount)"
41-
:disabled="
42-
$contactsStore.selectedContactsCount === 0 ||
43-
!$leadminerStore.cleaningFinished
44-
"
45-
@click="$stepper.next()"
46-
>
47-
<template #icon>
48-
<span class="p-button-icon p-button-icon-right">💎</span>
49-
</template>
50-
</Button>
5136
</div>
5237
</div>
5338
</template>
@@ -63,7 +48,6 @@ const { t } = useI18n({
6348
const $toast = useToast();
6449
const $stepper = useMiningStepper();
6550
const $leadminerStore = useLeadminerStore();
66-
const $contactsStore = useContactsStore();
6751
const activeTask = computed(() => $leadminerStore.miningTask !== undefined);
6852
const taskStartedAt = computed(() => $leadminerStore.miningStartedAt);
6953
const contactsToVerify = computed(() => $leadminerStore.createdContacts);

frontend/src/components/Mining/StepperPanels/EnrichPanel.vue

Lines changed: 0 additions & 164 deletions
This file was deleted.

frontend/src/components/Mining/StepperPanels/MinePanel.vue

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,12 @@
4040
"
4141
:loading="$leadminerStore.isLoadingStartMining"
4242
severity="contrast"
43-
class="border-solid border-2 border-black"
4443
:label="t('start_mining_now')"
4544
@click="startMining"
4645
/>
4746
<Button
4847
v-else
4948
:loading="$leadminerStore?.isLoadingStartMining"
50-
class="border-solid border-2 border-black"
5149
severity="contrast"
5250
icon="pi pi-stop"
5351
icon-pos="right"
@@ -104,14 +102,12 @@
104102
"
105103
:loading="$leadminerStore.isLoadingStartMining"
106104
severity="contrast"
107-
class="border-solid border-2 border-black"
108105
:label="t('start_mining_now')"
109106
@click="startMining"
110107
/>
111108
<Button
112109
v-else
113110
:loading="$leadminerStore?.isLoadingStartMining"
114-
class="border-solid border-2 border-black"
115111
severity="contrast"
116112
icon="pi pi-stop"
117113
icon-pos="right"

frontend/src/components/Mining/StepperPanels/SourcePanel.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
id="extract-source"
2929
:disabled="!sourceModel"
3030
severity="contrast"
31-
class="font-semibold flex-shrink-0 border-solid border-2 border-black"
31+
class="font-semibold flex-shrink-0"
3232
:label="t('extract_contacts')"
3333
@click="extractContacts()"
3434
/>

frontend/src/components/Mining/StepperPanels/StepWithPopover.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
<div :class="`${isActive ? 'p-step-active' : 'p-disabled'}`">
1010
<button class="p-step-header">
1111
<span class="p-step-number">{{ stepNumber }}</span>
12-
<span class="p-step-title hidden md:block"> {{ title }} </span>
12+
<span class="p-step-title hidden md:block">
13+
{{ title }}
14+
<template v-if="isPastStep">✅</template>
15+
</span>
1316
</button>
1417
</div>
1518
<span class="p-stepper-separator" />

frontend/src/components/ProgressCard.vue

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@
3535
<ProgressBar
3636
v-tooltip.bottom="{ value: props.progressTooltip, escape: false }"
3737
:value="progressValue"
38-
:pt="{
39-
value: {
40-
class: [progressColor],
41-
},
42-
}"
4338
/>
4439
</div>
4540
</template>
@@ -66,9 +61,6 @@ const props = defineProps({
6661
const progressStartedAt = computed(() => props.started);
6762
const progressValue = computed(() => Math.round(props.progress * 100));
6863
const progressPercentage = computed(() => Math.floor(progressValue.value));
69-
const progressColor = computed(() =>
70-
progressPercentage.value < 100 ? 'bg-amber-400' : 'bg-green-600',
71-
);
7264
7365
const finishedTime = ref(0);
7466

frontend/src/pages/dashboard.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<template>
22
<div class="flex flex-col grow">
33
<mining-stepper v-model:collapsed="$stepper.collapsed" />
4-
<MiningTable />
4+
<div v-show="showTable">
5+
<MiningTable />
6+
</div>
57
</div>
68
</template>
79
<script setup lang="ts">
8-
const MiningTable = defineAsyncComponent(
9-
() => import('../components/Mining/Table/MiningTable.vue'),
10-
);
11-
1210
const $stepper = useMiningStepper();
11+
const $contactsStore = useContactsStore();
12+
const showTable = computed(() => Boolean($contactsStore.contactsList));
1313
$stepper.open();
1414
</script>

0 commit comments

Comments
 (0)