-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
fix(files_reminder): passed reminder handling #59228
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -8,10 +8,9 @@ import type { INode } from '@nextcloud/files' | |||||
|
|
||||||
| import { showError, showSuccess } from '@nextcloud/dialogs' | ||||||
| import { emit as emitEventBus } from '@nextcloud/event-bus' | ||||||
| import { t } from '@nextcloud/l10n' | ||||||
| import { onBeforeMount, onMounted, ref } from 'vue' | ||||||
| import { formatRelativeTime, t } from '@nextcloud/l10n' | ||||||
| import { computed, onBeforeMount, onMounted, ref } from 'vue' | ||||||
| import NcButton from '@nextcloud/vue/components/NcButton' | ||||||
| import NcDateTime from '@nextcloud/vue/components/NcDateTime' | ||||||
| import NcDateTimePickerNative from '@nextcloud/vue/components/NcDateTimePickerNative' | ||||||
| import NcDialog from '@nextcloud/vue/components/NcDialog' | ||||||
| import NcNoteCard from '@nextcloud/vue/components/NcNoteCard' | ||||||
|
|
@@ -33,6 +32,15 @@ const isValid = ref(true) | |||||
| const customDueDate = ref<Date>() | ||||||
| const nowDate = ref(new Date()) | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think that's really necessary 😛 |
||||||
|
|
||||||
| const informationText = computed(() => { | ||||||
| const relativeDueDate = formatRelativeTime(customDueDate.value ?? 0) | ||||||
| return (nowDate.value.getTime() >= (customDueDate.value?.getTime() ?? 0)) | ||||||
| // TRANSLATORS: {relativeDueDate} will be replaced with a relative time, e.g. "2 hours ago" or "in 3 days". | ||||||
| ? t('files_reminders', 'We reminded you of this file {relativeDueDate}', { relativeDueDate }) | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand the purpose of this "historical reminder" message. Is it just a fallback for stale paths and/or triggering test(s)? Do we intentionally want the modal to present past reminders as historical state when they slip through, or should it instead behave as if no reminder exists?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, it's just that we don't handle the passed reminders logic on the front-end. The backend does it now. So I'm making the front compliant to whatever data. |
||||||
| // TRANSLATORS: {relativeDueDate} will be replaced with a relative time, e.g. "2 hours ago" or "in 3 days". | ||||||
| : t('files_reminders', 'We will remind you of this file {relativeDueDate}', { relativeDueDate }) | ||||||
| }) | ||||||
|
|
||||||
| onBeforeMount(() => { | ||||||
| const dueDate = props.node.attributes['reminder-due-date'] | ||||||
| ? new Date(props.node.attributes['reminder-due-date']) | ||||||
|
|
@@ -132,8 +140,7 @@ function onInput(): void { | |||||
| @input="onInput" /> | ||||||
|
|
||||||
| <NcNoteCard v-if="isValid && customDueDate" type="info"> | ||||||
| {{ t('files_reminders', 'We will remind you of this file') }} | ||||||
| <NcDateTime :timestamp="customDueDate" /> | ||||||
| {{ informationText }} | ||||||
| </NcNoteCard> | ||||||
|
|
||||||
| <NcNoteCard v-else type="error"> | ||||||
|
|
||||||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Uh oh!
There was an error while loading. Please reload this page.