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

Improve 404 handling #310

Merged
merged 22 commits into from
Jan 14, 2019
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
b964617
Migrate to babel-preset -env
parostatkiem-zz Dec 28, 2018
2492e63
Make 404 error configurable & dismiss the alert on route change
parostatkiem-zz Dec 28, 2018
9ff7368
Update docu & comments
parostatkiem-zz Dec 28, 2018
1abea87
Defauld child mechanizm works with NotExactRoute error
parostatkiem-zz Dec 31, 2018
3d71069
Update missing dependencies
parostatkiem-zz Dec 31, 2018
b163080
Fix problems
parostatkiem-zz Dec 31, 2018
f964361
Add e2e tets
parostatkiem-zz Dec 31, 2018
9a38c64
Downgrade to the stable version of babel-loader
parostatkiem-zz Dec 31, 2018
e62c853
Rename variable & change navPath length check
parostatkiem-zz Dec 31, 2018
1fd5824
rename handle404 variable and move it to Routing
parostatkiem-zz Dec 31, 2018
b968710
rename handle404 variable
parostatkiem-zz Dec 31, 2018
6d401c2
Update docu
parostatkiem-zz Dec 31, 2018
188d6c5
Add additional check if aler.ttl is number
parostatkiem-zz Jan 2, 2019
a4276b6
disable pageNotFoundHandler
parostatkiem-zz Jan 2, 2019
adb63f0
Rename variable & css class
parostatkiem-zz Jan 2, 2019
b37fd0f
Add custom handling of 'partly wrong link'
parostatkiem-zz Jan 4, 2019
f95e34b
Update docu related to pageNotFoundHandler
parostatkiem-zz Jan 4, 2019
f541d5d
Redirect to root's default node in case of "total" 404
parostatkiem-zz Jan 4, 2019
04d8228
Merge branch 'master' of https://github.com/kyma-project/luigi into i…
parostatkiem-zz Jan 4, 2019
f7aaca0
Update docs/navigation-configuration.md
bszwarc Jan 10, 2019
cc390ef
Update docs/navigation-configuration.md
bszwarc Jan 10, 2019
63eca12
Merge branch 'master' of github.com:kyma-project/luigi into improve-4…
kwiatekus Jan 14, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions core/.babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"presets": [ "es2015" ]
}
"presets": ["@babel/preset-env"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,14 @@ describe('Luigi client features', () => {
cy.get('.fd-alert').contains(
'Could not map the exact target node for the requested route projects/pr2/miscellaneous2/maskopatol'
);

//navigate somewhere else
cy.get('button')
.contains('Projects')
.click();

//alert disappears
cy.get('.fd-alert').should('not.exist');
});

it('navigate to a totally wrong link', () => {
Expand All @@ -171,6 +179,14 @@ describe('Luigi client features', () => {
cy.get('.fd-alert').contains(
'Could not find the requested route maskopatol/has/a/child'
);

//navigate somewhere else
cy.get('button')
.contains('Projects')
.click();

//alert disappears
cy.get('.fd-alert').should('not.exist');
});
});

Expand Down
87 changes: 87 additions & 0 deletions core/examples/luigi-sample-angular/src/assets/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<!DOCTYPE html>
<html lang="en_EN">
<head>
<title>Page not found</title>
<link rel='stylesheet' href='/fiori-fundamentals/fiori-fundamentals.min.css'>
<style type="text/css">
body {
font-family: Arial, Helvetica, sans-serif;
}
@keyframes goAndHitSomeCorners {
0% {
transform: scaleX(1);
}
33% {
transform: scaleX(0);
}

66% {
transform: scaleX(-1);
}
100% {
transform: scaleX(1);
}
}
.section-spacer {
height: 800px;
}
.fd-panel {
padding: 15px;
}
a {
color: #0a6ed1;
text-decoration: none;
}
a:hover {
color: #085caf;
}
.fd-page__header {
padding: 1em;
text-align: center;
}

.fd-action-bar__title {
font-size: 6em;
}
.fd-action-bar__description {
font-size: 4em;
}

.error-number--fake {
visibility: hidden;
color: yellow;
}
.error-number--real {
color: #34495f;
transition: 1s;
animation-name: goAndHitSomeCorners;
animation-delay: 5s;
position: absolute;
animation-duration: 3s;
animation-iteration-count: infinite;
animation-timing-function: ease;
}
</style>
</head>
<body>
<header class="fd-page__header">
<h1 class="fd-action-bar__title">
Ooooooooops :(
</h1>
<h2 class="fd-action-bar__description">Yes, you guessed right, it's a
<strong class="error-number--real">404</strong>
<strong class='error-number--fake'>404</strong>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--spacer instead of fake?

error
</h2>
</header>



<script type="text/javascript" src="/luigi-client/luigi-client.js"></script>
<script type="text/javascript">


</script>

</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,11 @@ var projectsNavProviderFn = function(context) {
});
};

var custom404handler = function(wrongPath) {
//leave this function empty if you have an external 404 handling
window.location.href = `page-not-found`;
};

Luigi.setConfig({
/**
* auth identity provider settings
Expand Down Expand Up @@ -496,6 +501,13 @@ Luigi.setConfig({
viewUrl: '/assets/sampleexternal.html#two'
}
]
},
{
pathSegment: 'page-not-found',
label: 'Page not found',
viewUrl: '/assets/404.html',
hideFromNav: true,
hideSideNav: true
}
];
},
Expand Down Expand Up @@ -568,6 +580,7 @@ Luigi.setConfig({
favicon: '/assets/favicon-sap.ico'
// favicon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8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4oS9MPFkeU5c3YyHgSv/Ca4S4CmC7V/8jvauYYAVIFMHBsTSYNRrXizMTFqjRVVUPHPLeOT1bk1gmOySkibnO04/U5Za55qX6Hm5PXCVQCCgWGExqrlT+8TLBJpIRBvX6zibS4HVR0VckdjFALJ2bGqsyE+sZ+Bev3zb4CoBk57/XhQFOy8KAYh3+LIu+fiU7IQL5QWO11ws53cIHvpHFCIQIhAiwOwvAQYAgVjy36N7Pc4AAAAASUVORK5CYII='
})
//handle404: this.custom404handler
// hideNavigation: true
// backdropDisabled: true
}
Expand Down
Loading