Coder Social home page Coder Social logo

Comments (14)

WrathOfZombies avatar WrathOfZombies commented on June 5, 2024

@Zlatkovsky, Agreed on the naming. I'll introduce the new signature in 0.8.0 and deprecate the current signature after 2 - 3 releases.

As for the flow itself, I don't see what you hope to accomplish with isAuthDialog=true? The dialog closes successfully today and there seems to be some error post that which will debug. Also there's no messaging back happening when its in only Web mode in IE 11. When isAuthDialog detects web mode, it just decides to create a new popup and constantly poll the popup till its back on the same domain.

from office-js-helpers.

WrathOfZombies avatar WrathOfZombies commented on June 5, 2024

@Zlatkovsky After thinking this through more carefully, I realize the current name is the best possible name that I can provide. But before I discuss that, the error that you are facing isn't related to messageParent and the host detection is working fine. Its an IE11 issue that I am trying to work around and will fix it soon.

As for the name itself. The idea behind the name is as follows:

if(Authenticator.isAuthDialog()) {
  // Then we know for sure that this code is running inside of a dialog (irrespective of an Office dialog, teams dialog or web popup)
 // Allow the developer to run the custom code here or completely stop execution
}

// This code will only be run inside of the main Add-in unless the developer hasn't stopped execution inside of a dialog. If so then both pieces of code will be run.

from office-js-helpers.

Zlatkovsky avatar Zlatkovsky commented on June 5, 2024

Bhargav, I agree that as single call that both dispatches and returns a result, it's hard to make that API name better. But what if you have something like this:

let initializeResult = Authenticator.initializeIfRelevant();
if (initializeResult.isAuthDialog) {
    // ...
    return;
 }

Which of course can be simplified to

if (Authenticator.initializeIfRelevant().isAuthDialog) {
    // ...
    return;
 }

And you can probably come up with a better name for initializeIfRelevant (including just initialize()), though I think the "is relevant" piece is also important to convey.

What do you think about that?

from office-js-helpers.

WrathOfZombies avatar WrathOfZombies commented on June 5, 2024

@Zlatkovsky Would you like to test out https://unpkg.com/@microsoft/[email protected]/dist/office.helpers.js. This addresses all the authentication issues faced in IE11

from office-js-helpers.

WrathOfZombies avatar WrathOfZombies commented on June 5, 2024

ping @Zlatkovsky

from office-js-helpers.

Zlatkovsky avatar Zlatkovsky commented on June 5, 2024

@WrathOfZombies , I tried integrating "0.8.0-beta.4" into Script Lab just now. I can't speak to the authentication issues, but it does break a bunch of other stuff (editor doesn't fully load; get an "Unable to get property 'lastUpdatedText' of undefined or null reference, which is coming out of Script Lab code, but is presumably being caused by some change in the Office.js helpers).

I haven't had a chance to debug it, but when I rolled back to 0.7.4 things were good again, and when I rolled forward to 0.8.0-beta.4, things were broken again. You can try it yourself simply by checking out the latest version of Script Lab, master branch (or others...) and first seeing that the site works in IE in the old version, and then fails with the new OfficeJsHelpers version.

(BTW, it fails in chrome as well, without a console error, but with same effect of the site becoming non-usable; perhaps it's some observable is breaking, and the buttons no longer respond after that).

from office-js-helpers.

Zlatkovsky avatar Zlatkovsky commented on June 5, 2024

BTW, is there a way (a tag?) by which I could view the diff between 0.8.0-beta.4 and 0.7.4?

from office-js-helpers.

WrathOfZombies avatar WrathOfZombies commented on June 5, 2024

Here's the delta but its quite large as there have been many changes from 0.7 to 0.8...

master...bhkrish/revamped-dialog-flow

from office-js-helpers.

ChobiJava avatar ChobiJava commented on June 5, 2024

Still seeing the problem that the Dialog won't close correctly in IE11 with 0.8.0-beta.4.

It seems to lie in that even though I'm running IE11, Utilities.isAddin() still returns true in Dialog.close().

from office-js-helpers.

WrathOfZombies avatar WrathOfZombies commented on June 5, 2024

@ChobiJava

So in the beta, the dialog problem with IE11 is solved by using localStorage. I have an interval tick to check if a particular unique localStorage item has been set and if so extract it and get the value from there. When running the beta and launching the dialog, after the redirection is complete, please check if the localStorage contains this key: VGVtcG9yYXJ5S2V5Rm9yT0pIQXV0aA==?

Also with respect to the lie, can you tell me the value of Utilities.host & Utilities.platform as that would help debug further?

from office-js-helpers.

ChobiJava avatar ChobiJava commented on June 5, 2024

@WrathOfZombies

Yeah, I found the reference to that key in the code while debugging. The value of the key is never set because of this codeblock

image

Just flip the else-if statement? :)

For the Utilities.host it returns OUTLOOK, while Utilities.platform returns OFFICE_ONLINE.

from office-js-helpers.

WrathOfZombies avatar WrathOfZombies commented on June 5, 2024

Then that is expected. As we want to use Outlook's Add-in dialog. I'll take a look at the bug that the add-in doesn't close in IE11.

Seems that for IE11 specifically, I need to do some sort of URL redirection within the dialog to make it work.

from office-js-helpers.

WrathOfZombies avatar WrathOfZombies commented on June 5, 2024

Please try the latest version and let me know if you are still seeing issues. @ChobiJava

Get the latest from here

from office-js-helpers.

ChobiJava avatar ChobiJava commented on June 5, 2024

The code seem to execute correctly @WrathOfZombies , but unfortunately as stated in this new issue the configuration for the endpoint is returned rather than the actual token.

from office-js-helpers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.