カスタム・アイコン付きインサイトを表示する公開アクション
次に、インサイトを表示するTypescriptの例を示します。r recordContextは、現在のバウサ・タブ・アクティブ・レコードとみなされます:
let recordContext: IRecordContext = await uiEventsFrameworkInstance.getCurrentBrowserTabContext().getActiveRecord();
let insightContext: IInsightContext = await recordContext.getInsightsContext();
const payload: IShowInsightsRequest = uiEventsFrameworkInstance.requestHelper.createPublishRequest('ShowInsights');
payload.setId('insightsId1');
payload.setTitle('Custom title');
payload.setIcon('oj-ux-ico-blog-post-detail');
insightContext.publish(payload).then((response: IInsightsOperationResponse) => {
console.log((response.getResponseData() as IInsightsOperationResponseData).getInsightsId());
});
recordContextを現在のボウサ・タブ・アクティブ・レコードとみなして、インサイトを表示するJavaScriptの例を次に示します
let recordContext = await uiEventsFrameworkInstance.getCurrentBrowserTabContext().getActiveRecord();
let insightContext = await recordContext.getInsightsContext();
const payload = uiEventsFrameworkInstance.requestHelper.createPublishRequest('ShowInsights');
payload.setId('insightsId1');
payload.setTitle('Custom title');
payload.setIcon('oj-ux-ico-blog-post-detail');
insightContext.publish(payload).then((response) => {
console.log(response.getResponseData().getInsightsId());
});