Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/deck.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdrian Missy <adrian.missy@onewavestudios.com>2022-04-26 20:34:29 +0300
committerJulius Härtl <jus@bitgrid.net>2022-10-29 11:25:28 +0300
commitf7717aa02a0fc755df4671a7c8134e33f9bbc9d9 (patch)
tree01a2dbc7a9cda107728109a39c044b6d43dba3b1 /src
parent15988961575f22e62eb6a727c13388442530aeb1 (diff)
feat: #2906 add card ID badge
- adds vscode settings file to gitingore - adds new badge for card ID - adds card ID to board filter - adds settings to disable card ID badge Signed-off-by: Adrian Missy <adrian.missy@onewavestudios.com>
Diffstat (limited to 'src')
-rw-r--r--src/components/cards/CardBadges.vue10
-rw-r--r--src/components/cards/CardItem.vue1
-rw-r--r--src/components/cards/badges/CardId.vue46
-rw-r--r--src/components/navigation/AppNavigation.vue18
-rw-r--r--src/store/card.js2
5 files changed, 74 insertions, 3 deletions
diff --git a/src/components/cards/CardBadges.vue b/src/components/cards/CardBadges.vue
index d45c96f2..28fe4b52 100644
--- a/src/components/cards/CardBadges.vue
+++ b/src/components/cards/CardBadges.vue
@@ -22,6 +22,7 @@
<template>
<div v-if="card" class="badges">
+ <CardId v-if="idBadge" class="icon-badge" :card="card" />
<div v-if="card.commentsCount > 0"
v-tooltip="commentsHint"
class="icon-badge"
@@ -50,6 +51,7 @@
</template>
<script>
import NcAvatarList from './AvatarList.vue'
+import CardId from './badges/CardId.vue'
import CardMenu from './CardMenu.vue'
import TextIcon from 'vue-material-design-icons/Text.vue'
import AttachmentIcon from 'vue-material-design-icons/Paperclip.vue'
@@ -59,7 +61,7 @@ import CommentUnreadIcon from 'vue-material-design-icons/CommentAccount.vue'
export default {
name: 'CardBadges',
- components: { NcAvatarList, CardMenu, TextIcon, AttachmentIcon, CheckmarkIcon, CommentIcon, CommentUnreadIcon },
+ components: { NcAvatarList, CardMenu, TextIcon, AttachmentIcon, CheckmarkIcon, CommentIcon, CommentUnreadIcon, CardId },
props: {
card: {
type: Object,
@@ -82,6 +84,9 @@ export default {
}
return null
},
+ idBadge() {
+ return this.$store.getters.config('cardIdBadge')
+ },
},
methods: {
openComments() {
@@ -103,7 +108,8 @@ export default {
display: flex;
margin-right: 2px;
- span {
+ span,
+ &::v-deep span {
padding: 10px 2px;
}
}
diff --git a/src/components/cards/CardItem.vue b/src/components/cards/CardItem.vue
index 5277d011..9c43af73 100644
--- a/src/components/cards/CardItem.vue
+++ b/src/components/cards/CardItem.vue
@@ -74,6 +74,7 @@
<span @click.stop="applyLabelFilter(label)">{{ label.title }}</span>
</li>
</transition-group>
+
<div v-show="!compactMode" class="card-controls compact-item" @click="openCard">
<CardBadges :card="card" />
</div>
diff --git a/src/components/cards/badges/CardId.vue b/src/components/cards/badges/CardId.vue
new file mode 100644
index 00000000..3754e693
--- /dev/null
+++ b/src/components/cards/badges/CardId.vue
@@ -0,0 +1,46 @@
+<!--
+ - @copyright Copyright (c) 2022 Adrian Missy <adrian.missy@onewavestudios.com>
+ -
+ - @author Adrian Missy <adrian.missy@onewavestudios.com>
+ -
+ - @license GNU AGPL version 3 or any later version
+ -
+ - This program is free software: you can redistribute it and/or modify
+ - it under the terms of the GNU Affero General Public License as
+ - published by the Free Software Foundation, either version 3 of the
+ - License, or (at your option) any later version.
+ -
+ - This program is distributed in the hope that it will be useful,
+ - but WITHOUT ANY WARRANTY; without even the implied warranty of
+ - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ - GNU Affero General Public License for more details.
+ -
+ - You should have received a copy of the GNU Affero General Public License
+ - along with this program. If not, see <http://www.gnu.org/licenses/>.
+ -
+ -->
+
+<template>
+ <div v-if="card" class="cardid">
+ <span>#{{ card.id }}</span>
+ </div>
+</template>
+
+<script>
+
+export default {
+ name: 'CardId',
+ props: {
+ card: {
+ type: Object,
+ default: null,
+ },
+ },
+}
+</script>
+
+<style lang="scss" scoped>
+ .cardid {
+ font-size: .9em;
+ }
+</style>
diff --git a/src/components/navigation/AppNavigation.vue b/src/components/navigation/AppNavigation.vue
index 31b8d891..da8bbab1 100644
--- a/src/components/navigation/AppNavigation.vue
+++ b/src/components/navigation/AppNavigation.vue
@@ -73,6 +73,16 @@
</div>
<div>
+ <input id="toggle-idbadge"
+ v-model="cardIdBadge"
+ type="checkbox"
+ class="checkbox">
+ <label for="toggle-idbadge">
+ {{ t('deck', 'Show card ID badge') }}
+ </label>
+ </div>
+
+ <div>
<input id="toggle-calendar"
v-model="configCalendar"
type="checkbox"
@@ -168,6 +178,14 @@ export default {
this.$store.dispatch('setConfig', { cardDetailsInModal: newValue })
},
},
+ cardIdBadge: {
+ get() {
+ return this.$store.getters.config('cardIdBadge')
+ },
+ set(newValue) {
+ this.$store.dispatch('setConfig', { cardIdBadge: newValue })
+ },
+ },
configCalendar: {
get() {
return this.$store.getters.config('calendar')
diff --git a/src/store/card.js b/src/store/card.js
index 4c2a902a..a57ba13a 100644
--- a/src/store/card.js
+++ b/src/store/card.js
@@ -183,7 +183,7 @@ export default {
}) !== -1
} else {
hasMatch = hasMatch && (card.title.toLowerCase().includes(filterOutQuotes(match).toLowerCase())
- || card.description.toLowerCase().includes(filterOutQuotes(match).toLowerCase()))
+ || card.description.toLowerCase().includes(filterOutQuotes(match).toLowerCase()) || card.id === parseInt(filterOutQuotes(match)))
}
if (!hasMatch) {
return false