Moonshine-IDE / Super.Human.Portal

Portal interface to show documentation for DominoVagrant and Super.Human.Installer
Other
0 stars 1 forks source link

Switch to use relative paths for API urls #16

Closed piotrzarzycki21 closed 1 year ago

piotrzarzycki21 commented 1 year ago
          @piotrzarzycki21,

I tested deploying this artifact to a Super.Human.Installer Domino instance for #15. Unfortunately, this failed with a CORS error on the agent calls. The agent calls use http://127.0.0.1:8080, but the Super.Human.Installer server should be called with a domain name. The default is https://domino.demo.startcloud.com, but the user is allowed to choose other names.

To allow this to work, I had to change the URL at two locations:

./js-release/SuperHumanPortal_Royale.js:'handleStepChange',kh='handleTopMostEventDispatcherMouseDown',lh='has-drawer',mh='headerModelChanged',nh='height',oh='heightChanged',ph='hidden',qh='hidden-desktop',rh='hidden-widescreen',sh='horizontalContentItemsCenteredFormItem',th='horizontalContentShrinkFormItem',uh='htmlChange',vh='htmlMessageChange',wh='htmlTitleChange',xh='http://127.0.0.1:8080',yh='i.fonticon.material-icons',zh='iBeadLayout',Ah='iContentView',Bh='iFormItemContentArea',Ch='iItemRendererClassFactory',Dh='iItemRendererInitializer',
./js-release/SuperHumanPortal_Royale.js:F.um=function(a){this.model.fullContentWidth=a};Object.defineProperties(xH.prototype,{label:{get:xH.prototype.xb,set:xH.prototype.Wb},labelClass:{get:xH.prototype.rh,set:xH.prototype.Em},required:{get:xH.prototype.Ab,set:xH.prototype.Xb},labelAlign:{get:xH.prototype.gc,set:xH.prototype.de},fullContentWidth:{get:xH.prototype.hh,set:xH.prototype.um}});xH.prototype.g={names:[{name:'CustomFormItem',h:ww,kind:t}]};function oK(){}G(kd,oK);oK.AGENT_BASE_URL='http://127.0.0.1:8080/SuperHumanPortal.nsf';G('Super.Human.Portal_Royale.classes.vo.Constants.AGENT_BASE_URL',oK.AGENT_BASE_URL);oK.prototype.g={names:[{name:'Constants',h:kd,kind:t}]};Object.keys(oK);function LH(){CL.call(this);this.typeNames='jewel drawer '+LH.FLOAT}H(LH,CL);G(Ep,LH);LH.FLOAT='float';G('org.apache.royale.jewel.Drawer.FLOAT',LH.FLOAT);LH.FIXED=Cg;G('org.apache.royale.jewel.Drawer.FIXED',LH.FIXED);F=LH.prototype;F.EC=function(a){I(a.target,HTMLElement).classList.contains(dg)&&this.close()};F.adjustAppScroll=function(){this.fixed?document.body.classList.remove(Jw):this.Hb?document.body.classList.add(Jw):document.body.classList.remove(Jw)};F.open=function(){this.isOpen=!0};

I had similar problems on domino-49. Can we make these paths relative to the server base (i.e. /Super.Human.Portal.nsf/XMLAuthenticationTest?OpenAgent) so that we don't need to change this? The Genesis installer for #15 won't necessarily know the base FQDN of the generated server.

Originally posted by @JoelProminic in https://github.com/Moonshine-IDE/Super.Human.Portal/issues/14#issuecomment-1513856607

piotrzarzycki21 commented 1 year ago

@JoelProminic I have switched this to relative urls.

JoelProminic commented 1 year ago

This is working properly on the Super.Human.Installer instance now. Thanks!