single page app in iframe

1,324 views
Skip to first unread message

Andriy Zhdanov

unread,
Jan 24, 2014, 4:17:51 AM1/24/14
to atlassian-...@googlegroups.com
Hi all,

I have some concern, it might be relevant to any atlassian-connect add-on, that has more than one page at one atlassian-connect entry point.

E.g., atlassian-connect.json fragment (that's what I call entry-point):

    "modules": {
        "generalPages": [{
            "url": "/hello-world",


And, e.g. using AngularJS route:
    $routeProvider
        .when('/:planetName?',

To say hello to particular planet :) so, url in iframe will be http://localhost:3000/.../#/Mars, most likely (at least it will be like this in normal Single Page App), and it will work, but it's not SEO-ready.

The problem is that when navigated inside iframe, location is not propagated to host page, and in other way, typing desired url in browser is not passed to add-on iframe. E.g. http://localhost:2990/jira/plugins/servlet/ac/example-plugin/hellow-world/#/Mars - parameter is not passed. That means it's impossible to bookmark add-on page.

Note, with normal (non JS app) I think it will be the same but hardly possible to solve, however with JS Single Page Apps, it might be possible to hash value to and from add-on iframe.

Does anybody have any comments, please?

Thank you.

Fernando Boucquez

unread,
Jan 24, 2014, 4:40:01 AM1/24/14
to atlassian-...@googlegroups.com

Hi Andriy,

I got the same problem creating our plugin with angularn js. As I see it, the fragment part of a uri is not part of the url, it is the way a brower 'jumps' to a section of page. If you sysout a servlet request url, the fragment is not part of it. The way I workaround the problem was saving the fragment path in local browser storage and redirect (location.path) when the refreshing the jira page with the iframe.

How was your experience with jira ac and angular so far? What about angularjs and atlassian's aui framework? Been creating web app with Java, flex, jquery, rails for 10 years and angularjs is the best web frameork ever.

--
You received this message because you are subscribed to the Google Groups "Atlassian Connect Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to atlassian-connec...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Andriy Zhdanov

unread,
Jan 24, 2014, 5:32:08 AM1/24/14
to atlassian-...@googlegroups.com

Hi Fernando,

Yeah, I'm a big fan of Angular, and single page apps in general too! I also have broad experience, and now bid on js :)

I also have the most pleasant experience with Atlassian, and like very much what I can see in AC. Though I don't use AUI much by now.

Regarding storing location in browser, it's good only for refresh, but doesn't help for bookmarking :(

I see the point that hash is not passed to server, so it can't be passed in iframe.src, but I believe js framework my make it available to addon.

Thanks.

You received this message because you are subscribed to a topic in the Google Groups "Atlassian Connect Dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/atlassian-connect-dev/UHB7hEI_W4A/unsubscribe.
To unsubscribe from this group and all of its topics, send an email to atlassian-connec...@googlegroups.com.

Fernando Boucquez

unread,
Jan 25, 2014, 2:01:08 AM1/25/14
to atlassian-...@googlegroups.com
Hi Andriy, I've missed the bookmarking thing. It would be an issue for us too. As you said, the iframe should inform Jira about the path and the other way around when refreshing or bookmark loading the page, maybe using the RA javascript library atlassian provides. Not sure if they want to add this feature.

Please keep in touch for all angularJs, Atlassian, AC integration adventure.

Cheers!
Fernando

Andriy Zhdanov

unread,
Jan 25, 2014, 2:33:26 AM1/25/14
to atlassian-...@googlegroups.com
Hi Fernando,

Yes, that's actually an attempt to check with Atlassian if RA can provide means to inform JIRA about the add-on path, and the other way around. Thank you for your support!
Reply all
Reply to author
Forward
0 new messages