@rippling/rippling-sdk 0.2.0-alpha.43 → 0.2.0-alpha.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/examples/manifest/dental-practice-management/dental-practice-management.ts +109 -52
- package/examples/manifest/dental-practice-management/manifest.json +83 -25
- package/examples/manifest/gym-membership-management/gym-membership-management.ts +107 -102
- package/examples/manifest/gym-membership-management/manifest.json +64 -32
- package/lib/manifest/_helpers.d.mts +4 -5
- package/lib/manifest/_helpers.d.mts.map +1 -1
- package/lib/manifest/_helpers.d.ts +4 -5
- package/lib/manifest/_helpers.d.ts.map +1 -1
- package/lib/manifest/_helpers.js.map +1 -1
- package/lib/manifest/_helpers.mjs.map +1 -1
- package/lib/manifest/app.d.mts +8 -13
- package/lib/manifest/app.d.mts.map +1 -1
- package/lib/manifest/app.d.ts +8 -13
- package/lib/manifest/app.d.ts.map +1 -1
- package/lib/manifest/app.js +13 -22
- package/lib/manifest/app.js.map +1 -1
- package/lib/manifest/app.mjs +13 -22
- package/lib/manifest/app.mjs.map +1 -1
- package/lib/manifest/sdui-page.d.mts +6 -1
- package/lib/manifest/sdui-page.d.mts.map +1 -1
- package/lib/manifest/sdui-page.d.ts +6 -1
- package/lib/manifest/sdui-page.d.ts.map +1 -1
- package/lib/manifest/sdui-page.js +6 -1
- package/lib/manifest/sdui-page.js.map +1 -1
- package/lib/manifest/sdui-page.mjs +6 -1
- package/lib/manifest/sdui-page.mjs.map +1 -1
- package/package.json +1 -1
- package/src/lib/manifest/_helpers.ts +4 -5
- package/src/lib/manifest/app.ts +18 -27
- package/src/lib/manifest/sdui-page.ts +6 -1
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -575,64 +575,121 @@ new CustomObjectPageLayout(planObj, {
|
|
|
575
575
|
visibilityConditions: {},
|
|
576
576
|
});
|
|
577
577
|
|
|
578
|
-
// ── SDUI
|
|
579
|
-
const
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
'
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
578
|
+
// ── SDUI object-list tabs ───────────────────────────────────────────────────
|
|
579
|
+
const sduiObjectListDependencies = {
|
|
580
|
+
'@rippling/rippling-sdk': '^0.2.0-alpha.33',
|
|
581
|
+
'@rippling/sdui-builder': '^0.1.0',
|
|
582
|
+
};
|
|
583
|
+
|
|
584
|
+
function objectListViewCode(objectApiName: string): string {
|
|
585
|
+
return [
|
|
586
|
+
"import { FunctionContext, FunctionEvent, FunctionResponse } from '@rippling/rippling-sdk';",
|
|
587
|
+
"import SDUI from '@rippling/sdui-builder';",
|
|
588
|
+
'',
|
|
589
|
+
`const OBJECT = '${objectApiName}';`,
|
|
590
|
+
'',
|
|
591
|
+
'export async function onRipplingEvent(',
|
|
592
|
+
' event: FunctionEvent,',
|
|
593
|
+
' context: FunctionContext,',
|
|
594
|
+
'): Promise<FunctionResponse> {',
|
|
595
|
+
' const action = event.parameters?.action;',
|
|
596
|
+
'',
|
|
597
|
+
" if (!action || action === 'init') {",
|
|
598
|
+
' const s = SDUI.createState({});',
|
|
599
|
+
' const root = SDUI.components.VStack({',
|
|
600
|
+
' children: [',
|
|
601
|
+
' SDUI.components.ObjectListView({',
|
|
602
|
+
' objectApiName: OBJECT,',
|
|
603
|
+
' canSearchInGrid: true,',
|
|
604
|
+
' }),',
|
|
605
|
+
' ],',
|
|
606
|
+
' });',
|
|
607
|
+
' return new FunctionResponse({',
|
|
608
|
+
' body: { spec: JSON.stringify(SDUI.render(s, root)) },',
|
|
609
|
+
' statusCode: 200,',
|
|
610
|
+
' headers: {},',
|
|
611
|
+
" message: '',",
|
|
612
|
+
' });',
|
|
613
|
+
' }',
|
|
614
|
+
'',
|
|
615
|
+
" return new FunctionResponse({ body: {}, statusCode: 200, headers: {}, message: '' });",
|
|
616
|
+
'}',
|
|
617
|
+
].join('\n');
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
function createObjectListPage(props: {
|
|
621
|
+
objectApiName: string;
|
|
622
|
+
functionApiName: string;
|
|
623
|
+
functionName: string;
|
|
624
|
+
functionDescription: string;
|
|
625
|
+
pageId: string;
|
|
626
|
+
pageName: string;
|
|
627
|
+
pageDescription: string;
|
|
628
|
+
}): SduiPage {
|
|
629
|
+
const listFn = new ManifestFunction(manifest, {
|
|
630
|
+
apiName: props.functionApiName,
|
|
631
|
+
name: props.functionName,
|
|
632
|
+
description: props.functionDescription,
|
|
633
|
+
runtime: 'lambda-deno',
|
|
634
|
+
code: objectListViewCode(props.objectApiName),
|
|
635
|
+
dependencies: sduiObjectListDependencies,
|
|
636
|
+
isAsync: false,
|
|
637
|
+
});
|
|
638
|
+
|
|
639
|
+
return new SduiPage(manifest, {
|
|
640
|
+
sduiPageId: props.pageId,
|
|
641
|
+
name: props.pageName,
|
|
642
|
+
function: listFn,
|
|
643
|
+
description: props.pageDescription,
|
|
644
|
+
});
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
const patientListPage = createObjectListPage({
|
|
648
|
+
objectApiName: patientObj.getApiName(),
|
|
649
|
+
functionApiName: 'dental_patient_list_fn',
|
|
650
|
+
functionName: 'Patients (SDUI)',
|
|
651
|
+
functionDescription: 'SDUI ObjectListView for patient records',
|
|
652
|
+
pageId: 'dental_patients',
|
|
653
|
+
pageName: 'Patients',
|
|
654
|
+
pageDescription: 'SDUI ObjectListView for patient records',
|
|
655
|
+
});
|
|
656
|
+
|
|
657
|
+
const operatoryListPage = createObjectListPage({
|
|
658
|
+
objectApiName: operatoryObj.getApiName(),
|
|
659
|
+
functionApiName: 'dental_operatory_list_fn',
|
|
660
|
+
functionName: 'Operatories (SDUI)',
|
|
661
|
+
functionDescription: 'SDUI ObjectListView for operatory records',
|
|
662
|
+
pageId: 'dental_operatories',
|
|
663
|
+
pageName: 'Operatories',
|
|
664
|
+
pageDescription: 'SDUI ObjectListView for operatory records',
|
|
665
|
+
});
|
|
666
|
+
|
|
667
|
+
const chairBoardPage = createObjectListPage({
|
|
668
|
+
objectApiName: apptObj.getApiName(),
|
|
669
|
+
functionApiName: 'dental_chair_schedule_fn',
|
|
670
|
+
functionName: 'Daily chair board (SDUI)',
|
|
671
|
+
functionDescription: 'SDUI ObjectListView for appointments (init + spec render)',
|
|
672
|
+
pageId: 'dental_chair_schedule',
|
|
673
|
+
pageName: 'Chair schedule',
|
|
674
|
+
pageDescription: 'SDUI list of appointments (searchable grid); use object records for status edits',
|
|
675
|
+
});
|
|
676
|
+
|
|
677
|
+
const treatmentPlanListPage = createObjectListPage({
|
|
678
|
+
objectApiName: planObj.getApiName(),
|
|
679
|
+
functionApiName: 'dental_treatment_plan_list_fn',
|
|
680
|
+
functionName: 'Treatment plans (SDUI)',
|
|
681
|
+
functionDescription: 'SDUI ObjectListView for treatment plan records',
|
|
682
|
+
pageId: 'dental_treatment_plans',
|
|
683
|
+
pageName: 'Treatment plans',
|
|
684
|
+
pageDescription: 'SDUI ObjectListView for treatment plan records',
|
|
628
685
|
});
|
|
629
686
|
|
|
630
687
|
new App(manifest, {
|
|
631
688
|
apiName: 'dental_practice_management_app',
|
|
632
689
|
name: 'Dental Practice Management',
|
|
633
|
-
description: 'Patient charts, operatories, treatment plans, and
|
|
690
|
+
description: 'Patient charts, operatories, treatment plans, and SDUI object-list tabs',
|
|
634
691
|
appType: 'custom',
|
|
635
|
-
pages: [
|
|
692
|
+
pages: [patientListPage, operatoryListPage, chairBoardPage, treatmentPlanListPage],
|
|
636
693
|
});
|
|
637
694
|
|
|
638
695
|
console.log(manifest.preview());
|
|
@@ -1588,6 +1588,7 @@
|
|
|
1588
1588
|
"name": "Patient chart",
|
|
1589
1589
|
"system_created": false,
|
|
1590
1590
|
"tab_edits": {
|
|
1591
|
+
"tabsOrder": ["chart"],
|
|
1591
1592
|
"newTabs": [
|
|
1592
1593
|
{
|
|
1593
1594
|
"key": "chart",
|
|
@@ -1638,8 +1639,7 @@
|
|
|
1638
1639
|
]
|
|
1639
1640
|
}
|
|
1640
1641
|
],
|
|
1641
|
-
"systemTabEdits": {}
|
|
1642
|
-
"tabsOrder": ["chart"]
|
|
1642
|
+
"systemTabEdits": {}
|
|
1643
1643
|
},
|
|
1644
1644
|
"header_edits": {
|
|
1645
1645
|
"newTitleField": "legal_name__c"
|
|
@@ -1655,6 +1655,7 @@
|
|
|
1655
1655
|
"name": "Operatory",
|
|
1656
1656
|
"system_created": false,
|
|
1657
1657
|
"tab_edits": {
|
|
1658
|
+
"tabsOrder": ["overview"],
|
|
1658
1659
|
"newTabs": [
|
|
1659
1660
|
{
|
|
1660
1661
|
"key": "overview",
|
|
@@ -1680,8 +1681,7 @@
|
|
|
1680
1681
|
]
|
|
1681
1682
|
}
|
|
1682
1683
|
],
|
|
1683
|
-
"systemTabEdits": {}
|
|
1684
|
-
"tabsOrder": ["overview"]
|
|
1684
|
+
"systemTabEdits": {}
|
|
1685
1685
|
},
|
|
1686
1686
|
"header_edits": {
|
|
1687
1687
|
"newTitleField": "operatory_name__c"
|
|
@@ -1697,6 +1697,7 @@
|
|
|
1697
1697
|
"name": "Appointment",
|
|
1698
1698
|
"system_created": false,
|
|
1699
1699
|
"tab_edits": {
|
|
1700
|
+
"tabsOrder": ["visit"],
|
|
1700
1701
|
"newTabs": [
|
|
1701
1702
|
{
|
|
1702
1703
|
"key": "visit",
|
|
@@ -1744,8 +1745,7 @@
|
|
|
1744
1745
|
]
|
|
1745
1746
|
}
|
|
1746
1747
|
],
|
|
1747
|
-
"systemTabEdits": {}
|
|
1748
|
-
"tabsOrder": ["visit"]
|
|
1748
|
+
"systemTabEdits": {}
|
|
1749
1749
|
},
|
|
1750
1750
|
"header_edits": {
|
|
1751
1751
|
"newTitleField": "board_label__c"
|
|
@@ -1761,6 +1761,7 @@
|
|
|
1761
1761
|
"name": "Treatment plan",
|
|
1762
1762
|
"system_created": false,
|
|
1763
1763
|
"tab_edits": {
|
|
1764
|
+
"tabsOrder": ["plan"],
|
|
1764
1765
|
"newTabs": [
|
|
1765
1766
|
{
|
|
1766
1767
|
"key": "plan",
|
|
@@ -1802,8 +1803,7 @@
|
|
|
1802
1803
|
]
|
|
1803
1804
|
}
|
|
1804
1805
|
],
|
|
1805
|
-
"systemTabEdits": {}
|
|
1806
|
-
"tabsOrder": ["plan"]
|
|
1806
|
+
"systemTabEdits": {}
|
|
1807
1807
|
},
|
|
1808
1808
|
"header_edits": {
|
|
1809
1809
|
"newTitleField": "plan_name__c"
|
|
@@ -1811,6 +1811,48 @@
|
|
|
1811
1811
|
"visibility_conditions": {},
|
|
1812
1812
|
"blueprint_key": "dental_treatment_plan__c"
|
|
1813
1813
|
},
|
|
1814
|
+
{
|
|
1815
|
+
"type": "FUNCTION",
|
|
1816
|
+
"name": "Patients (SDUI)",
|
|
1817
|
+
"api_name": "dental_patient_list_fn",
|
|
1818
|
+
"description": "SDUI ObjectListView for patient records",
|
|
1819
|
+
"code_draft": "import { FunctionContext, FunctionEvent, FunctionResponse } from '@rippling/rippling-sdk';\nimport SDUI from '@rippling/sdui-builder';\n\nconst OBJECT = 'dental_patient__c';\n\nexport async function onRipplingEvent(\n event: FunctionEvent,\n context: FunctionContext,\n): Promise<FunctionResponse> {\n const action = event.parameters?.action;\n\n if (!action || action === 'init') {\n const s = SDUI.createState({});\n const root = SDUI.components.VStack({\n children: [\n SDUI.components.ObjectListView({\n objectApiName: OBJECT,\n canSearchInGrid: true,\n }),\n ],\n });\n return new FunctionResponse({\n body: { spec: JSON.stringify(SDUI.render(s, root)) },\n statusCode: 200,\n headers: {},\n message: '',\n });\n }\n\n return new FunctionResponse({ body: {}, statusCode: 200, headers: {}, message: '' });\n}",
|
|
1820
|
+
"dependencies": {
|
|
1821
|
+
"@rippling/rippling-sdk": "^0.2.0-alpha.33",
|
|
1822
|
+
"@rippling/sdui-builder": "^0.1.0"
|
|
1823
|
+
},
|
|
1824
|
+
"deployment_options": {
|
|
1825
|
+
"runtime": "lambda-deno"
|
|
1826
|
+
}
|
|
1827
|
+
},
|
|
1828
|
+
{
|
|
1829
|
+
"type": "SDUI_PAGE",
|
|
1830
|
+
"name": "Patients",
|
|
1831
|
+
"sdui_page_id": "dental_patients",
|
|
1832
|
+
"function_api_name": "dental_patient_list_fn",
|
|
1833
|
+
"description": "SDUI ObjectListView for patient records"
|
|
1834
|
+
},
|
|
1835
|
+
{
|
|
1836
|
+
"type": "FUNCTION",
|
|
1837
|
+
"name": "Operatories (SDUI)",
|
|
1838
|
+
"api_name": "dental_operatory_list_fn",
|
|
1839
|
+
"description": "SDUI ObjectListView for operatory records",
|
|
1840
|
+
"code_draft": "import { FunctionContext, FunctionEvent, FunctionResponse } from '@rippling/rippling-sdk';\nimport SDUI from '@rippling/sdui-builder';\n\nconst OBJECT = 'dental_operatory__c';\n\nexport async function onRipplingEvent(\n event: FunctionEvent,\n context: FunctionContext,\n): Promise<FunctionResponse> {\n const action = event.parameters?.action;\n\n if (!action || action === 'init') {\n const s = SDUI.createState({});\n const root = SDUI.components.VStack({\n children: [\n SDUI.components.ObjectListView({\n objectApiName: OBJECT,\n canSearchInGrid: true,\n }),\n ],\n });\n return new FunctionResponse({\n body: { spec: JSON.stringify(SDUI.render(s, root)) },\n statusCode: 200,\n headers: {},\n message: '',\n });\n }\n\n return new FunctionResponse({ body: {}, statusCode: 200, headers: {}, message: '' });\n}",
|
|
1841
|
+
"dependencies": {
|
|
1842
|
+
"@rippling/rippling-sdk": "^0.2.0-alpha.33",
|
|
1843
|
+
"@rippling/sdui-builder": "^0.1.0"
|
|
1844
|
+
},
|
|
1845
|
+
"deployment_options": {
|
|
1846
|
+
"runtime": "lambda-deno"
|
|
1847
|
+
}
|
|
1848
|
+
},
|
|
1849
|
+
{
|
|
1850
|
+
"type": "SDUI_PAGE",
|
|
1851
|
+
"name": "Operatories",
|
|
1852
|
+
"sdui_page_id": "dental_operatories",
|
|
1853
|
+
"function_api_name": "dental_operatory_list_fn",
|
|
1854
|
+
"description": "SDUI ObjectListView for operatory records"
|
|
1855
|
+
},
|
|
1814
1856
|
{
|
|
1815
1857
|
"type": "FUNCTION",
|
|
1816
1858
|
"name": "Daily chair board (SDUI)",
|
|
@@ -1832,37 +1874,53 @@
|
|
|
1832
1874
|
"function_api_name": "dental_chair_schedule_fn",
|
|
1833
1875
|
"description": "SDUI list of appointments (searchable grid); use object records for status edits"
|
|
1834
1876
|
},
|
|
1877
|
+
{
|
|
1878
|
+
"type": "FUNCTION",
|
|
1879
|
+
"name": "Treatment plans (SDUI)",
|
|
1880
|
+
"api_name": "dental_treatment_plan_list_fn",
|
|
1881
|
+
"description": "SDUI ObjectListView for treatment plan records",
|
|
1882
|
+
"code_draft": "import { FunctionContext, FunctionEvent, FunctionResponse } from '@rippling/rippling-sdk';\nimport SDUI from '@rippling/sdui-builder';\n\nconst OBJECT = 'dental_treatment_plan__c';\n\nexport async function onRipplingEvent(\n event: FunctionEvent,\n context: FunctionContext,\n): Promise<FunctionResponse> {\n const action = event.parameters?.action;\n\n if (!action || action === 'init') {\n const s = SDUI.createState({});\n const root = SDUI.components.VStack({\n children: [\n SDUI.components.ObjectListView({\n objectApiName: OBJECT,\n canSearchInGrid: true,\n }),\n ],\n });\n return new FunctionResponse({\n body: { spec: JSON.stringify(SDUI.render(s, root)) },\n statusCode: 200,\n headers: {},\n message: '',\n });\n }\n\n return new FunctionResponse({ body: {}, statusCode: 200, headers: {}, message: '' });\n}",
|
|
1883
|
+
"dependencies": {
|
|
1884
|
+
"@rippling/rippling-sdk": "^0.2.0-alpha.33",
|
|
1885
|
+
"@rippling/sdui-builder": "^0.1.0"
|
|
1886
|
+
},
|
|
1887
|
+
"deployment_options": {
|
|
1888
|
+
"runtime": "lambda-deno"
|
|
1889
|
+
}
|
|
1890
|
+
},
|
|
1891
|
+
{
|
|
1892
|
+
"type": "SDUI_PAGE",
|
|
1893
|
+
"name": "Treatment plans",
|
|
1894
|
+
"sdui_page_id": "dental_treatment_plans",
|
|
1895
|
+
"function_api_name": "dental_treatment_plan_list_fn",
|
|
1896
|
+
"description": "SDUI ObjectListView for treatment plan records"
|
|
1897
|
+
},
|
|
1835
1898
|
{
|
|
1836
1899
|
"type": "CUSTOM_APP",
|
|
1837
1900
|
"api_name": "dental_practice_management_app",
|
|
1838
1901
|
"name": "Dental Practice Management",
|
|
1839
|
-
"description": "Patient charts, operatories, treatment plans, and
|
|
1902
|
+
"description": "Patient charts, operatories, treatment plans, and SDUI object-list tabs",
|
|
1840
1903
|
"app_type": "custom",
|
|
1841
1904
|
"pages": [
|
|
1842
1905
|
{
|
|
1843
|
-
"api_name": "
|
|
1844
|
-
"page_type": "
|
|
1845
|
-
"
|
|
1846
|
-
},
|
|
1847
|
-
{
|
|
1848
|
-
"api_name": "dental_operatory__c",
|
|
1849
|
-
"page_type": "object_page",
|
|
1850
|
-
"object_rql_name": "dental_operatory__c"
|
|
1851
|
-
},
|
|
1852
|
-
{
|
|
1853
|
-
"api_name": "dental_appointment__c",
|
|
1854
|
-
"page_type": "object_page",
|
|
1855
|
-
"object_rql_name": "dental_appointment__c"
|
|
1906
|
+
"api_name": "dental_patients",
|
|
1907
|
+
"page_type": "sdui_page",
|
|
1908
|
+
"sdui_page_id": "dental_patients"
|
|
1856
1909
|
},
|
|
1857
1910
|
{
|
|
1858
|
-
"api_name": "
|
|
1859
|
-
"page_type": "
|
|
1860
|
-
"
|
|
1911
|
+
"api_name": "dental_operatories",
|
|
1912
|
+
"page_type": "sdui_page",
|
|
1913
|
+
"sdui_page_id": "dental_operatories"
|
|
1861
1914
|
},
|
|
1862
1915
|
{
|
|
1863
1916
|
"api_name": "dental_chair_schedule",
|
|
1864
1917
|
"page_type": "sdui_page",
|
|
1865
1918
|
"sdui_page_id": "dental_chair_schedule"
|
|
1919
|
+
},
|
|
1920
|
+
{
|
|
1921
|
+
"api_name": "dental_treatment_plans",
|
|
1922
|
+
"page_type": "sdui_page",
|
|
1923
|
+
"sdui_page_id": "dental_treatment_plans"
|
|
1866
1924
|
}
|
|
1867
1925
|
]
|
|
1868
1926
|
}
|
|
@@ -630,117 +630,122 @@ new CustomObjectPageLayout(enrollmentObj, {
|
|
|
630
630
|
visibilityConditions: {},
|
|
631
631
|
});
|
|
632
632
|
|
|
633
|
-
// ── SDUI
|
|
634
|
-
const
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
'
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
const
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
633
|
+
// ── SDUI object-list tabs ───────────────────────────────────────────────────
|
|
634
|
+
const sduiObjectListDependencies = {
|
|
635
|
+
'@rippling/rippling-sdk': '^0.2.0-alpha.33',
|
|
636
|
+
'@rippling/sdui-builder': '^0.1.0',
|
|
637
|
+
};
|
|
638
|
+
|
|
639
|
+
function objectListViewCode(objectApiName: string): string {
|
|
640
|
+
return [
|
|
641
|
+
"import { FunctionContext, FunctionEvent, FunctionResponse } from '@rippling/rippling-sdk';",
|
|
642
|
+
"import SDUI from '@rippling/sdui-builder';",
|
|
643
|
+
'',
|
|
644
|
+
`const OBJECT = '${objectApiName}';`,
|
|
645
|
+
'',
|
|
646
|
+
'export async function onRipplingEvent(',
|
|
647
|
+
' event: FunctionEvent,',
|
|
648
|
+
' context: FunctionContext,',
|
|
649
|
+
'): Promise<FunctionResponse> {',
|
|
650
|
+
' const action = event.parameters?.action;',
|
|
651
|
+
'',
|
|
652
|
+
" if (!action || action === 'init') {",
|
|
653
|
+
' const s = SDUI.createState({});',
|
|
654
|
+
' const root = SDUI.components.VStack({',
|
|
655
|
+
' children: [',
|
|
656
|
+
' SDUI.components.ObjectListView({',
|
|
657
|
+
' objectApiName: OBJECT,',
|
|
658
|
+
' canSearchInGrid: true,',
|
|
659
|
+
' }),',
|
|
660
|
+
' ],',
|
|
661
|
+
' });',
|
|
662
|
+
' return new FunctionResponse({',
|
|
663
|
+
' body: { spec: JSON.stringify(SDUI.render(s, root)) },',
|
|
664
|
+
' statusCode: 200,',
|
|
665
|
+
' headers: {},',
|
|
666
|
+
" message: '',",
|
|
667
|
+
' });',
|
|
668
|
+
' }',
|
|
669
|
+
'',
|
|
670
|
+
" return new FunctionResponse({ body: {}, statusCode: 200, headers: {}, message: '' });",
|
|
671
|
+
'}',
|
|
672
|
+
].join('\n');
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
function createObjectListPage(props: {
|
|
676
|
+
objectApiName: string;
|
|
677
|
+
functionApiName: string;
|
|
678
|
+
functionName: string;
|
|
679
|
+
functionDescription: string;
|
|
680
|
+
pageId: string;
|
|
681
|
+
pageName: string;
|
|
682
|
+
pageDescription: string;
|
|
683
|
+
}): SduiPage {
|
|
684
|
+
const listFn = new ManifestFunction(manifest, {
|
|
685
|
+
apiName: props.functionApiName,
|
|
686
|
+
name: props.functionName,
|
|
687
|
+
description: props.functionDescription,
|
|
688
|
+
runtime: 'lambda-deno',
|
|
689
|
+
code: objectListViewCode(props.objectApiName),
|
|
690
|
+
dependencies: sduiObjectListDependencies,
|
|
691
|
+
isAsync: false,
|
|
692
|
+
});
|
|
693
|
+
|
|
694
|
+
return new SduiPage(manifest, {
|
|
695
|
+
sduiPageId: props.pageId,
|
|
696
|
+
name: props.pageName,
|
|
697
|
+
function: listFn,
|
|
698
|
+
description: props.pageDescription,
|
|
699
|
+
});
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
const memberListPage = createObjectListPage({
|
|
703
|
+
objectApiName: memberObj.getApiName(),
|
|
704
|
+
functionApiName: 'gym_member_list_fn',
|
|
705
|
+
functionName: 'Members (SDUI)',
|
|
706
|
+
functionDescription: 'SDUI ObjectListView for member records',
|
|
707
|
+
pageId: 'gym_members',
|
|
708
|
+
pageName: 'Members',
|
|
709
|
+
pageDescription: 'SDUI ObjectListView for member records',
|
|
710
|
+
});
|
|
711
|
+
|
|
712
|
+
const trainerListPage = createObjectListPage({
|
|
713
|
+
objectApiName: trainerObj.getApiName(),
|
|
714
|
+
functionApiName: 'gym_trainer_list_fn',
|
|
715
|
+
functionName: 'Trainers (SDUI)',
|
|
716
|
+
functionDescription: 'SDUI ObjectListView for trainer records',
|
|
717
|
+
pageId: 'gym_trainers',
|
|
718
|
+
pageName: 'Trainers',
|
|
719
|
+
pageDescription: 'SDUI ObjectListView for trainer records',
|
|
720
|
+
});
|
|
721
|
+
|
|
722
|
+
const todaySchedulePage = createObjectListPage({
|
|
723
|
+
objectApiName: sessionObj.getApiName(),
|
|
724
|
+
functionApiName: 'gym_today_schedule_fn',
|
|
725
|
+
functionName: 'Today’s schedule (SDUI)',
|
|
726
|
+
functionDescription:
|
|
706
727
|
'Searchable grid of class sessions — pair with list view “Today’s class sessions” or filter by date',
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
isAsync: false,
|
|
711
|
-
});
|
|
712
|
-
|
|
713
|
-
const checkInDeskFn = new ManifestFunction(manifest, {
|
|
714
|
-
apiName: 'gym_check_in_desk_fn',
|
|
715
|
-
name: 'Check-in desk (SDUI)',
|
|
716
|
-
description: 'Searchable roster grid — update attendance and checked-in time as members arrive',
|
|
717
|
-
runtime: 'lambda-deno',
|
|
718
|
-
code: checkInDeskCode,
|
|
719
|
-
dependencies: { '@rippling/rippling-sdk': '^0.2.0-alpha.33', '@rippling/sdui-builder': '^0.1.0' },
|
|
720
|
-
isAsync: false,
|
|
728
|
+
pageId: 'gym_today_schedule',
|
|
729
|
+
pageName: 'Today’s schedule',
|
|
730
|
+
pageDescription: 'SDUI list of class sessions for front desk (filter to today in the grid)',
|
|
721
731
|
});
|
|
722
732
|
|
|
723
|
-
const
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
sduiPageId: 'gym_check_in_desk',
|
|
732
|
-
name: 'Check-in desk',
|
|
733
|
-
function: checkInDeskFn,
|
|
734
|
-
description: 'SDUI roster — set attendance to Checked in and optional checked-in time',
|
|
733
|
+
const checkInDeskPage = createObjectListPage({
|
|
734
|
+
objectApiName: enrollmentObj.getApiName(),
|
|
735
|
+
functionApiName: 'gym_check_in_desk_fn',
|
|
736
|
+
functionName: 'Check-in desk (SDUI)',
|
|
737
|
+
functionDescription: 'Searchable roster grid — update attendance and checked-in time as members arrive',
|
|
738
|
+
pageId: 'gym_check_in_desk',
|
|
739
|
+
pageName: 'Check-in desk',
|
|
740
|
+
pageDescription: 'SDUI roster — set attendance to Checked in and optional checked-in time',
|
|
735
741
|
});
|
|
736
742
|
|
|
737
743
|
new App(manifest, {
|
|
738
744
|
apiName: 'gym_membership_management_app',
|
|
739
745
|
name: 'Gym Membership Management',
|
|
740
|
-
description:
|
|
741
|
-
'Members, trainers, schedules, enrollments, today’s sessions list view, and SDUI for schedule + check-in',
|
|
746
|
+
description: 'Members, trainers, schedules, enrollments, and SDUI object-list tabs for schedule + check-in',
|
|
742
747
|
appType: 'custom',
|
|
743
|
-
pages: [
|
|
748
|
+
pages: [memberListPage, trainerListPage, todaySchedulePage, checkInDeskPage],
|
|
744
749
|
});
|
|
745
750
|
|
|
746
751
|
console.log(manifest.preview());
|