Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes Round 1 #3632

Merged
merged 23 commits into from
Aug 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion REUSE.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ SPDX-FileCopyrightText = "none"
SPDX-License-Identifier = "CC0-1.0"

[[annotations]]
path = ["l10n/**.js", "l10n/**.json", "js/**.js.map", "js/**.js", "js/**.mjs", "js/**.mjs.map", "js/templates/**.handlebars", "emptyTemplates/**", "jsconfig.json", "img/app.svg", "img/polls.svg", "img/polls-dark.svg", "src/js/assets/icons/loading-small.gif", "src/js/assets/icons/maybe-vote.svg", "src/js/assets/icons/no-vote.svg", "src/js/assets/icons/spinner.svg", "src/js/assets/icons/yes-vote.svg"]
path = ["l10n/**.js", "l10n/**.json", "js/**.js.map", "js/**.js", "js/**.mjs", "js/**.mjs.map", "js/templates/**.handlebars", "emptyTemplates/**", "jsconfig.json", "img/app.svg", "img/polls.svg", "img/polls-dark.svg", "src/assets/icons/maybe-vote.svg", "src/assets/icons/no-vote.svg", "src/assets/icons/spinner.svg", "src/assets/icons/yes-vote.svg"]
precedence = "aggregate"
SPDX-FileCopyrightText = "2016 Nextcloud contributors"
SPDX-License-Identifier = "AGPL-3.0-or-later"
Expand Down
2 changes: 2 additions & 0 deletions appinfo/info.xml.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SPDX-FileCopyrightText: 2016 Nextcloud contributors
SPDX-License-Identifier: AGPL-3.0-or-later
1 change: 1 addition & 0 deletions lib/Db/Share.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ public function jsonSerialize(): array {
'invitationSent' => boolval($this->getInvitationSent()),
'reminderSent' => boolval($this->getReminderSent()),
'locked' => boolval($this->getDeleted() ? 0 : $this->getLocked()),
'displayName' => $this->getDisplayName(),
'label' => $this->getLabel(),
'URL' => $this->getURL(),
'publicPollEmail' => $this->getPublicPollEmail(),
Expand Down
1,275 changes: 677 additions & 598 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"stylelint:fix": "stylelint src --fix",
"version": "node update-app-version.mjs && git add ./appinfo/info.xml",
"build": "vite --mode production build",
"dev": "vite --mode development build",
"watch": "vite --mode development build --watch"
"dev": "set NODE_ENV=production && vite --mode development build",
"watch": "set NODE_ENV=production && vite --mode development build --watch"
},
"browserslist": [
"extends @nextcloud/browserslist-config"
Expand Down
7 changes: 5 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,16 @@
const loading = ref(false)

const appClass = computed(() => [
transitionClass, {
transitionClass.value, {
edit: pollStore.permissions.edit,
},
])

const useNavigation = computed(() => sessionStore.userStatus.isLoggedin)
const useSidebar = computed(() => pollStore.permissions.edit || pollStore.permissions.edit || sessionStore.route.name === 'combo')
const useSidebar = computed(() => pollStore.permissions.edit
|| pollStore.permissions.comment
|| sessionStore.route.name === 'combo'
)

/**
* Turn off transitions
Expand Down
11 changes: 10 additions & 1 deletion src/Types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
export { Activity, Activities } from '../stores/activity.ts'
export { UpdateType, Group, AppSettings } from '../stores/appSettings.ts'
export { Subscription } from '../stores/subscription.ts'
export { Combo, Participant } from '../stores/combo.ts'
export { Combo } from '../stores/combo.ts'
export { Comment, Comments, CommentsGrouped } from '../stores/comments.ts'
export { Poll, PollType, AccessType, ShowResults, AllowProposals, PollConfiguration, PollStatus, PollPermissions, CurrentUserStatus } from '../stores/poll.ts'
export { SortType, FilterType, PollCategory, Meta, PollList } from '../stores/polls.ts'
Expand All @@ -23,6 +23,7 @@ export enum StatusResults {
Success = 'success',
Loading = 'loading',
Loaded = 'loaded',
Unchanged = 'unchanged',
}

export enum SignalingType {
Expand Down Expand Up @@ -95,3 +96,11 @@ export type User = {
timeZone: string
categories: string[]
}

export type Participant = {
userId: string
displayName: string
pollId: number
user: User
}

14 changes: 13 additions & 1 deletion src/assets/scss/hacks.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,19 @@
*/
// some hacks, do alter the display of third parity components

// raltive position to be able to get sticky toolbar
// FIXME: remove this hack after the issue is fixed
.avatardiv .material-design-icon {
width: var(--size);
height: var(--size);
}

// h2 in notecard gets a margin-top of -6px instead of 24px for better alignment
.notecard h2 {
margin-top: -6px;
}


// relative position to be able to get sticky toolbar
.app-content {
position: relative !important;
}
Expand Down
20 changes: 11 additions & 9 deletions src/assets/scss/transitions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,22 @@
transition: all 0.5s ease;
}

.list-enter,
.list-enter-from,
.list-leave-to {
opacity: 0;
}

.list-move {
transition: transform 0.5s;
}

.fade-leave-active .fade-enter-active{
transition: opacity 0.5s;
transition: transform 0.5s ease;
}
}

