Skip to content

Commit

Permalink
Merge pull request #5630 from nextcloud/enh/interactive-widget
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusknorr authored Mar 6, 2024
2 parents 044706f + 213c8c5 commit fb33f90
Show file tree
Hide file tree
Showing 24 changed files with 1,341 additions and 1,615 deletions.
2,701 changes: 1,174 additions & 1,527 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"@babel/runtime": "^7.24.0",
"@nextcloud/auth": "^2.2.1",
"@nextcloud/axios": "^2.4.0",
"@nextcloud/capabilities": "^1.1.0",
"@nextcloud/dialogs": "^4.2.6",
"@nextcloud/event-bus": "^3.1.0",
"@nextcloud/files": "^3.1.0",
Expand Down
38 changes: 19 additions & 19 deletions src/components/Controls.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,32 +78,32 @@
required
@focus="$store.dispatch('toggleShortcutLock', true)"
@blur="$store.dispatch('toggleShortcutLock', false)">
<input v-tooltip="t('deck', 'Add list')"
<input :title="t('deck', 'Add list')"
class="icon-confirm"
type="submit"
value="">
</form>
</div>
<div v-if="board" class="board-action-buttons">
<div class="board-action-buttons__filter">
<NcPopover container=".board-action-buttons__filter"
:placement="'bottom-end'"
<NcPopover :placement="'bottom-end'"
:aria-label="t('deck', 'Active filters')"
:name="t('deck', 'Active filters')"
:tooltip="t('deck', 'Active filters')"
@show="filterVisible=true"
@hide="filterVisible=false">
<!-- We cannot use NcActions here are the popover trigger does not update on reactive icons -->
<NcButton slot="trigger"
ref="filterPopover"
:name="t('deck', 'Apply filter')"
class="filter-button"
:type="isFilterActive ? 'primary' : 'tertiary'">
<template #icon>
<FilterIcon v-if="isFilterActive" :size="20" decorative />
<FilterOffIcon v-else :size="20" decorative />
</template>
</NcButton>
<template #trigger>
<NcButton ref="filterPopover"
:title="t('deck', 'Apply filter')"
:aria-label="t('deck', 'Apply filter')"
class="filter-button"
:type="isFilterActive ? 'primary' : 'tertiary'">
<template #icon>
<FilterIcon v-if="isFilterActive" :size="20" decorative />
<FilterOffIcon v-else :size="20" decorative />
</template>
</NcButton>
</template>

