Skip to content

Commit

Permalink
Merge pull request #3525 from nextcloud/small-fixes-and-code-maintenance
Browse files Browse the repository at this point in the history
fix closing and tidy
  • Loading branch information
dartcafe committed May 26, 2024
2 parents f4c3eac + 4540e5c commit 68d7ecc
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 22 deletions.
4 changes: 0 additions & 4 deletions src/js/components/Base/modules/ConfigBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,6 @@ export default {
display: flex;
flex-direction: column;
padding-left: 24px;
// label {
// margin: 4px 0;
// }
}
}
Expand Down
14 changes: 9 additions & 5 deletions src/js/components/Configuration/ConfigClosing.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

<template>
<div>
<NcButton @click="toggleClosed()">
<NcButton @click="clickToggleClosed()">
<template #icon>
<OpenPollIcon v-if="isPollClosed" />
<ClosePollIcon v-else />
Expand All @@ -39,7 +39,7 @@
</template>

<script>
import { mapState, mapGetters } from 'vuex'
import { mapState, mapGetters, mapActions } from 'vuex'
import moment from '@nextcloud/moment'
import { NcButton, NcDateTimePicker, NcCheckboxRadioSwitch } from '@nextcloud/vue'
import OpenPollIcon from 'vue-material-design-icons/LockOpenVariant.vue'
Expand Down Expand Up @@ -113,11 +113,15 @@ export default {
},
methods: {
toggleClosed() {
...mapActions({
closePoll: 'poll/close',
reopenPoll: 'poll/reopen',
}),
clickToggleClosed() {
if (this.isPollClosed) {
this.$store.dispatch('poll/reopen')
this.reopenPoll()
} else {
this.$store.dispatch('poll/close')
this.closePoll()
}
},
},
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 @@ -155,7 +155,6 @@ export default {
&:hover {
background-color: var(--color-background-dark);
// box-shadow: 3px 3px 9px var(--color-background-darker);
}
&.locked:hover {
Expand Down
1 change: 0 additions & 1 deletion src/js/components/VoteTable/VoteTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ export default {
justify-content: center;
.user-actions {
// display: none;
visibility: hidden;
}
Expand Down
8 changes: 0 additions & 8 deletions src/js/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,6 @@ import SideBarCombo from './views/SideBarCombo.vue'
import Navigation from './views/Navigation.vue'
import Combo from './views/Combo.vue'

// Dynamic loading
// const List = () => import('./views/PollList.vue')
// const Administration = () => import('./views/Administration.vue')
// const NotFound = () => import('./views/NotFound.vue')
// const SideBarCombo = () => import('./views/SideBarCombo.vue')
// const Navigation = () => import('./views/Navigation.vue')
// const Combo = () => import('./views/Combo.vue')

Vue.use(Router)

/**
Expand Down
3 changes: 2 additions & 1 deletion src/js/store/modules/acl.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ const actions = {
} else {
response = await UserSettingsAPI.getAcl()
}
// context.commit('reset')
context.commit('set', { acl: response.data.acl })
} catch (error) {
if (error?.code === 'ERR_CANCELED') return
Expand All @@ -94,7 +93,9 @@ const actions = {
// TODO: for some reason unauthorized users first get the root route resulting in a 401
// and after that the publicVote route is called as next route
// therefore we just debug the error and reset the acl

Logger.debug('getAcl failed', error)
context.commit('reset')
} else {
throw error
}
Expand Down
2 changes: 1 addition & 1 deletion src/js/store/modules/appSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const actions = {
const response = await AppSettingsAPI.getAppSettings()
context.commit('set', response.data.appSettings)
} catch (error) {
// context.commit('reset')
Logger.debug('Error getting appSettings', { error })
}
},

Expand Down
2 changes: 1 addition & 1 deletion src/js/store/modules/poll.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ const getters = {
isProposalExpired: (state, getters) => getters.isProposalAllowed && state.configuration.proposalsExpire && moment.unix(state.configuration.proposalsExpire).diff() < 0,
isProposalExpirySet: (state, getters) => getters.isProposalAllowed && state.configuration.proposalsExpire,
proposalsExpireRelative: (state) => moment.unix(state.configuration.proposalsExpire).fromNow(),
isClosed: (state) => (state.expire > 0 && moment.unix(state.expire).diff() < 1000),
isClosed: (state) => (state.configuration.expire > 0 && moment.unix(state.configuration.expire).diff() < 1000),
getSafeTable: (state, getters, rootState) => !state.revealParticipants && getters.countCells > rootState.settings.user.performanceThreshold,
countParticipants: (state, getters) => getters.participants.length,
countHiddenParticipants: (state, getters) => getters.participants.length - getters.safeParticipants.length,
Expand Down
1 change: 1 addition & 0 deletions src/js/views/Dashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ export default {
showError(t('polls', 'Error loading poll list'))
})
},
methods: {
...mapActions({
loadPolls: 'polls/list',
Expand Down

0 comments on commit 68d7ecc

Please sign in to comment.