Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api-form-builder): migrate to HCMS entity #3862

Draft
wants to merge 41 commits into
base: neatbyte/form-builder-hcms
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
76cfaae
feat: form statistics
neatbyte-vnobis Dec 21, 2023
3af8bac
fix: make sure only existing ddb-es items get deleted
neatbyte-vnobis Jan 3, 2024
458fa4c
fix: requested changes
neatbyte-vnobis Jan 8, 2024
ff63eb1
fix: revert back form crud changes
neatbyte-vnobis Jan 8, 2024
57116a8
fix: handle createFormStats error scenario
neatbyte-vnobis Jan 9, 2024
973569c
wip: ddb form builder migration
leopuleo Jan 10, 2024
e53acd2
Merge branch 'next' into leo/feat/form-hcms-migrations
leopuleo Jan 22, 2024
748d3b5
test: check demo status
leopuleo Jan 23, 2024
11c1d9c
Merge branch 'neatbyte/form-builder-hcms' into neatbyte/form-stats
leopuleo Jan 24, 2024
e3ba630
Merge branch 'neatbyte/form-builder-hcms' into neatbyte/form-stats
leopuleo Jan 24, 2024
7cb1d66
chore: fix form stats creation
leopuleo Jan 24, 2024
9d8b860
test: fix ownedBy
leopuleo Jan 24, 2024
eb03028
fix: add revision level entry metas
leopuleo Jan 25, 2024
a708c5c
chore: fix naming
leopuleo Jan 25, 2024
0539fb9
feat: migrate form stats
leopuleo Jan 25, 2024
a1df7a4
Merge branch 'neatbyte/form-builder-hcms' into neatbyte/form-stats
leopuleo Jan 25, 2024
27c69a7
chore: change logging
leopuleo Jan 26, 2024
023f6b9
chore: change types
leopuleo Jan 26, 2024
65d9881
feat: migrate form submissions
leopuleo Jan 26, 2024
84ff96e
Merge branch 'neatbyte/form-builder-hcms' into neatbyte/form-stats
leopuleo Feb 5, 2024
09e507c
feat: es migrate forms
leopuleo Feb 6, 2024
f29ef50
chore: name
leopuleo Feb 6, 2024
42c43bc
feat: add form stats migration
leopuleo Feb 6, 2024
853321c
test: should execute in form stats migration
leopuleo Feb 6, 2024
9922872
test: add form submissions migration ddb-es
leopuleo Feb 7, 2024
c9b5b3a
refactor: move form submission to a separate migration
leopuleo Feb 7, 2024
fb7eefb
test: use getMigratedFormStatsData
leopuleo Feb 8, 2024
891eb17
chore: improve logs
leopuleo Feb 8, 2024
e537f64
chore: fix deps
leopuleo Feb 9, 2024
9fe9b55
chore: fix test
leopuleo Feb 9, 2024
fb5f646
Merge branch 'neatbyte/form-stats' into leo/feat/form-hcms-migrations
leopuleo Feb 9, 2024
d8e155c
fix: add forceExecute flat into shouldExecute
leopuleo Feb 10, 2024
e00b450
Merge branch 'neatbyte/form-builder-hcms' into neatbyte/form-stats
leopuleo Feb 10, 2024
75c5145
Merge branch 'neatbyte/form-stats' into leo/feat/form-hcms-migrations
leopuleo Feb 10, 2024
2a18d8b
Merge branch 'neatbyte/form-builder-hcms' into neatbyte/form-stats
leopuleo Feb 13, 2024
9723d2a
Merge branch 'neatbyte/form-stats' into leo/feat/form-hcms-migrations
leopuleo Feb 13, 2024
bfd86d0
Merge branch 'neatbyte/form-builder-hcms' into neatbyte/form-stats
leopuleo Feb 13, 2024
1158d2f
Merge branch 'neatbyte/form-builder-hcms' into leo/feat/form-hcms-mig…
leopuleo Feb 13, 2024
7e86ec6
Merge branch 'neatbyte/form-builder-hcms' into neatbyte/form-stats
leopuleo Feb 13, 2024
abb81fc
Merge branch 'neatbyte/form-stats' into leo/feat/form-hcms-migrations
leopuleo Feb 13, 2024
6358b5e
Merge branch 'neatbyte/form-builder-hcms' into leo/feat/form-hcms-mig…
leopuleo Feb 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3,351 changes: 3,351 additions & 0 deletions packages/migrations/__tests__/migrations/5.40.0/001/ddb-es/001.ddb.ts

