-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
25863: ui: use build version for docs links r=couchand a=couchand The first commit is reviewed separately here: #25823 #### ui: extract dataFromServer global from login file Since the dataFromServer will hold more than just login state, move it out to a new file. Release note: None #### ui: use build version for docs links Previously, the current version was hard-coded into the docs links, requiring manual effort to keep in sync with the released version of the binary. This change interpolates the `build.VersionPrefix()` instead, so that it's always correct. Fixes: #19024 Release note: None Co-authored-by: Andrew Couch <[email protected]>
- Loading branch information
Showing
6 changed files
with
55 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
export interface DataFromServer { | ||
ExperimentalUseLogin: boolean; | ||
LoginEnabled: boolean; | ||
LoggedInUser: string; | ||
Version: string; | ||
} | ||
|
||
// Tell TypeScript about `window.dataFromServer`, which is set in a script | ||
// tag in index.html, the contents of which are generated in a Go template | ||
// server-side. | ||
declare global { | ||
interface Window { | ||
dataFromServer: DataFromServer; | ||
} | ||
} | ||
|
||
export function getDataFromServer(): DataFromServer { | ||
return window.dataFromServer || {}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters