Beta tab initial test for E2E, needs styled

This commit is contained in:
Martin McKeaveney 2022-06-08 10:20:47 +01:00
parent f2370418d7
commit a479c7c55c
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}`,
})
},
})