-
Notifications
You must be signed in to change notification settings - Fork 33
changed disabled flag for menu items to only work in production envir… #893
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,8 +41,10 @@ const Sidebar: React.FC<{ isFips?: boolean }> = ({ isFips = false }) => { | |
| const isImportItem = | ||
| item.key && (item.key.includes("/import") || item.key.includes("/import-") || item.label === "Import"); | ||
|
|
||
| // // Handle disabled state based on access rights | ||
| if (isCreateItem || isImportItem) { | ||
| const isProduction = import.meta.env.MODE === 'production'; | ||
|
|
||
| // Handle disabled state based on access rights | ||
| if (isProduction && (isCreateItem || isImportItem)) { | ||
|
Comment on lines
+46
to
+47
|
||
| newItem.disabled = !hasCreateAccess; | ||
|
Comment on lines
+44
to
48
|
||
| } | ||
|
|
||
|
|
||
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 introduces single quotes for the MODE comparison, but the UI is formatted with Prettier configured for double quotes (ui/.prettierrc.json sets
singleQuote: false). This will causepnpm run check(prettier --check) to fail unless the string literal is switched to double quotes (or the file is reformatted).