Skip to content
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

Update the realtime page to open issue tabs in iframes #15

Open
MayamaTakeshi opened this issue Jan 1, 2023 · 3 comments
Open

Update the realtime page to open issue tabs in iframes #15

MayamaTakeshi opened this issue Jan 1, 2023 · 3 comments

Comments

@MayamaTakeshi
Copy link
Owner

MayamaTakeshi commented Jan 1, 2023

The realtime page should popup issues in iframes inside tabs.
It should store/restore tabs using local storage.
The tabs should contain 'close' icon to permit to close them.
Also, we should pass a parameter bare=true in the querystring url of the issue so that we can ask redmine to not include the headers (menus) in the retrieved page and any other things like sidebar.
Maybe there are some hints here: https://www.redmine.org/boards/1/topics/59964

We probably should use deface gem :remove via redmine_base_deface:
https://github.com/spree/deface

But if it gets complicated, javascript in the page could remove the header/sidebar.
For better effect we might need to make the tab content invisible till the iframe javascript informs it removed the header/sidebar (using BroadcastChannel)

Also, if bare=true gets complicated to process (in particular, in case of edition/submit of the issue), we the javascript client code can detect if it running in an iframe:
https://www.geeksforgeeks.org/how-to-check-a-webpage-is-loaded-inside-an-iframe-or-into-the-browser-window-using-javascript/

@MayamaTakeshi
Copy link
Owner Author

MayamaTakeshi commented Jan 7, 2023

Also, we could preserve urls per tab using session storage:
https://stackoverflow.com/questions/44667607/browser-tab-storage
and we can have large number of tabs open with proper pagination:
https://splidejs.com/guides/pagination/
https://splidejs.com/integration/vue-splide/

But we could also use mithril.js with this module:
https://github.com/PebbleRoad/mithril.paginate

However, I realized we cannot implement this yet. If a user is on another tab when a call is answered, the realtime browser tab would add an iframe html tab but the focus would not be set to the realtime tab. So till we solve this, we could not use this approach. Unless we are satisfied in just adding some indication that the realtime tab was updated. (but maybe we can find a way for the tab to set focus to itself).

@MayamaTakeshi
Copy link
Owner Author

But this might be enough:
https://codesandbox.io/s/lm57j2lkl?file=/src/index.js

@MayamaTakeshi
Copy link
Owner Author

"Agile Web Development with Rails 6" says:
We call render_to_string to render the view as a string, passing layout:
false, because we want only this view and not the entire page.

So i suppose we can use "layout: false" to get only the issue part and not the surrounding elements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant