We are creating dynamic content macro.
we have written below code on click of submit button.
overrides.manipulateMarkup = (macro) => {
let entityType = this.state.entityType;
window.parent.AJS.Confluence.storageManager().setItem(
"qMacroId",
JSON.stringify({ entityType })
);
let macroRenderRequest = {
contentId: window.parent.AJS.Confluence.Editor.getContentId(),
macro: {
name: "q-assets",
body: ReactDOMServer.renderToString(<QMacroRenderer />),
},
};
window.parent.tinyMCE.confluence.MacroUtils.insertMacro(
macroRenderRequest
);
};
window.parent.AJS.MacroBrowser.setMacroJsOverride(
"q-assets",
overrides
);
It will display like below in preview mode.
After clicking update/publish button it will display like below.
After adding our macro it will remove the content of other macros and other content on page as well.
kindly suggest solution.