1.6.0 • Published 2 months ago

@amag-ch/sap_cap_common_launchpad v1.6.0

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
2 months ago

npm version npm downloads

Lauchpad Sandbox for local testing

Table of Contents

Installing

Using npm:

$ npm install @amag-ch/sap_cap_common_launchpad --save-dev

Using yarn:

$ yarn add @amag-ch/sap_cap_common_launchpad --dev

Usage

Before cds version 6.8.0, add following to your custom server.js:

if (process.env.NODE_ENV !== 'production') {
    cds.once('bootstrap', () => new (require('@amag-ch/sap_cap_common_launchpad'))())
}

or the long version

if (process.env.NODE_ENV !== 'production') {
    const Lauchpad = require('@amag-ch/sap_cap_common_launchpad')
    cds.once('bootstrap', () => new Lauchpad())
}

Since cds version 6.8.0 the cds plugin feature register the launchpad automatically

Afterthen the launchpad is available under http://localhost:4004/$launchpad

Applications which should be displayed must be defined in package.json of your project under sapux

{
    "sapux": [
        "app/application1",
        "app/application2"
    ]
}

Configuration

Configuration by programming

Call new Lauchpad({...}) constructor to change the default options

{
    path: '/$launchpad', // Path under which the launchpad serves
    name: 'Launchpad', // Name of the lauchpad
    title: 'Lauchpad Sandbox', // Title of the launchpad
    cdn: 'https://ui5.sap.com', // URL from where the libs should be loaded
    version: '', // Specific UI5 version
    libs: 'sap.ui.core, sap.m, sap.ushell, sap.fe.templates', // UI5 libraries should be loaded at startup
    theme: 'sap_horizon' // UI5 theme
}

Configuration by definition

Add launchpad configuration in package.json or .cdsrc.json

{
    "cds": {
        "launchpad": {
            "version": "1.115.1",
            "theme": "sap_horizon_dark"
        }
    }
}

Own groups

If the project have multipe tiles, it's possible to move them in own groups

{
    "cds": {
        "launchpad": {
            "groups": {
                "business": [
                    "app/application1"
                ],
                "technical": [
                    "app/application2"
                ]
            }
        }
    }
}

Group titles

If auto generated groups titles doesn't fit, then those can be set manually

{
    "cds": {
        "launchpad": {
            "titles": {
                "groups": {
                    "business" "Different title for business"
                }
            },
            "groups": {
                "business": [
                    "app/application1"
                ],
                "technical": [
                    "app/application2"
                ]
            }
        }
    }
}

Own catalogs

If the project have multipe tiles, it's possible to move them in own catalogs

{
    "cds": {
        "launchpad": {
            "catalogs": {
                "technical": [
                    "app/application2"
                ]
            }
        }
    }
}

Catalog titles

If auto generated catalogs titles doesn't fit, then those can be set manually

{
    "cds": {
        "launchpad": {
            "titles": {
                "catalogs": {
                    "technical" "Different title for technical"
                }
            },
            "catalogs": {
                "technical": [
                    "app/application2"
                ]
            }
        }
    }
}

Roles

If tiles / applications should be only add, if logined user have the corresponding rights, then roles and assignment must be defined.

If an application is not assigned to a role, then it's general accessable.

It's only working if cds.middlewares are active.

{
    "cds": {
        "launchpad": {
            "titles": {
                "groups": {
                    "business" "Different title for business"
                }
            },
            "roles": {
                "BusinessUser": [
                    "app/application1"
                ],
                "TechnicalUser": [
                    "app/application2"
                ]
            },
            "groups": {
                "business": [
                    "app/application1"
                ],
                "technical": [
                    "app/application2"
                ]
            }
        }
    }
}

Target only applications

If applications should be started only over target navigation, then those can be added to special hidden catalog and group.

{
    "cds": {
        "launchpad": {
            "catalogs": {
                "business": [
                    "app/application1"
                ],
                "hidden": [
                    "app/application2"
                ]
            },            
            "groups": {
                "business": [
                    "app/application1"
                ],
                "hidden": [
                    "app/application2"
                ]
            }
        }
    }
}

License

MIT

1.6.0

2 months ago

1.5.0

2 months ago

1.4.1

3 months ago

1.4.0

3 months ago

1.3.1

10 months ago

1.3.0

10 months ago

1.2.0

11 months ago

1.1.0

1 year ago

1.0.0

1 year ago