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

release-22.2: ui: dynamically read ui data on js load #94067

Merged
merged 1 commit into from Dec 21, 2022

Commits on Dec 21, 2022

  1. ui: dynamically read ui data on js load

    Previous work that dynamically loaded the base ui data that we attach to
    `Window` did not account for JS code which referenced the `dataFromServer`
    variable directly in top-level consts. This led to a broken login widget in the
    top right corner and docs links that would pin to "stable" versions instead of
    the specific version link of the running cluster.
    
    This commit does not completely fix the issue but it applies several
    mitigations:
    
    First, the redux store is now initialized with the loaded copy of the
    `dataFromServer` info. This ensures that login information is initialized
    properly. Second, the store is now constructed in the promise we define in
    `index.tsx` instead of inline in the file in which it's defined, allowing us to
    control execution ordering. Third, one of the `dataFromServer` usages in the
    redux login selector is moved to be inside the selector to grab values at
    runtime. Last, the `docs.ts` file is updated to no longer use `const`s for all
    the doc link strings and instead use `let` which allows us to reload the links
    at runtime after we have version data from the server.
    
    Resolves cockroachdb#93273
    
    Epic: None
    
    Release note (ui change): Secure clusters now show correct login information in
    the top right corner. Docs links correctly reference the current cluster
    version when necessary.
    
    Release note (bug fix): Secure clusters now show correct login information in
    the top right corner. Docs links correctly reference the current cluster
    version when necessary.
    dhartunian committed Dec 21, 2022
    Configuration menu
    Copy the full SHA
    2f298f5 View commit details
    Browse the repository at this point in the history