-
Notifications
You must be signed in to change notification settings - Fork 309
card dashboard #1934
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
Merged
Merged
card dashboard #1934
Changes from 1 commit
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
3c5f68e
card dashboard
jakobroehrl 0748133
Enrich card results
juliusknorr 3a4bbac
Move scss variables to dedicated file
juliusknorr 348fc66
Allow to use card item without being available in global card store
juliusknorr 014d7aa
Fix api routes
juliusknorr 818ffa2
ocs route
jakobroehrl 66f6a3e
times
jakobroehrl f4a6060
remove unused imports
jakobroehrl a73b761
Allow editing cards on filtered views
juliusknorr 341eb47
Cleanup backend methods
juliusknorr b199442
Rename to overview
juliusknorr 06078c8
Cleanup frontend code
juliusknorr 1392892
Fix lint errors
juliusknorr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
times
Signed-off-by: Jakob Röhrl <[email protected]>
- Loading branch information
commit 66f6a3e1935d2127530d17aa34cda8a2f904a676
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,83 +24,92 @@ | |
| <div> | ||
| <Controls :dashboard-name="filter" /> | ||
|
|
||
| <div v-if="filter=='due'" class="dashboard"> | ||
| <div class="dashboard-column"> | ||
| <h2>overdue</h2> | ||
| <div v-for="card in withDueDashboardGroup.overdue" :key="card.id"> | ||
| <CardItem :item="card" /> | ||
| <div v-if="loading" key="loading" class="emptycontent"> | ||
| <div class="icon icon-loading" /> | ||
| <h2>{{ t('deck', 'Loading Dashboard') }}</h2> | ||
| <p /> | ||
| </div> | ||
|
|
||
| <div v-else> | ||
|
|
||
| <div v-if="filter=='due'" class="dashboard"> | ||
| <div class="dashboard-column"> | ||
| <h2>{{ t('deck', 'overdue') }}</h2> | ||
| <div v-for="card in dueOverdue" :key="card.id"> | ||
| <CardItem :item="card" /> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| <div class="dashboard-column"> | ||
| <h2>today</h2> | ||
| <div v-for="card in withDueDashboardGroup.today" :key="card.id"> | ||
| <CardItem :item="card" /> | ||
| <div class="dashboard-column"> | ||
| <h2>{{ t('deck', 'today') }}</h2> | ||
| <div v-for="card in withDueDashboardGroup.today" :key="card.id"> | ||
| <CardItem :item="card" /> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| <div class="dashboard-column"> | ||
| <h2>tomorrow</h2> | ||
| <div v-for="card in withDueDashboardGroup.tomorrow" :key="card.id"> | ||
| <CardItem :item="card" /> | ||
| <div class="dashboard-column"> | ||
| <h2>{{ t('deck', 'tomorrow') }}</h2> | ||
| <div v-for="card in withDueDashboardGroup.tomorrow" :key="card.id"> | ||
| <CardItem :item="card" /> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| <div class="dashboard-column"> | ||
| <h2>this week</h2> | ||
| <div v-for="card in withDueDashboardGroup.later" :key="card.id"> | ||
| <CardItem :item="card" /> | ||
| <div class="dashboard-column"> | ||
| <h2>{{ t('deck', 'this week') }}</h2> | ||
| <div v-for="card in withDueDashboardGroup.later" :key="card.id"> | ||
| <CardItem :item="card" /> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| <div class="dashboard-column"> | ||
| <h2>later</h2> | ||
| <div v-for="card in withDueDashboardGroup.thisWeek" :key="card.id"> | ||
| <CardItem :item="card" /> | ||
| <div class="dashboard-column"> | ||
| <h2>{{ t('deck', 'later') }}</h2> | ||
| <div v-for="card in withDueDashboardGroup.thisWeek" :key="card.id"> | ||
| <CardItem :item="card" /> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| <div v-if="filter=='assigned'" class="dashboard"> | ||
| <div class="dashboard-column"> | ||
| <h2>no due</h2> | ||
| <div v-for="card in withDueDashboardGroup.noDue" :key="card.id"> | ||
| <CardItem :item="card" /> | ||
| <div v-if="filter=='assigned'" class="dashboard"> | ||
| <div class="dashboard-column"> | ||
| <h2>{{ t('deck', 'no due') }}</h2> | ||
| <div v-for="card in assignedCardsDashboardGroup.nodue" :key="card.id"> | ||
| <CardItem :item="card" /> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| <div class="dashboard-column"> | ||
| <h2>overdue</h2> | ||
| <div v-for="card in assignedCardsDashboardGroup.overdue" :key="card.id"> | ||
| <CardItem :item="card" /> | ||
| <div class="dashboard-column"> | ||
| <h2>{{ t('deck', 'overdue') }}</h2> | ||
| <div v-for="card in assignedCardsDashboardGroup.overdue" :key="card.id"> | ||
| <CardItem :item="card" /> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| <div class="dashboard-column"> | ||
| <h2>today</h2> | ||
| <div v-for="card in assignedCardsDashboardGroup.today" :key="card.id"> | ||
| <CardItem :item="card" /> | ||
| <div class="dashboard-column"> | ||
| <h2>{{ t('deck', 'today') }}</h2> | ||
| <div v-for="card in assignedCardsDashboardGroup.today" :key="card.id"> | ||
| <CardItem :item="card" /> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| <div class="dashboard-column"> | ||
| <h2>tomorrow</h2> | ||
| <div v-for="card in assignedCardsDashboardGroup.tomorrow" :key="card.id"> | ||
| <CardItem :item="card" /> | ||
| <div class="dashboard-column"> | ||
| <h2>{{ t('deck', 'tomorrow') }}</h2> | ||
| <div v-for="card in assignedCardsDashboardGroup.tomorrow" :key="card.id"> | ||
| <CardItem :item="card" /> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| <div class="dashboard-column"> | ||
| <h2>this week</h2> | ||
| <div v-for="card in assignedCardsDashboardGroup.thisWeek" :key="card.id"> | ||
| <CardItem :item="card" /> | ||
| <div class="dashboard-column"> | ||
| <h2>{{ t('deck', 'this week') }}</h2> | ||
| <div v-for="card in assignedCardsDashboardGroup.thisWeek" :key="card.id"> | ||
| <CardItem :item="card" /> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| <div class="dashboard-column"> | ||
| <h2>this week</h2> | ||
| <div v-for="card in withDueDashboardGroup.later" :key="card.id"> | ||
| <CardItem :item="card" /> | ||
| <div class="dashboard-column"> | ||
| <h2>{{ t('deck', 'later') }}</h2> | ||
| <div v-for="card in withDueDashboardGroup.later" :key="card.id"> | ||
| <CardItem :item="card" /> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
@@ -126,10 +135,16 @@ export default { | |
| default: '', | ||
| }, | ||
| }, | ||
| data: function() { | ||
| return { | ||
| loading: true, | ||
| } | ||
| }, | ||
| computed: { | ||
| ...mapGetters([ | ||
| 'withDueDashboard', | ||
| 'assignedCardsDashboard', | ||
| 'dueOverdue' | ||
| ]), | ||
| withDueDashboardGroup() { | ||
| return this.groupByDue(this.withDueDashboard) | ||
|
|
@@ -139,9 +154,31 @@ export default { | |
| }, | ||
| }, | ||
| created() { | ||
| this.$store.dispatch('loadDashboards') | ||
| this.getData() | ||
| }, | ||
| watch: { | ||
| "$route.params.filter"() { | ||
| this.getData() | ||
| } | ||
| }, | ||
| methods: { | ||
| async getData() { | ||
| this.loading = true | ||
| try { | ||
| if (this.filter === 'due') { | ||
| await this.$store.dispatch('loadDueDashboard') | ||
| } | ||
|
|
||
| if (this.filter === 'assigned') { | ||
| await this.$store.dispatch('loadAssignDashboard') | ||
| } | ||
| } catch (e) { | ||
| console.error(e) | ||
| } | ||
| this.loading = false | ||
| }, | ||
|
|
||
|
|
||
| groupByDue(dataset) { | ||
| const all = { | ||
| nodue: [], | ||
|
|
@@ -156,20 +193,23 @@ export default { | |
| if (card.duedate === null) { | ||
|
||
| all.nodue.push(card) | ||
| } else { | ||
| const days = Math.floor(moment(card.duedate).diff(this.$root.time, 'seconds') / 60 / 60 / 24) | ||
| if (days < 0) { | ||
| const hours = Math.floor(moment(card.duedate).diff(this.$root.time, 'seconds') / 60 / 60 ) | ||
| let d = new Date() | ||
| let currentHour = d.getHours() | ||
| console.log(card.title +' '+ hours ) | ||
| if (hours < 0) { | ||
| all.overdue.push(card) | ||
| } | ||
| if (days === 0) { | ||
| if (hours >= 0 && hours < (24 - currentHour)) { | ||
| all.today.push(card) | ||
| } | ||
| if (days === 1) { | ||
| if (hours >= (24 - currentHour) && hours < (48 - currentHour)) { | ||
| all.tomorrow.push(card) | ||
| } | ||
| if (days > 1 && days < 8) { | ||
| if (hours >= (48 - currentHour) && hours < (24 * 7)) { | ||
| all.thisWeek.push(card) | ||
| } | ||
| if (days > 8) { | ||
| if (hours >= (24 * 7)) { | ||
| all.later.push(card) | ||
| } | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.