Skip to content

Commit

Permalink
Fix iconset page page (#434)
Browse files Browse the repository at this point in the history
* Fix classic iconset page not showing any icons

Fixes openhab/openhab-docs#2169.

Caused by openhab/openhab-webui#2084.

Signed-off-by: Florian Hotze <[email protected]>

* Update .gitignore files for generated stuff and remove thing-types.json

thing-types.json does not need to be in the repo, as it is generated by the docs build.
I guess it was accidentally committed in 16da0db#diff-866bea5377be53e4c1181d586cea266080b5223a9a956a12149e4e20be09765e.

Signed-off-by: Florian Hotze <[email protected]>
  • Loading branch information
florian-h05 authored Dec 15, 2023
1 parent 74e3185 commit 95e8a44
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# IntelliJ project folder
.idea

# Logs
logs
*.log
Expand Down
1 change: 1 addition & 0 deletions .vuepress/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
addons-*
public/logos
thing-types.json
tmp
16 changes: 8 additions & 8 deletions .vuepress/components/IconsetDisplay.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
<h2>Other Icons</h2>
<div class="iconset-icons">
<div class="iconset-icon" v-for="icon in icons_without_category.sort()">
<img :src="`/iconsets/classic/${icon}`" :title="iconTooltip(icon.replace('.png', ''))" />
<caption>{{icon.replace('.png', '')}}</caption>
<img :src="`/iconsets/classic/${icon}`" :title="iconTooltip(icon.replace('.svg', ''))" />
<caption>{{icon.replace('.svg', '')}}</caption>
</div>
</div>
</div>
Expand Down Expand Up @@ -76,22 +76,22 @@ export default {
},
methods: {
existingIcons (category) {
return (category.filter(i => allicons.indexOf(i + '.png') >= 0))
return (category.filter(i => allicons.indexOf(i + '.svg') >= 0))
},
iconFile (icon) {
return `/iconsets/classic/${icon}.png`
return `/iconsets/classic/${icon}.svg`
},
iconTooltip (icon) {
return (allicons.filter(i => i.indexOf(icon + '.png') === 0 || i.indexOf(icon + '-') === 0)).map(i => i.replace('.png', '')).join(' ')
return (allicons.filter(i => i.indexOf(icon + '.svg') === 0 || i.indexOf(icon + '-') === 0)).map(i => i.replace('.svg', '')).join(' ')
}
},
computed: {
icons_without_category () {
return allicons.filter(i =>
i.indexOf('-') < 0 &&
this.categories.places.indexOf(i.replace('.png', '')) < 0 &&
this.categories.things.indexOf(i.replace('.png', '')) < 0 &&
Object.values(this.categories.channels).every(c => c.indexOf(i.replace('.png', '')) < 0)
this.categories.places.indexOf(i.replace('.svg', '')) < 0 &&
this.categories.things.indexOf(i.replace('.svg', '')) < 0 &&
Object.values(this.categories.channels).every(c => c.indexOf(i.replace('.svg', '')) < 0)
)
}
}
Expand Down
1 change: 0 additions & 1 deletion .vuepress/thing-types.json

This file was deleted.

1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ concepts
configuration
developer
installation
settings
tutorial
ui
readme.md
2 changes: 1 addition & 1 deletion generate_iconset_doc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
$categories_places = []
$categories_thing = []

Dir.glob("#{$original_iconsets_location}/#{$iconset_name}/src/main/resources/icons/*.png").each { |path|
Dir.glob("#{$original_iconsets_location}/#{$iconset_name}/src/main/resources/icons/*.svg").each { |path|
$icons_list.push(File.basename(path))
}

Expand Down

0 comments on commit 95e8a44

Please sign in to comment.