Service - Menu Config: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
mNo edit summary |
||
| Line 14: | Line 14: | ||
storageResources: { | storageResources: { | ||
"dynamodb": { | "dynamodb": { | ||
storageType: "dynamoDB", | storageType: "dynamoDB", | ||
tableName: "MenuConfigMain", | tableName: "MenuConfigMain", | ||
} | } | ||
}, | }, | ||
fieldNames: { | fieldNames: { | ||
menuConfigId: { | |||
type: "string", | type: "string", | ||
randomOnCreate: true, | randomOnCreate: true, | ||
requiredOnCreate: false, | requiredOnCreate: false, | ||
optionalOnCreate: false, | optionalOnCreate: false, | ||
canUpdate: false, | canUpdate: false, | ||
| Line 37: | Line 28: | ||
}, | }, | ||
menuConfig: { | menuConfig: { | ||
type: " | type: "object", | ||
randomOnCreate: false, | randomOnCreate: false, | ||
requiredOnCreate: true, | requiredOnCreate: true, | ||
optionalOnCreate: false, | optionalOnCreate: false, | ||
canUpdate: | canUpdate: true, | ||
storageResourceTags: ['dynamodb'], | storageResourceTags: ['dynamodb'], | ||
}, | }, | ||
| Line 64: | Line 55: | ||
{ | { | ||
type: "partitionKey", | type: "partitionKey", | ||
fieldNames | fieldNames: "menuConfigId" | ||
}, | }, | ||
], | ], | ||
}, | }, | ||
]</syntaxhighlight> | ] | ||
</syntaxhighlight> | |||
= DynamoDB tables = | = DynamoDB tables = | ||
| Line 76: | Line 68: | ||
<syntaxhighlight lang="JavaScript"> | <syntaxhighlight lang="JavaScript"> | ||
{ | { | ||
menuConfigId: "xx", // | menuConfigId: "xx", // {random uuid} | ||
menuConfig: "xx", // json encoded object of configuration | menuConfig: "xx", // json encoded object of configuration | ||
menuConfigName: "yy", // user specified name of the config | menuConfigName: "yy", // user specified name of the config | ||
| Line 85: | Line 77: | ||
* partition key: menuConfigId | * partition key: menuConfigId | ||
* sort key: {none} | * sort key: {none} | ||
== UsersMenuConfigs == | == UsersMenuConfigs == | ||
Latest revision as of 02:37, 17 July 2025
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
ObjectSchema
MenuConfig
[
{
objectType: "menuConfig",
storageResources: {
"dynamodb": {
storageType: "dynamoDB",
tableName: "MenuConfigMain",
}
},
fieldNames: {
menuConfigId: {
type: "string",
randomOnCreate: true,
requiredOnCreate: false,
optionalOnCreate: false,
canUpdate: false,
storageResourceTags: ['dynamodb'],
},
menuConfig: {
type: "object",
randomOnCreate: false,
requiredOnCreate: true,
optionalOnCreate: false,
canUpdate: true,
storageResourceTags: ['dynamodb'],
},
menuConfigName: {
type: "string",
randomOnCreate: false,
requiredOnCreate: true,
optionalOnCreate: false,
canUpdate: true,
storageResourceTags: ['dynamodb'],
},
userId: { // before put check with base-user-id or targetId
type: "string",
randomOnCreate: false,
requiredOnCreate: true,
optionalOnCreate: false,
canUpdate: false,
storageResourceTags: ['dynamodb'],
},
},
identifiers: [
{
type: "partitionKey",
fieldNames: "menuConfigId"
},
],
},
]
DynamoDB tables
MenuConfigMain
{
menuConfigId: "xx", // {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}
UsersMenuConfigs
{
userId: "xx" // user who owns the menuConfig
menuConfigId: "xx",
}
- partition key: userId
- sort key: menuConfigId
{
menuRows:[
{
rowName: "xx", // used when configuring only as a reference
menuElements: [
{
elementType: "menu"
menuElements: [
{
elementType: "staticUrl"
url: "xxx",
},
{
elementType: "sitePage"
sitePageId: "xx",
},
{
elementType: "plainText"
plainText: "xxx",
},
],
},
{
elementType: "projectMenu", // used for the main project menu
}
// ..
]
},
// ..
]
}