fix rotation on state arrow

This commit is contained in:
Martin McKeaveney 2020-02-11 17:23:25 +00:00
parent e410748bed
commit 5795a78cd5
2 changed files with 37 additions and 4 deletions

View File

@ -58,14 +58,14 @@
onChanged(e.target.value);
}} />
<button on:click={() => (isOpen = !isOpen)}>
<span
<div
class="icon"
style={`
transform: rotate(${isOpen ? 180 : -90}deg);
color: ${bindingPath ? 'rgba(0, 85, 255, 0.8)' : 'inherit'}
transform: rotate(${isOpen ? 0 : 90}deg);
color: ${bindingPath ? 'rgba(0, 85, 255, 0.8);' : 'inherit;'}
`}>
<ArrowDownIcon size={36} />
</span>
</div>
</button>
</div>
{#if isOpen}

View File

@ -9,6 +9,7 @@ const screen1 = require("../appPackages/testApp/pages/main/screens/screen1.json"
const screen2 = require("../appPackages/testApp/pages/main/screens/screen2.json")
const { readJSON, pathExists, unlink, readFile } = require("fs-extra")
const { getHashedCssPaths } = require("../utilities/builder/convertCssToFiles")
const listScreens = require("../utilities/builder/listScreens");
const app = require("./testApp")()
testComponents.textbox.name = `./customComponents/textbox`
@ -217,3 +218,35 @@ it("/savePage should prepare all necessary client files", async () => {
expect(savedScreen2Css).toEqual(screen2Css)
expect(indexHtmlMain.includes(screen2CssPaths.url)).toBe(true)
})
it("builds the correct stateOrigins object from a screen definition with no handlers", () => {
expect(listScreens.buildStateOrigins(screen1)).toEqual({});
});
it("builds the correct stateOrigins object from a screen definition with handlers", () => {
expect(listScreens.buildStateOrigins({
"name": "screen1",
"description": "",
"props": {
"_component": "@budibase/standard-components/div",
"className": "",
"onClick": [
{
"##eventHandlerType": "Set State",
"parameters": {
"path": "testKey",
"value": "value"
}
}
]
}
})).toEqual({
"testKey": {
"##eventHandlerType": "Set State",
"parameters": {
"path": "testKey",
"value": "value"
}
}
});
});