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

add card in upcoming cards view #2332

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
default due: today
Signed-off-by: Jakob Röhrl <jakob.roehrl@web.de>
  • Loading branch information
jakobroehrl committed Oct 1, 2020
commit d8c02404379514c5411afe777540532901ebcfd8
4 changes: 2 additions & 2 deletions lib/Controller/CardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ public function rename($cardId, $title) {
* @param int $order
* @return \OCP\AppFramework\Db\Entity
*/
public function create($title, $stackId, $type = 'plain', $order = 999) {
return $this->cardService->create($title, $stackId, $type, $order, $this->userId);
public function create($title, $stackId, $type = 'plain', $order = 999, $description = '', $duedate = null) {
return $this->cardService->create($title, $stackId, $type, $order, $this->userId, $description, $duedate);
}

/**
Expand Down
11 changes: 7 additions & 4 deletions src/components/Controls.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<h2><a href="#">{{ overviewName }}</a></h2>
<Actions>
<ActionButton icon="icon-add" @click.stop="modalShow=true">
{{ t('deck', 'Add card') }}
{{ t('deck', 'Add card on Today') }}
jakobroehrl marked this conversation as resolved.
Show resolved Hide resolved
</ActionButton>
</Actions>
</div>
Expand Down Expand Up @@ -199,9 +199,9 @@
</div>
</div>

<Modal v-if="modalShow" :title="t('deck', 'Add card')" @close="modalShow=false">
<Modal v-if="modalShow" :title="t('deck', 'Add card on Today')" @close="modalShow=false">
<div class="modal__content">
jakobroehrl marked this conversation as resolved.
Show resolved Hide resolved
<h3>{{ t('deck', 'Add card') }}</h3>
<h3>{{ t('deck', 'Add card on Today') }}</h3>
<Multiselect v-model="selectedBoard"
:placeholder="t('deck', 'Select a board')"
:options="boards"
Expand All @@ -214,7 +214,7 @@
:max-height="100"
label="title" />

<label for="new-stack-input-main" class="hidden-visually">{{ t('deck', 'Add card') }}</label>
<label for="new-stack-input-main" class="hidden-visually">{{ t('deck', 'Add card on Today') }}</label>
<input id="new-stack-input-main"
ref="newCardInput"
v-model="newCardTitle"
Expand Down Expand Up @@ -381,10 +381,13 @@ export default {
},
async addCard() {
try {
const today = new Date()
today.setHours(23, 59, 59, 999)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about this, having a card due at 23:59 is probably not the best attempt.

How about adding a date picker and setting a default due date for in an hour there?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of Todo Tools use Today as default.
Regarding #2231 (comment) Today is the current date and 23:59

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In #1157 we are discussing the different purpose of a due date at a specific time/timezone and a due date at a day.

Regarding Desk and the current issues 23:59 seems to be a quick win for me, that can be imoroved later.

await this.$store.dispatch('addCard', {
jakobroehrl marked this conversation as resolved.
Show resolved Hide resolved
title: this.newCardTitle,
stackId: this.selectedStack.id,
boardId: this.selectedBoard.id,
duedate: today.toISOString(),
})
this.newCardTitle = ''
} catch (e) {
Expand Down