Skip to content

Commit 0a639b0

Browse files
authored
🔀 Merge pull request gchq#462 from Lissy93/FIX/section-height
[FIX] Section Height (colourful theme)
2 parents e1a78db + 947d616 commit 0a639b0

File tree

8 files changed

+32
-11
lines changed

8 files changed

+32
-11
lines changed

.github/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## 🐛 2.0.1 - Fixes Section Height [PR #462](https://github.com/Lissy93/dashy/pull/462)
4+
- Adds `cutToHeight` to config schema (Re: #461)
5+
- Removes the full-height CSS from colorful theme
6+
- Improved config validation warnings in JSON editor
7+
- Removes empty Keycloak block from appConfig editor
8+
- Adds typechecking to search and clear search for Safari
9+
310
## ⚡️ 2.0.0 - Small Fixes and Docker Multi-Arch Build [PR #451](https://github.com/Lissy93/dashy/pull/451)
411
- Fixes full-height sections for mobile and Safari (Re: #432, #442)
512
- Fixes empty section visible in search (Re: #447)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Dashy",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"license": "MIT",
55
"main": "server",
66
"author": "Alicia Sykes <[email protected]> (https://aliciasykes.com)",

src/components/Configuration/JsonEditor.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ export default {
198198
errorMessages.push({
199199
type: 'validation',
200200
msg: `${this.$t('config-editor.warning-msg-validation')}: `
201-
+ `${error.error.keyword} ${error.error.message}`,
201+
+ `${(error.error || error).dataPath} ${(error.error || error).message}`,
202202
});
203203
break;
204204
case 'error':

src/components/InteractiveEditor/EditAppConfig.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,15 @@ export default {
8686
/* Remove any attribute which has an undefined value before saving */
8787
removeUndefinedValues(rawAppConfig) {
8888
const raw = rawAppConfig;
89-
const isEmpty = (value) => (value === undefined);
90-
Object.keys(raw).forEach(key => isEmpty(raw[key]) && delete raw[key]);
89+
const isEmptyObject = (obj) => (typeof obj === 'object' && Object.keys(obj).length === 0);
90+
const isEmpty = (value) => (value === undefined || isEmptyObject(value));
91+
// Delete empty values
92+
Object.keys(raw).forEach(key => {
93+
if (isEmpty(raw[key])) delete raw[key];
94+
});
95+
// If KC config empty, delete it
96+
const kcConfig = raw.auth.keycloak;
97+
if (!kcConfig.clientId && !kcConfig.realm && !kcConfig.serverUrl) delete raw.auth.keycloak;
9198
return raw;
9299
},
93100
},

src/components/Settings/SettingsContainer.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,13 @@ export default {
100100
this.settingsVisible = this.getSettingsVisibility();
101101
},
102102
methods: {
103+
/* Emit event to begin/ continue searching */
103104
userIsTypingSomething(something) {
104105
this.$emit('user-is-searchin', something);
105106
},
107+
/* Call function to clear search field, remove focus and reset results */
106108
clearFilterInput() {
107-
this.$refs.SearchBar.clearFilterInput();
109+
if (this.$refs.SearchBar) this.$refs.SearchBar.clearFilterInput();
108110
},
109111
getInitialTheme() {
110112
return this.appConfig.theme || '';
@@ -115,10 +117,12 @@ export default {
115117
if (typeof userThemes === 'string') return [userThemes];
116118
return userThemes;
117119
},
120+
/* Show / hide settings */
118121
toggleSettingsVisibility() {
119122
this.settingsVisible = !this.settingsVisible;
120123
localStorage.setItem(localStorageKeys.HIDE_SETTINGS, this.settingsVisible);
121124
},
125+
/* Get initial settings visibility, either from appConfig, local storage or browser type */
122126
getSettingsVisibility() {
123127
const screenWidth = document.body.clientWidth;
124128
if (screenWidth && screenWidth < 600) return false;

src/components/Workspace/SideBar.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ export default {
6464
/* If an initial URL is specified, then open relevant section */
6565
openDefaultSection() {
6666
if (!this.initUrl) return;
67-
const process = (url) => url.replace(/[^\w\s]/gi, '').toLowerCase();
67+
const process = (url) => (url ? url.replace(/[^\w\s]/gi, '').toLowerCase() : undefined);
6868
const compare = (item) => (process(item.url) === process(this.initUrl));
69-
this.sections.forEach((section, sectionIndex) => {
70-
if (section.items.findIndex(compare) !== -1) this.openSection(sectionIndex);
69+
this.sections.forEach((section, secIndex) => {
70+
if (section.items && section.items.findIndex(compare) !== -1) this.openSection(secIndex);
7171
});
7272
},
7373
},

src/styles/color-themes.scss

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,9 +353,6 @@ html[data-theme='colorful'] {
353353
div.context-menu {
354354
border-color: var(--primary);
355355
}
356-
.collapsable.is-open {
357-
height: -webkit-fill-available;
358-
}
359356
}
360357

361358
html[data-theme='minimal-light'], html[data-theme='minimal-dark'], html[data-theme='vaporware'] {

src/utils/ConfigSchema.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,12 @@
530530
"default": false,
531531
"description": "If true, section needs to be clicked to open"
532532
},
533+
"cutToHeight": {
534+
"title": "Cut to Height",
535+
"type": "boolean",
536+
"default": false,
537+
"description": "By default, sections will fill available space. Set this option to true to match section height with content height"
538+
},
533539
"color": {
534540
"title": "Color",
535541
"type": "string",

0 commit comments

Comments
 (0)