Service - SitePage Config: Difference between revisions

From Izara Wiki
Jump to navigation Jump to search
No edit summary
Line 48: Line 48:
groupings: [
groupings: [
{
{
groupingName: "xx",
rows: [
rows: [
{
{
pageElements: [
rowName: "xx",
cells: [
{
{
pageElementType: "table" // "table"//"graph"/...
cellName: "xx",
// maybe "objectDisplay" not needed, can be included in "objectForm"
pageElements: [
tableConfigId: "xxx",
overwriteFilters:[ // not sure correct way to handle
{
{
// eg: set which userId the data is for, eg default to signed in userId
pageElementType: "table", //"table"|"objectCreate"|"objectForm"|"freeText"
// maybe have a keyword that matches signedInUserId so sitePageConfig is more generic/shared with other users
tableConfigId: "tableConfigId_1",
}
//optional:
]
overwriteFilter: ""
},
{
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",
pageElementType: "objectCreate",
fieldName: "xx"
objectCreateConfigId: "objectCreateConfigId_1",
//objectType set in objectCreateConfig
},
},
{
{
elementType: "recalculateDataLink", // links to any calculatedData for th objectType
pageElementType: "objectForm",
dataTag: "xx"
objectFormConfigId: "objectFormConfigId_1",
//optional:
identifiers: { // check structure with SeaGame
  xx: "yy",
  qq: "rr"
}
//objectType set in objectFormConfig
},
},
{
{
elementType: "submitButton",
pageElementType: "freeText",
text: "xx"
text: "xxx",
},
},
//...
]
]
}
},
// ..
]
]
},
},

Revision as of 11:24, 5 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)
	rows: {
		rowName: "xx",
		groupings: [
			{
				groupingName: "xx",
				rows: [
					{
						rowName: "xx",
						cells: [
							{
								cellName: "xx",
								pageElements: [
									{
										pageElementType: "table", //"table"|"objectCreate"|"objectForm"|"freeText"
										tableConfigId: "tableConfigId_1",
										//optional:
										overwriteFilter: ""
									},
									{
										pageElementType: "objectCreate",
										objectCreateConfigId: "objectCreateConfigId_1",
										//objectType set in objectCreateConfig
									},
									{
										pageElementType: "objectForm",
										objectFormConfigId: "objectFormConfigId_1",
										//optional:
										identifiers: { // check structure with SeaGame
										  xx: "yy",
										  qq: "rr"
										}
										//objectType set in objectFormConfig
									},
									{
										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