Skip to content

Commit c54ad60

Browse files
committed
Merge branch 'main' into develop
2 parents 4b46a93 + 12160d0 commit c54ad60

File tree

37 files changed

+706
-147
lines changed

37 files changed

+706
-147
lines changed

argilla-frontend/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ These are the section headers that we use:
1616

1717
## [Unreleased]()
1818

19+
## [2.6.0](https://github.com/argilla-io/argilla/compare/v2.5.0...v2.6.0)
20+
21+
### Added
22+
23+
- Add share progress feature ([#5727](https://github.com/argilla-io/argilla/pull/5727))
24+
- Added feature to export datasets from Argilla to Hugging Face hub from the UI ([#5730](https://github.com/argilla-io/argilla/pull/5730))
25+
1926
### Fixed
2027

2128
- Improved performance and accessibility ([#5724](https://github.com/argilla-io/argilla/pull/5724))

argilla-frontend/components/base/base-button/BaseButton.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
:target="target"
2626
:rel="newRel"
2727
@click="onClick"
28+
@mouseover="$emit('mouseover')"
29+
@mouseleave="$emit('mouseleave')"
2830
>
2931
<slot />
3032
</a>
@@ -36,6 +38,8 @@
3638
:loading="loading"
3739
:disabled="disabled"
3840
@click="onClick"
41+
@mouseover="$emit('mouseover')"
42+
@mouseleave="$emit('mouseleave')"
3943
>
4044
<slot />
4145
</nuxt-link>
@@ -48,6 +52,8 @@
4852
:type="type"
4953
:disabled="disabled"
5054
@click="onClick"
55+
@mouseover="$emit('mouseover')"
56+
@mouseleave="$emit('mouseleave')"
5157
>
5258
<BaseSpinner
5359
class="spinner"

argilla-frontend/components/features/annotation/header/header-bar/ExportToHub.vue

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
<BaseButton
44
class="primary export-to-hub__button"
55
@mousedown.native.prevent="openDialog"
6+
@mouseenter.native="openDialogOnHover"
7+
@mouseleave.native="closeDialogOnLeave"
68
:loading="isExporting"
79
:disabled="isExporting"
810
>
@@ -13,7 +15,7 @@
1315
</BaseButton>
1416
<transition name="fade" appear>
1517
<dialog
16-
v-if="isDialogOpen"
18+
v-if="isDialogVisible"
1719
v-click-outside="{
1820
events: ['mousedown'],
1921
handler: closeDialog,
@@ -26,23 +28,24 @@
2628
class="export-to-hub__title"
2729
v-text="$t('exportToHub.exporting')"
2830
/>
29-
<p>
30-
<span
31-
class="export-to-hub__exporting-message__warning"
32-
v-text="$t('exportToHub.exportingWarning')"
33-
/>
34-
{{ exportToHubForm.orgOrUsername }}/{{
35-
exportToHubForm.datasetName
36-
}}
37-
<span
38-
class="export-to-hub__exporting-message__private"
39-
v-text="
40-
exportToHubForm.isPrivate
41-
? $t('exportToHub.private')
42-
: $t('exportToHub.public')
43-
"
44-
/>
45-
</p>
31+
<p
32+
class="export-to-hub__exporting-message__warning"
33+
v-text="$t('exportToHub.exportingWarning')"
34+
/>
35+
<p
36+
class="export-to-hub__exporting-message__name"
37+
v-text="
38+
`${exportToHubForm.orgOrUsername}/${exportToHubForm.datasetName}`
39+
"
40+
/>
41+
<p
42+
class="export-to-hub__exporting-message__private"
43+
v-text="
44+
exportToHubForm.isPrivate
45+
? $t('exportToHub.private')
46+
: $t('exportToHub.public')
47+
"
48+
/>
4649
</div>
4750
<form v-else @submit.prevent="exportToHub" class="export-to-hub__form">
4851
<h2
@@ -205,14 +208,16 @@ export default {
205208
@include font-size(14px);
206209
margin: 0;
207210
&__private {
208-
display: block;
209-
text-transform: uppercase;
210-
@include font-size(12px);
211+
margin: 0;
212+
@include font-size(13px);
213+
}
214+
&__name {
215+
margin: 0;
216+
font-weight: 500;
211217
}
212218
&__warning {
213-
display: block;
219+
margin-top: 0;
214220
color: var(--fg-tertiary);
215-
@include font-size(14px);
216221
}
217222
}
218223
@@ -258,6 +263,9 @@ export default {
258263
&:hover {
259264
background: hsl(0, 1%, 22%);
260265
}
266+
&[disabled] {
267+
pointer-events: auto !important;
268+
}
261269
}
262270
&__icon {
263271
@include media(">tablet") {

argilla-frontend/components/features/annotation/header/header-bar/useExportToHubViewModel.ts

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useResolve } from "ts-injecty";
2-
import { onBeforeMount, ref, computed } from "vue";
2+
import { onBeforeMount, ref, computed, watch } from "vue";
33
import { Dataset } from "~/v1/domain/entities/dataset/Dataset";
44
import { ExportDatasetToHubUseCase } from "~/v1/domain/usecases/export-dataset-to-hub-use-case";
55
import { JobRepository } from "~/v1/infrastructure/repositories";
@@ -20,6 +20,7 @@ export const useExportToHubViewModel = (props: ExportToHubProps) => {
2020
const { get, set } = useLocalStorage();
2121

2222
const isDialogOpen = ref(false);
23+
const isDialogHovered = ref(false);
2324
const errors = ref({
2425
orgOrUsername: [],
2526
datasetName: [],
@@ -162,16 +163,41 @@ export const useExportToHubViewModel = (props: ExportToHubProps) => {
162163

163164
const closeDialog = () => {
164165
isDialogOpen.value = false;
166+
isDialogHovered.value = false;
165167
};
166168

169+
const openDialogOnHover = () => {
170+
if (isExporting.value) {
171+
isDialogHovered.value = true;
172+
}
173+
};
174+
175+
const closeDialogOnLeave = () => {
176+
if (isExporting.value && !isDialogOpen.value) {
177+
isDialogHovered.value = false;
178+
}
179+
};
180+
181+
const isDialogVisible = computed(
182+
() => isDialogOpen.value || isDialogHovered.value
183+
);
184+
185+
watch(isExporting, (newValue) => {
186+
if (!newValue) {
187+
closeDialog();
188+
}
189+
});
190+
167191
onBeforeMount(() => {
168192
watchExportStatus();
169193
});
170194

171195
return {
172-
isDialogOpen,
196+
isDialogVisible,
173197
closeDialog,
174198
openDialog,
199+
openDialogOnHover,
200+
closeDialogOnLeave,
175201
isExporting,
176202
exportToHub,
177203
exportToHubForm,

argilla-frontend/components/features/annotation/progress/AnnotationProgress.vue

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,19 @@
2222
v-if="!metrics.hasMetrics"
2323
class="my-progress__status--skeleton"
2424
/>
25-
<StatusCounter
26-
v-else
27-
class="my-progress__status"
28-
:color="RecordStatus.submitted.color"
29-
:name="RecordStatus.submitted.name"
30-
:value="metrics.submitted"
31-
/>
25+
<div v-else class="my-progress__share">
26+
<Share v-if="canSeeShare" />
27+
<StatusCounter
28+
:ghost="true"
29+
:rainbow="shouldShowSubmittedAnimation"
30+
class="my-progress__status"
31+
:color="RecordStatus.submitted.color"
32+
:name="RecordStatus.submitted.name"
33+
:value="metrics.submitted"
34+
/>
35+
</div>
3236
</div>
3337
</template>
34-
3538
<script>
3639
import { RecordStatus } from "~/v1/domain/entities/record/RecordStatus";
3740
import { useAnnotationProgressViewModel } from "./useAnnotationProgressViewModel";
@@ -71,5 +74,12 @@ $statusCounterMinHeight: 30px;
7174
min-height: $statusCounterMinHeight;
7275
}
7376
}
77+
&__share {
78+
width: 100%;
79+
display: flex;
80+
align-items: center;
81+
justify-content: end;
82+
gap: $base-space;
83+
}
7484
}
7585
</style>
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
<template>
2+
<div class="share" @click.stop="copyOnClipboard">
3+
<BaseActionTooltip :tooltip="$t('copiedToClipboard')">
4+
<BaseButton
5+
class="share__button"
6+
:title="$t('button.tooltip.copyToClipboard')"
7+
@mouseover="openDialog"
8+
@mouseleave="closeDialog"
9+
>
10+
<svgicon class="share__icon" name="link" width="14" height="14" />
11+
{{ $t("share") }}
12+
</BaseButton>
13+
</BaseActionTooltip>
14+
<transition name="fade" appear>
15+
<dialog
16+
v-if="isDialogOpen"
17+
class="share__dialog"
18+
v-click-outside="closeDialog"
19+
>
20+
<div class="share__dialog--container">
21+
<BaseSpinner v-if="!sharingImage.loaded" :size="20" />
22+
<img v-else :src="sharingImage.src" />
23+
</div>
24+
</dialog>
25+
</transition>
26+
</div>
27+
</template>
28+
<script>
29+
import { useShareViewModel } from "./useShareViewModel";
30+
31+
export default {
32+
setup() {
33+
return useShareViewModel();
34+
},
35+
};
36+
</script>
37+
38+
<style lang="scss" scoped>
39+
$bullet-size: 8px;
40+
.share {
41+
z-index: 2;
42+
margin-left: auto;
43+
margin-right: 0;
44+
45+
&__dialog {
46+
position: absolute;
47+
right: 1em;
48+
left: auto;
49+
width: auto;
50+
height: 204px;
51+
min-width: 360px;
52+
max-width: 360px;
53+
bottom: calc(100% + $base-space + 2px);
54+
display: block;
55+
padding: $base-space * 2;
56+
border: 1px solid var(--bg-opacity-10);
57+
border-radius: $border-radius-m;
58+
box-shadow: $shadow;
59+
z-index: 2;
60+
61+
&--container {
62+
display: flex;
63+
justify-content: center;
64+
align-items: center;
65+
height: 100%;
66+
}
67+
}
68+
69+
&__button {
70+
@include font-size(12px);
71+
height: 24px;
72+
padding: $base-space;
73+
background: var(--bg-opacity-3);
74+
border-radius: $border-radius;
75+
}
76+
77+
&__icon {
78+
padding: 0;
79+
flex-shrink: 0;
80+
}
81+
}
82+
</style>

0 commit comments

Comments
 (0)