Browse Source
Merge pull request #43589 from nextcloud/feat/reminder-status
Merge pull request #43589 from nextcloud/feat/reminder-status
feat(files_reminders): Add reminder status indicatorpull/42763/merge
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
18 changed files with 269 additions and 111 deletions
-
2apps/files/src/components/FileEntry/FileEntryActions.vue
-
10apps/files_reminders/appinfo/info.xml
-
1apps/files_reminders/composer/composer/autoload_classmap.php
-
1apps/files_reminders/composer/composer/autoload_static.php
-
4apps/files_reminders/lib/AppInfo/Application.php
-
51apps/files_reminders/lib/Listener/SabrePluginAddListener.php
-
4apps/files_reminders/src/actions/clearReminderAction.ts
-
62apps/files_reminders/src/actions/reminderStatusAction.ts
-
2apps/files_reminders/src/actions/setReminderCustomAction.ts
-
2apps/files_reminders/src/actions/setReminderMenuAction.ts
-
100apps/files_reminders/src/components/SetCustomReminderModal.vue
-
4apps/files_reminders/src/init.ts
-
4apps/files_reminders/src/services/customPicker.ts
-
121apps/files_reminders/src/shared/utils.ts
-
4dist/files-main.js
-
2dist/files-main.js.map
-
4dist/files_reminders-init.js
-
2dist/files_reminders-init.js.map
@ -0,0 +1,51 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
|
|||
/** |
|||
* @copyright 2024 Christopher Ng <chrng8@gmail.com> |
|||
* |
|||
* @author Christopher Ng <chrng8@gmail.com> |
|||
* |
|||
* @license GNU AGPL version 3 or any later version |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
namespace OCA\FilesReminders\Listener; |
|||
|
|||
use OCA\DAV\Events\SabrePluginAddEvent; |
|||
use OCA\FilesReminders\Dav\PropFindPlugin; |
|||
use OCP\EventDispatcher\Event; |
|||
use OCP\EventDispatcher\IEventListener; |
|||
use Psr\Container\ContainerInterface; |
|||
|
|||
/** @template-implements IEventListener<SabrePluginAddEvent> */ |
|||
class SabrePluginAddListener implements IEventListener { |
|||
public function __construct( |
|||
private ContainerInterface $container, |
|||
) { |
|||
} |
|||
|
|||
public function handle(Event $event): void { |
|||
if (!($event instanceof SabrePluginAddEvent)) { |
|||
return; |
|||
} |
|||
|
|||
$server = $event->getServer(); |
|||
$plugin = $this->container->get(PropFindPlugin::class); |
|||
$server->addPlugin($plugin); |
|||
} |
|||
} |
@ -0,0 +1,62 @@ |
|||
/** |
|||
* @copyright 2024 Christopher Ng <chrng8@gmail.com> |
|||
* |
|||
* @author Christopher Ng <chrng8@gmail.com> |
|||
* |
|||
* @license AGPL-3.0-or-later |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License as |
|||
* published by the Free Software Foundation, either version 3 of the |
|||
* License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU Affero General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU Affero General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
* |
|||
*/ |
|||
|
|||
import { FileAction, type Node } from '@nextcloud/files' |
|||
import { translate as t } from '@nextcloud/l10n' |
|||
|
|||
import AlarmSvg from '@mdi/svg/svg/alarm.svg?raw' |
|||
|
|||
import { pickCustomDate } from '../services/customPicker.ts' |
|||
import { getVerboseDateString } from '../shared/utils.ts' |
|||
|
|||
export const action = new FileAction({ |
|||
id: 'reminder-status', |
|||
|
|||
inline: () => true, |
|||
|
|||
displayName: () => '', |
|||
|
|||
title: (nodes: Node[]) => { |
|||
const node = nodes.at(0)! |
|||
const dueDate = new Date(node.attributes['reminder-due-date']) |
|||
return `${t('files_reminders', 'Reminder set')} – ${getVerboseDateString(dueDate)}` |
|||
}, |
|||
|
|||
iconSvgInline: () => AlarmSvg, |
|||
|
|||
enabled: (nodes: Node[]) => { |
|||
// Only allow on a single node
|
|||
if (nodes.length !== 1) { |
|||
return false |
|||
} |
|||
const node = nodes.at(0)! |
|||
const dueDate = node.attributes['reminder-due-date'] |
|||
return Boolean(dueDate) |
|||
}, |
|||
|
|||
async exec(node: Node) { |
|||
pickCustomDate(node) |
|||
return null |
|||
}, |
|||
|
|||
order: -15, |
|||
}) |
4
dist/files-main.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
2
dist/files-main.js.map
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
4
dist/files_reminders-init.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
2
dist/files_reminders-init.js.map
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
Write
Preview
Loading…
Cancel
Save
Reference in new issue