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

Check if given path exists for core/client openAsX functions #2298

Merged
merged 19 commits into from
Nov 2, 2021

Conversation

ndricimrr
Copy link
Contributor

@ndricimrr ndricimrr commented Sep 30, 2021

Description

Changes proposed in this pull request:
Fixes #2292

Calls to test with:
Client:

LuigiClient.linkManager().openAsDrawer('badpath', { title: 'a drawer title', size: 'm' });
LuigiClient.linkManager().openAsModal('/badpath', { title: 'a modal title', size: 'm' });
LuigiClient.linkManager().openAsSplitView('/asdadasd', { title: 'splitview title', size: 'm' });

Core:

Luigi.navigation().openAsModal('/gsdsda', { title: 'a modal title', size: 'm' });
Luigi.navigation().openAsSplitView('xcvv', { title: 'a splitview title', size: 'm' });
Luigi.navigation().openAsDrawer('/test123', { title: 'a drawer title', size: 'm' });

Defined handler:
Routing.js

pageNotFoundHandler = (notFounPath, wasAnyPathFitted) => {
    console.log("Wrong path:", notFounPath);
      Luigi.showAlert({
        text: `Path not found: ${wrongPath}`,
        type: 'error',
        closeAfter: 3000
      });
    
    return {redirectTo: "errors"};
  };

with handler defined, should redirect to specified path and show handlers alert.
without handler specified, should show default alert and also print default console warning.

Related issue(s)

@stanleychh stanleychh self-assigned this Oct 4, 2021
@stanleychh
Copy link
Contributor

@ndricimrr , Travis was not happy, Please have a look when you have time 😊

core/src/App.html Outdated Show resolved Hide resolved
core/src/App.html Outdated Show resolved Hide resolved
@JohannesDoberer JohannesDoberer merged commit cadcf7c into SAP:master Nov 2, 2021
@JohannesDoberer JohannesDoberer mentioned this pull request Nov 2, 2021
stanleychh pushed a commit to stanleychh/luigi that referenced this pull request Dec 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Luigi.navigation().openAsX(...) should check if given path exists
3 participants