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

[FIX] Minor UI editor fixes #416

Merged
merged 4 commits into from
Jan 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# 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)
- 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
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Dashy",
"version": "1.9.6",
"version": "1.9.7",
"license": "MIT",
"main": "server",
"author": "Alicia Sykes <alicia@omg.lol> (https://aliciasykes.com)",
Expand Down Expand Up @@ -96,4 +96,4 @@
"> 1%",
"last 2 versions"
]
}
}
20 changes: 12 additions & 8 deletions src/components/LinkItems/Section.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
@openContextMenu="openContextMenu"
>
<!-- 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') }}
</div>
<!-- Item Container -->
<div v-else-if="sectionType === 'item'"
<div v-if="hasItems"
:class="`there-are-items ${isGridLayout? 'item-group-grid': ''} inner-size-${itemSize}`"
:style="gridStyle" :id="`section-${groupId}`"
> <!-- Show for each item -->
Expand Down Expand Up @@ -58,7 +58,7 @@
/>
</div>
<div
v-else-if="sectionType === 'widget'"
v-if="hasWidgets"
:class="`widget-list ${isWide? 'wide' : ''}`">
<WidgetBase
v-for="(widget, widgetIndx) in widgets"
Expand Down Expand Up @@ -154,11 +154,15 @@ export default {
sortOrder() {
return this.displayData.sortBy || defaultSortOrder;
},
/* A section can contain either items or widgets */
sectionType() {
if (this.widgets && this.widgets.length > 0) return 'widget';
if (this.items && this.items.length > 0) return 'item';
return 'empty';
hasItems() {
if (this.isEditMode) return true;
return this.items && this.items.length > 0;
},
hasWidgets() {
return this.widgets && this.widgets.length > 0;
},
isEmpty() {
return !this.hasItems && !this.hasWidgets;
},
/* If the sortBy attribute is specified, then return sorted data */
sortedItems() {
Expand Down
3 changes: 2 additions & 1 deletion src/utils/SectionHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
const makeItemId = (sectionStr, itemStr, index) => {
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}`;
};

Expand Down
5 changes: 1 addition & 4 deletions src/utils/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ module.exports = {
pageInfo: {
title: 'Dashy',
description: '',
navLinks: [
{ title: 'Home', path: '/' },
{ title: 'Source', path: 'https://github.com/Lissy93/dashy' },
],
navLinks: [],
footerText: '',
},
/* Default appConfig to be used, if user does not specify their own */
Expand Down