Merge pull request #832 from Budibase/cheeks-bugfixes

Cheeks bugfixes
This commit is contained in:
Andrew Kingston 2020-11-09 09:48:58 +00:00 committed by GitHub
commit 3a01f53c7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 6 deletions

View File

@ -177,7 +177,7 @@ export const getFrontendStore = () => {
const foundScreen = currentPageScreens.findIndex(
el => el._id === screen._id
)
if (currentPageScreens !== -1) {
if (foundScreen !== -1) {
currentPageScreens.splice(foundScreen, 1)
}
currentPageScreens.push(screen)

View File

@ -1,5 +1,5 @@
<script>
import { goto } from "@sveltech/routify"
import { goto, params } from "@sveltech/routify"
import { backendUiStore, store } from "builderStore"
import { notifier } from "builderStore/store/notifications"
import { Input, Label, ModalContent } from "@budibase/bbui"
@ -51,6 +51,7 @@
const screens = screenTemplates($store, [table])
.filter(template => defaultScreens.includes(template.id))
.map(template => template.create())
store.actions.pages.select("main")
for (let screen of screens) {
// Record the table that created this screen so we can link it later
screen.autoTableId = table._id

View File

@ -10,10 +10,12 @@
export let screens = []
$: sortedScreens = screens.sort(
(s1, s2) => s1.props._instanceName > s2.props._instanceName
)
/*
$: sortedScreens = screens.sort((s1, s2) => {
const name1 = s1.props._instanceName?.toLowerCase() ?? ""
const name2 = s2.props._instanceName?.toLowerCase() ?? ""
return name1 > name2 ? 1 : -1
})
/*
Using a store here seems odd....
have a look in the <ComponentsHierarchyChildren /> code file to find out why.
I have commented the dragDropStore parameter