Skip to content
This repository has been archived by the owner on May 4, 2022. It is now read-only.

Commit

Permalink
fix portlet-icon support for iconUrl custom SVG icons
Browse files Browse the repository at this point in the history
App directory details page header uses portlet-icon to render app directory entry icon. This fixes support for custom iconUrl by correctly sourcing the data from the layoutObject in the portlet entry rather than incorrectly trying to source it from the surface. Cf. the structure of the data in the example app directory entry JSONs.
  • Loading branch information
apetro committed Jun 8, 2020
1 parent 699cb4a commit 6035f23
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ and this project adheres to

## unreleased

No changes yet.
+ fix `portlet-icon` directive to support `iconUrl`
(the now preferred URL-to-an-SVG-file way of referencing icons).
so that app directory details pages show the entry icon rather than defaulting
to showing a star icon.

## 10.2.2 - 2020-04-14

Expand Down
4 changes: 2 additions & 2 deletions web/src/main/webapp/my-app/layout/partials/portlet-icon.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
-->
<md-icon ng-if="portlet.mdIcon">{{ portlet.mdIcon }}</md-icon>
<img ng-if="!portlet.mdIcon && !portlet.faIcon && portlet.iconUrl" ng-src="{{portlet.iconUrl}}" alt="App icon">
<img style="width:24px; height:24px;" ng-if="!portlet.mdIcon && !portlet.faIcon && portlet.layoutObject && portlet.layoutObject.iconUrl" ng-src="{{portlet.layoutObject.iconUrl}}" alt="App icon">
<i ng-if="!portlet.mdIcon && portlet.faIcon && portlet.faIcon.indexOf('fa-')===0" class="fa {{::portlet.faIcon}}"></i>
<i ng-if="!portlet.mdIcon && portlet.faIcon && portlet.faIcon.indexOf('fa-')!==0" class="{{::portlet.faIcon}}"></i>
<i ng-if="!portlet.mdIcon && !portlet.faIcon && !portlet.iconUrl" class="fa fa-star"></i>
<i ng-if="!portlet.mdIcon && !portlet.faIcon && (!portlet.layoutObject.iconUrl || !portlet.layoutObject.iconUrl )" class="fa fa-star"></i>

0 comments on commit 6035f23

Please sign in to comment.