diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2019-12-18 16:44:50 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-18 16:44:50 +0300 |
commit | a401c3f1f8e66e66dbad86a448b75ea8d64fdb93 (patch) | |
tree | ff46a2074064b30cb2ef5ac0731e04e678f43cb2 | |
parent | 9af74f622427bd341e1a1a5f133db9125311b4ba (diff) | |
parent | cbac75dec711a380415ef065048d95ec1feb67cf (diff) |
Merge pull request #226 from nextcloud/enh/225/notification-updates
Update recommended app notifications
-rw-r--r-- | img/apps/calendar.svg | 2 | ||||
-rw-r--r-- | img/apps/contacts.svg | 2 | ||||
-rw-r--r-- | img/apps/deck.svg | 1 | ||||
-rw-r--r-- | img/apps/groupfolders.svg | 1 | ||||
-rw-r--r-- | img/apps/mail.svg | 5 | ||||
-rw-r--r-- | img/apps/notes.svg | 1 | ||||
-rw-r--r-- | img/apps/social.svg | 1 | ||||
-rw-r--r-- | img/apps/spreed.svg | 2 | ||||
-rw-r--r-- | img/apps/tasks.svg | 4 | ||||
-rw-r--r-- | lib/Notification/AppHint.php | 17 | ||||
-rw-r--r-- | lib/Notification/Notifier.php | 34 |
11 files changed, 52 insertions, 18 deletions
diff --git a/img/apps/calendar.svg b/img/apps/calendar.svg index 020ae8fe..252efb5d 100644 --- a/img/apps/calendar.svg +++ b/img/apps/calendar.svg @@ -1 +1 @@ -<svg height="16" width="16" xmlns="http://www.w3.org/2000/svg" version="1.1" viewbox="0 0 16 16"><path d="m4 1c-0.5 0-1 0.5-1 1v2c0 0.5 0.5 1 1 1s1-0.5 1-1v-2c0-0.5-0.5-1-1-1zm8 0c-0.5 0-1 0.5-1 1v2c0 0.5 0.5 1 1 1s1-0.5 1-1v-2c0-0.5-0.5-1-1-1zm-6.5 2v1c0 0.831-0.5 1.5-1.5 1.5s-1.5-0.5-1.5-1.5v-0.9375c-0.8841 0.227-1.5 1.0247-1.5 1.9375v8c0 1.108 0.892 2 2 2h10c1.108 0 2-0.892 2-2v-8c0-0.9128-0.61588-1.7105-1.5-1.9375v0.9375c0 0.831-0.5 1.5-1.5 1.5s-1.5-0.5-1.5-1.5v-1zm7.5 5v5h-10v-5z"/></svg> +<svg width="16" height="16" version="1.1" viewbox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="m4 1c-0.5 0-1 0.5-1 1v2c0 0.5 0.5 1 1 1s1-0.5 1-1v-2c0-0.5-0.5-1-1-1zm8 0c-0.5 0-1 0.5-1 1v2c0 0.5 0.5 1 1 1s1-0.5 1-1v-2c0-0.5-0.5-1-1-1zm-6.5 2v1c0 0.831-0.5 1.5-1.5 1.5s-1.5-0.5-1.5-1.5v-0.9375c-0.8841 0.227-1.5 1.0247-1.5 1.9375v8c0 1.108 0.892 2 2 2h10c1.108 0 2-0.892 2-2v-8c0-0.9128-0.61588-1.7105-1.5-1.9375v0.9375c0 0.831-0.5 1.5-1.5 1.5s-1.5-0.5-1.5-1.5v-1zm7.5 5v5h-10v-5z"/></svg> diff --git a/img/apps/contacts.svg b/img/apps/contacts.svg index 5bc91dc5..9efcf39d 100644 --- a/img/apps/contacts.svg +++ b/img/apps/contacts.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 16 16" height="16" width="16" version="1.1"><path d="m9 1c-1.746 0-3 1.43-3 2.8 0 1.4 0.1 2.4 0.8 3.5 0.224 0.29 0.485 0.35 0.7 0.6 0.135 0.5 0.24 1 0.1 1.5-0.436 0.153-0.85 0.332-1.27 0.5-0.51-0.273-1.1-0.5-1.61-0.7-0.07-0.28-0.02-0.487 0.05-0.75 0.12-0.125 0.23-0.18 0.36-0.3 0.37-0.45 0.39-1.21 0.39-1.75 0-0.8-0.72-1.4-1.5-1.4-0.87 0-1.5 0.72-1.5 1.4h-0.02c0 0.7 0.05 1.2 0.4 1.75 0.1 0.15 0.242 0.175 0.35 0.3 0.0674 0.25 0.121 0.5 0.05 0.75-0.64 0.223-1.244 0.5-1.8 0.8-0.42 0.3-0.233 0.182-0.5 1.15-0.124 0.5 1.3 0.73 2.32 0.81-0.05 0.275-0.12 0.64-0.32 1.34-0.32 1.25 4.353 1.7 6 1.7 2.43 0 6.313-0.456 5.98-1.7-0.52-1.94-0.208-1.71-0.98-2.3-1.09-0.654-2.452-1.167-3.6-1.6-0.15-0.557-0.04-0.97 0.1-1.5 0.235-0.25 0.5-0.36 0.72-0.6 0.69-0.884 0.78-2.424 0.78-3.5 0-1.586-1.43-2.8-3-2.8z"/></svg> +<svg width="16" height="16" version="1.1" viewbox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="m9 1c-1.746 0-3 1.43-3 2.8 0 1.4 0.1 2.4 0.8 3.5 0.224 0.29 0.485 0.35 0.7 0.6 0.135 0.5 0.24 1 0.1 1.5-0.436 0.153-0.85 0.332-1.27 0.5-0.51-0.273-1.1-0.5-1.61-0.7-0.07-0.28-0.02-0.487 0.05-0.75 0.12-0.125 0.23-0.18 0.36-0.3 0.37-0.45 0.39-1.21 0.39-1.75 0-0.8-0.72-1.4-1.5-1.4-0.87 0-1.5 0.72-1.5 1.4h-0.02c0 0.7 0.05 1.2 0.4 1.75 0.1 0.15 0.242 0.175 0.35 0.3 0.0674 0.25 0.121 0.5 0.05 0.75-0.64 0.223-1.244 0.5-1.8 0.8-0.42 0.3-0.233 0.182-0.5 1.15-0.124 0.5 1.3 0.73 2.32 0.81-0.05 0.275-0.12 0.64-0.32 1.34-0.32 1.25 4.353 1.7 6 1.7 2.43 0 6.313-0.456 5.98-1.7-0.52-1.94-0.208-1.71-0.98-2.3-1.09-0.654-2.452-1.167-3.6-1.6-0.15-0.557-0.04-0.97 0.1-1.5 0.235-0.25 0.5-0.36 0.72-0.6 0.69-0.884 0.78-2.424 0.78-3.5 0-1.586-1.43-2.8-3-2.8z"/></svg> diff --git a/img/apps/deck.svg b/img/apps/deck.svg new file mode 100644 index 00000000..1c62ddd9 --- /dev/null +++ b/img/apps/deck.svg @@ -0,0 +1 @@ +<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="7" width="14" height="8" ry="1"/><rect x="2" y="5" width="12" height="1" ry=".5"/><rect x="3" y="3" width="10" height="1" ry=".5"/><rect x="4" y="1" width="8" height="1" ry=".5"/></svg> diff --git a/img/apps/groupfolders.svg b/img/apps/groupfolders.svg new file mode 100644 index 00000000..b0a143d0 --- /dev/null +++ b/img/apps/groupfolders.svg @@ -0,0 +1 @@ +<svg width="32" height="32" viewbox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><path d="M9.24 6.67c-1.955 0-3.613 1.43-3.613 3.275.014.583.066 1.302.414 2.823v.037l.038.038c.112.32.275.503.49.753.215.25.47.544.715.79l.075.076c.048.21.107.436.15.64.117.54.105.922.076 1.053-.84.295-1.885.647-2.823 1.054-.526.228-1.002.433-1.392.677-.39.244-.777.43-.903.978a.473.473 0 0 0 0 .076c-.123 1.13-.31 2.793-.452 3.915a.618.618 0 0 0 .3.603c1.704.92 4.32 1.29 6.927 1.28 2.607-.01 5.202-.403 6.85-1.28a.618.618 0 0 0 .3-.603c-.044-.35-.1-1.14-.15-1.92-.05-.778-.09-1.543-.15-1.994a.607.607 0 0 0-.15-.3c-.524-.626-1.306-1.008-2.22-1.393-.836-.352-1.815-.717-2.786-1.13-.055-.12-.11-.473 0-1.016.03-.144.074-.3.113-.45l.263-.3c.216-.248.447-.506.64-.754.192-.25.35-.462.452-.753l.037-.038c.393-1.588.393-2.25.413-2.823v-.037c0-1.845-1.658-3.275-3.613-3.275zm10.336-3.005c-2.85 0-5.268 2.084-5.268 4.774.02.85.096 1.898.604 4.115v.055l.055.055c.162.466.4.733.713 1.097s.687.793 1.043 1.153c.04.042.068.068.11.11.07.306.155.636.22.932.168.788.15 1.346.11 1.537-1.226.43-2.75.942-4.117 1.536-.768.334-1.462.632-2.03.988-.57.356-1.134.625-1.317 1.427a.67.67 0 0 0 0 .11c-.18 1.648-.452 4.07-.66 5.707a.9.9 0 0 0 .44.878c2.48 1.34 6.295 1.88 10.096 1.865s7.584-.586 9.987-1.865a.9.9 0 0 0 .44-.878c-.067-.512-.148-1.665-.22-2.8-.072-1.133-.134-2.25-.22-2.907a.884.884 0 0 0-.22-.44c-.763-.91-1.903-1.468-3.237-2.03-1.217-.513-2.645-1.045-4.06-1.646-.08-.177-.16-.69 0-1.483.042-.212.108-.44.164-.658.133-.15.237-.272.384-.44.315-.36.652-.735.933-1.098.28-.362.51-.673.66-1.097l.053-.055c.574-2.315.574-3.28.604-4.116V8.44c0-2.69-2.418-4.775-5.268-4.775z" style="block-progression:tb;text-indent:0;text-transform:none"/></svg> diff --git a/img/apps/mail.svg b/img/apps/mail.svg index 57c5010b..9fc08d96 100644 --- a/img/apps/mail.svg +++ b/img/apps/mail.svg @@ -1,4 +1 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<svg xmlns="http://www.w3.org/2000/svg" height="32" width="32" version="1.0" viewBox="0 0 32 32"> - <path fill="#000" d="m1.7778 6c-0.98491 0-1.7778 0.7935-1.7778 1.7784v16.446c0 0.985 0.79289 1.776 1.7778 1.776h28.444c0.985 0 1.778-0.791 1.778-1.776v-16.446c0-0.9849-0.793-1.7784-1.778-1.7784zm1.5 2.0562 12.167 12.167h1.0556l12.222-12.167 1.2222 1.2222-7.2778 7.3889 5.5 5.6111-1.2222 1.2222-5.6111-5.6111-4.0556 4.1111h-2.5556l-4.055-4.11-5.6114 5.666-1.2223-1.278 5.5556-5.611-7.3333-7.3886z"/> -</svg> +<svg width="32" height="32" version="1.0" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><path d="m1.7778 6c-0.98491 0-1.7778 0.7935-1.7778 1.7784v16.446c0 0.985 0.79289 1.776 1.7778 1.776h28.444c0.985 0 1.778-0.791 1.778-1.776v-16.446c0-0.9849-0.793-1.7784-1.778-1.7784zm1.5 2.0562 12.167 12.167h1.0556l12.222-12.167 1.2222 1.2222-7.2778 7.3889 5.5 5.6111-1.2222 1.2222-5.6111-5.6111-4.0556 4.1111h-2.5556l-4.055-4.11-5.6114 5.666-1.2223-1.278 5.5556-5.611-7.3333-7.3886z"/></svg> diff --git a/img/apps/notes.svg b/img/apps/notes.svg new file mode 100644 index 00000000..5e754f5e --- /dev/null +++ b/img/apps/notes.svg @@ -0,0 +1 @@ +<svg width="32" height="32" version="1.0" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><path d="m6 2c-2.216 0-4 1.784-4 4v20c0 2.216 1.784 4 4 4h20c2.216 0 4-1.784 4-4v-16.719l-0.906 0.9068-5.282-5.2818 2.907-2.9062h-20.719zm15.812 4.9062 5.282 5.2818-8.313 8.312-8.781 3.5 3.5-8.781 8.312-8.3128zm-7.406 9.1878-2.656 4.406 1.75 1.75 4.406-2.656-3.5-3.5z"/></svg> diff --git a/img/apps/social.svg b/img/apps/social.svg new file mode 100644 index 00000000..e2797eab --- /dev/null +++ b/img/apps/social.svg @@ -0,0 +1 @@ +<svg width="32" height="32" version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><path d="m16 29-2.03-1.848c-7.21-6.538-11.97-10.864-11.97-16.142 0-4.326 3.388-7.7 7.7-7.7 2.436 0 4.774 1.134 6.3 2.912 1.526-1.778 3.864-2.912 6.3-2.912 4.312 0 7.7 3.374 7.7 7.7 0 5.278-4.76 9.604-11.97 16.142z" stroke-width="1.4"/></svg> diff --git a/img/apps/spreed.svg b/img/apps/spreed.svg index 3b0f0e64..3e133d0a 100644 --- a/img/apps/spreed.svg +++ b/img/apps/spreed.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" version="1.1" viewBox="0 0 16 16"><path d="m7.9992 0.999a6.9993 6.9994 0 0 0 -6.9992 6.9996 6.9993 6.9994 0 0 0 6.9992 6.9994 6.9993 6.9994 0 0 0 3.6308 -1.024c0.86024 0.34184 2.7871 1.356 3.2457 0.91794 0.47922-0.45765-0.56261-2.6116-0.81238-3.412a6.9993 6.9994 0 0 0 0.935 -3.4814 6.9993 6.9994 0 0 0 -6.9991 -6.9993zm0.0008 2.6611a4.34 4.3401 0 0 1 4.34 4.3401 4.34 4.3401 0 0 1 -4.34 4.3398 4.34 4.3401 0 0 1 -4.34 -4.3398 4.34 4.3401 0 0 1 4.34 -4.3401z" stroke-width="0.14"/></svg> +<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="m7.9992 0.999a6.9993 6.9994 0 0 0-6.9992 6.9996 6.9993 6.9994 0 0 0 6.9992 6.9994 6.9993 6.9994 0 0 0 3.6308-1.024c0.86024 0.34184 2.7871 1.356 3.2457 0.91794 0.47922-0.45765-0.56261-2.6116-0.81238-3.412a6.9993 6.9994 0 0 0 0.935-3.4814 6.9993 6.9994 0 0 0-6.9991-6.9993zm8e-4 2.6611a4.34 4.3401 0 0 1 4.34 4.3401 4.34 4.3401 0 0 1-4.34 4.3398 4.34 4.3401 0 0 1-4.34-4.3398 4.34 4.3401 0 0 1 4.34-4.3401z" stroke-width=".14"/></svg> diff --git a/img/apps/tasks.svg b/img/apps/tasks.svg new file mode 100644 index 00000000..ae6f22a4 --- /dev/null +++ b/img/apps/tasks.svg @@ -0,0 +1,4 @@ +<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'> +<svg width="32px" height="32px" enable-background="new 0 0 32 32" version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"> +<path d="m14.383 26.764s0.259-0.716 0.563-1.367c4.908-10.57 11.212-17.53 14.008-20.69 2.264-2.559 1.378-2.156 0.375-1.503-4.09 2.659-11.742 11.206-14.668 14.169-0.542 0.545-1.769 1.833-2.045 1.833-0.313 0-1.358-0.481-1.955-0.833-2.282-1.338-4.464-2.643-5.834-3.136-2.917-1.049-2.092-0.052-1.926 0.281 0.521 1.042 7.566 6.689 9.899 9.356 0.722 0.824 1.583 1.89 1.583 1.89z" stroke="#000" stroke-miterlimit="10" stroke-width=".75"/> +</svg> diff --git a/lib/Notification/AppHint.php b/lib/Notification/AppHint.php index 01c2be88..6e0351b2 100644 --- a/lib/Notification/AppHint.php +++ b/lib/Notification/AppHint.php @@ -50,6 +50,8 @@ class AppHint { /** @var string */ private $userId; + const APP_HINT_VERSION = '18'; + public function __construct(INotificationManager $notificationManager, IGroupManager $groupManager, IAppManager $appManager, IConfig $config, IEventDispatcher $eventDispatcher, $userId) { $this->notificationManager = $notificationManager; $this->groupManager = $groupManager; @@ -60,12 +62,13 @@ class AppHint { } public function sendAppHintNotifications(): void { - if ($this->userId !== null && $this->groupManager->isAdmin($this->userId) && $this->config->getUserValue($this->userId, 'firstrunwizard', 'apphint') !== 'yes') { - $this->sendNotification('calendar', $this->userId); - $this->sendNotification('contacts', $this->userId); - $this->sendNotification('mail', $this->userId); - $this->sendNotification('spreed', $this->userId); - $this->config->setUserValue($this->userId, 'firstrunwizard', 'apphint', 'yes'); + if ($this->userId !== null && $this->groupManager->isAdmin($this->userId) && $this->config->getUserValue($this->userId, 'firstrunwizard', 'apphint') !== self::APP_HINT_VERSION) { + $this->sendNotification('groupfolders', $this->userId); + $this->sendNotification('social', $this->userId); + $this->sendNotification('notes', $this->userId); + $this->sendNotification('deck', $this->userId); + $this->sendNotification('tasks', $this->userId); + $this->config->setUserValue($this->userId, 'firstrunwizard', 'apphint', self::APP_HINT_VERSION); } } @@ -78,7 +81,7 @@ class AppHint { protected function sendNotification(string $app, string $user): void { $notification = $this->generateNotification($app, $user); if ( - $this->config->getUserValue($this->userId, 'firstrunwizard', 'apphint') !== 'yes' + $this->config->getUserValue($this->userId, 'firstrunwizard', 'apphint') !== self::APP_HINT_VERSION && $this->notificationManager->getCount($notification) === 0 && !$this->appManager->isEnabledForUser($app) ) { diff --git a/lib/Notification/Notifier.php b/lib/Notification/Notifier.php index c72e8195..cf6a5deb 100644 --- a/lib/Notification/Notifier.php +++ b/lib/Notification/Notifier.php @@ -105,6 +105,11 @@ class Notifier implements INotifier { case 'apphint-contacts': case 'apphint-mail': case 'apphint-spreed': + case 'apphint-tasks': + case 'apphint-deck': + case 'apphint-notes': + case 'apphint-social': + case 'apphint-groupfolders': $app = $notification->getObjectId(); return $this->setAppHintDetails($notification, $languageCode, $app); default: @@ -166,10 +171,31 @@ class Notifier implements INotifier { $notification->setParsedMessage($l->t('Simple email app nicely integrated with Files, Contacts and Calendar.')); $appLink = '/social/mail'; break; - case 'spreed': - $notification->setParsedSubject($l->t('App recommendation: Nextcloud Talk')); - $notification->setParsedMessage($l->t('Screensharing, online meetings and web conferencing – on desktop and with mobile apps.')); - $appLink = '/social/spreed'; + + case 'tasks': + $notification->setParsedSubject($l->t('App recommendation: Tasks')); + $notification->setParsedMessage($l->t('Sync tasks from various devices with your Nextcloud and edit them online.')); + $appLink = '/organization/tasks'; + break; + case 'deck': + $notification->setParsedSubject($l->t('App recommendation: Deck')); + $notification->setParsedMessage($l->t('Kanban style organization for personal planning and team projects.')); + $appLink = '/organization/deck'; + break; + case 'notes': + $notification->setParsedSubject($l->t('App recommendation: Notes')); + $notification->setParsedMessage($l->t('Distraction-free notes and writing.')); + $appLink = '/organization/notes'; + break; + case 'social': + $notification->setParsedSubject($l->t('App recommendation: Social')); + $notification->setParsedMessage($l->t('Nextcloud becomes part of the federated social networks.')); + $appLink = '/social/social'; + break; + case 'groupfolders': + $notification->setParsedSubject($l->t('App recommendation: Group folders')); + $notification->setParsedMessage($l->t('Admin-configured folders shared by everyone in a group.')); + $appLink = '/files/groupfolders'; break; } $notification |