Skip to content

Commit

Permalink
fix(#438): add escaping to story title (#439)
Browse files Browse the repository at this point in the history
  • Loading branch information
Decipher authored Feb 10, 2022
1 parent a514ae7 commit d65eb40
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/wild-humans-cough.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"druxt-entity": patch
---

fix(#438): fixed DruxtEntity and DruxtEntityForm stories.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default {
options: [<%= (options.entities || []).map((o) => `'${o.id}'`).join(', ') %>],
control: {
type: 'select',
labels: Object.fromEntries([<%= (options.entities || []).map((o) => `['${o.id}', "${o.title} (${o.id})"]`).join(', ') %>])
labels: Object.fromEntries([<%= (options.entities || []).map((o) => `['${o.id}', '${o.title.replace(/\'/g, "\\'")} (${o.id})']`).join(', ') %>])
},
},
value: {
Expand Down
2 changes: 1 addition & 1 deletion packages/entity/templates/druxt-entity.instance.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default {
options: [<%= (options.entities || []).map((o) => `'${o.id}'`).join(', ') %>],
control: {
type: 'select',
labels: Object.fromEntries([<%= (options.entities || []).map((o) => `['${o.id}', "${o.title} (${o.id})"]`).join(', ') %>])
labels: Object.fromEntries([<%= (options.entities || []).map((o) => `['${o.id}', '${o.title.replace(/\'/g, "\\'")} (${o.id})']`).join(', ') %>])
},
type: {
required: true,
Expand Down

0 comments on commit d65eb40

Please sign in to comment.