Skip to content

Commit

Permalink
Merge pull request #1809 from nextcloud/version/3.0.0-rc.2
Browse files Browse the repository at this point in the history
Version/3.0.0 rc.2
  • Loading branch information
dartcafe committed Jul 5, 2021
2 parents 1f3b494 + df66373 commit 6708a60
Show file tree
Hide file tree
Showing 17 changed files with 22 additions and 51 deletions.
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
4 changes: 2 additions & 2 deletions lib/Controller/PublicController.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ public function deleteComment(int $commentId, string $token): DataResponse {
*/
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)];
});
}

Expand All @@ -304,7 +304,7 @@ public function subscribe(string $token): DataResponse {
*/
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)];
});
}

Expand Down
4 changes: 2 additions & 2 deletions lib/Controller/SubscriptionApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function get(int $pollId): DataResponse {
*/
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());
Expand All @@ -93,7 +93,7 @@ public function subscribe(int $pollId): DataResponse {
*/
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());
Expand Down
4 changes: 2 additions & 2 deletions lib/Controller/SubscriptionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function get(int $pollId = 0): DataResponse {
*/
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, '')];
});
}

Expand All @@ -71,7 +71,7 @@ public function subscribe(int $pollId): DataResponse {
*/
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, '')];
});
}
}
2 changes: 1 addition & 1 deletion lib/Event/PollDeletedEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

class PollDeletedEvent extends PollEvent {
public function getLogMsg(): string {
return ''; // Log::MSG_ID_DELETEPOLL;
return '';
}

public function getNotification(): array {
Expand Down
21 changes: 0 additions & 21 deletions lib/Migration/CreateIndices.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,6 @@

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;

Expand Down
3 changes: 0 additions & 3 deletions lib/Migration/RemoveIndices.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,11 @@ public function getName() {

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);
}
}
Expand Down
6 changes: 5 additions & 1 deletion lib/Migration/TableSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ abstract class TableSchema {
'0108Date20210307130003',
'0108Date20210307130009',
'0109Date20210323120002',
'030000Date20210611120000',
];

/**
Expand Down Expand Up @@ -137,7 +138,10 @@ abstract class TableSchema {
'full_anonymous',
'options',
'settings',
]
],
'polls_comments' => [
'dt',
],
];

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* 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;
Expand Down
8 changes: 1 addition & 7 deletions lib/Model/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,7 @@ public function __construct(
$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();
}

/**
Expand Down
4 changes: 4 additions & 0 deletions lib/Notification/Notifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ public function prepare(INotification $notification, string $languageCode): INot
$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']));
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/SubscriptionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function add(int $pollId, string $userId): void {
$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 {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/Actions/ActionDelete.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default {
return {
deleteInterval: null,
deleteTimeout: null,
countdown: 7, // seconds
countdown: 4, // seconds
}
},
Expand Down
1 change: 0 additions & 1 deletion src/js/components/Calendar/CalendarPeek.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion src/js/components/VoteTable/VoteColumn.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}),
Expand Down
5 changes: 0 additions & 5 deletions src/js/components/VoteTable/VoteTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -129,7 +126,6 @@ export default {
display: flex;
flex-direction: column;
overflow-x: scroll;
// max-width: 245px;
}
.vote-table__votes {
Expand Down Expand Up @@ -157,7 +153,6 @@ export default {
}
&.closed .vote-column {
// padding: 8px 2px;
&.confirmed {
order: 1;
border-radius: 10px;
Expand Down

0 comments on commit 6708a60

Please sign in to comment.