bullhorn / novo-elements

UI Repository for Bullhorn's Novo Theme
http://bullhorn.github.io/novo-elements
MIT License
76 stars 61 forks source link

windowName is null #1131

Open leonardosalatino opened 4 years ago

leonardosalatino commented 4 years ago

Describe the bug I get windowName in null after appBridge.register(). I also have the tab text with "Loading..."

To Reproduce Steps to reproduce the behavior:

  1. I'm trying to create a new menu item. Already registered it, I can access to it and I am able to see my local page inside the bullhorn app
  2. The tab title for my menu item is with the text "Loading..." and it never changes
  3. The page is showing "This app can only be run inside of Bullhorn as a Custom Menu Item" error because the windowName, after the bridge registation, is in null.
  4. I'm working with this code: https://github.com/bullhorn/extension-samples/tree/master/05.HelloMenuItem Here I'm at /app/services/appBridge.services.ts, method "register(): void".
  5. The line "this.bridge.register(this.appBridgeConfig).then((windowName: string) => {" is returning windowName in null. Because of that then the page is not shown because the following validation is not passed:
    this.registered = !this.requiresWindowObject || windowName != null;
    if (this.registered) {
    this.onRegistered.emit(true);
    } else {
    this.registerRetry();
    }

But if I just add a "this.registered = true" to run the emit(), the validation is baypassed and the page successfully loaded. I just would like to correctly fix it because I think this error is causing the tab label to keep with the text "Loading..."

Expected behavior

Actual behavior bridge.register is returning windowName in null, in the then clause of the promise

Specifications

Screenshots loading tab title

ericflores108 commented 8 months ago

Hi @leonardosalatino - I am having a similar issue. Once I implemented your fix, it is giving me this error:

register - FAILED - (no parent)" Error: No handler found for post message: register from https://local.bullhornstaffing.com:4201 in https://cls43.bullhornstaffing.com/BullhornStaffing/CustomAction.cfm

Did you encounter a similar issue? Thanks in advance.

platypusjones commented 6 months ago

Also encountering the same issue. I notice two problems when registering:

  1. windowName always returns null. This is true even if a windowName property is present in environment.appBridgeConfig. From the relevant code it looks like this should be definable.
  2. _registeredFrames is always empty. Since the array is empty, the expected close() behavior isn't effective.