Fiori launchpad becomes unresponsive after chatbot plugin deployment

475 Views Asked by At

We have developed chatbot functionality for our on-premise ERP using Recast.AI.

Basically, we have deployed a plugin on the On-Premise Fiori launchpad using the following code; However the Fiori launchpad freezes after the chatbot launches and we cannot execute anything on the Fiori Launchpad. The options in SAP Note 2544600 haven't helped us. Any idea, what could be the issue?

Regards,

Karan

sap.ui.define([
"sap/ui/core/UIComponent",

], function (UIComponent) {
"use strict";


return UIComponent.extend("com.abc.chatbot.Component", {

    /**
     * The component is initialized by UI5 automatically during the startup of the app and calls the init method once.
     * @public
     * @override
     */
    init: function () {
        // call the base component's init function
        UIComponent.prototype.init.apply(this, arguments);
        var renderer = sap.ushell.Container.getRenderer("fiori2");
        if (!document.getElementById("recast-webchat")) {


            var s = document.createElement("script");
            s.setAttribute("id", "recast-webchat");
            s.setAttribute("src", "https://cdn.recast.ai/webchat/webchat.js");
            //document.body.appendChild(s);
            if (document.body != null) {
                document.body.appendChild(s);
            }
        }
        s.setAttribute("channelId", "abc");
        s.setAttribute("token", "xyz");
    }
});

});

The issue is with appendChild; which makes the launchpad unresponsive. Not sure what could be the alternative as I have tried various ways such as creating div, fragments as well.

1

There are 1 best solutions below

0
On

the webchat has been updated since with a fix for Fiori. It should now work