-
Notifications
You must be signed in to change notification settings - Fork 50
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
New dashboard #3150
Merged
Merged
New dashboard #3150
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
19f936b
Create new dashboard mockup
manuelmeister 50a0385
Refine design
manuelmeister e69c379
Refine dashboard design
manuelmeister 87ee437
Rename components
carlobeltrame c42bb76
Use translations
carlobeltrame 27653d2
Use computed v-model for quick filter button
carlobeltrame 1cd702c
Simplify SelectFilter
carlobeltrame 6ff5111
Fix the button for selecting own activities
carlobeltrame ecd99ba
Fix avatars in select
carlobeltrame 220991c
Adapt category filter to multiselect and real data
carlobeltrame 23e52cd
Adapt period filter to real data
carlobeltrame cd42b08
The button is a filter preset for all filters
carlobeltrame 2d57eda
Reimplement filtering and clean up dashboard
carlobeltrame afc6c25
Fix ActivityRow
carlobeltrame 9328499
Make activity title clickable
carlobeltrame cddbce2
Fix avatar display
carlobeltrame 0c82861
Fix responsibles filter
carlobeltrame a0066a4
Fix display of date
carlobeltrame b14e5b1
Fix relevance detection of period filter
carlobeltrame 22c1b56
Remove old dashboard implementation
carlobeltrame 7853f8b
Fix n+1 query and API documentation
carlobeltrame 18bb96a
Make duration more visually distinct
carlobeltrame 267ea90
Use built-in ListFormat for formatting lists of values
carlobeltrame 682851b
Add an underline on hover for now
carlobeltrame 064ba96
Pass tc as argument to avoid console errors
carlobeltrame d6738b8
Fix various console errors due to partially loaded data
carlobeltrame e886736
Change label
carlobeltrame b704de4
Make period filter more intuitive and add fallback messages
carlobeltrame 6bc4f1d
Add back a component for baseline alignment
carlobeltrame 922b797
Remove unused css style
carlobeltrame 702e699
Clean up and add skeleton loaders
carlobeltrame 8a37d7b
Add multiple modes of duration display
carlobeltrame b0c7047
Visually distinguish clear option using an icon
carlobeltrame 8cb5b01
Make clear option have less visual weight
carlobeltrame 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
There are no files selected for viewing
This file contains 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 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 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 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 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 |
---|---|---|
@@ -0,0 +1,128 @@ | ||
<template> | ||
<tr class="row"> | ||
<th style="text-align: left" class="tabular-nums" scope="row"> | ||
<TextAlignBaseline | ||
><span class="smaller">{{ scheduleEntry.number }}</span></TextAlignBaseline | ||
> | ||
<br /> | ||
<CategoryChip small dense :category="category" class="d-sm-none" /> | ||
</th> | ||
<td class="d-none d-sm-table-cell"> | ||
<CategoryChip small dense :category="category" /> | ||
</td> | ||
<td class="nowrap"> | ||
{{ start }}<br /> | ||
<span class="e-subtitle">{{ duration }}</span> | ||
</td> | ||
<td style="width: 100%" class="contentrow"> | ||
<router-link | ||
:to="routerLink" | ||
class="text-decoration-none text-decoration-hover-underline black--text" | ||
> | ||
{{ title }}<br /> | ||
</router-link> | ||
<span class="e-subtitle">{{ location }}</span> | ||
</td> | ||
<td class="contentrow avatarrow overflow-visible"> | ||
<AvatarRow :camp-collaborations="collaborators" size="28" class="ml-auto" /> | ||
</td> | ||
</tr> | ||
</template> | ||
|
||
<script> | ||
import AvatarRow from './AvatarRow.vue' | ||
import CategoryChip from '@/components/generic/CategoryChip.vue' | ||
import { | ||
hourShort, | ||
timeDurationShort, | ||
} from '../../common/helpers/dateHelperUTCFormatted.js' | ||
import TextAlignBaseline from '@/components/layout/TextAlignBaseline.vue' | ||
|
||
export default { | ||
name: 'ActivityRow', | ||
components: { CategoryChip, AvatarRow, TextAlignBaseline }, | ||
props: { | ||
scheduleEntry: { type: Object, required: true }, | ||
}, | ||
computed: { | ||
collaborators() { | ||
return this.scheduleEntry | ||
.activity() | ||
.activityResponsibles() | ||
.items.map((responsible) => responsible.campCollaboration()) | ||
}, | ||
category() { | ||
return this.scheduleEntry.activity().category() | ||
}, | ||
title() { | ||
return this.scheduleEntry.activity().title | ||
}, | ||
location() { | ||
return this.scheduleEntry.activity().location | ||
}, | ||
start() { | ||
return hourShort(this.scheduleEntry.start) | ||
}, | ||
duration() { | ||
return timeDurationShort(this.scheduleEntry.start, this.scheduleEntry.end) | ||
}, | ||
routerLink() { | ||
return { | ||
name: 'activity', | ||
params: { | ||
campId: this.scheduleEntry.period().camp().id, | ||
scheduleEntryId: this.scheduleEntry.id, | ||
}, | ||
} | ||
}, | ||
}, | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
.row { | ||
display: table-row; | ||
vertical-align: baseline; | ||
} | ||
|
||
tr + tr :is(td, th) { | ||
border-top: 1px solid #ddd; | ||
} | ||
|
||
:is(td, th) { | ||
padding-top: 0.25rem; | ||
padding-bottom: 0.25rem; | ||
} | ||
|
||
:is(td, th) + :is(td, th) { | ||
padding-left: 0.5rem; | ||
} | ||
|
||
.contentrow { | ||
max-width: 100px; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
white-space: nowrap; | ||
} | ||
|
||
.avatarrow { | ||
vertical-align: middle; | ||
} | ||
|
||
.e-subtitle { | ||
font-size: 0.9em; | ||
color: #666; | ||
} | ||
|
||
.nowrap { | ||
white-space: nowrap; | ||
} | ||
|
||
.smaller { | ||
font-size: 0.75em; | ||
} | ||
|
||
.text-decoration-hover-underline:hover { | ||
text-decoration: underline !important; | ||
} | ||
</style> |
This file contains 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 |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<template> | ||
<div class="avatarrow" :style="avatarrow"> | ||
<div | ||
v-for="campCollaboration in campCollaborations" | ||
:key="campCollaboration && campCollaboration._meta.self" | ||
class="avataritem" | ||
> | ||
<UserAvatar :size="Number(size)" :camp-collaboration="campCollaboration" /> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import UserAvatar from '@/components/user/UserAvatar.vue' | ||
|
||
export default { | ||
name: 'AvatarRow', | ||
components: { UserAvatar }, | ||
props: { | ||
campCollaborations: { type: Array, default: () => [] }, | ||
size: { type: [Number, String], default: 20 }, | ||
}, | ||
computed: { | ||
maxWidth() { | ||
return ( | ||
(this.campCollaborations?.length - 1) * (Number(this.size) * 0.25) + | ||
Number(this.size) | ||
) | ||
}, | ||
avatarrow() { | ||
return { | ||
'max-width': `${this.maxWidth}px`, | ||
'font-size': `${this.size}px`, | ||
} | ||
}, | ||
}, | ||
} | ||
</script> | ||
|
||
<style scoped lang="scss"> | ||
.avatarrow { | ||
display: flex; | ||
flex-direction: row-reverse; | ||
gap: 0.75em; | ||
padding-left: 0.5em; | ||
padding-right: 0.5em; | ||
transition: gap 0.25s ease; | ||
} | ||
|
||
@media #{map-get($display-breakpoints, 'md-and-up')} { | ||
.avatarrow { | ||
gap: 1.1em; | ||
} | ||
} | ||
|
||
.avatarrow:hover { | ||
gap: 1.1em; | ||
} | ||
|
||
.avataritem { | ||
display: grid; | ||
width: 0; | ||
place-content: center; | ||
text-decoration: none; | ||
} | ||
</style> |
This file contains 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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<template> | ||
<v-chip | ||
label | ||
outlined | ||
:color="value ? 'primary' : null" | ||
@click="$emit('input', !value)" | ||
>{{ label }}</v-chip | ||
> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'BooleanFilter', | ||
props: { | ||
value: Boolean, | ||
label: { type: String, required: true }, | ||
}, | ||
} | ||
</script> | ||
|
||
<style scoped></style> |
This file contains 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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<template> | ||
<span>|</span> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'FilterDivider', | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
span { | ||
color: rgba(0, 0, 0, 0.12); | ||
align-self: center; | ||
} | ||
</style> |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When do we relative import components and when via the @ notation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do so more or less at random. I try to avoid too many ../../../../, and especially try to import from the symlinked common instead of the common folder outside the frontend folder. But most of the time I let phpstorm manage this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just my 2 cents: