diff options
author | John Molakvoæ <skjnldsv@protonmail.com> | 2023-11-03 19:49:53 +0100 |
---|---|---|
committer | John Molakvoæ <skjnldsv@protonmail.com> | 2023-11-08 08:40:27 +0100 |
commit | 32c1aebaae07b9b4d7e2dcdfca6b2cbd36a6cfc3 (patch) | |
tree | 26b047d37a3c3276e9336936f0d5c8bbde949869 /apps/files_reminders | |
parent | 50417bcee8f103fb569a860b63cf8cf1e6bc1c18 (diff) | |
download | nextcloud-server-32c1aebaae07b9b4d7e2dcdfca6b2cbd36a6cfc3.tar.gz nextcloud-server-32c1aebaae07b9b4d7e2dcdfca6b2cbd36a6cfc3.zip |
fix(cypress): formatFileSize change revert from files library
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files_reminders')
5 files changed, 25 insertions, 15 deletions
diff --git a/apps/files_reminders/src/actions/setReminderSuggestionActions.scss b/apps/files_reminders/src/actions/setReminderSuggestionActions.scss index 16964e9ae2f..93a94bafa2b 100644 --- a/apps/files_reminders/src/actions/setReminderSuggestionActions.scss +++ b/apps/files_reminders/src/actions/setReminderSuggestionActions.scss @@ -21,10 +21,11 @@ */ // TODO: remove when/if the actions API supports a separator // This the last preset action, so we need to add a separator -.files-list__row-action-set-reminder-3 { - margin-bottom: 13px; +.files-list__row-action-set-reminder-custom { + margin-top: 13px; + position: relative; - &::after { + &::before { content: ""; margin: 3px 10px 3px 15px; border-bottom: 1px solid var(--color-border-dark); @@ -34,5 +35,6 @@ position: absolute; left: 0; right: 0; + top: -10px; } } diff --git a/apps/files_reminders/src/actions/setReminderSuggestionActions.ts b/apps/files_reminders/src/actions/setReminderSuggestionActions.ts index 453bab4c5c1..069a840ff71 100644 --- a/apps/files_reminders/src/actions/setReminderSuggestionActions.ts +++ b/apps/files_reminders/src/actions/setReminderSuggestionActions.ts @@ -63,8 +63,13 @@ const nextWeek: ReminderOption = { ariaLabel: t('files_reminders', 'Set reminder for next week'), } -// Generate the default preset actions -export const actions = [laterToday, tomorrow, thisWeekend, nextWeek].map((option): FileAction|null => { +/** + * Generate a file action for the given option + * + * @param option The option to generate the action for + * @return The file action or null if the option should not be shown + */ +const generateFileAction = (option): FileAction|null => { const dateTime = getDateTime(option.dateTimePreset) if (!dateTime) { return null @@ -72,7 +77,7 @@ export const actions = [laterToday, tomorrow, thisWeekend, nextWeek].map((option return new FileAction({ id: `set-reminder-${option.dateTimePreset}`, - displayName: () => `${option.label} - ${getDateString(dateTime)}`, + displayName: () => `${option.label} – ${getDateString(dateTime)}`, title: () => `${option.ariaLabel} – ${getVerboseDateString(dateTime)}`, // Empty svg to hide the icon @@ -103,4 +108,9 @@ export const actions = [laterToday, tomorrow, thisWeekend, nextWeek].map((option order: 21, }) -}).filter(Boolean) as FileAction[] +} + +// Generate the default preset actions +export const actions = [laterToday, tomorrow, thisWeekend, nextWeek] + .map(generateFileAction) + .filter(Boolean) as FileAction[] diff --git a/apps/files_reminders/src/components/SetCustomReminderModal.vue b/apps/files_reminders/src/components/SetCustomReminderModal.vue index c4023d1c39b..4e3c5fb0fca 100644 --- a/apps/files_reminders/src/components/SetCustomReminderModal.vue +++ b/apps/files_reminders/src/components/SetCustomReminderModal.vue @@ -148,8 +148,8 @@ export default Vue.extend({ }, async setCustom(): Promise<void> { - // Handle input cleared - if (this.customDueDate === '') { + // Handle input cleared or invalid date + if (!(this.customDueDate instanceof Date) || isNaN(this.customDueDate)) { showError(t('files_reminders', 'Please choose a valid date & time')) return } diff --git a/apps/files_reminders/src/services/customPicker.ts b/apps/files_reminders/src/services/customPicker.ts index 3a15cd514f8..46a0f917c0c 100644 --- a/apps/files_reminders/src/services/customPicker.ts +++ b/apps/files_reminders/src/services/customPicker.ts @@ -37,8 +37,6 @@ const CustomReminderModal = new View({ }) export const pickCustomDate = async (node: Node): Promise<void> => { - console.debug('CustomReminderModal', mount, CustomReminderModal) - CustomReminderModal.open(node) // Wait for the modal to close diff --git a/apps/files_reminders/src/shared/utils.ts b/apps/files_reminders/src/shared/utils.ts index 605b429a378..86182ba5106 100644 --- a/apps/files_reminders/src/shared/utils.ts +++ b/apps/files_reminders/src/shared/utils.ts @@ -24,10 +24,10 @@ import moment from '@nextcloud/moment' import { getCanonicalLocale } from '@nextcloud/l10n' export enum DateTimePreset { - LaterToday, - Tomorrow, - ThisWeekend, - NextWeek, + LaterToday = 'later-today', + Tomorrow = 'tomorrow', + ThisWeekend = 'this-weekend', + NextWeek = 'next-week', } export const getDateTime = (dateTime: DateTimePreset): null | Date => { |