From d7d5c0291ce9e57da3cfdf8b207226857b9e5c9b Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sun, 30 Oct 2022 13:41:48 +0000 Subject: [PATCH 1/4] =?UTF-8?q?=E2=9C=A8=20Adds=20option=20for=20default?= =?UTF-8?q?=20icon=20(#925)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/LinkItems/Item.vue | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/components/LinkItems/Item.vue b/src/components/LinkItems/Item.vue index 581d4a7a..feafb75d 100644 --- a/src/components/LinkItems/Item.vue +++ b/src/components/LinkItems/Item.vue @@ -14,16 +14,16 @@ :style="customStyle" > -
+
{{ item.title }}

{{ item.description }}

- @@ -65,7 +65,6 @@ import MoveItemTo from '@/components/InteractiveEditor/MoveItemTo'; import ContextMenu from '@/components/LinkItems/ItemContextMenu'; import StoreKeys from '@/utils/StoreMutations'; import ItemMixin from '@/mixins/ItemMixin'; -// import { targetValidator } from '@/utils/ConfigHelpers'; import EditModeIcon from '@/assets/interface-icons/interactive-editor-edit-mode.svg'; import { modalNames } from '@/utils/defaults'; @@ -89,6 +88,10 @@ export default { EditModeIcon, }, computed: { + /* Returns either item.icon, or appConfig.defaultIcon, or null */ + itemIcon() { + return this.item.icon || this.$store.getters.appConfig?.defaultIcon; + }, makeColumnCount() { if ((this.sectionDisplayData || {}).itemCountX) return this.sectionDisplayData.itemCountX; if (this.sectionWidth < 380) return 1; @@ -101,8 +104,7 @@ export default { /* Based on item props, adjust class names */ makeClassList() { const { isAddNew, isEditMode, size } = this; - const { icon } = this.item; - return `size-${size} ${!icon ? 'short' : ''} ` + return `size-${size} ${!this.itemIcon ? 'short' : ''} ` + `${isAddNew ? 'add-new' : ''} ${isEditMode ? 'is-edit-mode' : ''}`; }, /* Used by certain themes (material), to show animated CSS icon */ From 3cde47c7b721a9eceb90b3b8989524d6635edc24 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sun, 30 Oct 2022 13:51:21 +0000 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=93=9D=20Adds=20docs=20for=20using=20?= =?UTF-8?q?appConfig.defaultIcon=20(#925)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/icons.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/icons.md b/docs/icons.md index 2e97b7c3..b58481c1 100644 --- a/docs/icons.md +++ b/docs/icons.md @@ -11,6 +11,7 @@ Both sections and items can have an icon, which is specified using the `icon` at - [Material Icons](#material-design-icons) - [Icons by URL](#icons-by-url) - [Local Icons](#local-icons) +- [Using a Default Icon](#default-icon) - [No Icon](#no-icon)

@@ -172,6 +173,12 @@ You can also use sub-folders within the `item-icons` directory to keep things or --- +## Default Icon + +If you'd like to set a default icon, to be applied to any items which don't have an icon already set, then this can be done under `appConfig.defaultIcon`. + +--- + ## No Icon If you don't wish for a given item or section to have an icon, just leave out the `icon` attribute. From 9f07ba08433641747dc6170016c72966416538ae Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sun, 30 Oct 2022 13:53:26 +0000 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=97=83=20Adds=20defaultIcon=20to=20sc?= =?UTF-8?q?hema=20and=20config=20list=20(#925)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/configuring.md | 1 + src/utils/ConfigSchema.json | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/docs/configuring.md b/docs/configuring.md index 9807070c..4c915893 100644 --- a/docs/configuring.md +++ b/docs/configuring.md @@ -112,6 +112,7 @@ The following file provides a reference of all supported configuration options. **`fontAwesomeKey`** | `string` | _Optional_ | If you have a font-awesome key, then you can use it here and make use of premium icons. It is a 10-digit alpha-numeric string from you're FA kit URL (e.g. `13014ae648`) **`faviconApi`** | `enum` | _Optional_ | Only applicable if you are using favicons for item icons. Specifies which service to use to resolve favicons. Set to `local` to do this locally, without using an API. Services running locally will use this option always. Available options are: `local`, `faviconkit`, `iconhorse`, `google`, `clearbit`, `webmasterapi` and `allesedv`. Defaults to `faviconkit`. See [Icons](/docs/icons.md#favicons) for more info **`auth`** | `object` | _Optional_ | All settings relating to user authentication. See [`auth`](#appconfigauth-optional) +**`defaultIcon`** | `string` | _Optional_ | An icon to be applied to any items, which don't already have an icon set. See [Icon Docs](/docs/icons.md#default-icon) for more info **`layout`** | `enum` | _Optional_ | Layout for homepage, either `horizontal`, `vertical` or `auto`. Defaults to `auto`. This specifies the layout and direction of how sections are positioned on the home screen. This can also be modified and overridden from the UI. **`iconSize`** | `enum` | _Optional_ | The size of link items / icons. Can be either `small`, `medium,` or `large`. Defaults to `medium`. This can also be set directly from the UI. **`colCount`** | `number` | _Optional_ | The number of columns of sections displayed on the homepage, using the default view. Should be in integer between `1` and `8`. Note that by default this is applied responsively, based on current screen size, and specifying a value here will override this behavior, which may not be desirable. diff --git a/src/utils/ConfigSchema.json b/src/utils/ConfigSchema.json index 3506bf34..bce7ddfe 100644 --- a/src/utils/ConfigSchema.json +++ b/src/utils/ConfigSchema.json @@ -193,6 +193,11 @@ "default": "allesedv", "description": "Which service to use to resolve favicons. Set to local to do this locally instead" }, + "defaultIcon": { + "title": "Default Icon", + "type": "string", + "description": "An icon to apply to any items which don't yet have the icon set" + }, "layout": { "title": "Default Layout", "type": "string", From 4d3a25c1bd4a80c21c77c488ae228ef0d86a4aa7 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sun, 30 Oct 2022 13:55:27 +0000 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=A9=B9=20Replaces=20width=20fill-avai?= =?UTF-8?q?lible=20with=20stretch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/LinkItems/Section.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/LinkItems/Section.vue b/src/components/LinkItems/Section.vue index 60d6c188..f1659ed5 100644 --- a/src/components/LinkItems/Section.vue +++ b/src/components/LinkItems/Section.vue @@ -389,9 +389,9 @@ export default { justify-content: space-around; .widget-base { min-width: 10rem; + width: stretch; width: -webkit-fill-available; width: -moz-available; - width: fill-available; } } }