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

Update page for missing Short URL #171679

Merged
merged 13 commits into from
Nov 30, 2023

Conversation

tsullivan
Copy link
Member

@tsullivan tsullivan commented Nov 21, 2023

Summary

Closes #169935

Screenshots

Before image
After image

Testing

  1. Create a simple dashboard
  2. Use the Share > Short URL feature to create a short link to the dashboard.
  3. Copy the shortened URL link to the clipboard, create a browser bookmark using the link.
  4. Navigate to Saved Objects Management and delete the backing saved object of the short link
  5. Click the new bookmark to try to open the shortened URL
  6. Land on this new page

Checklist

Delete any items that are not applicable to this PR.

@tsullivan tsullivan force-pushed the short-urls/new-error-page branch from 946c016 to c3175c0 Compare November 21, 2023 19:09
@tsullivan tsullivan changed the title Short urls/new error page Better Short URL missing link redirection error Nov 21, 2023
@tsullivan tsullivan changed the title Better Short URL missing link redirection error Update Short URL missing link page Nov 21, 2023
@tsullivan tsullivan changed the title Update Short URL missing link page Update page for missing Short URL Nov 21, 2023
@MichaelMarcialis
Copy link
Contributor

Thanks for putting this together, @tsullivan. Per your request, I've taken a look at this and the originating issue posted by @vadimkibana. Is there a compelling reason to not simply use the standard Kibana 404 error here? If I'm attempting to navigate to a saved object that no longer exists (via short or long URL), this is what I would expect to happen.

CleanShot 2023-11-27 at 11 01 53

@tsullivan tsullivan force-pushed the short-urls/new-error-page branch 2 times, most recently from 90fdc2a to 3195a3b Compare November 28, 2023 18:42
@tsullivan tsullivan force-pushed the short-urls/new-error-page branch from 6e62725 to c285b77 Compare November 29, 2023 00:09
@tsullivan tsullivan marked this pull request as ready for review November 29, 2023 00:10
@tsullivan tsullivan requested review from a team as code owners November 29, 2023 00:10
@tsullivan tsullivan added the release_note:skip Skip the PR/issue when compiling release notes label Nov 29, 2023
@tsullivan tsullivan self-assigned this Nov 29, 2023
@tsullivan tsullivan requested a review from a team as a code owner November 29, 2023 20:06
@tsullivan tsullivan force-pushed the short-urls/new-error-page branch from e886297 to 24bdc5d Compare November 29, 2023 21:07
@tsullivan tsullivan removed the request for review from a team November 29, 2023 21:07

const defaultBody = i18n.translate('share.urlService.redirect.components.Error.body', {
defaultMessage:
'The stored URL for this link could not be opened. This could be due to lost Kibana Saved Object data.',
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the text could be improved.
I like the text from the screenshot better #171679 (comment)

Also the URL might be broken because it just was incorrect (e.g. mistaken when manually typed or not fully copied)

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe something like Sorry, the object you're looking for can't be found at this URL. It might have been removed or maybe it never existed.

// Using the current URL containing "/app/r/", make a URL to the root basePath
// by trimming that part to end up at the Home app or project home.
const currentUrl = window.location.href;
const newUrl = currentUrl.replace(/\/app\/r\/.*/, '');
Copy link
Contributor

Choose a reason for hiding this comment

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

Why wouldn't we use home href from settings instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

++ to use the defaultRoute from settings, prepended with the app basePath

beac26f

Copy link
Contributor

@Dosant Dosant left a comment

Choose a reason for hiding this comment

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

Looks good apart from suggestion to improve copy and if '/' redirects to defaultRoute from uiSettings

@tsullivan tsullivan enabled auto-merge (squash) November 30, 2023 20:04
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #78 / serverless search UI Importing an existing dashboard "after all" hook for "does not show the unsaved changes badge in edit mode"

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
share 73 78 +5

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
share 5.6KB 7.3KB +1.7KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
share 52.2KB 52.4KB +180.0B
Unknown metric groups

async chunk count

id before after diff
share 1 3 +2

ESLint disabled line counts

id before after diff
share 7 8 +1

miscellaneous assets size

id before after diff
share 0.0B 387.0KB ⚠️ +387.0KB

Total ESLint disabled count

id before after diff
share 9 10 +1

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @tsullivan

@tsullivan tsullivan merged commit e6f3f06 into elastic:main Nov 30, 2023
32 checks passed
@kibanamachine kibanamachine added v8.12.0 backport:skip This commit does not require backporting labels Nov 30, 2023
jbudz added a commit to jbudz/kibana that referenced this pull request Dec 1, 2023
@jbudz
Copy link
Member

jbudz commented Dec 1, 2023

Hey, sorry this had to be reverted with #172334. The canvas shareable runtime build is skipped on pull requests by default, but had a build failure later. The build can be opted-in with the ci:build-canvas-shareable-runtime label.

Logs are available at https://buildkite.com/elastic/kibana-artifacts-snapshot/builds/3610#018c22ec-6c1e-4b63-92de-58d63d688f94

@jbudz jbudz added the reverted label Dec 1, 2023
tsullivan added a commit that referenced this pull request Dec 5, 2023
## Summary

This PR re-opens #171679 which had
to be reverted due to CI instability at the time it was originally
mergted.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes reverted v8.12.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Better Short URL missing link redirection error
7 participants