Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Commit

Permalink
Bookmark tip (#173)
Browse files Browse the repository at this point in the history
* Create bookmark.js

* Update README.md

Add Tip 2 for bookmark to catwalk

* Update port logic

Works for desktop, server and with docker container
Add fallback if appId is not present in url, go to catwalk.core.qlik.com

* Add href to bookmark folder and js file
  • Loading branch information
KFredberg authored and sublibra committed Feb 8, 2019
1 parent 68473bd commit 6a18553
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ The catwalk UI doesn't provide login to the Qlik Sense app but as long as there

![host white list](./images/qmc-whitelist.png)

### Tip :tada:
### Tip 1:tada:
We created a Qlik Sense extension that can be found in the sense-extension folder that will create a link to the Qlik hosted catwalk UI with the current open app if "dragged" onto a sheet of you Qlik Sense app.
To install the extension you have to zip the folder and import it into you Qlik Sense installation, [see](https://help.qlik.com/en-US/sense-developer/November2018/Subsystems/Extensions/Content/Sense_Extensions/Howtos/deploy-extensions.htm)

### Tip 2:tada:
We created a javascript bookmark that can be found in the [bookmark](./bookmark) folder that will open up a new tab to the Qlik hosted catwalk UI with the current open app.
To setup Create a bookmark and paste the content of [bookmark.js](./bookmark/bookmark.js) in the URL field.
24 changes: 24 additions & 0 deletions bookmark/bookmark.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
javascript: (function () {
const getAppId = (location) => {
const prefix = '/sense/app/';
let start = location.pathname.indexOf(prefix);
if (start === -1) return;
start += prefix.length;
const end = location.pathname.indexOf('/', start);
const appId = location.pathname.substring(start, end !== -1 ? end : location.pathname.length);
return appId;
};
const appId = getAppId(window.location);
if (appId) {
const { hostname } = window.location;
const protocol = window.location.protocol === 'http:' ? 'ws' : 'wss';
const port = window.location.port === '' ? '': `:${window.location.port}`;

const engineUrl = `${protocol}://${hostname}${port}/app/${appId}`;
const url = `http://catwalk.core.qlik.com/?engine_url=${engineUrl}`;
window.open(url, '_blank');
} else {
const url = 'http://catwalk.core.qlik.com';
window.open(url, '_blank');
}
}());

0 comments on commit 6a18553

Please sign in to comment.