1
0
Fork 0
mirror of synced 2024-07-19 05:06:18 +12:00

Beta tab initial test for E2E, needs styled

This commit is contained in:
Martin McKeaveney 2022-06-08 10:20:47 +01:00
parent 75c599ce70
commit 02320c0ee0
3 changed files with 15 additions and 3 deletions

View file

@ -1,13 +1,13 @@
<script>
import { Body, Button, Layout, Heading } from "@budibase/bbui"
import { CookieUtils } from "@budibase/frontend-core"
import { flags } from "stores/backend"
function openFeedbackApp() {
window.open(`https://bb.budibase.app/betauifeedback`)
}
function revertToOldBuilder() {
CookieUtils.removeCookie("beta:new_design_ui")
async function revertToOldBuilder() {
await flags.toggleUiFeature("design_ui")
window.location.reload()
}
</script>

View file

@ -16,6 +16,9 @@ export function createFlagsStore() {
})
await actions.fetch()
},
toggleUiFeature: async feature => {
await API.toggleUiFeature({ value: feature })
},
}
return {

View file

@ -22,4 +22,13 @@ export const buildFlagEndpoints = API => ({
},
})
},
/**
* Allows us to experimentally toggle a beta UI feature through a cookie.
* @param value the feature to toggle
*/
toggleUiFeature: async ({ value }) => {
return await API.post({
url: `/api/beta/${value}`,
})
},
})