<div v-if="filterVisible" class="filter">
<h3>{{ t('deck', 'Filter by tag') }}</h3>
Expand Down Expand Up @@ -228,7 +228,7 @@
</NcActionButton>
</NcActions>
<!-- FIXME: NcActionRouter currently doesn't work as an inline action -->
<NcActions>
<NcActions v-if="isFullApp">
<NcActionButton icon="icon-menu-sidebar"
:aria-label="t('deck', 'Open details')"
:name="t('deck', 'Details')"
Expand Down Expand Up @@ -306,6 +306,7 @@ export default {
'canManage',
]),
...mapState({
isFullApp: state => state.isFullApp,
compactMode: state => state.compactMode,
showCardCover: state => state.showCardCover,
searchQuery: state => state.searchQuery,
Expand Down Expand Up @@ -412,6 +413,9 @@ export default {
this.showAddCardModal = false
},
setPageTitle(title) {
if (!this.isFullApp) {
return
}
if (this.defaultPageTitle === false) {
this.defaultPageTitle = window.document.title
if (this.defaultPageTitle.indexOf(' - Deck - ') !== -1) {
Expand Down Expand Up @@ -559,8 +563,4 @@ export default {
.popover:focus {
outline: 2px solid var(--color-main-text);
}
.tooltip-inner.popover-inner {
text-align: left;
}
</style>
7 changes: 2 additions & 5 deletions src/components/SessionList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* -->

<template>
<div v-tooltip.bottom="t('text', 'Currently present people')"
<div :title="t('text', 'Currently present people')"
class="avatar-list">
<div v-for="session in sessionsVisible"
:key="session.uid"
Expand All @@ -37,16 +37,13 @@
</template>

<script>
import { NcAvatar, Tooltip } from '@nextcloud/vue'
import { NcAvatar } from '@nextcloud/vue'
export default {
name: 'SessionList',
components: {
NcAvatar,
},
directives: {
tooltip: Tooltip,
},
props: {
sessions: {
type: Array,
Expand Down
24 changes: 20 additions & 4 deletions src/components/board/Board.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
class="no-close"
:placeholder="t('deck', 'List name')"
required>
<input v-tooltip="t('deck', 'Add list')"
<input title="t('deck', 'Add list')"
class="icon-confirm"
type="submit"
value="">
Expand Down Expand Up @@ -81,7 +81,16 @@
</Container>
</div>
</transition>
<GlobalSearchResults />
<GlobalSearchResults v-if="isFullApp" />
<NcModal v-if="localModal"
:clear-view-delay="0"
:close-button-contained="true"
size="large"
@close="localModal = null">
<div class="modal__content modal__card">
<CardSidebar :id="localModal" @close="localModal = null" />
</div>
</NcModal>
</div>
</template>

Expand All @@ -91,11 +100,11 @@ import { mapState, mapGetters } from 'vuex'
import Controls from '../Controls.vue'
import DeckIcon from '../icons/DeckIcon.vue'
import Stack from './Stack.vue'
import { NcEmptyContent } from '@nextcloud/vue'
import { NcEmptyContent, NcModal } from '@nextcloud/vue'
import GlobalSearchResults from '../search/GlobalSearchResults.vue'
import { showError } from '../../helpers/errors.js'
import { createSession } from '../../sessions.js'
import CardSidebar from '../card/CardSidebar.vue'
export default {
name: 'Board',
components: {
Expand All @@ -106,6 +115,8 @@ export default {
Draggable,
Stack,
NcEmptyContent,
NcModal,
CardSidebar,
},
inject: [
'boardApi',
Expand All @@ -123,10 +134,12 @@ export default {
newStackTitle: '',
currentScrollPosX: null,
currentMousePosX: null,
localModal: null,
}
},
computed: {
...mapState({
isFullApp: state => state.isFullApp,
board: state => state.currentBoard,
showArchived: state => state.showArchived,
}),
Expand Down Expand Up @@ -155,6 +168,9 @@ export default {
created() {
this.session = createSession(this.id)
this.fetchData()
this.$root.$on('open-card', (cardId) => {
this.localModal = cardId
})
},
beforeDestroy() {
this.session.close()
Expand Down
4 changes: 2 additions & 2 deletions src/components/board/SharingTabSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
class="shareWithList">
<li>
<NcAvatar :user="board.owner.uid" />
<span class="has-tooltip username">
<span class="username">
{{ board.owner.displayname }}
<span v-if="!isCurrentUser(board.owner.uid)" class="board-owner-label">
{{ t('deck', 'Board owner') }}
Expand All @@ -35,7 +35,7 @@
<NcAvatar v-if="acl.type===0" :user="acl.participant.uid" />
<div v-if="acl.type===1" class="avatardiv icon icon-group" />
<div v-if="acl.type===7" class="avatardiv icon icon-circles" />
<span class="has-tooltip username">
<span class="username">
{{ acl.participant.displayname }}
<span v-if="acl.type===1">{{ t('deck', '(Group)') }}</span>
<span v-if="acl.type===7">{{ t('deck', '(Team)') }}</span>
Expand Down
4 changes: 2 additions & 2 deletions src/components/board/Stack.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
{{ stack.title }}
</h3>
<h3 v-else-if="!editing"
v-tooltip="stack.title"
title="stack.title"
dir="auto"
tabindex="0"
:aria-label="stack.title"
Expand All @@ -51,7 +51,7 @@
dir="auto"
type="text"
required="required">
<input v-tooltip="t('deck', 'Edit list title')"
<input title="t('deck', 'Edit list title')"
class="icon-confirm"
type="submit"
value="">
Expand Down
15 changes: 9 additions & 6 deletions src/components/board/TagsTabSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,21 @@
<div :style="{ backgroundColor: '#' + editingLabel.color }" class="color0 icon-colorpicker" />
</NcColorPicker>
<input v-model="editingLabel.title" type="text">
<input v-tooltip="{content: missingDataLabel, show: !editLabelObjValidated, trigger: 'manual' }"
:disabled="!editLabelObjValidated"
<input :disabled="!editLabelObjValidated"
type="submit"
value=""
class="icon-confirm">
<NcActions>
<NcActionButton v-tooltip="{content: missingDataLabel, show: !editLabelObjValidated, trigger: 'manual' }"
:disabled="!editLabelObjValidated"
<NcActionButton :disabled="!editLabelObjValidated"
icon="icon-close"
@click="editingLabelId = null">
{{ t('deck', 'Cancel') }}
</NcActionButton>
</NcActions>
</form>
<p v-if="!editLabelObjValidated">
{{ missingDataLabel }}
</p>
</template>
<template v-else>
<div v-if="canManage && !isArchived" class="label-title" @click="clickEdit(label)">
Expand Down Expand Up @@ -58,8 +59,7 @@
<div :style="{ backgroundColor: '#' + addLabelObj.color }" class="color0 icon-colorpicker" />
</NcColorPicker>
<input v-model="addLabelObj.title" type="text">
<input v-tooltip="{content: missingDataLabel, show: !addLabelObjValidated, trigger: 'manual' }"
:disabled="!addLabelObjValidated"
<input :disabled="!addLabelObjValidated"
type="submit"
value=""
class="icon-confirm">
Expand All @@ -69,6 +69,9 @@
</NcActionButton>
</NcActions>
</form>
<p v-if="!addLabelObjValidated">
{{ missingDataLabel }}
</p>
</li>
<button v-if="canManage && !isArchived" @click="clickShowAddLabel()">
<span class="icon-add" />{{ t('deck', 'Add a new tag') }}
Expand Down
2 changes: 1 addition & 1 deletion src/components/boards/BoardItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
:user="user.participant.uid"
:display-name="user.participant.displayname"
class="board-list-avatar" />
<div v-if="board.acl.length > 5" v-tooltip="otherAcl" class="avatardiv popovermenu-wrapper board-list-avatar icon-more" />
<div v-if="board.acl.length > 5" :title="otherAcl" class="avatardiv popovermenu-wrapper board-list-avatar icon-more" />
</div>
<div class="board-list-actions-cell" />
</router-link>
Expand Down
11 changes: 7 additions & 4 deletions src/components/card/CardSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
@submit-title="handleSubmitTitle"
@close="closeSidebar">
<template #secondary-actions>
<NcActionButton v-if="cardDetailsInModal" icon="icon-menu-sidebar" @click.stop="closeModal()">
<NcActionButton v-if="cardDetailsInModal && isFullApp" icon="icon-menu-sidebar" @click.stop="closeModal()">
{{ t('deck', 'Open in sidebar view') }}
</NcActionButton>
<NcActionButton v-else icon="icon-external" @click.stop="showModal()">
<NcActionButton v-else-if="isFullApp" icon="icon-external" @click.stop="showModal()">
{{ t('deck', 'Open in bigger view') }}
</NcActionButton>

Expand Down Expand Up @@ -83,6 +83,7 @@

<script>
import { NcActionButton, NcAppSidebar, NcAppSidebarTab } from '@nextcloud/vue'
import { getCapabilities } from '@nextcloud/capabilities'
import { mapState, mapGetters } from 'vuex'
import CardSidebarTabDetails from './CardSidebarTabDetails.vue'
import CardSidebarTabAttachments from './CardSidebarTabAttachments.vue'
Expand All @@ -99,7 +100,7 @@ import { showError } from '@nextcloud/dialogs'
import { getLocale } from '@nextcloud/l10n'
import CardMenuEntries from '../cards/CardMenuEntries.vue'
const capabilities = window.OC.getCapabilities()
const capabilities = getCapabilities()
export default {
name: 'CardSidebar',
Expand Down Expand Up @@ -144,6 +145,7 @@ export default {
},
computed: {
...mapState({
isFullApp: state => state.isFullApp,
currentBoard: state => state.currentBoard,
}),
...mapGetters(['canEdit', 'assignables', 'cardActions', 'stackById']),
Expand Down Expand Up @@ -188,7 +190,8 @@ export default {
},
closeSidebar() {
this.$router.push({ name: 'board' })
this.$router?.push({ name: 'board' })
this.$emit('close')
},
showModal() {
Expand Down
2 changes: 1 addition & 1 deletion src/components/card/CardSidebarTabComments.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div>
<div class="comment--header">
<NcAvatar :user="currentUser.uid" />
<span class="has-tooltip username">
<span class="username">
{{ currentUser.displayName }}
</span>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/card/CommentForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
@blur="error = null"
@input="validate()" />
</At>
<input v-tooltip="t('deck', 'Save')"
<input :title="t('deck', 'Save')"
class="icon-confirm"
type="submit"
value=""
Expand Down
2 changes: 1 addition & 1 deletion src/components/card/CommentItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<li v-else class="comment">
<div class="comment--header">
<NcAvatar :user="comment.actorId" />
<span class="has-tooltip username">
<span class="username">
{{ comment.actorDisplayName }}
</span>
<NcActions v-show="!edit" :force-menu="true">
Expand Down
2 changes: 1 addition & 1 deletion src/components/card/Description.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<span v-if="descriptionLastEdit && !descriptionSaving">{{ t('deck', '(Unsaved)') }}</span>
<span v-if="descriptionSaving">{{ t('deck', '(Saving…)') }}</span>
<a v-if="!textAppAvailable"
v-tooltip="t('deck', 'Formatting help')"
:title="t('deck', 'Formatting help')"
href="https://deck.readthedocs.io/en/latest/Markdown/"
target="_blank"
class="icon icon-info" />
Expand Down
5 changes: 1 addition & 4 deletions src/components/cards/AvatarList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
</template>

<script>
import { NcAvatar, NcPopover, Tooltip } from '@nextcloud/vue'
import { NcAvatar, NcPopover } from '@nextcloud/vue'
import { generateUrl } from '@nextcloud/router'
import AccountMultiple from 'vue-material-design-icons/AccountMultiple.vue'
Expand All @@ -96,9 +96,6 @@ export default {
NcPopover,
AccountMultiple,
},
directives: {
tooltip: Tooltip,
},
props: {
users: {
type: Array,
Expand Down
2 changes: 1 addition & 1 deletion src/components/cards/CardBadges.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<CardId v-if="idBadge" class="icon-badge" :card="card" />

<div v-if="card.commentsCount > 0"
v-tooltip="commentsHint"
:title="commentsHint"
class="icon-badge"
@click.stop="openComments">
<CommentUnreadIcon v-if="card.commentsUnread > 0" :size="16" />
Expand Down
Loading

0 comments on commit fb33f90

Please sign in to comment.