Skip to content

Commit dad8d70

Browse files
committed
The No-Due column on the overview page is a killer for load time
I have hundreds of cards that don't have dates on them because that feature isn't used, so the page load time takes 5-6 seconds. Attempting to add a flag to deactivate loading them optionally, so I can skip that list. Signed-off-by: Rob Emery <git@mintsoft.net>
1 parent 989f68c commit dad8d70

5 files changed

Lines changed: 66 additions & 7 deletions

File tree

docs/API.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,6 +1128,7 @@ Deck stores user and app configuration values globally and per board. The GET en
11281128
| --- | --- |
11291129
| calendar | Determines if the calendar/tasks integration through the CalDAV backend is enabled for the user (boolean) |
11301130
| cardDetailsInModal | Determines if the bigger view is used (boolean) |
1131+
| hideNoDueOnOverview | Determines if the No Due Date column should be displayed |
11311132
| cardIdBadge | Determines if the ID badges are displayed on cards (boolean) |
11321133
| groupLimit | Determines if creating new boards is limited to certain groups of the instance. The resulting output is an array of group objects with the id and the displayname (Admin only)|
11331134

@@ -1173,6 +1174,7 @@ Deck stores user and app configuration values globally and per board. The GET en
11731174
| notify-due | `off`, `assigned` or `all` |
11741175
| calendar | Boolean |
11751176
| cardDetailsInModal | Boolean |
1177+
| hideNoDueOnOverview | Boolean |
11761178
| cardIdBadge | Boolean |
11771179

11781180
#### Example request

lib/Service/ConfigService.php

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ public function getAll(): array {
5252
$data = [
5353
'calendar' => $this->isCalendarEnabled(),
5454
'cardDetailsInModal' => $this->isCardDetailsInModal(),
55-
'cardIdBadge' => $this->isCardIdBadgeEnabled()
55+
'cardIdBadge' => $this->isCardIdBadgeEnabled(),
56+
'hideNoDueOnOverview' => $this->isHideNoDueOnOverviewEnabled()
5657
];
5758
if ($this->groupManager->isAdmin($userId)) {
5859
$data['groupLimit'] = $this->get('groupLimit');
@@ -85,6 +86,11 @@ public function get(string $key) {
8586
return false;
8687
}
8788
return (bool)$this->config->getUserValue($this->getUserId(), Application::APP_ID, 'cardDetailsInModal', true);
89+
case 'hideNoDueOnOverview':
90+
if ($this->getUserId() === null) {
91+
return false;
92+
}
93+
return (bool)$this->config->getUserValue($this->getUserId(), Application::APP_ID, 'hideNoDueOnOverview', true);
8894
case 'cardIdBadge':
8995
if ($this->getUserId() === null) {
9096
return false;
@@ -123,6 +129,20 @@ public function isCardDetailsInModal(?int $boardId = null): bool {
123129
return (bool)$this->config->getUserValue($userId, Application::APP_ID, 'board:' . $boardId . ':cardDetailsInModal', $defaultState);
124130
}
125131

132+
public function isHideNoDueOnOverviewEnabled(?int $boardId = null): bool {
133+
$userId = $this->getUserId();
134+
if ($userId === null) {
135+
return false;
136+
}
137+
138+
$defaultState = (bool)$this->config->getUserValue($userId, Application::APP_ID, 'hideNoDueOnOverview', false);
139+
if ($boardId === null) {
140+
return $defaultState;
141+
}
142+
143+
return (bool)$this->config->getUserValue($userId, Application::APP_ID, 'board:' . $boardId . ':hideNoDueOnOverview', $defaultState);
144+
}
145+
126146
public function isCardIdBadgeEnabled(): bool {
127147
$userId = $this->getUserId();
128148
if ($userId === null) {
@@ -177,6 +197,10 @@ public function set($key, $value) {
177197
$this->config->setUserValue($userId, Application::APP_ID, 'cardDetailsInModal', (string)$value);
178198
$result = $value;
179199
break;
200+
case 'hideNoDueOnOverview':
201+
$this->config->setUserValue($userId, Application::APP_ID, 'hideNoDueOnOverview', (string)$value);
202+
$result = $value;
203+
break;
180204
case 'cardIdBadge':
181205
$this->config->setUserValue($userId, Application::APP_ID, 'cardIdBadge', (string)$value);
182206
$result = $value;

src/App.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,14 @@ export default {
9898
this.$store.dispatch('setConfig', { cardDetailsInModal: newValue })
9999
},
100100
},
101+
hideNoDueOnOverview: {
102+
get() {
103+
return this.$store.getters.config('hideNoDueOnOverview')
104+
},
105+
set(newValue) {
106+
this.$store.dispatch('setConfig', { hideNoDueOnOverview: newValue })
107+
},
108+
},
101109
},
102110
created() {
103111
const initialState = loadState('deck', 'initialBoards', null)

src/components/DeckAppSettings.vue

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414
:label="t('deck', 'Use bigger card view')" />
1515
</NcFormBox>
1616
</NcAppSettingsSection>
17+
<NcAppSettingsSection id="general-settings" :name="t('deck', 'General')">
18+
<NcFormBox>
19+
<NcFormBoxSwitch v-model="hideNoDueOnOverview"
20+
:label="t('deck', 'Hide no-due column on upcoming cards')" />
21+
</NcFormBox>
22+
</NcAppSettingsSection>
1723

1824
<NcAppSettingsSection id="appearance-settings" :name="t('deck', 'Appearance')">
1925
<NcFormBox>
@@ -119,6 +125,14 @@ export default {
119125
this.$store.dispatch('setConfig', { cardDetailsInModal: newValue })
120126
},
121127
},
128+
hideNoDueOnOverview: {
129+
get() {
130+
return this.$store.getters.config('hideNoDueOnOverview')
131+
},
132+
set(newValue) {
133+
this.$store.dispatch('setConfig', { hideNoDueOnOverview: newValue })
134+
},
135+
},
122136
cardIdBadge: {
123137
get() {
124138
return this.$store.getters.config('cardIdBadge')

src/components/overview/Overview.vue

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,6 @@ const COLUMN_PROPS_LIST = [
7474
title: 'Later',
7575
filter: 'later',
7676
},
77-
{
78-
title: 'No due',
79-
filter: 'nodue',
80-
sort: false,
81-
},
8277
]
8378
8479
export default {
@@ -95,9 +90,17 @@ export default {
9590
},
9691
},
9792
data() {
93+
const dynamicList = [...COLUMN_PROPS_LIST];
94+
if(hideNoDueOnOverview) {
95+
dynamicList.push({
96+
title: 'No due',
97+
filter: 'nodue',
98+
sort: false,
99+
});
100+
}
98101
return {
99102
loading: true,
100-
columnPropsList: COLUMN_PROPS_LIST,
103+
columnPropsList: dynamicList,
101104
}
102105
},
103106
computed: {
@@ -112,6 +115,14 @@ export default {
112115
return ''
113116
}
114117
},
118+
hideNoDueOnOverview: {
119+
get() {
120+
return this.$store.getters.config('hideNoDueOnOverview')
121+
},
122+
set(newValue) {
123+
this.$store.dispatch('setConfig', { hideNoDueOnOverview: newValue })
124+
},
125+
},
115126
...mapGetters(['assignedCardsDashboard']),
116127
},
117128
watch: {

0 commit comments

Comments
 (0)