diff --git a/Makefile b/Makefile index b60b38af4..915c4e80e 100644 --- a/Makefile +++ b/Makefile @@ -55,9 +55,8 @@ lint-fix: .PHONY: clean clean: rm -rf $(build_dir) - rm -f js/polls.js - rm -f js/polls.js.map - + rm -rf js/ + mkdir -p js clean-dev: clean rm -rf node_modules rm -rf ./vendor diff --git a/README.md b/README.md index af016618e..67668f43d 100644 --- a/README.md +++ b/README.md @@ -5,18 +5,15 @@ [![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/nextcloud/polls.svg?style=flat-square)](https://scrutinizer-ci.com/g/nextcloud/polls) [![Software License](https://img.shields.io/badge/license-AGPL-brightgreen.svg?style=flat-square)](LICENSE) -## This branch is in alpha state, do not use for production needs - This is a poll app, similar to doodle or dudle, for Nextcloud written in PHP and JS / Vue. -It is a rework of the already existing [polls app](https://github.com/raduvatav/polls) written by @raduvatav. **Note**: ownCloud is **no longer** supported! Last (confirmed) working version is 0.8.1 and is released in the oC marketplace. **Note**: IE11 users will face some CSS problems (see #541). Please change to a compatible browser (Firefox, Chrome, Edge, etc.). Or better: don't even try this browser ### Features -- :bar_chart: Create / edit polls (datetimes _and_ texts) +- :bar_chart: Create / edit polls (datetimes and texts) - :date: Set expiration date -- :lock: Restrict access (only logged in users, certain groups / users, hidden and public) +- :lock: Restrict access (all site users or invited users only) - :speech_balloon: Comments ### Bugs @@ -27,23 +24,22 @@ Create a new poll from the navigation bar and get an overview of your polls ![Overview](screenshots/overview.png) Vote and comment -![Vote](screenshots/vote.png) +![Vote](screenshots/comment.png) -Edit poll on the vote page as owner or an admin -![Edit poll](screenshots/edit-poll.png) -![Edit options](screenshots/edit-options.png) +Edit poll on the vote page +![Edit poll](screenshots/configurations.png) +![Edit options](screenshots/options.png) Add shared links to your poll -![Share poll](screenshots/edit-shares.png) +![Share poll](screenshots/shares.png) -View the vote page on mobiles -![Vote mobile portrait](screenshots/vote-mobile-portrait.png) +View the vote page on mobiles (Turn phone to landscape to see th full table) +![Vote mobile portrait](screenshots/mobile-portrait.png) -Turn phone to landscape to see details -![Vote mobile landscape](screenshots/vote-mobile-landscape.png) +Only the owner can edit the poll. Granting access to admin users will be available in the next version. ## Installation / Update -This app is supposed to work on Nextcloud version 13+. +This app is supposed to work on Nextcloud version 16+. ### Install latest release You can download and install the latest release from the [Nextcloud app store](https://apps.nextcloud.com/apps/polls). diff --git a/lib/Migration/Version0010Date20191227063812.php b/lib/Migration/Version0010Date20191227063812.php index 08dff52a6..4b5bfd762 100644 --- a/lib/Migration/Version0010Date20191227063812.php +++ b/lib/Migration/Version0010Date20191227063812.php @@ -242,11 +242,13 @@ public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array /** @var ISchemaWrapper $schema */ $schema = $schemaClosure(); - if ($schema->hasTable('polls_polls')) { + if ($schema->hasTable('polls_polls') && + $schema->hasTable('polls_events')) { $this->migrateEvents(); } - if ($schema->hasTable('polls_share')) { + if ($schema->hasTable('polls_share') && + $schema->hasTable('polls_events')) { $this->copyTokens(); } } @@ -343,7 +345,8 @@ protected function copyTokens() { 'type' => $insert->createParameter('type'), 'poll_id' => $insert->createParameter('poll_id'), 'user_id' => $insert->createParameter('user_id'), - 'user_email' => $insert->createParameter('user_email') + 'user_email' => $insert->createParameter('user_email'), + 'user' => $insert->createParameter('user') ]); $query = $this->connection->getQueryBuilder(); $query->select('*') @@ -358,7 +361,8 @@ protected function copyTokens() { ->setParameter('type', 'public') ->setParameter('poll_id', $row['id']) ->setParameter('user_id', null) - ->setParameter('user_email', null); + ->setParameter('user_email', null) + ->setParameter('user', ''); $insert->execute(); } elseif ($row['access'] == 'hidden') { // copy the hash to a public share @@ -368,7 +372,8 @@ protected function copyTokens() { ->setParameter('type', 'public') ->setParameter('poll_id', $row['id']) ->setParameter('user_id', null) - ->setParameter('user_email', null); + ->setParameter('user_email', null) + ->setParameter('user', ''); $insert->execute(); } elseif ($row['access'] == 'registered') { // copy the hash to a public share @@ -378,7 +383,8 @@ protected function copyTokens() { ->setParameter('type', 'public') ->setParameter('poll_id', $row['id']) ->setParameter('user_id', null) - ->setParameter('user_email', null); + ->setParameter('user_email', null) + ->setParameter('user', ''); } else { // create a personal share for invitated users @@ -398,7 +404,8 @@ protected function copyTokens() { ->setParameter('type', $parts[0]) ->setParameter('poll_id', $row['id']) ->setParameter('user_id', $parts[1]) - ->setParameter('user_email', null); + ->setParameter('user_email', null) + ->setParameter('user', ''); $insert->execute(); } } diff --git a/lib/Migration/Version0010Date20200119101800.php b/lib/Migration/Version0010Date20200119101800.php new file mode 100644 index 000000000..0152c9720 --- /dev/null +++ b/lib/Migration/Version0010Date20200119101800.php @@ -0,0 +1,73 @@ + + * + * @author René Gieling + * + * @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 . + * + */ + +namespace OCA\Polls\Migration; + +use OCP\DB\ISchemaWrapper; +use OCP\DB\QueryBuilder\IQueryBuilder; +use OCP\IConfig; +use OCP\IDBConnection; +use OCP\Migration\SimpleMigrationStep; +use OCP\Migration\IOutput; + +/** + * Installation class for the polls app. + * Initial db creation + */ +class Version0010Date20200119101800 extends SimpleMigrationStep { + + /** @var IDBConnection */ + protected $connection; + + /** @var IConfig */ + protected $config; + + /** + * @param IDBConnection $connection + * @param IConfig $config + */ + public function __construct(IDBConnection $connection, IConfig $config) { + $this->connection = $connection; + $this->config = $config; + } + + /** + * @param IOutput $output + * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` + * @param array $options + * @return null|ISchemaWrapper + * @since 13.0.0 + */ + public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) { + /** @var ISchemaWrapper $schema */ + $schema = $schemaClosure(); + + if ($schema->hasTable('polls_polls') && + $schema->hasTable('polls_events')) { + + $schema->dropTable('polls_events'); + } + + return $schema; + } +} diff --git a/screenshots/comment.png b/screenshots/comment.png new file mode 100644 index 000000000..b5a66580f Binary files /dev/null and b/screenshots/comment.png differ diff --git a/screenshots/configuration.png b/screenshots/configuration.png new file mode 100644 index 000000000..9d0643280 Binary files /dev/null and b/screenshots/configuration.png differ diff --git a/screenshots/edit-options.png b/screenshots/edit-options.png deleted file mode 100644 index f97343d92..000000000 Binary files a/screenshots/edit-options.png and /dev/null differ diff --git a/screenshots/edit-poll.png b/screenshots/edit-poll.png deleted file mode 100644 index b84fa767b..000000000 Binary files a/screenshots/edit-poll.png and /dev/null differ diff --git a/screenshots/edit-shares.png b/screenshots/edit-shares.png deleted file mode 100644 index 7eedd0301..000000000 Binary files a/screenshots/edit-shares.png and /dev/null differ diff --git a/screenshots/mobile-portrait.png b/screenshots/mobile-portrait.png new file mode 100644 index 000000000..b9698b522 Binary files /dev/null and b/screenshots/mobile-portrait.png differ diff --git a/screenshots/options.png b/screenshots/options.png new file mode 100644 index 000000000..3f8787575 Binary files /dev/null and b/screenshots/options.png differ diff --git a/screenshots/overview.png b/screenshots/overview.png index 8d19ad16b..e1b90977f 100644 Binary files a/screenshots/overview.png and b/screenshots/overview.png differ diff --git a/screenshots/shares.png b/screenshots/shares.png new file mode 100644 index 000000000..a2dfd082a Binary files /dev/null and b/screenshots/shares.png differ diff --git a/screenshots/vote-mobile-landscape.png b/screenshots/vote-mobile-landscape.png deleted file mode 100644 index 45858793c..000000000 Binary files a/screenshots/vote-mobile-landscape.png and /dev/null differ diff --git a/screenshots/vote-mobile-portrait.png b/screenshots/vote-mobile-portrait.png deleted file mode 100644 index b1932016b..000000000 Binary files a/screenshots/vote-mobile-portrait.png and /dev/null differ diff --git a/screenshots/vote.png b/screenshots/vote.png deleted file mode 100644 index 53cb13f8f..000000000 Binary files a/screenshots/vote.png and /dev/null differ diff --git a/src/js/components/Base/PollInformation.vue b/src/js/components/Base/PollInformation.vue index b20bac282..6c22627f5 100644 --- a/src/js/components/Base/PollInformation.vue +++ b/src/js/components/Base/PollInformation.vue @@ -23,7 +23,7 @@