-
Notifications
You must be signed in to change notification settings - Fork 446
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: DorraJaouad <[email protected]>
- Loading branch information
1 parent
4f2319e
commit aba6325
Showing
5 changed files
with
95 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<!-- | ||
- SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors | ||
- SPDX-License-Identifier: AGPL-3.0-or-later | ||
--> | ||
|
||
<script setup lang="ts"> | ||
import { computed } from 'vue' | ||
|
||
import { t } from '@nextcloud/l10n' | ||
|
||
import NcProgressBar from '@nextcloud/vue/dist/Components/NcProgressBar.js' | ||
|
||
import { useChatExtrasStore } from '../../stores/chatExtras.js' | ||
|
||
const chatExtrasStore = useChatExtrasStore() | ||
|
||
const tasksCount = computed(() => chatExtrasStore.tasksCount) | ||
const tasksDoneCount = computed(() => chatExtrasStore.tasksDoneCount) | ||
|
||
const tasksRatio = computed(() => { | ||
if (tasksCount.value === 0) { | ||
return 0 | ||
} | ||
return (tasksDoneCount.value / tasksCount.value) * 100 | ||
}) | ||
|
||
const tasksSummary = computed(() => { | ||
if (tasksRatio.value === 100) { | ||
return t('spreed', 'All tasks done!') | ||
} | ||
// TRANSLATORS number of tasks done of total number of tasks | ||
return t('spreed', '{done} of {total} tasks', { | ||
done: tasksDoneCount.value, | ||
total: tasksCount.value, | ||
}) | ||
}) | ||
|
||
</script> | ||
|
||
<template> | ||
<div v-if="tasksCount" class="tasks-counter"> | ||
<NcProgressBar type="circular" :value="tasksRatio" :color="tasksRatio === 100 ? 'var(--color-success)' : null" /> | ||
<div class="tasks-counter__count"> | ||
{{ tasksSummary }} | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<style lang="scss" scoped> | ||
.tasks-counter { | ||
display: flex; | ||
align-items: center; | ||
margin-inline: calc(var(--default-grid-baseline) * 2); | ||
|
||
&__count { | ||
font-weight: 500; | ||
} | ||
} | ||
|
||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters