-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[APM] Delay rendering invalid license notification #53924
Conversation
@@ -19,6 +19,10 @@ export function LicenseProvider({ children }: { children: React.ReactChild }) { | |||
const license = useObservable(license$); | |||
const hasInvalidLicense = !license?.isActive; | |||
|
|||
if (!license) { | |||
return null; | |||
} |
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 adds an additional (third) case. I don't think that is necessary. The two states that's needed imo:
- If the license has loaded AND is invalid, show
<InvalidLicenseNotification />
- If license is not loaded OR loaded and valid, show children:
<LicenseContext.Provider value={license} children={children} />
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.
In most cases the license will be valid eventually, so the user should not have to wait for the license check until they can see the app.
That was my initial thought. But then you'd still have a flash of a
different UI (if your license is not valid). Or is that acceptable because
we expect our users to have an appropriate license?
Op vr 3 jan. 2020 14:00 schreef Søren Louv-Jansen <[email protected]
…:
***@***.**** requested changes on this pull request.
In most cases the license will be valid eventually, so the user should not
have to wait for the license check until they can see the app.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#53924?email_source=notifications&email_token=AACWDXDTR2BCR7H6SKEQYZ3Q34ZINA5CNFSM4KCLNW52YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCQTILJI#pullrequestreview-338068901>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACWDXDMWPDCR2KJNGIJR4DQ34ZINANCNFSM4KCLNW5Q>
.
|
I think by far the majority pagehits (like, 90% +) will have a valid license so we should optimize for that case. I'm therefore good with a flash from app to license message if it's invalid. |
Don't render an invalid license notification if the license information has not been loaded. (Don't render any UI either).
6f0528d
to
9505d3f
Compare
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
The PR has been updated as @sqren is on vacation.
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.
* master: (69 commits) [Graph] Fix various a11y issues (elastic#54097) Add ApplicationService app status management (elastic#50223) logs in one time (elastic#54447) Deprecate using `elasticsearch.ssl.certificate` without `elasticsearch.ssl.key` and vice versa (elastic#54392) [Optimizer] Fix a stack overflow with watch_cache when it attempts to delete very large folders. (elastic#54457) Security - Role Mappings UI (elastic#53620) [SIEM] [Detection engine] Permission II (elastic#54292) Allow User to Cleanup Repository from UI (elastic#53047) [Detection engine] Some UX for rule creation (elastic#54471) share specific instances of some ui packages (elastic#54079) [ML] APM modules configs for RUM Javascript and NodeJS (elastic#53792) [APM] Delay rendering invalid license notification (elastic#53924) [Graph] Improve error message on graph requests (elastic#54230) [ILM] Kibana should allow a min_age setting of 0ms in ILM policy phases (elastic#53719) Unit Tests for common/lib (elastic#53736) [Graph] Only show explorable fields (elastic#54101) remove linting rule exception for markdown (elastic#54232) [Monitoring] Fetch shard data more efficiently (elastic#54028) [Maps] Add hiddenLayers option to embeddable map input (elastic#54355) Pass termOrder and hasTermsAgg properties to serializeThresholdWatch function (elastic#54391) ...
* master: (69 commits) [Graph] Fix various a11y issues (elastic#54097) Add ApplicationService app status management (elastic#50223) logs in one time (elastic#54447) Deprecate using `elasticsearch.ssl.certificate` without `elasticsearch.ssl.key` and vice versa (elastic#54392) [Optimizer] Fix a stack overflow with watch_cache when it attempts to delete very large folders. (elastic#54457) Security - Role Mappings UI (elastic#53620) [SIEM] [Detection engine] Permission II (elastic#54292) Allow User to Cleanup Repository from UI (elastic#53047) [Detection engine] Some UX for rule creation (elastic#54471) share specific instances of some ui packages (elastic#54079) [ML] APM modules configs for RUM Javascript and NodeJS (elastic#53792) [APM] Delay rendering invalid license notification (elastic#53924) [Graph] Improve error message on graph requests (elastic#54230) [ILM] Kibana should allow a min_age setting of 0ms in ILM policy phases (elastic#53719) Unit Tests for common/lib (elastic#53736) [Graph] Only show explorable fields (elastic#54101) remove linting rule exception for markdown (elastic#54232) [Monitoring] Fetch shard data more efficiently (elastic#54028) [Maps] Add hiddenLayers option to embeddable map input (elastic#54355) Pass termOrder and hasTermsAgg properties to serializeThresholdWatch function (elastic#54391) ...
* [APM] Delay rendering invalid license notification Don't render an invalid license notification if the license information has not been loaded. (Don't render any UI either). * Show UI if license has not loaded
Don't render an invalid license notification if the license information has not been loaded. (Don't render any UI either).
This only happens for a very, usually unnoticeable, amount of time, but it's still visible from time to time AFAICT.