The sessions required for Internal SR API calls are now loaded via an iframe

This commit is contained in:
2026-09-29 17:48:03 -03:00
parent 4d3f1f9760
commit 3fd89a307c
13 changed files with 366 additions and 35 deletions

View File

@@ -216,13 +216,16 @@ function createContentApplication(overrides = {}) {
readResponseBodyForDebug: (...args) => debugContentLog.readResponseBodyForDebug(...args),
maskToken: (...args) => debugContentLog.maskToken(...args), environment
});
const crmSrPopover = createCrmSrPopover({
requestDetails: async srId => {
const internalSrSession = createInternalSrSession({
environment,
query: async srId => {
const result = await platformContentMessages.sendRuntimeMessage({ type: messageTypes.requestInternalServiceRequest, srId });
debugContentLog.appendBackgroundRequestLog(result?.debugRequests || []);
if (!result?.ok) throw new Error(result?.error || "Unable to load SR details.");
return result.items;
},
return result;
}
});
const crmSrPopover = createCrmSrPopover({
requestDetails: srId => internalSrSession.request(srId),
MODAL_ID: contracts.MODAL_ID,
createCopyButton: (...args) => opportunitiesLinks.createCopyOpportunityButton(...args),
createCloseIcon: (...args) => contentIcons.createCloseIcon(...args), environment