-
Notifications
You must be signed in to change notification settings - Fork 145
hide help link for non TiDB distro #1015
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
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
@@ -172,7 +173,13 @@ function useSignInSubmit( | |||
} catch (e) { | |||
if (!e.handled) { | |||
const errMsg = t('signin.message.error', { msg: e.message }) | |||
if (e.errCode === 'error.api.user.insufficient_privileges') { | |||
if ( | |||
distro.tidb !== 'TiDB' || |
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.
It is possible that the distribution's TiDB
has not been renamed.
We can use process.env.DISTRO_BUILD_TAG
to distinguish whether the build is a distro.
And we should add
overrideProcessEnv({
REACT_APP_RELEASE_VERSION: JSON.stringify(getInternalVersion()),
DISTRO_BUILD_TAG: process.env.DISTRO_BUILD_TAG,
}),
at config-overrides.js
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.
Let me try it
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.
Done!
ui/lib/utils/i18n.ts
Outdated
@@ -60,4 +60,8 @@ i18next | |||
}, | |||
}) | |||
|
|||
export function isDistro() { | |||
return process.env.REACT_APP_DISTRO_BUILD_TAG !== undefined |
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.
Tried use return process.env.REACT_APP_DISTRO_BUILD_TAG !== 1
to judge, but can't pass the ts compile, it says process.env.xxx values are string | null,although in this case, process.env.REACT_APP_DISTRO_BUILD_TAG is a number.
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.
Maybe we can export the variables directly, like const isDistro = process.env.REACT_APP_DISTRO_BUILD_TAG !== undefined
.
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.
Make sense, let me update it.
LGTM. |
How to build a distro dashboard:
Add the following code in the populate.go to pass the compile:
Build UI
Build all