Developer Documentation
  • Documentation Overview
  • Development Introduction
  • Getting Started
  • Fundamentals
    • Deploy an App via Pre-defined Sidecar
      • Sidecar Tutorial: Server-side
      • Sidecar Tutorial: Client-side
      • Sidecar Tutorial: Docker & Deploy
    • Deploy an App with Eureka
    • Design Guidance
  • Authentication
    • Accessing data exposed by the platform
    • Single Sign-On
      • Angular
      • Vue
      • Java Spring: Accepting JWT
      • Python Django: Accepting JWT
    • User and Role Identification
  • APIs | Data Integration
    • Submodel Index
    • Masterdata
    • Transactional data
  • Docker Information
    • Ruby Stack
    • Golang Stack
    • Node JS Stack
    • Java Spring Stack
    • Python Stack
  • Connect to the Platform
    • Integrate using Eureka Rest APIs
    • Use our Pre-built sidecar
    • Production deployment
  • Add-on Features
    • IApps-Navigation
  • Testing
  • FAQs | Troubleshooting
  • Registration
    • Application pre-requisites
      • Basic Requirements
    • Register Developer Account
    • Submit basic application info
    • Onboard Application
      • Submit Appstore details
        • App basic information
      • Configure Application
        • App Permission
        • App Data
        • AAS Instance
        • Licensing
        • Access Rights
        • Account Info
        • Terms Of Use
        • Pricing
      • Publish and test
        • Deploy
        • Register into Service Discovery
    • Publish to Marketplace
  • User Experience
  • The business model - How do I get paid?
  • References
    • IndustryApps - Intro
    • What is an Asset Administration Shell?
    • What is ECLASS?
      • How is ECLASS and Concept dictionary are used
    • Industry 4.0 standards
    • Customer Terms of Use
      • Subscription Order
    • Solution provider Terms of Use
      • Contract regions
      • Submission Form ( Solution provider)
Powered by GitBook
On this page
  1. Add-on Features

IApps-Navigation

Add-on Feature

The IApps-Navigation feature provides a method for users to circle back to the IndustryApps platform if they have accessed a third-party application which redirects via a new tab. Please utilise this add-on feature if your applications configuration fits this criteria.

Users utilise many applications on IndustryApps for different use cases, and as such providing a smooth flow transition is important for an improved user experience.

How do I add it?

The feature should be added as code snippets in your client-side application. The add-on will redirect the user back when the IApps back button on-click event is triggered.

Copy the line of code below into your index.html file.

In case of an Angular application a similar framework, you may include the .js and .css files in the angular.json script and style sections.

<div id="iapps-nav-logo"></div>

Include the iapps-nav.js functions file illustrated below.

iapps-nav.js
document.getElementById("iapps-nav-logo").onclick = function() {onClickIappsLogo()};

var isDragged = false;
function onClickIappsLogo() {
    if (isDragged) {
        return;
    }
    let params = window.location.hash.split('launch=')
    let url = params.length > 1 ? params[1] : '';
    window.location.href = decodeURIComponent(url);
}

dragElement(document.getElementById("iapps-nav-logo"));

function dragElement(elmnt) {
    var pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0;
    if (document.getElementById("iapps-nav-logo")) {
        // if present, the header is where you move the DIV from:
        document.getElementById("iapps-nav-logo").onmousedown = dragMouseDown;
    } else {
        // otherwise, move the DIV from anywhere inside the DIV:
        elmnt.onmousedown = dragMouseDown;
    }

    function dragMouseDown(e) {
        e = e || window.event;
        e.preventDefault();
        // get the mouse cursor position at startup:
        pos3 = e.clientX;
        pos4 = e.clientY;
        document.onmouseup = closeDragElement;
        // call a function whenever the cursor moves:
        document.onmousemove = elementDrag;
    }

    function elementDrag(e) {
        isDragged = true;
        e = e || window.event;
        e.preventDefault();
        // calculate the new cursor position:
        pos1 = pos3 - e.clientX;
        pos2 = pos4 - e.clientY;
        pos3 = e.clientX;
        pos4 = e.clientY;
        // set the element's new position:
        elmnt.style.top = (elmnt.offsetTop - pos2) + "px";
        elmnt.style.left = (elmnt.offsetLeft - pos1) + "px";
    }

    function closeDragElement() {
        // stop moving when mouse button is released:
        document.onmouseup = null;
        document.onmousemove = null;
        setTimeout(dragEnd, 500);
    }

    function dragEnd() {
        isDragged = false;
    }
}

Include the iapps-nav.css file illustrated below.

iapps-nav.css
#iapps-nav-logo {
    background: url("assets/iapps-nav.png") ;
    position: fixed;
    height: 60px;
    width: 60px;
    background-size: contain;
    cursor: pointer;
    top: 75px;
    left: 10px;
    z-index: 25;
}

In case of an Angular application, include the js and css files in the angular.json script and style sections.

Copy the iapps-nav.png image to your assets folder, available below.

Third-party Applications URL should contain a queryParam - launch. The URL assigned to launch the param will be used to redirect while clicking on the IApps back button.

Example:

https://www.thirdpartyapp.com?launch=https://democustomer.uat.industryapps.net

The Add-on feature repository is available below.

PreviousAdd-on FeaturesNextTesting

Last updated 2 years ago

https://github.com/IndustryApps/iapps-navigation-addon-featuregithub.com
66KB
iapps-nav.png
image