.fade-enter, .fade-leave-to {
opacity: 0;
}
.v-enter-active,
.v-leave-active {
transition: opacity 0.5s ease;
}

.v-enter-from,
.v-leave-to {
opacity: 0;
}
2 changes: 1 addition & 1 deletion src/components/Actions/modules/ActionDelete.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
-->

<script setup lang="ts">
import { defineProps, defineEmits, ref, computed } from 'vue'
import { ref, computed } from 'vue'
import { NcButton } from '@nextcloud/vue'
import DeleteIcon from 'vue-material-design-icons/Delete.vue'
import RestoreIcon from 'vue-material-design-icons/Recycle.vue'
Expand Down
2 changes: 1 addition & 1 deletion src/components/Actions/modules/ActionSendConfirmed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<script setup lang="ts">
import { useRoute } from 'vue-router'
import { defineEmits, ref } from 'vue'
import { ref } from 'vue'
import { NcButton, NcModal } from '@nextcloud/vue'
import EmailCheckIcon from 'vue-material-design-icons/EmailCheck.vue' // view-comfy-outline
import { PollsAPI } from '../../../Api/index.js'
Expand Down
2 changes: 1 addition & 1 deletion src/components/Activity/Activities.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</script>

<template>
<TransitionGroup name="fade"
<TransitionGroup name="list"
class="activities"
tag="ul">
<ActivityItem v-for="(item) in activityStore.list"
Expand Down
2 changes: 1 addition & 1 deletion src/components/Activity/ActivityItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
-->

<script setup lang="ts">
import { computed, defineProps } from 'vue'
import { computed } from 'vue'
import moment from '@nextcloud/moment'
import { NcUserBubble, NcRichText } from '@nextcloud/vue'
import { GuestBubble, SimpleLink } from '../../helpers/index.ts'
Expand Down
2 changes: 0 additions & 2 deletions src/components/AppIcons/modules/MaybeIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
-->

<script setup lang="ts">
import { defineProps } from 'vue'

