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

Move navigation to @nextcloud/vue components #1944

Merged
merged 4 commits into from
May 29, 2020
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 src/components/Controls.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</p>
</div>
<div v-if="board" class="board-actions">
<div v-if="canManage && !showArchived"
<div v-if="canManage && !showArchived && !board.archived"
id="stack-add"
v-click-outside="hideAddStack">
<Actions v-if="!isAddStackVisible" :title="t('deck', 'Add new list')">
Expand Down
7 changes: 4 additions & 3 deletions src/components/board/Stack.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<div class="stack">
<div v-click-outside="stopCardCreation" class="stack--header">
<transition name="fade" mode="out-in">
<h3 v-if="!canManage">
<h3 v-if="!canManage || isArchived">
{{ stack.title }}
</h3>
<h3 v-else-if="!editing"
Expand All @@ -42,12 +42,12 @@
value="">
</form>
</transition>
<Actions v-if="canManage" :force-menu="true">
<Actions v-if="canManage && !isArchived" :force-menu="true">
<ActionButton icon="icon-delete" @click="deleteStack(stack)">
{{ t('deck', 'Delete list') }}
</ActionButton>
</Actions>
<Actions v-if="canEdit && !showArchived">
<Actions v-if="canEdit && !showArchived && !isArchived">
<ActionButton icon="icon-add" @click.stop="showAddCard=true">
{{ t('deck', 'Add card') }}
</ActionButton>
Expand Down Expand Up @@ -133,6 +133,7 @@ export default {
...mapGetters([
'canManage',
'canEdit',
'isArchived',
]),
...mapState({
showArchived: state => state.showArchived,
Expand Down
7 changes: 4 additions & 3 deletions src/components/board/TagsTabSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
<div :style="{ backgroundColor: `#${label.color}`, color:textColor(label.color) }" class="label-title">
<span>{{ label.title }}</span>
</div>
<button v-if="canManage"
<button v-if="canManage && !isArchived"
v-tooltip="t('deck', 'Edit')"
class="icon-rename"
@click="clickEdit(label)" />
<button v-if="canManage"
<button v-if="canManage && !isArchived"
v-tooltip="t('deck', 'Delete')"
class="icon-delete"
@click="deleteLabel(label.id)" />
Expand All @@ -55,7 +55,7 @@
</form>
</template>
</li>
<button v-if="canManage" @click="clickShowAddLabel()">
<button v-if="canManage && !isArchived" @click="clickShowAddLabel()">
<span class="icon-add" />{{ t('deck', 'Add a new tag') }}
</button>
</ul>
Expand Down Expand Up @@ -88,6 +88,7 @@ export default {
...mapGetters({
labels: 'currentBoardLabels',
canManage: 'canManage',
isArchived: 'isArchived',
}),
addLabelObjValidated() {
if (this.addLabelObj.title === '') {
Expand Down
25 changes: 18 additions & 7 deletions src/components/cards/CardItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
class="card"
@click="openCard">
<div class="card-upper">
<h3 v-if="showArchived || !canEdit">
<h3 v-if="isArchived || showArchived || !canEdit">
{{ card.title }}
</h3>
<h3 v-else-if="!editing">
Expand All @@ -47,7 +47,7 @@
<input type="button" class="icon-confirm" @click="finishedEdit(card)">
</form>

<div v-if="!editing" class="right">
<div v-if="!editing" class="duedate right">
<transition name="zoom">
<div v-if="card.duedate" :class="dueIcon">
<span>{{ relativeDate }}</span>
Expand All @@ -57,7 +57,8 @@

<CardMenu v-if="!editing && compactMode" :id="id" class="right" />
</div>
<transition-group name="zoom"
<transition-group v-if="card.labels.length"
name="zoom"
tag="ul"
class="labels"
@click="openCard">
Expand Down Expand Up @@ -109,6 +110,7 @@ export default {
}),
...mapGetters([
'canEdit',
'isArchived',
]),
card() {
return this.$store.getters.cardById(this.id)
Expand Down Expand Up @@ -189,7 +191,7 @@ export default {

.card-upper {
display: flex;
min-height: 50px;
min-height: 44px;
form {
display: flex;
padding: 5px 7px;
Expand All @@ -200,7 +202,7 @@ export default {

}
h3 {
margin: 14px $card-padding;
margin: 12px $card-padding;
flex-grow: 1;
font-size: 100%;
overflow-x: hidden;
Expand Down Expand Up @@ -257,10 +259,12 @@ export default {
}
}
}
.duedate {
margin-right: 9px;
}
.right {
display: flex;
align-items: flex-start;
margin-right: 9px;
}

.icon.due {
Expand All @@ -269,6 +273,7 @@ export default {
margin-top: 9px;
margin-bottom: 9px;
padding: 3px 4px;
padding-right: 0;
font-size: 90%;
display: flex;
align-items: center;
Expand All @@ -284,14 +289,17 @@ export default {
background-color: var(--color-error);
color: var(--color-primary-text);
opacity: .7;
padding: 3px 4px;
}
&.now {
background-color: var(--color-warning);
opacity: .7;
padding: 3px 4px;
}
&.next {
background-color: var(--color-background-dark);
opacity: .7;
padding: 3px 4px;
}

span {
Expand All @@ -303,8 +311,11 @@ export default {
}

.compact {
min-height: 50px;
min-height: 44px;

.duedate {
margin-right: 0;
}
&.has-labels {
padding-bottom: $card-padding;
}
Expand Down
3 changes: 2 additions & 1 deletion src/components/cards/CardMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<template>
<div>
<div @click.stop.prevent>
<Actions v-if="canEdit">
<Actions v-if="canEdit && !isArchived">
<ActionButton v-if="showArchived === false" icon="icon-user" @click="assignCardToMe()">
{{ t('deck', 'Assign to me') }}
</ActionButton>
Expand Down Expand Up @@ -93,6 +93,7 @@ export default {
computed: {
...mapGetters([
'canEdit',
'isArchived',
]),
...mapState({
showArchived: state => state.showArchived,
Expand Down
74 changes: 43 additions & 31 deletions src/components/navigation/AppNavigation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,47 @@

<template>
<div id="app-navigation" :class="{'icon-loading': loading}">
<AppNavigationVue>
<ul>
<AppNavigationBoardCategory
id="deck-navigation-all"
to="/board"
:text="t('deck', 'All boards')"
:boards="noneArchivedBoards"
:open-on-add-boards="true"
icon="icon-deck" />
<AppNavigationBoardCategory
id="deck-navigation-archived"
to="/board/archived"
:text="t('deck', 'Archived boards')"
:boards="archivedBoards"
icon="icon-archive" />
<AppNavigationBoardCategory
id="deck-navigation-shared"
to="/board/shared"
:text="t('deck', 'Shared with you')"
:boards="sharedBoards"
icon="icon-shared" />
<AppNavigationAddBoard v-if="canCreate" />
</ul>
<AppNavigationSettings>
<div>
<Multiselect v-model="groupLimit"
:class="{'icon-loading-small': groupLimitDisabled}"
open-direction="bottom"
:options="groups"
:multiple="true"
:disabled="groupLimitDisabled"
:placeholder="t('deck', 'Limit deck usage of groups')"
label="displayname"
track-by="id"
@input="updateConfig" />
<p>{{ t('deck', 'Limiting Deck will block users not part of those groups from creating their own boards. Users will still be able to work on boards that have been shared with them.') }}</p>
</div>
</AppNavigationSettings>
</AppNavigationVue>

<ul id="deck-navigation">
<AppNavigationBoardCategory
id="deck-navigation-all"
:text="t('deck', 'All boards')"
:boards="noneArchivedBoards"
:open-on-add-boards="true"
icon="icon-deck" />
<AppNavigationBoardCategory
id="deck-navigation-archived"
:text="t('deck', 'Archived boards')"
:boards="archivedBoards"
icon="icon-archive" />
<AppNavigationBoardCategory
id="deck-navigation-shared"
:text="t('deck', 'Shared boards')"
:boards="sharedBoards"
icon="icon-shared" />
<AppNavigationAddBoard v-if="canCreate" />
</ul>
<div v-if="isAdmin"
Expand All @@ -50,19 +74,6 @@
{{ t('deck', 'Settings') }}
</button>
</div>
<div id="app-settings-content">
<Multiselect v-model="groupLimit"
:class="{'icon-loading-small': groupLimitDisabled}"
open-direction="bottom"
:options="groups"
:multiple="true"
:disabled="groupLimitDisabled"
:placeholder="t('deck', 'Limit deck usage of groups')"
label="displayname"
track-by="id"
@input="updateConfig" />
<p>{{ t('deck', 'Limiting Deck will block users not part of those groups from creating their own boards. Users will still be able to work on boards that have been shared with them.') }}</p>
</div>
</div>
</div>
</template>
Expand All @@ -71,8 +82,7 @@
import axios from '@nextcloud/axios'
import { mapGetters } from 'vuex'
import ClickOutside from 'vue-click-outside'
import { Multiselect } from '@nextcloud/vue'

import { AppNavigation as AppNavigationVue, AppNavigationSettings, Multiselect } from '@nextcloud/vue'
import AppNavigationAddBoard from './AppNavigationAddBoard'
import AppNavigationBoardCategory from './AppNavigationBoardCategory'
import { loadState } from '@nextcloud/initial-state'
Expand All @@ -83,6 +93,8 @@ const canCreateState = loadState('deck', 'canCreate')
export default {
name: 'AppNavigation',
components: {
AppNavigationVue,
AppNavigationSettings,
AppNavigationAddBoard,
AppNavigationBoardCategory,
Multiselect,
Expand Down
Loading