Service - SitePage Config: Difference between revisions

From Izara Wiki
Jump to navigation Jump to search
No edit summary
 
(5 intermediate revisions by one other user not shown)
Line 44: Line 44:
// add css theme and overwrite settings
// add css theme and overwrite settings
// standardize property names to match tableConfig structure (eg elementTypes)
// standardize property names to match tableConfig structure (eg elementTypes)
rows: {
sections: [
rowName: "xx",
{
groupings: [
sectionName: "xx",
{
groupings: [
rows: [
{
{
groupingName: "xx",
pageElements: [
rows: [
{
{
pageElementType: "table" // "table"//"graph"/...
rowName: "xx",
// maybe "objectDisplay" not needed, can be included in "objectForm"
cells: [
tableConfigId: "xxx",
{
overwriteFilters:[ // not sure correct way to handle
cellName: "xx",
{
elements: [
// 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: "table", //"table"|"formObjectCreate"|"formObjectEdit"|"freeText"
}
tableConfigId: "tableConfigId_1",
]
//optional:
},
overwriteFilter: ""
{
},
pageElementType: "objectForm" // "createObject"|"objectForm"|"objectDisplay"? maybe "objectDisplay" not needed, can be included in "objectForm"
{
objectSchema: {
pageElementType: "formObjectCreate",
serviceTag: "xxx",
objectCreateConfigId: "formObjectCreateConfigId_1",
objectType: "xxx",
//objectType set in formObjectCreateConfig
},
{
pageElementType: "formObjectEdit",
objectFormConfigId: "formObjectEditConfigId_1",
//optional:
identifiers: { // check structure with SeaGame
  xx: "yy",
  qq: "rr"
}
//objectType set in formObjectEditConfig
},
{
pageElementType: "freeText",
text: "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"
},
//...
]
}
]
},
//...
],
},
//...
],
},
//...
}
}
</syntaxhighlight>
</syntaxhighlight>

Latest revision as of 05:21, 7 July 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)
	sections: [
		{
			sectionName: "xx",
			groupings: [
				{
					groupingName: "xx",
					rows: [
						{
							rowName: "xx",
							cells: [
								{
									cellName: "xx",
									elements: [
										{
											pageElementType: "table", //"table"|"formObjectCreate"|"formObjectEdit"|"freeText"
											tableConfigId: "tableConfigId_1",
											//optional:
											overwriteFilter: ""
										},
										{
											pageElementType: "formObjectCreate",
											objectCreateConfigId: "formObjectCreateConfigId_1",
											//objectType set in formObjectCreateConfig
										},
										{
											pageElementType: "formObjectEdit",
											objectFormConfigId: "formObjectEditConfigId_1",
											//optional:
											identifiers: { // check structure with SeaGame
											  xx: "yy",
											  qq: "rr"
											}
											//objectType set in formObjectEditConfig
										},
										{
											pageElementType: "freeText",
											text: "xxx",
										},					
									]
								},
								// ..
							]
						},
						//...
					],
				},
				//...
			],
		},
		//...
	]
}

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

Working documents

SitePage Config