-
Notifications
You must be signed in to change notification settings - Fork 248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modifying iframe_sample_app to send and receive messages #64
Conversation
…nt from an external website
Did you want us to review this or still WIP? |
if (data.firstLoad && SIDE_BAR_REGEX.test(this.currentLocation())) { | ||
this.showIframe({ width: '300px', height: '260px' }); | ||
handleHello: function(data) { | ||
if (data.awesome) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might need a comment. I think we had a problem at one point where people thought data.awesome
was something we provided
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will be adding in the readme that you need to have the zaf sdk running locally. That is going to be open source so people can see in the code what is being sent in data
. Do you think this data.awesome
bit will be clear then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to check for data.awesome
presence if it's our own data structure? Perhaps it would be better to send something back in the data structure that we can render.
|
||
this.$form = this.$('form').eq(0); | ||
this.formData = this.$form.serializeArray(); | ||
var message = this.formData[0].value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use the input field directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did that for consistency. I looked at how other demo apps are doing similar things with forms
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mmm, do you remember which one by any chance? I'd would personally only do this if I was passing the whole form to be processed by some other code. We should have as little code as possible in these apps, though I know some demo apps are fairly complicated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was here: https://github.com/zendesk/demo_apps/blob/master/external_api_sample_app/app.js#L208
But I think it is passing the complete form data, like you said. So I'll simplify it here
Perhaps it would be nice to have some representation in the UI for the iframe as well. Thoughts @zendesk/quokka? |
@maximeprades @acottrell this sample app depends on a external page that includes ZAF SDK and is able to send and receive any messages it receives. I asked @itirkarp to use the page included in ZAF SDK itself, since we're planning to open source it (soonish I'm hoping). The other alternative would be to host this somewhere, but then App Developers wouldn't be able to change its code, obviously. |
@itirkarp could you make a PR with the changes to ZAF SDK as well? |
@danielbreves as long as we're not making a lot of noise around it and if you make sure security team is aware (follow these steps: https://zendesk.atlassian.net/wiki/display/ENG/Open+Source) i'm ok with open sourcing that repo if you think it's ready. The only thing is I want to "relaunch" it properly in Q1, with some marketing calories behind it as a brand new feature so that's why I don't want to make noise about it now (i.e blog post etc...) |
@maximeprades awesome! I've added a couple of killer LAB stories that we could use to add even more "calories" for the launch in Q1: LAB-14, LAB-15 |
@danielbreves are the URLs final? I remember some discussions around serving them from the CDN for better perf which would result in a URL change and thus breaking apps for people. |
@maximeprades I believe so, we verified it's already being served from the CDN: https://zendesk.atlassian.net/browse/ROAD-173?focusedCommentId=92827&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-92827 |
ok what about URLs? are they final? what are they? sorry I suppose i could RTFM 😄 |
@maximeprades totally haha -> https://developer.zendesk.com/apps/docs/agent/iframes_in_apps |
|
||
This app aims to be a good start to learn how to iframe things of different sizes and methods. | ||
This app aims to be a good start to learn how send messages between an iframe and an app. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
, using the [Zendesk App Framework SDK]()
?
@danielbreves |
if (data.firstLoad) { | ||
this.showIframe({ width: '1024px', height: '500px' }); | ||
handleMessageReceived: function(data) { | ||
if (data.awesome) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data.awesome
was just to demonstrate the ability to pass data around, since we're already using data.message
below we can probably get it of data.awesome
everywhere else.
💇 |
👍 |
|
||
</div> | ||
|
||
{{iframe "http://localhost:9001"}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\n OCD
any chance of a screenshot / licecap gif? |
@sandlerr There is a screenshot in the readme |
👍 |
|
||
This app aims to be a good start to learn how to iframe things of different sizes and methods. | ||
This app aims to be a good start to learn how send messages between an iframe and an app using the [Zendesk App Framework SDK](https://github.com/zendesk/zendesk_app_framework_sdk) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...learn how to send...
?
8464ffa
to
d53b56f
Compare
Modifying iframe_sample_app to send and receive messages
Earlier the iframe_sample_app used to display content from an external website (Wikipedia).
/cc @zendesk/quokka
References
Risks