luigi icon indicating copy to clipboard operation
luigi copied to clipboard

External links support in Luigi.ux().showAlert()

Open golojg opened this issue 3 years ago • 1 comments

Description Could you be so kind and add possibility to use external links in Luigi.ux().showAlert() method? Currently only the internal links are supported in the form of relative or absolute paths (see here: https://docs.luigi-project.io/docs/luigi-core-api/?section=showalert)

Reasons I would link to use link to documentation in message and it is external link.

golojg avatar Oct 20 '21 11:10 golojg

Hi @golojg, have you tried to use "dismissKey"? With that you can define a "link" and react when it was clicked. See https://docs.luigi-project.io/docs/luigi-core-api/?section=parameters-21

usage example:

Luigi.ux().showAlert({
    text: 'Read our {docs}!',
    links: {
        docs: {
            text: 'documentation',
            dismissKey: 'docs'
        }
    }
})
 .then((dismissKey) => {
    if(dismissKey === 'docs') {
        window.open('https://path.to/your/docs');
    }
 });

hardl avatar Oct 21 '21 12:10 hardl