Service - SitePage Config: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
= Overview = | = Overview = | ||
Manages configuration for site pages created by users that | Manages configuration for site pages created by users that can include elements such as tables, forms to create/update objects, graphs, etc | ||
= Repository = | = Repository = | ||
Line 39: | Line 39: | ||
<syntaxhighlight lang="json"> | <syntaxhighlight lang="json"> | ||
{ | { | ||
pageName: "xx", // set by the creator of the page, displayed in setup pages eg menuConfig | pageName: "xx", // set by the creator of the page, displayed in setup pages eg menuConfig | ||
// grouping/row/cell/elements structure same tableConfig | // grouping/row/cell/elements structure same tableConfig | ||
Line 55: | Line 50: | ||
rows: [ | rows: [ | ||
{ | { | ||
pageElements: [ | |||
{ | { | ||
pageElementType: "table" // "table"//"graph"/... | |||
// maybe "objectDisplay" not needed, can be included in "objectForm" | |||
tableConfigId: "xxx", | |||
overwriteFilters:[ // not sure correct way to handle | |||
{ | |||
// eg: set which userId the data is for, eg default to signed in userId | |||
// maybe have a keyword that matches signedInUserId so sitePageConfig is more generic/shared with other users | |||
} | |||
] | |||
}, | }, | ||
{ | { | ||
elementType: "submitButton", | pageElementType: "objectForm" // "createObject"|"objectForm"|"objectDisplay"? maybe "objectDisplay" not needed, can be included in "objectForm" | ||
objectSchema: { | |||
serviceTag: "xxx", | |||
objectType: "xxx", | |||
}, | |||
formElements: [ | |||
{ | |||
elementType: "freeText", | |||
text: "xx", | |||
}, | |||
{ | |||
elementType: "fieldName" | |||
fieldName: "xx", | |||
displaySetting: "xx", // "input"|"displayOnly" input is not available for calculatedData | |||
}, | |||
{ | |||
elementType: "calculatedField", | |||
fieldName: "xx" | |||
}, | |||
{ | |||
elementType: "recalculateDataLink", // links to any calculatedData for th objectType | |||
dataTag: "xx" | |||
}, | |||
{ | |||
elementType: "submitButton", | |||
text: "xx" | |||
}, | |||
//... | |||
] | |||
} | |||
] | ] | ||
}, | }, | ||
Line 89: | Line 104: | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
= Multiple pageElements on one page = | |||
* any number of tables or forms can be shown on a single page, presented according to groupings/rows structure | |||
* each table and form is independent from each other, so each form has it's own submission and submits independently from other forms | |||
* each form receives it's identifiers independently, so each form will check if identifiers sent by menuConfig, if not will show inputs for them | |||
= Interaction with MenuConfig = | = Interaction with MenuConfig = | ||
* MenuElements set to sitePages link to a sitePageConfigId | * MenuElements set to sitePages link to a sitePageConfigId | ||
* if | * if sitePageConfig has any "objectForm"|"objectDisplay" pageElements then menuConfig offers to hardcode identifierIds, or eg a popup to enter the identifiers | ||
* if no identifierIds are sent to " | * if no identifierIds are sent to "objectForm"|"objectDisplay" page then the page initially offers inputs to set the identifierIds (no pageElements shown) for that pageElement | ||
= Authorizers = | = Authorizers = |
Revision as of 13:32, 10 June 2023
Overview
Manages configuration for site pages created by users that can include elements such as tables, forms to create/update objects, graphs, etc
Repository
https://bitbucket.org/izara-core-shared/izara-core-shared-sitepage-config
DynamoDB tables
SitePageConfigMain
{
sitePageConfigId: "xx", // {random uuid}
sitePageConfig: "xx", // json encoded object of configuration
sitePageConfigName: "yy", // user specified name of the config
userId: "xx"
}
- partition key: sitePageConfigId
- sort key: {none}
UsersSitePageConfigs
{
userId: "xx" // user who owns the sitePageConfig
sitePageConfigId: "xx",
}
- partition key: userId
- sort key: sitePageConfigId
sitePageConfig Object
{
pageName: "xx", // set by the creator of the page, displayed in setup pages eg menuConfig
// grouping/row/cell/elements structure same tableConfig
// add css theme and overwrite settings
// standardize property names to match tableConfig structure (eg elementTypes)
rows: {
rowName: "xx",
groupings: [
{
rows: [
{
pageElements: [
{
pageElementType: "table" // "table"//"graph"/...
// maybe "objectDisplay" not needed, can be included in "objectForm"
tableConfigId: "xxx",
overwriteFilters:[ // not sure correct way to handle
{
// eg: set which userId the data is for, eg default to signed in userId
// maybe have a keyword that matches signedInUserId so sitePageConfig is more generic/shared with other users
}
]
},
{
pageElementType: "objectForm" // "createObject"|"objectForm"|"objectDisplay"? maybe "objectDisplay" not needed, can be included in "objectForm"
objectSchema: {
serviceTag: "xxx",
objectType: "xxx",
},
formElements: [
{
elementType: "freeText",
text: "xx",
},
{
elementType: "fieldName"
fieldName: "xx",
displaySetting: "xx", // "input"|"displayOnly" input is not available for calculatedData
},
{
elementType: "calculatedField",
fieldName: "xx"
},
{
elementType: "recalculateDataLink", // links to any calculatedData for th objectType
dataTag: "xx"
},
{
elementType: "submitButton",
text: "xx"
},
//...
]
}
]
},
//...
],
},
//...
],
},
//...
}
Multiple pageElements on one page
- any number of tables or forms can be shown on a single page, presented according to groupings/rows structure
- each table and form is independent from each other, so each form has it's own submission and submits independently from other forms
- each form receives it's identifiers independently, so each form will check if identifiers sent by menuConfig, if not will show inputs for them
Interaction with MenuConfig
- MenuElements set to sitePages link to a sitePageConfigId
- if sitePageConfig has any "objectForm"|"objectDisplay" pageElements then menuConfig offers to hardcode identifierIds, or eg a popup to enter the identifiers
- if no identifierIds are sent to "objectForm"|"objectDisplay" page then the page initially offers inputs to set the identifierIds (no pageElements shown) for that pageElement
Authorizers
- after have identifierIds we can pull the data for that object
- also need to pull the targetId for any authorizer which will need to be sent with submissions
- might be cases where we can edit appLevel objects? In which case tagetId not required
Create or Display/Update multiple linked objects
- considering having new pageTypes that hook into ImportData flow for creating multiple objects according to object relationships
- basic "createObject"|"displayObject" pages send directly to service that is responsible for objectType to perform the action
- multiple linked object submission will format request and send to ImportData which creates PendingObject/Links and processes accordingly