Browse Source

Merge pull request #697 from Budibase/bug/link-id-create-table-error

Minor bug fix for template screens and fixing link doc IDs
pull/4023/head
Michael Drury 6 years ago
committed by GitHub
parent
commit
00a455ecc7
  1. 3
      packages/builder/src/builderStore/storeUtils.js
  2. 1
      packages/builder/src/components/backend/ModelNavigator/modals/CreateTableModal.svelte
  3. 9
      packages/server/src/db/utils.js

3
packages/builder/src/builderStore/storeUtils.js

@ -36,7 +36,8 @@ export const saveCurrentPreviewItem = s =>
: saveScreenApi(s.currentPreviewItem, s) : saveScreenApi(s.currentPreviewItem, s)
export const savePage = async s => { export const savePage = async s => {
const page = s.pages[s.currentPageName] const pageName = s.currentPageName || "main"
const page = s.pages[pageName]
await api.post(`/_builder/api/${s.appId}/pages/${s.currentPageName}`, { await api.post(`/_builder/api/${s.appId}/pages/${s.currentPageName}`, {
page: { componentLibraries: s.pages.componentLibraries, ...page }, page: { componentLibraries: s.pages.componentLibraries, ...page },
uiFunctions: s.currentPageFunctions, uiFunctions: s.currentPageFunctions,

1
packages/builder/src/components/backend/ModelNavigator/modals/CreateTableModal.svelte

@ -41,7 +41,6 @@
.map(template => template.create()) .map(template => template.create())
for (let screen of screens) { for (let screen of screens) {
console.log(JSON.stringify(screen))
try { try {
await store.createScreen(screen) await store.createScreen(screen)
} catch (_) { } catch (_) {

9
packages/server/src/db/utils.js

@ -124,7 +124,14 @@ exports.generateAutomationID = () => {
* @returns {string} The new link doc ID which the automation doc can be stored under. * @returns {string} The new link doc ID which the automation doc can be stored under.
*/ */
exports.generateLinkID = (modelId1, modelId2, recordId1, recordId2) => { exports.generateLinkID = (modelId1, modelId2, recordId1, recordId2) => {
return `${DocumentTypes.AUTOMATION}${SEPARATOR}${modelId1}${SEPARATOR}${modelId2}${SEPARATOR}${recordId1}${SEPARATOR}${recordId2}` return `${DocumentTypes.LINK}${SEPARATOR}${modelId1}${SEPARATOR}${modelId2}${SEPARATOR}${recordId1}${SEPARATOR}${recordId2}`
}
/**
* Gets parameters for retrieving link docs, this is a utility function for the getDocParams function.
*/
exports.getLinkParams = (otherProps = {}) => {
return getDocParams(DocumentTypes.LINK, null, otherProps)
} }
/** /**

Loading…
Cancel
Save