diff options
author | René Gieling <github@dartcafe.de> | 2021-07-05 15:20:01 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-05 15:20:01 +0300 |
commit | 6708a60c26d04cf7f89d0137d2a12fb1bb45cebe (patch) | |
tree | a389792cfc4b08d220aba703e27c6d3964b5f033 | |
parent | 1f3b494cd60d9972b05ed273e91efdc3754c74ec (diff) | |
parent | df66373fbed0a146bcecd277349d3525221c61c4 (diff) |
Merge pull request #1809 from nextcloud/version/3.0.0-rc.2v3.0.0-rc.2
Version/3.0.0 rc.2
-rw-r--r-- | appinfo/info.xml | 2 | ||||
-rw-r--r-- | lib/Controller/PublicController.php | 4 | ||||
-rw-r--r-- | lib/Controller/SubscriptionApiController.php | 4 | ||||
-rw-r--r-- | lib/Controller/SubscriptionController.php | 4 | ||||
-rw-r--r-- | lib/Event/PollDeletedEvent.php | 2 | ||||
-rw-r--r-- | lib/Migration/CreateIndices.php | 21 | ||||
-rw-r--r-- | lib/Migration/RemoveIndices.php | 3 | ||||
-rw-r--r-- | lib/Migration/TableSchema.php | 6 | ||||
-rw-r--r-- | lib/Migration/Version030000Date20210704120000.php (renamed from lib/Migration/Version030000Date20210611120000.php) | 2 | ||||
-rw-r--r-- | lib/Model/Group.php | 8 | ||||
-rw-r--r-- | lib/Notification/Notifier.php | 4 | ||||
-rw-r--r-- | lib/Service/SubscriptionService.php | 2 | ||||
-rw-r--r-- | package.json | 2 | ||||
-rw-r--r-- | src/js/components/Actions/ActionDelete.vue | 2 | ||||
-rw-r--r-- | src/js/components/Calendar/CalendarPeek.vue | 1 | ||||
-rw-r--r-- | src/js/components/VoteTable/VoteColumn.vue | 1 | ||||
-rw-r--r-- | src/js/components/VoteTable/VoteTable.vue | 5 |
17 files changed, 22 insertions, 51 deletions
diff --git a/appinfo/info.xml b/appinfo/info.xml index 66d7618e..b5713b52 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -5,7 +5,7 @@ <name>Polls</name> <summary>A polls app, similar to doodle/dudle with the possibility to restrict access.</summary> <description>A polls app, similar to doodle/dudle with the possibility to restrict access (members, certain groups/users, hidden and public).</description> - <version>3.0.0-rc.1</version> + <version>3.0.0-rc.2</version> <licence>agpl</licence> <author>Vinzenz Rosenkranz</author> <author>René Gieling</author> diff --git a/lib/Controller/PublicController.php b/lib/Controller/PublicController.php index 5843d7a2..040f4eb1 100644 --- a/lib/Controller/PublicController.php +++ b/lib/Controller/PublicController.php @@ -293,7 +293,7 @@ class PublicController extends Controller { */ public function subscribe(string $token): DataResponse { return $this->response(function () use ($token) { - return ['subscribed' => $this->subscriptionService->set(0, $token, true)]; + return ['subscribed' => $this->subscriptionService->set(true, 0, $token)]; }); } @@ -304,7 +304,7 @@ class PublicController extends Controller { */ public function unsubscribe(string $token): DataResponse { return $this->response(function () use ($token) { - return ['subscribed' => $this->subscriptionService->set(0, $token, false)]; + return ['subscribed' => $this->subscriptionService->set(true, 0, $token)]; }); } diff --git a/lib/Controller/SubscriptionApiController.php b/lib/Controller/SubscriptionApiController.php index 7a63e88e..419d2228 100644 --- a/lib/Controller/SubscriptionApiController.php +++ b/lib/Controller/SubscriptionApiController.php @@ -78,7 +78,7 @@ class SubscriptionApiController extends ApiController { */ public function subscribe(int $pollId): DataResponse { try { - $this->subscriptionService->set($pollId, '', true); + $this->subscriptionService->set(true, $pollId, ''); return new DataResponse(['status' => 'Subscribed to poll ' . $pollId], Http::STATUS_OK); } catch (Exception $e) { return new DataResponse(['message' => $e->getMessage()], $e->getStatus()); @@ -93,7 +93,7 @@ class SubscriptionApiController extends ApiController { */ public function unsubscribe(int $pollId): DataResponse { try { - $this->subscriptionService->set($pollId, '', false); + $this->subscriptionService->set(false, $pollId, ''); return new DataResponse(['status' => 'Unsubscribed from poll ' . $pollId], Http::STATUS_OK); } catch (Exception $e) { return new DataResponse(['message' => $e->getMessage()], $e->getStatus()); diff --git a/lib/Controller/SubscriptionController.php b/lib/Controller/SubscriptionController.php index deb640e1..b6289c46 100644 --- a/lib/Controller/SubscriptionController.php +++ b/lib/Controller/SubscriptionController.php @@ -61,7 +61,7 @@ class SubscriptionController extends Controller { */ public function subscribe(int $pollId): DataResponse { return $this->response(function () use ($pollId) { - return ['subscribed' => $this->subscriptionService->set($pollId, '', true)]; + return ['subscribed' => $this->subscriptionService->set(true, $pollId, '')]; }); } @@ -71,7 +71,7 @@ class SubscriptionController extends Controller { */ public function unsubscribe(int $pollId): DataResponse { return $this->response(function () use ($pollId) { - return ['subscribed' => $this->subscriptionService->set($pollId, '', false)]; + return ['subscribed' => $this->subscriptionService->set(false, $pollId, '')]; }); } } diff --git a/lib/Event/PollDeletedEvent.php b/lib/Event/PollDeletedEvent.php index 6862f30d..1c8e8f70 100644 --- a/lib/Event/PollDeletedEvent.php +++ b/lib/Event/PollDeletedEvent.php @@ -27,7 +27,7 @@ use OCA\Polls\Notification\Notifier; class PollDeletedEvent extends PollEvent { public function getLogMsg(): string { - return ''; // Log::MSG_ID_DELETEPOLL; + return ''; } public function getNotification(): array { diff --git a/lib/Migration/CreateIndices.php b/lib/Migration/CreateIndices.php index 623fcd93..6a3dbb84 100644 --- a/lib/Migration/CreateIndices.php +++ b/lib/Migration/CreateIndices.php @@ -31,27 +31,6 @@ use OCP\Migration\IOutput; class CreateIndices implements IRepairStep { - // private const INDICES = [ - // 'polls_options' => ['name' => 'UNIQ_options', 'unique' => true, 'columns' => ['poll_id', 'poll_option_text', 'timestamp']], - // 'polls_log' => ['name' => 'UNIQ_unprocessed', 'unique' => true, 'columns' => ['processed', 'poll_id', 'user_id', 'message_id']], - // 'polls_notif' => ['name' => 'UNIQ_subscription', 'unique' => true, 'columns' => ['poll_id', 'user_id']], - // 'polls_share' => ['name' => 'UNIQ_shares', 'unique' => true, 'columns' => ['poll_id', 'user_id']], - // 'polls_votes' => ['name' => 'UNIQ_votes', 'unique' => true, 'columns' => ['poll_id', 'user_id', 'vote_option_text']], - // 'polls_preferences' => ['name' => 'UNIQ_preferences', 'unique' => true, 'columns' => ['user_id']], - // 'polls_watch' => ['name' => 'UNIQ_watch', 'unique' => true, 'columns' => ['poll_id', 'table']], - // ]; - // - // private const PARENT_TABLE = 'polls_polls'; - // - // private const CHILD_TABLES = [ - // 'polls_comments', - // 'polls_log', - // 'polls_notif', - // 'polls_options', - // 'polls_share', - // 'polls_votes', - // ]; - /** @var Connection */ private $connection; diff --git a/lib/Migration/RemoveIndices.php b/lib/Migration/RemoveIndices.php index 79564fc8..d1617f99 100644 --- a/lib/Migration/RemoveIndices.php +++ b/lib/Migration/RemoveIndices.php @@ -48,14 +48,11 @@ class RemoveIndices implements IRepairStep { public function run(IOutput $output): void { foreach (TableSchema::FK_CHILD_TABLES as $tableName) { - // $output->info('"polls" - Removing foreign keys from '. $tableName); $this->removeForeignKeys($tableName); - // $output->info('"polls" - Removing indices in '. $tableName); $this->removeGenericIndices($tableName); } foreach (TableSchema::UNIQUE_INDICES as $tableName => $value) { - // $output->info('"polls" - Removing unique indices in '. $tableName); $this->removeUniqueIndices($tableName); } } diff --git a/lib/Migration/TableSchema.php b/lib/Migration/TableSchema.php index 0f975711..3b2459e2 100644 --- a/lib/Migration/TableSchema.php +++ b/lib/Migration/TableSchema.php @@ -102,6 +102,7 @@ abstract class TableSchema { '0108Date20210307130003', '0108Date20210307130009', '0109Date20210323120002', + '030000Date20210611120000', ]; /** @@ -137,7 +138,10 @@ abstract class TableSchema { 'full_anonymous', 'options', 'settings', - ] + ], + 'polls_comments' => [ + 'dt', + ], ]; /** diff --git a/lib/Migration/Version030000Date20210611120000.php b/lib/Migration/Version030000Date20210704120000.php index aa8d2862..f2a05ec3 100644 --- a/lib/Migration/Version030000Date20210611120000.php +++ b/lib/Migration/Version030000Date20210704120000.php @@ -37,7 +37,7 @@ use OCP\Migration\IOutput; * Changed class naming: Version[jjmmpp]Date[YYYYMMDDHHMMSS] * Version: jj = major version, mm = minor, pp = patch */ -class Version030000Date20210611120000 extends SimpleMigrationStep { +class Version030000Date20210704120000 extends SimpleMigrationStep { /** @var IDBConnection */ protected $connection; diff --git a/lib/Model/Group.php b/lib/Model/Group.php index 772be60e..28af24b8 100644 --- a/lib/Model/Group.php +++ b/lib/Model/Group.php @@ -41,13 +41,7 @@ class Group extends UserGroupClass { $this->icon = self::ICON; $this->group = self::getContainer()->query(IGroupManager::class)->get($this->id); $this->description = \OC::$server->getL10N('polls')->t('Group'); - try { - // since NC19 - $this->displayName = $this->group->getDisplayName(); - } catch (\Exception $e) { - // until NC18 - $this->displayName = $this->id; - } + $this->displayName = $this->group->getDisplayName(); } /** diff --git a/lib/Notification/Notifier.php b/lib/Notification/Notifier.php index cbafc681..2ae0d55e 100644 --- a/lib/Notification/Notifier.php +++ b/lib/Notification/Notifier.php @@ -117,6 +117,10 @@ class Notifier implements INotifier { $actor = $this->getActor($parameters['actor']); } + if (isset($actor['actor'])) { + $actor = $actor['actor']; + } + switch ($notification->getSubject()) { case self::NOTIFY_INVITATION: $notification->setParsedSubject($l->t('%s invited you to a poll', $actor['name'])); diff --git a/lib/Service/SubscriptionService.php b/lib/Service/SubscriptionService.php index fa35ea5a..558be8fe 100644 --- a/lib/Service/SubscriptionService.php +++ b/lib/Service/SubscriptionService.php @@ -69,7 +69,7 @@ class SubscriptionService { $this->subscriptionMapper->insert($subscription); } - public function set(int $pollId = 0, string $token = '', bool $subscribed): bool { + public function set(bool $subscribed, int $pollId = 0, string $token = ''): bool { if ($token) { $this->acl->setToken($token); } else { diff --git a/package.json b/package.json index eb1e45c5..a9fd26f9 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "polls", "description": "Polls app for nextcloud", - "version": "v3.0.0-rc.1", + "version": "3.0.0-rc.2", "authors": [ { "name": "Vinzenz Rosenkranz", diff --git a/src/js/components/Actions/ActionDelete.vue b/src/js/components/Actions/ActionDelete.vue index 499ffc8f..7d45e3e6 100644 --- a/src/js/components/Actions/ActionDelete.vue +++ b/src/js/components/Actions/ActionDelete.vue @@ -57,7 +57,7 @@ export default { return { deleteInterval: null, deleteTimeout: null, - countdown: 7, // seconds + countdown: 4, // seconds } }, diff --git a/src/js/components/Calendar/CalendarPeek.vue b/src/js/components/Calendar/CalendarPeek.vue index 001cde50..0eea8662 100644 --- a/src/js/components/Calendar/CalendarPeek.vue +++ b/src/js/components/Calendar/CalendarPeek.vue @@ -98,7 +98,6 @@ export default { calendarKey: 0, calendarName: 'Polls', displayColor: 'transparent', - // displayColor: 'var(--color-main-background)', allDay: '', description: this.poll.description, start: this.option.timestamp, diff --git a/src/js/components/VoteTable/VoteColumn.vue b/src/js/components/VoteTable/VoteColumn.vue index b10998fe..bb1bd314 100644 --- a/src/js/components/VoteTable/VoteColumn.vue +++ b/src/js/components/VoteTable/VoteColumn.vue @@ -93,7 +93,6 @@ export default { ...mapState({ acl: (state) => state.poll.acl, poll: (state) => state.poll, - // share: (state) => state.share, settings: (state) => state.settings.user, }), diff --git a/src/js/components/VoteTable/VoteTable.vue b/src/js/components/VoteTable/VoteTable.vue index 5133df23..b84114d7 100644 --- a/src/js/components/VoteTable/VoteTable.vue +++ b/src/js/components/VoteTable/VoteTable.vue @@ -84,9 +84,6 @@ export default { computed: { ...mapState({ acl: (state) => state.poll.acl, - // poll: (state) => state.poll, - // share: (state) => state.share, - // settings: (state) => state.settings.user, }), ...mapGetters({ @@ -129,7 +126,6 @@ export default { display: flex; flex-direction: column; overflow-x: scroll; - // max-width: 245px; } .vote-table__votes { @@ -157,7 +153,6 @@ export default { } &.closed .vote-column { - // padding: 8px 2px; &.confirmed { order: 1; border-radius: 10px; |