const props = defineProps(
{
title: {
Expand Down
1 change: 0 additions & 1 deletion src/components/AppIcons/modules/PollsAppIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
-->

<script setup lang="ts">
import { defineProps } from 'vue'

const props = defineProps(
{
Expand Down
1 change: 0 additions & 1 deletion src/components/AppIcons/modules/Spinner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
- SPDX-License-Identifier: AGPL-3.0-or-later
-->
<script setup lang="ts">
import { defineProps } from 'vue'

const props = defineProps(
{
Expand Down
2 changes: 0 additions & 2 deletions src/components/Base/modules/BadgeDiv.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
-->

<script setup lang="ts">
import { defineProps } from 'vue'

defineProps({
tag: {
type: String,
Expand Down
1 change: 0 additions & 1 deletion src/components/Base/modules/ConfigBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
-->

<script setup lang="ts">
import { defineProps } from 'vue'
import InformationIcon from 'vue-material-design-icons/InformationVariant.vue'

defineProps({
Expand Down
1 change: 0 additions & 1 deletion src/components/Base/modules/FlexSpacer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
-->

<script setup lang="ts">
import { defineProps } from 'vue'

const props = defineProps({
tag: {
Expand Down
14 changes: 7 additions & 7 deletions src/components/Base/modules/InputDiv.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
-->

<script setup lang="ts">
import { computed, onMounted, defineModel, PropType } from 'vue'
import { computed, onMounted, PropType } from 'vue'
import PlusIcon from 'vue-material-design-icons/Plus.vue'
import MinusIcon from 'vue-material-design-icons/Minus.vue'
import ArrowRightIcon from 'vue-material-design-icons/ArrowRight.vue'
Expand Down Expand Up @@ -150,7 +150,7 @@

if (model.value !== nextValue) {
model.value = nextValue
emit('change')
emit('submit')
}
}

Expand All @@ -163,7 +163,7 @@

if (model.value !== nextValue) {
model.value = nextValue
emit('change')
emit('submit')
}
}

Expand All @@ -188,14 +188,14 @@
:inputmode="inputmode"
:placeholder="placeholder"
:class="[{ 'has-modifier': useNumModifiers, 'has-submit': submit }, computedSignalingClass]"
@input="$emit('input')"
@change="$emit('change')"
@keyup.enter="$emit('change')">
@input="emit('input')"
@change="emit('change')"
@keyup.enter="emit('submit')">

<Spinner v-if="checking" class="signaling-icon spinner" />
<AlertIcon v-else-if="error" class="signaling-icon error" />
<CheckIcon v-else-if="success" class="signaling-icon success" />
<ArrowRightIcon v-else-if="showSubmit" class="signaling-icon submit" @click="$emit('change')" />
<ArrowRightIcon v-else-if="showSubmit" class="signaling-icon submit" @click="emit('change')" />
<MinusIcon v-if="useNumModifiers" class="modifier subtract" @click="subtract()" />
<PlusIcon v-if="useNumModifiers" class="modifier add" @click="add()" />
</div>
Expand Down
2 changes: 2 additions & 0 deletions src/components/Base/modules/IntersectionObserver.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
const observer = ref(null)

const observerTarget = ref<Element>(null)
const emit = defineEmits(['visible'])

onMounted(() => {
const observer = new IntersectionObserver((entries) => {
entries.forEach((entry) => {
if (entry.isIntersecting) {
inViewport.value = true
emit('visible')
} else {
inViewport.value = false
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Base/modules/RadioGroupDiv.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
-->

<script setup lang="ts">
import { computed, defineEmits, defineModel, defineProps, PropType } from 'vue'
import { computed, PropType } from 'vue'
import { NcCheckboxRadioSwitch } from '@nextcloud/vue'

export type CheckboxOption = {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Calendar/CalendarInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<script setup lang="ts">
import moment from '@nextcloud/moment'
import { computed, defineProps, PropType } from 'vue'
import { computed, PropType } from 'vue'
import { Option } from '../../Types/index.ts'

const props = defineProps(
Expand Down
2 changes: 1 addition & 1 deletion src/components/Calendar/CalendarPeek.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<script setup lang="ts">

import { computed, defineProps, onMounted, ref, PropType } from 'vue'
import { computed, onMounted, ref, PropType } from 'vue'
import orderBy from 'lodash/orderBy'
import { NcPopover } from '@nextcloud/vue'
import moment from '@nextcloud/moment'
Expand Down
18 changes: 9 additions & 9 deletions src/components/Cards/VoteInfoCards.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@
</script>

<template>
<div class="info-section">
<CardUnpublishedPoll v-if="showUnpublishedPollCard" />
<CardAddProposals v-if="showAddProposalsCard" />
<CardLimitedVotes v-if="showLimitCard" />
<CardClosedPoll v-if="showClosedCard" />
<CardSendConfirmations v-if="showSendConfirmationsCard" />
<CardLocked v-if="pollStore.currentUserStatus.isLocked" />
<CardRegister v-if="showRegisterCard" />
</div>
<TransitionGroup class="info-section">
<CardUnpublishedPoll v-if="showUnpublishedPollCard" :key="0" />
<CardAddProposals v-if="showAddProposalsCard" :key="1" />
<CardLimitedVotes v-if="showLimitCard" :key="2" />
<CardClosedPoll v-if="showClosedCard" :key="3" />
<CardSendConfirmations v-if="showSendConfirmationsCard" :key="4" />
<CardLocked v-if="pollStore.currentUserStatus.isLocked" :key="5" />
<CardRegister v-if="showRegisterCard" :key="6" />
</TransitionGroup>
</template>

2 changes: 1 addition & 1 deletion src/components/Cards/modules/CardSendConfirmations.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
-->

<script setup lang="ts">
import { defineEmits, ref } from 'vue'
import { ref } from 'vue'
import { CardDiv } from '../../Base/index.js'
import ActionSendConfirmed from '../../Actions/modules/ActionSendConfirmed.vue'
import { t } from '@nextcloud/l10n'
Expand Down
2 changes: 1 addition & 1 deletion src/components/Combo/ComboTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
-->

<script setup lang="ts">
import { defineProps, PropType } from 'vue'
import { PropType } from 'vue'
import VoteColumn from './VoteColumn.vue'
import UserItem from '../User/UserItem.vue'
import { useComboStore } from '../../stores/combo.ts'
Expand Down
2 changes: 1 addition & 1 deletion src/components/Combo/VoteColumn.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</template>

<script setup lang="ts">
import { defineProps, PropType } from 'vue'
import { PropType } from 'vue'
import VoteItem from './VoteItem.vue'
import OptionItem from '../Options/OptionItem.vue'
import { useComboStore } from '../../stores/combo.ts'
Expand Down
2 changes: 1 addition & 1 deletion src/components/Combo/VoteItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<script setup lang="ts">
import VoteIndicator from '../VoteTable/VoteIndicator.vue'
import { useComboStore } from '../../stores/combo.ts'
import { computed, defineProps, PropType } from 'vue'
import { computed, PropType } from 'vue'
import { Option, Poll, Answer, User } from '../../Types/index.ts'

const comboStore = useComboStore()
Expand Down
1 change: 1 addition & 0 deletions src/components/Comments/CommentAdd.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
class="comment-add__input"
:placeholder="t('polls', 'New comment …')"
submit
@submit="writeComment()"
@change="writeComment()" />
</div>
</template>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Comments/CommentItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
-->

<script setup lang="ts">
import { computed, defineProps, PropType } from 'vue'
import { computed, PropType } from 'vue'
import moment from '@nextcloud/moment'
import linkifyStr from 'linkify-string'
import { showError } from '@nextcloud/dialogs'
Expand Down
4 changes: 2 additions & 2 deletions src/components/Comments/Comments.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
</script>

<template>
<TransitionGroup is="ul"
name="fade"
<TransitionGroup tag="ul"
name="list"
:class="['comments' , { 'alternativestyle': preferencesStore.user.useCommentsAlternativeStyling }]"
:style="cssVar">
<CommentItem v-for="(comment) in commentsStore.groupedComments"
Expand Down
Loading