diff --git a/backend/metrics/views.py b/backend/metrics/views.py
index 1b9fde4f..4ed1e121 100644
--- a/backend/metrics/views.py
+++ b/backend/metrics/views.py
@@ -18,8 +18,9 @@ class ProgressAPI(APIView):
def get(self, request, *args, **kwargs):
examples = Example.objects.filter(project=self.kwargs["project_id"]).values("id")
total = examples.count()
- done = ExampleState.objects.count_done(examples, user=self.request.user)
- return {"total": total, "remaining": total - done}
+ complete = ExampleState.objects.count_done(examples, user=self.request.user)
+ data = {"total": total, "remaining": total - complete, "complete": complete}
+ return Response(data=data, status=status.HTTP_200_OK)
class MemberProgressAPI(APIView):
diff --git a/frontend/components/tasks/sidebar/AnnotationProgress.vue b/frontend/components/tasks/sidebar/AnnotationProgress.vue
new file mode 100644
index 00000000..6fb8f848
--- /dev/null
+++ b/frontend/components/tasks/sidebar/AnnotationProgress.vue
@@ -0,0 +1,46 @@
+
+
+ Progress
+
+
+
+ Total
+
+
+
+ Complete
+
+
+
+
+
+ {{ value }}%
+
+
+
+
+
+
+
diff --git a/frontend/composables/useExampleItem.ts b/frontend/composables/useExampleItem.ts
index b6e4faab..718382b6 100644
--- a/frontend/composables/useExampleItem.ts
+++ b/frontend/composables/useExampleItem.ts
@@ -5,7 +5,8 @@ import { ExampleDTO } from '@/services/application/example/exampleData'
export const useExampleItem = () => {
const state = reactive({
example: {} as ExampleDTO,
- totalExample: 0
+ totalExample: 0,
+ progress: {}
})
const { app } = useContext()
@@ -28,16 +29,22 @@ export const useExampleItem = () => {
state.example = await exampleService.findById(projectId, state.example.id)
}
+ const updateProgress = async(projectId: string) => {
+ state.progress = await app.$services.metrics.fetchMyProgress(projectId)
+ }
+
const confirm = async(
projectId: string,
) => {
await exampleService.confirm(projectId, state.example.id)
await getExampleById(projectId)
+ updateProgress(projectId)
}
return {
state,
confirm,
getExample,
+ updateProgress
}
}
diff --git a/frontend/domain/models/metrics/metrics.ts b/frontend/domain/models/metrics/metrics.ts
index 5e420e1c..0a4c2747 100644
--- a/frontend/domain/models/metrics/metrics.ts
+++ b/frontend/domain/models/metrics/metrics.ts
@@ -6,3 +6,9 @@ export interface Progress {
total: number
progress: {user: string, done: number}[]
}
+
+export interface MyProgress {
+ total: number
+ complete: number
+ remaining: number
+}
diff --git a/frontend/domain/models/metrics/metricsRepository.ts b/frontend/domain/models/metrics/metricsRepository.ts
index c0cc37c5..d5168f11 100644
--- a/frontend/domain/models/metrics/metricsRepository.ts
+++ b/frontend/domain/models/metrics/metricsRepository.ts
@@ -1,7 +1,8 @@
-import { Distribution, Progress } from '~/domain/models/metrics/metrics'
+import { Distribution, Progress, MyProgress } from '~/domain/models/metrics/metrics'
export interface MetricsRepository {
fetchCategoryDistribution(projectId: string): Promise
fetchSpanDistribution(projectId: string): Promise
fetchMemberProgress(projectId: string): Promise