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

Use Vuetify Themes #898

Merged
merged 42 commits into from
Jan 11, 2021
Merged

Use Vuetify Themes #898

merged 42 commits into from
Jan 11, 2021

Conversation

grolu
Copy link
Contributor

@grolu grolu commented Dec 3, 2020

What this PR does / why we need it:
This PR is a big step to make the dashboard customizable. By using vuetify themes it is possible to centrally configure the colors used by the dashboard. This also allows us to introduce dark mode.

Screen Shot 2021-01-11 at 12 49 12

Screen Shot 2021-01-11 at 12 49 33

Screen Shot 2021-01-11 at 12 50 58

Which issue(s) this PR fixes:
Fixes #873 Fixes #714

Special notes for your reviewer:

Release note:

Use Vuetify Themes to define Dashboard color scheme. This makes it easier to change colors and adaptions will not be overwritten by future code changes. See [Themes](https://github.com/gardener/dashboard/blob/master/docs/Theming.md) documentation for instructions on how to apply a custom theme to the Dashboard
Added Dark Mode support
Redesigned, cleaner Login Page

@gardener-robot gardener-robot added needs/review Needs review size/xl Size of pull request is huge (see gardener-robot robot/bots/size.py) needs/second-opinion Needs second review by someone else labels Dec 3, 2020
@gardener-robot-ci-1 gardener-robot-ci-1 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Dec 3, 2020
@gardener-robot-ci-3 gardener-robot-ci-3 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Dec 4, 2020
@gardener-robot-ci-1 gardener-robot-ci-1 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Dec 4, 2020
@gardener-robot-ci-2 gardener-robot-ci-2 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Dec 4, 2020
@gardener-robot-ci-1 gardener-robot-ci-1 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Dec 4, 2020
# Conflicts:
#	frontend/src/components/ShootListRow.vue
#	frontend/src/views/ShootList.vue

Changed hard coded color values to theme colors
@gardener-robot-ci-3 gardener-robot-ci-3 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Dec 4, 2020
@gardener-robot-ci-1 gardener-robot-ci-1 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jan 7, 2021
@gardener-robot-ci-2 gardener-robot-ci-2 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Jan 7, 2021
@gardener-robot-ci-1 gardener-robot-ci-1 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jan 7, 2021
@gardener-robot-ci-2 gardener-robot-ci-2 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jan 7, 2021
frontend/src/app.js Outdated Show resolved Hide resolved
<v-icon class="mr-3">mdi-account-circle</v-icon>
My Account
</v-btn>
</v-card-actions>
<v-divider></v-divider>
<v-card-actions class="px-3">
<v-icon color="primary" class="ml-2 mr-3">mdi-brightness-6</v-icon>
<v-switch v-model="darkModeValue" dense hide-details class="ma-0" color="primary" @click.native.stop></v-switch>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<v-switch v-model="darkModeValue" dense hide-details class="ma-0" color="primary" @click.native.stop></v-switch>
<v-switch v-model="darkMode" dense hide-details class="ma-0" color="primary" @click.native.stop></v-switch>

Comment on lines +151 to +152
'setError',
'setDarkMode'
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
'setError',
'setDarkMode'
'setError'

@gardener-robot-ci-1 gardener-robot-ci-1 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Jan 7, 2021
Comment on lines 164 to 165
'cfg',
'darkMode'
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
'cfg',
'darkMode'
'cfg'

Comment on lines 201 to 207
darkModeValue: {
get () {
return this.darkMode
},
set (value) {
this.setDarkMode(value)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
darkModeValue: {
get () {
return this.darkMode
},
set (value) {
this.setDarkMode(value)
}
darkMode: {
get () {
return this.$store.state.darkMode
},
set (value) {
this.$store.commit('SET_DARK_MODE', value)
}

@@ -122,7 +127,8 @@ const state = {
shortName: 'SC',
description: 'Indicates whether all system components in the kube-system namespace are up and running. Gardener manages these system components and should automatically take care that the components become healthy again.'
}
}
},
darkMode: false
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
darkMode: false
darkMode: (Vuetify.framework.theme.dark = localStorage.getItem('global/dark-mode') === 'true')

Comment on lines 1410 to 1418
},
setDarkMode ({ commit }, darkMode) {
commit('SET_DARK_MODE', darkMode)
return state.darkMode
},
initStore ({ commit }) {
const darkMode = localStorage.getItem('global/dark-mode') || false
commit('SET_DARK_MODE', darkMode)
return state
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
},
setDarkMode ({ commit }, darkMode) {
commit('SET_DARK_MODE', darkMode)
return state.darkMode
},
initStore ({ commit }) {
const darkMode = localStorage.getItem('global/dark-mode') || false
commit('SET_DARK_MODE', darkMode)
return state

@@ -20,22 +20,23 @@ const App = Vue.extend({
this.$bus.$emit('esc-pressed')
}
})

const darkMode = Vue.localStorage.getItem('global/dark-mode') === 'true'
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const darkMode = Vue.localStorage.getItem('global/dark-mode') === 'true'
const darkMode = this.$localStorage.getItem('global/dark-mode') === 'true'

Comment on lines 1006 to 1008
},
getDarkMode (state) {
return state.darkMode
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
},
getDarkMode (state) {
return state.darkMode

get () {
return this.darkMode
return this.getDarkMode
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return this.getDarkMode
return this.$store.state.darkMode

]),
...mapGetters([
'username',
'displayName',
'avatarUrl',
'isAdmin'
'isAdmin',
'getDarkMode'
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
'getDarkMode'

@gardener-robot-ci-3 gardener-robot-ci-3 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Jan 11, 2021
@gardener-robot-ci-2 gardener-robot-ci-2 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jan 11, 2021
@gardener-robot-ci-3 gardener-robot-ci-3 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jan 11, 2021
Copy link
Contributor

@holgerkoser holgerkoser left a comment

Choose a reason for hiding this comment

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

/lgtm

@gardener-robot gardener-robot added reviewed/lgtm Has approval for merging and removed needs/review Needs review needs/second-opinion Needs second review by someone else labels Jan 11, 2021
@grolu grolu merged commit c8de58f into master Jan 11, 2021
@valentinvieriu
Copy link

Dark mode looks awesome!!!!! Can't wait to enable it!

@rfranzke
Copy link
Member

Is this synced automatically based on the system settings on MacOS? :)

@petersutter petersutter deleted the enh/vue-themes branch January 11, 2021 12:58
@grolu
Copy link
Contributor Author

grolu commented Jan 11, 2021

Is this synced automatically based on the system settings on MacOS? :)

Currently not. Maybe we can think about something like this when we introduce user settings.

@rfranzke
Copy link
Member

Yeah, thanks @grolu, would be great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) reviewed/lgtm Has approval for merging size/xl Size of pull request is huge (see gardener-robot robot/bots/size.py)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make colors configurable Dark Mode Support
8 participants