Large diffs are not rendered by default.

255 changes: 255 additions & 0 deletions packages/migrations/__tests__/migrations/5.40.0/001/ddb-es/001.es.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,255 @@
import { user } from "./001.ddb";

export const createEsFormsData = () => {
return [
// Form with 1 revision published
{
formId: "65c0a07038a36e00082095ea",
savedOn: "2024-02-05T08:47:01.134Z",
publishedOn: "2024-02-05T08:47:01.134Z",
published: true,
locale: "en-US",
createdOn: "2024-02-05T08:46:40.354Z",
version: 1,
createdBy: user,
webinyVersion: "0.0.0",
__type: "fb.form",
name: "Demo form 1",
id: "65c0a07038a36e00082095ea#0001",
locked: true,
ownedBy: user,
slug: "demo-form-1-65c0a07038a36e00082095ea",
tenant: "root",
status: "published"
},

// Form with 2 revisions: 1° published, 2° draft
{
formId: "65c479873ff56c0008735714",
savedOn: "2024-02-08T06:50:17.141Z",
publishedOn: null,
published: false,
locale: "en-US",
createdOn: "2024-02-08T06:50:17.141Z",
version: 2,
createdBy: user,
webinyVersion: "0.0.0",
__type: "fb.form",
name: "Demo form 2",
id: "65c479873ff56c0008735714#0002",
locked: false,
ownedBy: user,
slug: "demo-form-2-65c479873ff56c0008735714",
tenant: "root",
status: "draft"
},

// Form with 1 draft revision
{
formId: "65c492e1766cb000084357d1",
savedOn: "2024-02-08T08:38:06.346Z",
published: false,
locale: "en-US",
createdOn: "2024-02-08T08:37:53.951Z",
version: 1,
createdBy: user,
webinyVersion: "0.0.0",
__type: "fb.form",
name: "Demo form 3",
id: "65c492e1766cb000084357d1#0001",
locked: false,
ownedBy: user,
slug: "demo-form-3-65c492e1766cb000084357d1",
tenant: "root",
status: "draft"
},

// Form with 4 revisions: 1° published, 2° published, 3° unpublished, 4° draft
{
formId: "65c4994929b99b0008bd6167",
savedOn: "2024-02-08T09:06:08.967Z",
publishedOn: null,
published: false,
locale: "en-US",
createdOn: "2024-02-08T09:06:08.967Z",
version: 4,
createdBy: user,
webinyVersion: "0.0.0",
__type: "fb.form",
name: "Demo form 4",
id: "65c4994929b99b0008bd6167#0004",
locked: false,
ownedBy: user,
slug: "demo-form-4-65c4994929b99b0008bd6167",
tenant: "root",
status: "draft"
},

// Form with contact fields, required, organised in 2 steps
{
formId: "65c4a67e371e020008a5a8cb",
savedOn: "2024-02-08T10:02:12.516Z",
publishedOn: "2024-02-08T10:02:12.516Z",
published: true,
locale: "en-US",
createdOn: "2024-02-08T10:01:34.873Z",
version: 1,
createdBy: user,
webinyVersion: "0.0.0",
__type: "fb.form",
name: "Demo form 5",
id: "65c4a67e371e020008a5a8cb#0001",
locked: true,
ownedBy: user,
slug: "demo-form-5-65c4a67e371e020008a5a8cb",
tenant: "root",
status: "published"
},

// Form with default fields
{
formId: "65c4c9d05e7aad0008b21715",
savedOn: "2024-02-08T12:36:36.667Z",
publishedOn: "2024-02-08T12:36:36.667Z",
published: true,
locale: "en-US",
createdOn: "2024-02-08T12:32:16.133Z",
version: 1,
createdBy: user,
webinyVersion: "0.0.0",
__type: "fb.form",
name: "Demo form 6",
id: "65c4c9d05e7aad0008b21715#0001",
locked: true,
ownedBy: user,
slug: "demo-form-6-65c4c9d05e7aad0008b21715",
tenant: "root",
status: "published"
},

// Form with custom settings
{
formId: "65c4d1dfb0bf8a00087fbcd6",
savedOn: "2024-02-08T13:07:56.618Z",
published: false,
locale: "en-US",
createdOn: "2024-02-08T13:06:39.264Z",
version: 1,
createdBy: user,
webinyVersion: "0.0.0",
__type: "fb.form",
name: "Demo form 7",
id: "65c4d1dfb0bf8a00087fbcd6#0001",
locked: false,
ownedBy: user,
slug: "demo-form-7-65c4d1dfb0bf8a00087fbcd6",
tenant: "root",
status: "draft"
},

// Form 1 from root tenant, locale de-DE
{
formId: "65c4ea4ac04244000878b1e9",
savedOn: "2024-02-08T14:51:05.869Z",
publishedOn: "2024-02-08T14:51:05.869Z",
published: true,
locale: "de-DE",
createdOn: "2024-02-08T14:50:50.570Z",
version: 1,
createdBy: user,
webinyVersion: "0.0.0",
__type: "fb.form",
name: "Demo form 8",
id: "65c4ea4ac04244000878b1e9#0001",
locked: true,
ownedBy: user,
slug: "demo-form-8-65c4ea4ac04244000878b1e9",
tenant: "root",
status: "published"
},

// Form 2 from root tenant, locale de-DE
{
formId: "65c4ea4ac04244000878b1f0",
savedOn: "2024-02-08T14:51:05.869Z",
publishedOn: "2024-02-08T14:51:05.869Z",
published: true,
locale: "de-DE",
createdOn: "2024-02-08T14:50:50.570Z",
version: 1,
createdBy: user,
webinyVersion: "0.0.0",
__type: "fb.form",
name: "Demo form 9",
id: "65c4ea4ac04244000878b1f0#0001",
locked: true,
ownedBy: user,
slug: "demo-form-9-65c4ea4ac04244000878b1f0",
tenant: "root",
status: "published"
},

// Form 1 from root tenant, locale fr-FR
{
formId: "65c4ea4ac04244000878b1f1",
savedOn: "2024-02-08T14:51:05.869Z",
publishedOn: "2024-02-08T14:51:05.869Z",
published: true,
locale: "fr-FR",
createdOn: "2024-02-08T14:50:50.570Z",
version: 1,
createdBy: user,
webinyVersion: "0.0.0",
__type: "fb.form",
name: "Demo form 10",
id: "65c4ea4ac04244000878b1f1#0001",
locked: true,
ownedBy: user,
slug: "demo-form-10-65c4ea4ac04244000878b1f1",
tenant: "root",
status: "published"
},

// Form 1 from otherTenant, locale fr-FR
{
formId: "65c4ea4ac04244000878b1f2",
savedOn: "2024-02-08T14:51:05.869Z",
publishedOn: "2024-02-08T14:51:05.869Z",
published: true,
locale: "fr-FR",
createdOn: "2024-02-08T14:50:50.570Z",
version: 1,
createdBy: user,
webinyVersion: "0.0.0",
__type: "fb.form",
name: "Demo form 11",
id: "65c4ea4ac04244000878b1f2#0001",
locked: true,
ownedBy: user,
slug: "demo-form-11-65c4ea4ac04244000878b1f2",
tenant: "otherTenant",
status: "published"
},

// Form 2 from otherTenant, locale fr-FR
{
formId: "65c4ea4ac04244000878b1f3",
savedOn: "2024-02-08T14:51:05.869Z",
publishedOn: "2024-02-08T14:51:05.869Z",
published: true,
locale: "fr-FR",
createdOn: "2024-02-08T14:50:50.570Z",
version: 1,
createdBy: user,
webinyVersion: "0.0.0",
__type: "fb.form",
name: "Demo form 12",
id: "65c4ea4ac04244000878b1f3#0001",
locked: true,
ownedBy: user,
slug: "demo-form-12-65c4ea4ac04244000878b1f3",
tenant: "otherTenant",
status: "published"
}
];
};
Loading
Loading