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 0dd73b5e71
3 changed files with 9 additions and 6 deletions

View File

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

View File

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

View File

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