Service - Menu Config: Difference between revisions

From Izara Wiki
Jump to navigation Jump to search
Line 77: Line 77:
<syntaxhighlight lang="json">
<syntaxhighlight lang="json">
let visibleObj = {
let visibleObj = {
         rows: [],
         rows: [
        menuElements: [
        {
        show: false,
        menuElements : [],
        }
        ], //Recursive function
        ],
         visibleRowIndex: 0, //[Top level]
         visibleRowIndex: 0, //[Top level]
         visibleRenameRowIndex: null, //[Top level]
         visibleRenameRowIndex: null, //[Top level]

Revision as of 05:20, 15 June 2023

Overview

Manages configuration for site menus created by users and used in different areas of the project.

Repository

https://bitbucket.org/izara-core-shared/izara-core-shared-menu-config

DynamoDB tables

MenuConfigMain

{
	menuConfigId: "xx", // {useCase}_{random uuid}
	menuConfig: "xx", // json encoded object of configuration
	menuConfigName: "yy", // user specified name of the config
	userId: "xx"
}
  • partition key: menuConfigId
  • sort key: {none}
  • save menuConfig according to useCase, not yet applied but could sub areas of the project into different use cases, handled by the same Menu Config service

UsersMenuConfigs

{
	userId: "xx" // user who owns the menuConfig
	menuConfigId: "xx",
}
  • partition key: userId
  • sort key: menuConfigId

menuConfig Object

{
	menuRows:[
		{
			rowName: "xx", // used when configuring only as a reference
			menuElements: [
				{
					elementType: "menu"
					menuElements: [
						{
							elementType: "staticUrl"
							url: "xxx",
						},
						{
							elementType: "projectLink"
							service: "xx",
							resource: "xx",
							action: "xx",
						},
						{
							elementType: "plainText"
							plainText: "xxx",
						},
					],
				},
				{
					elementType: "projectMenu", // used for the main project menu
				}
				// ..
			]
		},
		// ..
	]
}

Visible Object

let visibleObj = {
        rows: [
        	menuElements: [
        		{
        		show: false,
        		menuElements : [],	
        		}
        	], //Recursive function
        ],
        visibleRowIndex: 0, //[Top level]
        visibleRenameRowIndex: null, //[Top level]
      };
  • visibleRowIndex : identify visible position each row
  • visibleRenameRowIndex : use control css button was visible or selected

Working documents

Menu Config