I have a Macro with a table which is filled in part by a MacroConfig. Some cells in the table cannot be edited (they are not presented in the MacroConfig), which is exactly what I want. But, I also want to change the value of a config value by generating a value in the app. I want to connect my macro to Storage, but for that I need a unique ID in storage and it cannot be the localId because every component of the page has a localId (macros even more than one…) and this value has to be specific for my own component, besides, it must only go into Storage when the page is published for the first time.
Is there a way to do this?
I also looked at what the v2 REST API gets me on the Macro page component. Example:
{
"type": "extension",
"attrs": {
"layout": "default",
"extensionType": "com.atlassian.ecosystem",
"extensionKey": "229f13e1-6ba7-4385-9723-39954456f9fb/bda39fa4-b4d6-425c-948b-b3589217549f/static/dl-spike-one-decstory",
"text": "DL Decision Story (Development)",
"parameters": {
"guestParams": {
"acceptedConsequences": "We accept that we will have to create exceptions for systems requiring more RAM",
"alternativesNotChosen": "The maximum of RAM per VM is more than 64GB",
"goal": "With a lower value, too many VMs will not have enough RAM. With a higher value, it becomes hard to optimise hardware use.",
"context": "We are required to set a maximum for RAM per VM",
"choice": "The maximum of RAM per VM is 37GB",
"dlid": "0",
"revisitWhen": "When the hardware improves such that a higher maximum is possible."
},
"localId": "7140339b-61a0-4c44-baee-1911cba36aea",
"extensionId": "ari:cloud:ecosystem::extension/229f13e1-6ba7-4385-9723-39954456f9fb/bda39fa4-b4d6-425c-948b-b3589217549f/static/dl-spike-one-decstory",
"extensionTitle": "DL Decision Story (Development)"
},
"localId": "caa395df-1e3b-4084-b758-7b13dce2d31b"
}
},
parameters.guestParams
contains the configuration of the Macro it seems.
The ‘dlid’ field in the configuration above has been set by entering a constant defaultValue
in a TextField
in the MacroConfig
. I need somehow to make that a dynamic value so that when the page is published I can use it in my Storage interface.
Or I need another solution that can combine/coordinate Macro, MacroConfig and Storage. Building my own custom UI element is out (that would end my project), it is a hard requirement to do it with standard Forge/UI Kit elements.