-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
web: Normalize client-side error handling #13595
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for authentik-docs canceled.
|
✅ Deploy Preview for authentik-storybook ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #13595 +/- ##
==========================================
+ Coverage 92.74% 92.76% +0.01%
==========================================
Files 794 794
Lines 40502 40502
==========================================
+ Hits 37565 37570 +5
+ Misses 2937 2932 -5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
authentik PR Installation instructions Instructions for docker-composeAdd the following block to your AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-7a97b2176bd7e7098e0f6777d7e7216c4077315d
AUTHENTIK_OUTPOSTS__CONTAINER_IMAGE_BASE=ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s Afterwards, run the upgrade commands from the latest release notes. Instructions for KubernetesAdd the following block to your authentik:
outposts:
container_image_base: ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s
global:
image:
repository: ghcr.io/goauthentik/dev-server
tag: gh-7a97b2176bd7e7098e0f6777d7e7216c4077315d Afterwards, run the upgrade commands from the latest release notes. |
export function formatGeoEvent(event: EventWithContext): SlottedTemplateResult { | ||
if (!event.context.geo) return nothing; | ||
|
||
const { city, country, continent } = event.context.geo; | ||
|
||
const parts = [city, country, continent].filter(Boolean); | ||
|
||
return html`${parts.join(", ")}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Included in the PR as prep for a type-safe check on the recent events element.
<small>${EventGeo(item)}</small>`, | ||
<small>${formatGeoEvent(item)}</small>`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs more love in a future iteration but the idea is something like events would have stronger typing, and that formatGeoEvent
would operate like a i18n function.
renderEmpty(): TemplateResult { | ||
renderEmpty(inner?: SlottedTemplateResult): TemplateResult { | ||
if (this.error) { | ||
return super.renderEmpty(inner); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes issue where errors don't render when the empty state is active. IMO this needs fixing in the base Table
class but that refactor will need a PR of its own.
a00fd5a
to
ee0405e
Compare
Wizard navigation steps.
Details
This PR is a preparation for permissions based UI rendering. The primary change in this PR is the parsing of runtime errors into type-safe interfaces. By default TypeScript will leave Promise
.catch
's error parameter asany
to indicate that the error may arise from unexpected sources, such as network issues, runtime type errors, etc.This PR seeks to both enforce better typing and provide more accurate runtime information.
Checklist
ak test authentik/
)make lint-fix
)If an API change has been made
make gen-build
)If changes to the frontend have been made
make web
)If applicable
make website
)