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

This commit is contained in:
Martin McKeaveney 2021-02-01 14:30:02 +00:00
commit 6725f820a4
3 changed files with 15 additions and 3 deletions

View File

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

View File

@ -107,6 +107,6 @@ describe("check manifest", () => {
it("should be able to retrieve the manifest", () => { it("should be able to retrieve the manifest", () => {
const manifest = getManifest() const manifest = getManifest()
expect(manifest.math).not.toBeNull() 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")
}) })
}) })

View File

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