Browse Source

Merge branch 'feature/handlebars-helpers' of github.com:Budibase/budibase into feature/handlebars-helpers

master
Martin McKeaveney 6 years ago
parent
commit
6725f820a4
  1. 14
      packages/builder/src/components/design/PropertiesPanel/BindingPanel.svelte
  2. 2
      packages/string-templates/test/basic.spec.js
  3. 2
      packages/string-templates/test/helpers.spec.js

14
packages/builder/src/components/design/PropertiesPanel/BindingPanel.svelte

@ -101,7 +101,7 @@
<li on:click={() => addToText(helper.text)}>
<div>
<Label extraSmall>{helper.displayText}</Label>
{@html helper.description}
<div class="description">{@html helper.description}</div>
</div>
</li>
{/each}
@ -192,4 +192,16 @@
color: var(--red);
text-decoration: underline;
}
.description :global(p) {
color: var(--grey-7);
}
.description :global(p:hover) {
color: var(--ink);
}
.description :global(p a) {
color: var(--grey-7);
}
</style>

2
packages/string-templates/test/basic.spec.js

@ -107,6 +107,6 @@ describe("check manifest", () => {
it("should be able to retrieve the manifest", () => {
const manifest = getManifest()
expect(manifest.math).not.toBeNull()
expect(manifest.math.abs.description).toBe("Return the magnitude of `a`.")
expect(manifest.math.abs.description).toBe("<p>Return the magnitude of <code>a</code>.</p>\n")
})
})

2
packages/string-templates/test/helpers.spec.js

@ -167,7 +167,7 @@ describe("test the date helpers", () => {
it("should allow use of the date helper with now time", async () => {
const date = new Date()
const output = await processString("{{ date now 'DD' }}", {})
expect(output).toBe(date.getDate().toString())
expect(parseInt(output)).toBe(date.getDate())
})
})

Loading…
Cancel
Save