Skip to content
Draft
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: 2 additions & 0 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -1128,6 +1128,7 @@ Deck stores user and app configuration values globally and per board. The GET en
| --- | --- |
| calendar | Determines if the calendar/tasks integration through the CalDAV backend is enabled for the user (boolean) |
| cardDetailsInModal | Determines if the bigger view is used (boolean) |
| hideNoDueOnOverview | Determines if the No Due Date column should be displayed |
| cardIdBadge | Determines if the ID badges are displayed on cards (boolean) |
| 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)|

Expand Down Expand Up @@ -1173,6 +1174,7 @@ Deck stores user and app configuration values globally and per board. The GET en
| notify-due | `off`, `assigned` or `all` |
| calendar | Boolean |
| cardDetailsInModal | Boolean |
| hideNoDueOnOverview | Boolean |
| cardIdBadge | Boolean |

#### Example request
Expand Down
26 changes: 25 additions & 1 deletion lib/Service/ConfigService.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ public function getAll(): array {
$data = [
'calendar' => $this->isCalendarEnabled(),
'cardDetailsInModal' => $this->isCardDetailsInModal(),
'cardIdBadge' => $this->isCardIdBadgeEnabled()
'cardIdBadge' => $this->isCardIdBadgeEnabled(),
'hideNoDueOnOverview' => $this->isHideNoDueOnOverviewEnabled()
];
if ($this->groupManager->isAdmin($userId)) {
$data['groupLimit'] = $this->get('groupLimit');
Expand Down Expand Up @@ -85,6 +86,11 @@ public function get(string $key) {
return false;
}
return (bool)$this->config->getUserValue($this->getUserId(), Application::APP_ID, 'cardDetailsInModal', true);
case 'hideNoDueOnOverview':
if ($this->getUserId() === null) {
return false;
}
return (bool)$this->config->getUserValue($this->getUserId(), Application::APP_ID, 'hideNoDueOnOverview', true);
case 'cardIdBadge':
if ($this->getUserId() === null) {
return false;
Expand Down Expand Up @@ -123,6 +129,20 @@ public function isCardDetailsInModal(?int $boardId = null): bool {
return (bool)$this->config->getUserValue($userId, Application::APP_ID, 'board:' . $boardId . ':cardDetailsInModal', $defaultState);
}

public function isHideNoDueOnOverviewEnabled(?int $boardId = null): bool {
$userId = $this->getUserId();
if ($userId === null) {
return false;
}

$defaultState = (bool)$this->config->getUserValue($userId, Application::APP_ID, 'hideNoDueOnOverview', false);
if ($boardId === null) {
return $defaultState;
}

return (bool)$this->config->getUserValue($userId, Application::APP_ID, 'board:' . $boardId . ':hideNoDueOnOverview', $defaultState);
}

public function isCardIdBadgeEnabled(): bool {
$userId = $this->getUserId();
if ($userId === null) {
Expand Down Expand Up @@ -177,6 +197,10 @@ public function set($key, $value) {
$this->config->setUserValue($userId, Application::APP_ID, 'cardDetailsInModal', (string)$value);
$result = $value;
break;
case 'hideNoDueOnOverview':
$this->config->setUserValue($userId, Application::APP_ID, 'hideNoDueOnOverview', (string)$value);
$result = $value;
break;
case 'cardIdBadge':
$this->config->setUserValue($userId, Application::APP_ID, 'cardIdBadge', (string)$value);
$result = $value;
Expand Down
8 changes: 8 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,14 @@ export default {
this.$store.dispatch('setConfig', { cardDetailsInModal: newValue })
},
},
hideNoDueOnOverview: {
get() {
return this.$store.getters.config('hideNoDueOnOverview')
},
set(newValue) {
this.$store.dispatch('setConfig', { hideNoDueOnOverview: newValue })
},
},
},
created() {
const initialState = loadState('deck', 'initialBoards', null)
Expand Down
14 changes: 14 additions & 0 deletions src/components/DeckAppSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
:label="t('deck', 'Use bigger card view')" />
</NcFormBox>
</NcAppSettingsSection>
<NcAppSettingsSection id="general-settings" :name="t('deck', 'General')">
<NcFormBox>
<NcFormBoxSwitch v-model="hideNoDueOnOverview"
:label="t('deck', 'Hide no-due column on upcoming cards')" />
</NcFormBox>
</NcAppSettingsSection>

<NcAppSettingsSection id="appearance-settings" :name="t('deck', 'Appearance')">
<NcFormBox>
Expand Down Expand Up @@ -119,6 +125,14 @@ export default {
this.$store.dispatch('setConfig', { cardDetailsInModal: newValue })
},
},
hideNoDueOnOverview: {
get() {
return this.$store.getters.config('hideNoDueOnOverview')
},
set(newValue) {
this.$store.dispatch('setConfig', { hideNoDueOnOverview: newValue })
},
},
cardIdBadge: {
get() {
return this.$store.getters.config('cardIdBadge')
Expand Down
23 changes: 17 additions & 6 deletions src/components/overview/Overview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,6 @@ const COLUMN_PROPS_LIST = [
title: 'Later',
filter: 'later',
},
{
title: 'No due',
filter: 'nodue',
sort: false,
},
]

export default {
Expand All @@ -95,9 +90,17 @@ export default {
},
},
data() {
const dynamicList = [...COLUMN_PROPS_LIST];
if(hideNoDueOnOverview) {
dynamicList.push({
title: 'No due',
filter: 'nodue',
sort: false,
});
}
return {
loading: true,
columnPropsList: COLUMN_PROPS_LIST,
columnPropsList: dynamicList,
}
},
computed: {
Expand All @@ -112,6 +115,14 @@ export default {
return ''
}
},
hideNoDueOnOverview: {
get() {
return this.$store.getters.config('hideNoDueOnOverview')
},
set(newValue) {
this.$store.dispatch('setConfig', { hideNoDueOnOverview: newValue })
},
},
...mapGetters(['assignedCardsDashboard']),
},
watch: {
Expand Down