Service - SitePage Config: Difference between revisions

From Izara Wiki
Jump to navigation Jump to search
Line 57: Line 57:
pageElements: [
pageElements: [
{
{
pageElementType: "table", //"table"|"objectCreate"|"objectForm"|"freeText"
pageElementType: "table", //"table"|"formObjectCreate"|"formObjectEdit"|"freeText"
tableConfigId: "tableConfigId_1",
tableConfigId: "tableConfigId_1",
//optional:
//optional:

Revision as of 11:30, 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"|"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