-
Notifications
You must be signed in to change notification settings - Fork 276
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
feat(alert): [alert] Adapting to the SMB theme #2169
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 |
---|---|---|
|
@@ -17,7 +17,8 @@ export const $constants = { | |
success: 'icon-success', | ||
error: 'icon-error', | ||
info: 'icon-help', | ||
warning: 'icon-warning' | ||
warning: 'icon-warning', | ||
simple: 'icon-help' | ||
Comment on lines
+20
to
+21
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tip Codebase Verification Incomplete implementation of the new 'simple' alert type The addition of the 'simple' alert type in the Analysis chainConsider refining the implementation of the new 'simple' alert type The addition of a 'simple' alert type aligns with the PR objective of adapting to the SMB theme. However, there are a few points to consider:
To address these points, consider the following changes:
ICON_MAP: {
success: 'icon-success',
error: 'icon-error',
info: 'icon-help',
warning: 'icon-warning',
- simple: 'icon-help'
+ simple: 'icon-simple' // Replace with an appropriate icon
},
TITLE_MAP: {
success: 'ui.alert.success',
error: 'ui.alert.error',
info: 'ui.alert.info',
- warning: 'ui.alert.warning'
+ warning: 'ui.alert.warning',
+ simple: 'ui.alert.simple'
},
type: {
type: String,
- default: 'info'
+ default: 'info',
+ validator: (value: string) => ['success', 'error', 'info', 'warning', 'simple'].includes(value)
}, To ensure full compatibility with the new 'simple' type, run the following script to check for any other occurrences of alert types that might need updating: This will help identify any other locations where the alert types are used or checked, ensuring comprehensive implementation of the new 'simple' type. Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Search for alert type references in the codebase
echo "Searching for alert type references:"
rg --type typescript --type vue "type.*(?:success|error|info|warning)" -g '!**/index.ts'
Length of output: 208 Script: #!/bin/bash
# Description: Search for alert type references in the codebase
echo "Searching for alert type references:"
rg --type ts --type tsx --type vue "type.*(?:success|error|info|warning)" -g '!**/index.ts'
Length of output: 204 Script: #!/bin/bash
# Description: Search for alert type references in the codebase
echo "Searching for alert type references:"
rg --type typescript --type typescriptreact --type vue "type.*(?:success|error|info|warning)" -g '!**/index.ts'
Length of output: 231 Script: #!/bin/bash
# Description: Search for alert type references in the codebase using file extensions
echo "Searching for alert type references:"
rg "type.*(?:success|error|info|warning)" -g "*.ts" -g "*.tsx" -g "*.vue" -g "!**/index.ts"
Length of output: 70336 |
||
}, | ||
TITLE_MAP: { | ||
success: 'ui.alert.success', | ||
|
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.
Consider using a theme variable instead of a hard-coded color.
The change from
var(--ti-common-color-text-secondary, #575d6c)
to#808080
for the simple icon color reduces theme flexibility. While this may align with the SMB theme requirements, it could lead to inconsistencies if the theme is updated in the future.Consider one of the following alternatives:
For example:
This approach maintains flexibility while still achieving the desired color for the SMB theme.