/* * Todo App Without ObjectListView — custom SDUI backed by Custom Object records. * * This example intentionally does not render ObjectListView. The SDUI page reads * and writes `todo__c` records from the function, then renders its own * todo list with TextInput, Button, Checkbox, and layout components. * * todo__c <- name, completed__c * * Run: * yarn tsn examples/manifest/todo-app-without-object-list-view/todo-app-without-object-list-view.ts \ * > examples/manifest/todo-app-without-object-list-view/manifest.json */ import * as fs from 'node:fs'; import * as path from 'node:path'; import { App, BooleanField, Category, CustomObject, CustomObjectFieldSection, CustomObjectPageLayout, ManifestBuilder, ManifestFunction, SduiPage, } from '@rippling/rippling-sdk/lib/manifest'; const manifest = new ManifestBuilder({ key: 'todo_app_without_object_list_view', name: 'Todo App Without ObjectListView', description: 'A todo app that renders custom SDUI and persists changes to Custom Object records', }); const todoCategory = new Category(manifest, { apiName: 'custom_todo_app__c', name: 'Todo App', description: 'Custom todo app records', }); const todoObj = new CustomObject(manifest, { apiName: 'todo__c', name: 'Todo', pluralLabel: 'Todos', category: todoCategory, description: 'A todo item rendered by a custom SDUI page', icon: { emoji: '✅' }, }); const detailsSection = new CustomObjectFieldSection(todoObj, { name: 'Details', sectionId: 'sec_custom_todo_details', }); const completedField = new BooleanField(todoObj, { apiName: 'completed__c', displayName: 'Completed', description: 'Whether the todo item is complete', section: detailsSection, }); new CustomObjectPageLayout(todoObj, { apiName: 'default', name: 'Todo', layoutId: 'layout_custom_todo', tabEdits: { newTabs: [ { key: 'todo', name: 'Todo', type: 'tab_with_sections', sections: [ { name: 'Details', type: 'fields_section', section: detailsSection, fields: [{ field: 'name', editable: true }, completedField], }, ], }, ], systemTabEdits: {}, tabsOrder: ['todo'], }, visibilityConditions: {}, }); const todoPageFn = new ManifestFunction(manifest, { apiName: 'custom_todo_page_fn', name: 'renderTodoPage', description: 'Custom SDUI todo page backed by Custom Object record APIs', code: fs.readFileSync(path.join(__dirname, 'functions', 'todo-page.ts'), 'utf-8'), dependencies: { '@rippling/rippling-sdk': '^0.2.0-alpha.65', '@rippling/pebble-sdui-web': '^0.9.2' }, isAsync: false, }); const todoPage = new SduiPage(manifest, { sduiPageId: 'custom_todo_page', name: 'Todos', function: todoPageFn, }); new App(manifest, { apiName: 'todo_app_without_object_list_view', name: 'Todo App Without ObjectListView', description: 'Todo app with a fully custom SDUI page and Custom Object persistence', appType: 'custom', pages: [todoPage], }); console.log(manifest.preview());