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

Page is not loaded when typing the apps home page url with / at the end of the URL #75051

Closed
cauemarcondes opened this issue Aug 14, 2020 · 2 comments · Fixed by #75074
Closed
Assignees
Labels
bug Fixes for quality problems that affect the customer experience Feature:New Platform Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v7.10.0

Comments

@cauemarcondes
Copy link
Contributor

cauemarcondes commented Aug 14, 2020

On APM we're moving to use the platform history (#74328) I was making some tests and found out an issue when redirection the home page.

When we navigate to APM home page app/apm we redirect the user to app/apm/services. The problem happens when I type app/apm/ (with / at the end of the URL). The URL is replaced to app/apm/services but the page isn't loaded.

Screenshot 2020-08-14 at 17 04 25

I've investigated a bit and found out that the problem happens in this function https://github.com/elastic/kibana/blob/master/src/core/public/application/scoped_history.ts#L281

private stripBasePath(location: Location<HistoryLocationState>): Location<HistoryLocationState> {
    return {
      ...location,
      pathname: location.pathname.replace(new RegExp(`^${this.basePath}`), ''),
    };
  }

When I type app/apm/, this value is set as basePath, and when this function is called it returns services instead of /services.

A possible solution would be to remove the last slash from the base path.

@cauemarcondes cauemarcondes added bug Fixes for quality problems that affect the customer experience v7.10.0 labels Aug 14, 2020
@cauemarcondes cauemarcondes changed the title Problem when redirecting the home page. Page is not loaded when typing the apps home page url with / at the end of the URL Aug 14, 2020
@joshdover joshdover added Feature:New Platform Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc labels Aug 14, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform (Team:Platform)

@joshdover
Copy link
Contributor

A possible solution would be to remove the last slash from the base path.

It seems that we should be using the match.path property instead of the match.url property when we configure the ScopedHistory:

render={({ match: { url } }) => (
<AppContainer
appPath={url}
appStatus={appStatuses.get(appId) ?? AppStatus.inaccessible}
createScopedHistory={createScopedHistory}
{...{ appId, mounter, setAppLeaveHandler, setIsMounting }}
/>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:New Platform Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v7.10.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants