diff options
author | René Gieling <github@dartcafe.de> | 2020-01-14 08:49:30 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-14 08:49:30 +0300 |
commit | c2ac05d1ac78425788926905c76048a67a89c2f7 (patch) | |
tree | e2c00a1b12512557f0d41cc5b344b7b169ae0a22 | |
parent | 051c461ac7941914752e4b1789f1c5d568cdb68d (diff) | |
parent | f452a4a4b5776fd55e5db56ecd7f1691243204ac (diff) |
Merge pull request #743 from nextcloud/fixes1.0-RC1v1.0-rc2
Fixes1.0 rc1
-rw-r--r-- | lib/Controller/PollController.php | 3 | ||||
-rw-r--r-- | lib/Cron/NotificationCron.php | 15 | ||||
-rw-r--r-- | lib/Db/Poll.php | 12 | ||||
-rw-r--r-- | src/js/components/Base/PollInformation.vue | 4 | ||||
-rw-r--r-- | src/js/components/Create/CreateDlg.vue | 1 | ||||
-rw-r--r-- | src/js/components/Navigation/Navigation.vue | 8 | ||||
-rw-r--r-- | src/js/components/Navigation/PollNavigationItems.vue | 8 | ||||
-rw-r--r-- | src/js/views/PublicVote.vue | 3 | ||||
-rw-r--r-- | src/js/views/Vote.vue | 20 | ||||
-rw-r--r-- | webpack.prod.js | 3 |
10 files changed, 34 insertions, 43 deletions
diff --git a/lib/Controller/PollController.php b/lib/Controller/PollController.php index 88122dfa..c3805ecf 100644 --- a/lib/Controller/PollController.php +++ b/lib/Controller/PollController.php @@ -50,6 +50,7 @@ class PollController extends Controller { private $userId; private $pollMapper; + private $optionMapper; private $trans; private $logger; private $groupManager; @@ -67,7 +68,7 @@ class PollController extends Controller { * @param ILogger $logger * @param IL10N $trans * @param PollMapper $pollMapper - * @param OptionsMapper $optionMapper + * @param OptionMapper $optionMapper * @param IGroupManager $groupManager * @param IUserManager $userManager * @param LogService $logService diff --git a/lib/Cron/NotificationCron.php b/lib/Cron/NotificationCron.php index 27a9677b..e5ddbe13 100644 --- a/lib/Cron/NotificationCron.php +++ b/lib/Cron/NotificationCron.php @@ -23,27 +23,20 @@ namespace OCA\Polls\Cron; -use Exception; - -use OCP\ILogger; -use OCP\BackgroundJob\TimedJob; - +use OC\BackgroundJob\TimedJob; use OCA\Polls\Service\MailService; class NotificationCron extends TimedJob { /** @var MailService*/ private $mailService; - private $logger; /** @param MailService $mailService */ public function __construct( - ILogger $logger, MailService $mailService ) { - $this->logger = $logger; - $this->setInterval(60); + $this->setInterval(5); $this->mailService = $mailService; } @@ -52,8 +45,6 @@ class NotificationCron extends TimedJob { * @param string $token */ protected function run($arguments) { - if ($this->mailService->sendNotifications()) { - $this->logger->debug('Notifications sent'); - } + $this->mailService->sendNotifications(); } } diff --git a/lib/Db/Poll.php b/lib/Db/Poll.php index fcddb625..92a6e66f 100644 --- a/lib/Db/Poll.php +++ b/lib/Db/Poll.php @@ -30,7 +30,7 @@ use JsonSerializable; use OCP\AppFramework\Db\Entity; /** - * @method integer getType() + * @method string getType() * @method void setType(string $value) * @method string getTitle() * @method void setTitle(string $value) @@ -38,9 +38,9 @@ use OCP\AppFramework\Db\Entity; * @method void setDescription(string $value) * @method string getOwner() * @method void setOwner(string $value) - * @method string getCreated() + * @method integer getCreated() * @method void setCreated(integer $value) - * @method string getExpire() + * @method integer getExpire() * @method void setExpire(integer $value) * @method integer getDeleted() * @method void setDeleted(integer $value) @@ -52,13 +52,13 @@ use OCP\AppFramework\Db\Entity; * @method void setFullAnonymous(integer $value) * @method integer getAllowMaybe() * @method void setAllowMaybe(integer $value) - * @method integer getOptions() + * @method string getOptions() * @method void setOptions(string $value) - * @method integer getSettings() + * @method string getSettings() * @method void setSettings(string $value) * @method integer getVoteLimit() * @method void setVoteLimit(integer $value) - * @method integer getShowResults() + * @method string getShowResults() * @method void setShowResults(string $value) * @method integer getAdminAccess() * @method void setAdminAccess(integer $value) diff --git a/src/js/components/Base/PollInformation.vue b/src/js/components/Base/PollInformation.vue index 330d731c..95227023 100644 --- a/src/js/components/Base/PollInformation.vue +++ b/src/js/components/Base/PollInformation.vue @@ -25,9 +25,9 @@ <UserBubble :user="poll.owner" :display-name="poll.owner" /> {{ t('polls', ' started this poll on %n. ', 1, moment.unix(poll.created).format('LLLL')) }} <span v-if="expired">{{ t('polls', 'Voting is no more possible, because this poll expired since %n', 1, moment.unix(poll.expire).format('LLLL')) }}</span> - <span v-if="!expired && poll.expire && acl.allowVote">{{ t('polls', 'You can place your vote until %n. ',1, moment.unix(poll.expire).format('LLLL')) }}</span> + <span v-if="!expired && poll.expire && acl.allowVote">{{ t('polls', 'You can place your vote until %n. ', 1, moment.unix(poll.expire).format('LLLL')) }}</span> <span v-if="poll.anonymous">{{ t('polls', 'The names of other participants are hidden, as this is an anonymous poll. ') }}</span> - <span>{{ t('polls', '%n voters participated in this poll until now.', 1, participants.length) }}</span> + <span>{{ n('polls', '%n person participated in this poll until now.', '%n persons participated in this poll until now.', participants.length) }}</span> </div> </template> diff --git a/src/js/components/Create/CreateDlg.vue b/src/js/components/Create/CreateDlg.vue index 4a9bd90c..3964dfa8 100644 --- a/src/js/components/Create/CreateDlg.vue +++ b/src/js/components/Create/CreateDlg.vue @@ -93,6 +93,7 @@ export default { this.setPollProperty({ type: this.type }) this.$store.dispatch('writePollPromise') .then(() => { + this.$store.dispatch('loadPolls') this.cancel() OC.Notification.showTemporary(t('polls', 'Poll "%n" added', 1, this.poll.title), { type: 'success' }) this.$router.push({ name: 'vote', params: { id: this.poll.id } }) diff --git a/src/js/components/Navigation/Navigation.vue b/src/js/components/Navigation/Navigation.vue index b951899d..dd267858 100644 --- a/src/js/components/Navigation/Navigation.vue +++ b/src/js/components/Navigation/Navigation.vue @@ -137,14 +137,6 @@ export default { this.refreshPolls() this.$router.push({ name: 'vote', params: { id: response.pollId } }) }) - - }, - pollIcon(pollType) { - if (pollType === 'datePoll') { - return 'icon-calendar' - } else { - return 'icon-toggle-filelist' - } }, switchDeleted(pollId) { diff --git a/src/js/components/Navigation/PollNavigationItems.vue b/src/js/components/Navigation/PollNavigationItems.vue index 26f9ddec..dd4ca532 100644 --- a/src/js/components/Navigation/PollNavigationItems.vue +++ b/src/js/components/Navigation/PollNavigationItems.vue @@ -59,7 +59,7 @@ export default { computed: { pollIcon() { if (this.poll.type === 'datePoll') { - return 'icon-calendar' + return 'icon-calendar-000' } else { return 'icon-toggle-filelist' } @@ -67,3 +67,9 @@ export default { } } </script> + +<style lang="scss"> +.icon-calendar-000 { + background-image: var(--icon-calendar-000); +} +</style> diff --git a/src/js/views/PublicVote.vue b/src/js/views/PublicVote.vue index 7520c2bc..707f72b1 100644 --- a/src/js/views/PublicVote.vue +++ b/src/js/views/PublicVote.vue @@ -82,7 +82,8 @@ export default { computed: { ...mapState({ - poll: state => state.poll + poll: state => state.poll, + acl: state => state.acl }), windowTitle: function() { diff --git a/src/js/views/Vote.vue b/src/js/views/Vote.vue index ca990fff..90fbc820 100644 --- a/src/js/views/Vote.vue +++ b/src/js/views/Vote.vue @@ -106,16 +106,6 @@ export default { watch: { $route() { this.loadPoll() - }, - - 'poll.id': function() { - this.$store.dispatch({ type: 'loadPoll', pollId: this.$route.params.id }) - .then(() => { - if (this.acl.allowEdit && moment.unix(this.poll.created).diff() > -10000) { - this.sideBarOpen = true - } - this.isLoading = false - }) } }, @@ -128,8 +118,16 @@ export default { this.isLoading = false this.$store.dispatch({ type: 'loadPollMain', pollId: this.$route.params.id }) .then(() => { + this.$store.dispatch({ type: 'loadPoll', pollId: this.$route.params.id }) + .then(() => { + if (this.acl.allowEdit && moment.unix(this.poll.created).diff() > -10000) { + this.sideBarOpen = true + } + this.isLoading = false + }) }) - .catch(() => { + .catch((error) => { + console.error(error) this.isLoading = false }) }, diff --git a/webpack.prod.js b/webpack.prod.js index 184715d3..f5295256 100644 --- a/webpack.prod.js +++ b/webpack.prod.js @@ -2,5 +2,6 @@ const merge = require('webpack-merge') const common = require('./webpack.common.js') module.exports = merge(common, { - mode: 'production' + mode: 'production', + devtool: 'source-map' }) |