Skip to content

Commit

Permalink
Fix display of stars in map.apps 4.14
Browse files Browse the repository at this point in the history
HTML is now escaped by the updated dgrid for security reasons. Returning { html: ... } is necessary if raw html should be rendered.

See also dojo/dojo1-dgrid#1419
  • Loading branch information
mbeckem committed Aug 12, 2022
1 parent 5e47668 commit 991e2f7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
This project is intended to be integrated as a bundle to the installation of your map.apps manager.

## Installation Guide
**Requirement: map.apps 4.6.0**
**Requirement: map.apps 4.14**

Before you add the Bundle to your manager, please configure the user and the topic property in the manifest.json to point to your GitHub account. Topic can be left empty.
You will have to add a released bundle.jar/zip as a bundle in your map.apps manager.
Expand Down
7 changes: 5 additions & 2 deletions src/main/js/bundles/mapapps-github-manager/BundleStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import TypeFormat from "ct/util/TypeFormat";
import ct_when from "ct/_when";
import apprt_request from "apprt-request";
import d_array from "dojo/_base/array";
import stringEscape from "apprt-core/string-escape";

export default declare([ComplexMemory], {
jsonp: true,
Expand All @@ -29,8 +30,10 @@ export default declare([ComplexMemory], {
// register new formatter at ct/util/TypeFormatter class
TypeFormat["stars"] = function (value) {
// eslint-disable-next-line max-len
const star = '<svg aria-label="stars" class="octicon octicon-star" height="16" role="img" version="1.1" viewBox="0 0 14 16" width="14"><path fill="#f1c40f" d="M14 6l-4.9-.64L7 1 4.9 5.36 0 6l3.6 3.26L2.67 14 7 11.67 11.33 14l-.93-4.74z"></path></svg>'
return star + " " + value;
const star = '<svg aria-label="stars" class="octicon octicon-star" height="16" role="img" version="1.1" viewBox="0 0 14 16" width="14"><path fill="#f1c40f" d="M14 6l-4.9-.64L7 1 4.9 5.36 0 6l3.6 3.26L2.67 14 7 11.67 11.33 14l-.93-4.74z"></path></svg>';
return {
html: `${star} ${stringEscape(value)}`
};
};

if (TypeFormat["version"]) {
Expand Down

0 comments on commit 991e2f7

Please sign in to comment.