Files

3 lines
1.9 KiB
JavaScript

/*v1.0.0 (2024-10-29)*/var w;!function(o){"use strict";var e="c4it-f4sd-icons";o.mx=o.mx||{},o.mx.workspacesConfig=o.mx.workspacesConfig||{},o.mx.workspacesConfig.modules=o.mx.workspacesConfig.modules||{},o.mx.workspacesConfig.modules.add=o.mx.workspacesConfig.modules.add||function(e,n){o.mx.workspacesConfig.modules[e]=n},o.mx.workspacesConfig.modules.add("mx.C4IT.F4SD",{name:"mx.C4IT.F4SD",config:["$mdIconProvider",function(n){n.iconSet(e,"workspaces/C4IT_F4SD/F4SDIcons.svg"),o.mx=o.mx||{},o.mx.components=o.mx.components||{},o.mx.components.Icons=o.mx.components.Icons||{},o.mx.components.Icons.unshift({id:e,name:"C4IT F4SD Icons",icons:[{SVG:!0,id:e+":icon-f4sd",name:"F4SD Icon",keywords:["c4it","custom","f4sd"]},{SVG:!0,id:e+":icon-f4sd-coloured",name:"F4SD Icon (coloured)",keywords:["c4it","custom","f4sd"]}]})}]})}
(window),window,angular.module("mx.C4IT.F4SD").controller("mx.C4IT.F4SD.Actions.callF4SD",["mx.shell.Config","mx.SolutionBuilderAgent.Http","mx.shell.NotificationService","mx.internationalization",function(o,e,n,s){var t=this;this.restHost=o.settings.restHosts.default,this.messageF4SDOpened=s.get("c4it.f4sd.action-open-called")||"F4SD is beeing opened...",this.execute=function(o,s){var c=o[0]["Sys-ObjectId"]||o[0].ID;try{t.controllerParams=new URLSearchParams(s.controllerParams)}catch(a){console.log(a),n.error("Action config parameters format exception");return}
let i=new URL("/api/c4itf4sdwebapi/getdirectlinkf4sd/",t.restHost);i.searchParams.append("type",t.controllerParams.get("type")||s.name),i.searchParams.append("eoid",c),e.get(i.pathname+i.search).then(function(o){try{let e=new URL(o);"f4sdsend:"==e.protocol&&(t.controllerParams.has("showNotification")&&1==t.controllerParams.get("showNotification")&&n.info(t.messageF4SDOpened),window.location.href=o)}catch(s){console.log(s),n.error("Service not available")}},function o(e){console.log(e),n.error("Service not available")})}}]);