🔀 Merge pull request #416 from Lissy93/FIX/add-edit-item

[FIX] Minor UI editor fixes
Fixes #389
Fixes #390
Fixes #415
This commit is contained in:
Alicia Sykes 2022-01-09 15:18:53 +00:00 committed by GitHub
commit c5bbcebe06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 22 additions and 15 deletions

View File

@ -1,5 +1,10 @@
# Changelog # Changelog
## 🐛 1.9.7 - Minor UI Editor Bug fixes [PR #416](https://github.com/Lissy93/dashy/pull/416)
- Fixes unable to edit item bug (#415)
- Fixes unable to add new app bug (#390)
- Fixes nav links visibility (#389)
## ⚡️ 1.9.6 - Adds Proxy Support for Widget Requests [PR #392](https://github.com/Lissy93/dashy/pull/392) ## ⚡️ 1.9.6 - Adds Proxy Support for Widget Requests [PR #392](https://github.com/Lissy93/dashy/pull/392)
- Refactors widget mixin to include data requests, so that code can be shared between widgets - Refactors widget mixin to include data requests, so that code can be shared between widgets
- Adds a Node endpoint for proxying requests server-side, used for APIs that are not CORS enabled - Adds a Node endpoint for proxying requests server-side, used for APIs that are not CORS enabled

View File

@ -1,6 +1,6 @@
{ {
"name": "Dashy", "name": "Dashy",
"version": "1.9.6", "version": "1.9.7",
"license": "MIT", "license": "MIT",
"main": "server", "main": "server",
"author": "Alicia Sykes <alicia@omg.lol> (https://aliciasykes.com)", "author": "Alicia Sykes <alicia@omg.lol> (https://aliciasykes.com)",
@ -96,4 +96,4 @@
"> 1%", "> 1%",
"last 2 versions" "last 2 versions"
] ]
} }

View File

@ -12,11 +12,11 @@
@openContextMenu="openContextMenu" @openContextMenu="openContextMenu"
> >
<!-- If no items, show message --> <!-- If no items, show message -->
<div v-if="sectionType === 'empty'" class="no-items"> <div v-if="isEmpty" class="no-items">
{{ $t('home.no-items-section') }} {{ $t('home.no-items-section') }}
</div> </div>
<!-- Item Container --> <!-- Item Container -->
<div v-else-if="sectionType === 'item'" <div v-if="hasItems"
:class="`there-are-items ${isGridLayout? 'item-group-grid': ''} inner-size-${itemSize}`" :class="`there-are-items ${isGridLayout? 'item-group-grid': ''} inner-size-${itemSize}`"
:style="gridStyle" :id="`section-${groupId}`" :style="gridStyle" :id="`section-${groupId}`"
> <!-- Show for each item --> > <!-- Show for each item -->
@ -58,7 +58,7 @@
/> />
</div> </div>
<div <div
v-else-if="sectionType === 'widget'" v-if="hasWidgets"
:class="`widget-list ${isWide? 'wide' : ''}`"> :class="`widget-list ${isWide? 'wide' : ''}`">
<WidgetBase <WidgetBase
v-for="(widget, widgetIndx) in widgets" v-for="(widget, widgetIndx) in widgets"
@ -154,11 +154,15 @@ export default {
sortOrder() { sortOrder() {
return this.displayData.sortBy || defaultSortOrder; return this.displayData.sortBy || defaultSortOrder;
}, },
/* A section can contain either items or widgets */ hasItems() {
sectionType() { if (this.isEditMode) return true;
if (this.widgets && this.widgets.length > 0) return 'widget'; return this.items && this.items.length > 0;
if (this.items && this.items.length > 0) return 'item'; },
return 'empty'; hasWidgets() {
return this.widgets && this.widgets.length > 0;
},
isEmpty() {
return !this.hasItems && !this.hasWidgets;
}, },
/* If the sortBy attribute is specified, then return sorted data */ /* If the sortBy attribute is specified, then return sorted data */
sortedItems() { sortedItems() {

View File

@ -8,7 +8,8 @@ export const shouldBeVisible = (routeName) => !hideFurnitureOn.includes(routeNam
/* Based on section title, item name and index, return a string value for ID */ /* Based on section title, item name and index, return a string value for ID */
const makeItemId = (sectionStr, itemStr, index) => { const makeItemId = (sectionStr, itemStr, index) => {
const charSum = sectionStr.split('').map((a) => a.charCodeAt(0)).reduce((x, y) => x + y); const charSum = sectionStr.split('').map((a) => a.charCodeAt(0)).reduce((x, y) => x + y);
const itemTitleStr = itemStr.replace(/\s+/g, '-').replace(/[^a-zA-Z ]/g, '').toLowerCase(); const newItemStr = itemStr || `unknown_${Math.random()}`;
const itemTitleStr = newItemStr.replace(/\s+/g, '-').replace(/[^a-zA-Z ]/g, '').toLowerCase();
return `${index}_${charSum}_${itemTitleStr}`; return `${index}_${charSum}_${itemTitleStr}`;
}; };

View File

@ -3,10 +3,7 @@ module.exports = {
pageInfo: { pageInfo: {
title: 'Dashy', title: 'Dashy',
description: '', description: '',
navLinks: [ navLinks: [],
{ title: 'Home', path: '/' },
{ title: 'Source', path: 'https://github.com/Lissy93/dashy' },
],
footerText: '', footerText: '',
}, },
/* Default appConfig to be used, if user does not specify their own */ /* Default appConfig to be used, if user does not specify their own */