-
Notifications
You must be signed in to change notification settings - Fork 0
feat: task page #228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
feat: task page #228
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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
2 changes: 1 addition & 1 deletion
2
apps/atrium-telegram/app/pages/agreement/[agreementId]/index.vue
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,109 @@ | ||
| <template> | ||
| <PageContainer> | ||
| <Section class="motion-preset-slide-left"> | ||
| <div class="flex flex-row gap-2 items-center"> | ||
| <UAvatar :src="performer?.avatarUrl ?? undefined" class="size-8" /> | ||
|
|
||
| <div v-if="isCompleted" class="flex flex-row gap-1 items-center text-primary"> | ||
| <UIcon | ||
| name="i-lucide-check" | ||
| class="shrink-0 size-8 text-primary" | ||
| /> | ||
| <p v-if="task?.completedAt" class="text-base/5 font-semibold"> | ||
| {{ format(new Date(task.completedAt), 'd MMMM yyyy в HH:mm', { locale: ru }) }} | ||
| </p> | ||
| </div> | ||
| <UIcon | ||
| v-else | ||
| name="i-lucide-loader-circle" | ||
| class="shrink-0 size-8 text-muted/50 motion-preset-spin motion-duration-4000" | ||
| /> | ||
|
|
||
| <div v-if="isFocused" class="flex flex-row items-center gap-1.5 text-primary"> | ||
| <UIcon | ||
| name="i-lucide-goal" | ||
| class="shrink-0 size-8 motion-preset-seesaw" | ||
| /> | ||
| <p class="max-w-22 text-sm/4 font-bold"> | ||
| В Фокусе | ||
| </p> | ||
| </div> | ||
| </div> | ||
|
|
||
| <SectionTitle :title="task?.name ?? ''" /> | ||
|
|
||
| <div v-if="task?.description" class="w-full text-base/5 font-normal whitespace-pre-wrap break-words"> | ||
| {{ task.description }} | ||
| </div> | ||
|
|
||
| <div v-if="task?.report" class="flex flex-row gap-2 items-start w-full"> | ||
| <UIcon name="i-lucide-clipboard-pen" class="shrink-0 size-6 text-primary" /> | ||
| <p class="text-base/5 font-semibold whitespace-pre-wrap break-words"> | ||
| {{ task.report }} | ||
| </p> | ||
| </div> | ||
|
|
||
| <div v-if="task?.date" class="flex flex-row gap-2 items-start w-full"> | ||
| <UIcon name="i-lucide-calendar" class="shrink-0 size-6 text-primary" /> | ||
| <p class="text-base/5 font-semibold whitespace-pre-wrap break-words"> | ||
| {{ format(new Date(task.date), 'd MMMM yyyy', { locale: ru }) }} | ||
| </p> | ||
| </div> | ||
|
|
||
| <div v-if="taskList" class="flex flex-row gap-2 items-start w-full"> | ||
| <UIcon name="i-lucide-book-marked" class="shrink-0 size-6 text-primary" /> | ||
| <p class="text-base/5 font-semibold whitespace-pre-wrap break-words"> | ||
| {{ taskList.name }} | ||
| </p> | ||
| </div> | ||
|
|
||
| <div class="mt-6 flex flex-col gap-0.5"> | ||
| <div class="text-sm text-muted"> | ||
| Создана | ||
| <time | ||
| v-if="task?.createdAt" | ||
| :datetime="task.createdAt" | ||
| v-text="format(new Date(task.createdAt), 'd MMMM yyyy в HH:mm', { locale: ru })" | ||
| /> | ||
| </div> | ||
|
|
||
| <div v-if="task?.updatedAt" class="text-sm text-muted"> | ||
| Обновлена | ||
| <time | ||
| :datetime="task.updatedAt" | ||
| v-text="format(new Date(task.updatedAt), 'd MMMM yyyy в HH:mm', { locale: ru })" | ||
| /> | ||
| </div> | ||
|
|
||
| <div v-if="task?.completedAt" class="text-sm text-muted"> | ||
| Закрыта | ||
| <time | ||
| :datetime="task.completedAt" | ||
| v-text="format(new Date(task.completedAt), 'd MMMM yyyy в HH:mm', { locale: ru })" | ||
| /> | ||
| </div> | ||
| </div> | ||
| </Section> | ||
| </PageContainer> | ||
| </template> | ||
|
|
||
| <script setup lang="ts"> | ||
| import { format } from 'date-fns' | ||
| import { ru } from 'date-fns/locale/ru' | ||
|
|
||
| definePageMeta({ | ||
| name: 'task-taskId', | ||
| }) | ||
|
|
||
| const { params } = useRoute('task-taskId') | ||
|
|
||
| const userStore = useUserStore() | ||
| const taskStore = useTaskStore() | ||
| const task = computed(() => taskStore.tasks.find((t) => t.id === params.taskId)) | ||
| const taskList = computed(() => taskStore.lists.find((t) => t.id === task.value?.listId)) | ||
|
|
||
| const isCompleted = computed(() => !!task.value?.completedAt) | ||
| const performer = computed(() => userStore.staff.find((staff) => staff.id === task.value?.performerId)) | ||
|
|
||
| const isFocused = computed(() => task.value?.id === performer.value?.focusedTaskId) | ||
| </script> | ||
This file contains hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Significant code duplication with TaskInfoCard.vue.
The completed state UI (lines 7-15) and focused state UI (lines 22-30) are duplicated verbatim from TaskInfoCard.vue. This duplication extends to the date formatting logic and icon configuration.
Consider extracting these state indicator blocks into a reusable component (e.g.,
TaskStatusIndicators.vue) that both the card and detail page can use.Example refactor:
Then use it in both files: