-
Notifications
You must be signed in to change notification settings - Fork 135
Fix bounty issue #279
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
Fix bounty issue #279
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@SolariSystems is attempting to deploy a commit to the Databuddy OSS Team on Vercel. A member of the Team first needs to authorize it. |
|
|
Greptile SummaryThis PR titled "Fix bounty issue" introduces a critical file corruption in the database schema. A React Native component ( Issues Found:
Confidence Score: 0/5
Important Files Changed
|
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.
1 file reviewed, 1 comment
packages/db/src/drizzle/schema.ts
Outdated
| import React, { useState } from 'react'; | ||
| import { View, Text, TouchableOpacity, StyleSheet, FlatList, Dimensions } from 'react-native'; | ||
|
|
||
| interface Flag { | ||
| id: string; | ||
| name: string; | ||
| folder?: string; | ||
| } | ||
|
|
||
| const FeatureFlagFolders = ({ flags }: { flags: Flag[] }) => { | ||
| const [expandedFolders, setExpandedFolders] = useState<{ [key: string]: boolean }>({}); | ||
|
|
||
| const toggleFolder = (folderPath: string) => { | ||
| setExpandedFolders((prev) => ({ | ||
| ...prev, | ||
| [folderPath]: !prev[folderPath], | ||
| })); | ||
| }; | ||
|
|
||
| const renderFlagItem = ({ item }: { item: Flag }) => { | ||
| const folderPath = item.folder || ''; | ||
| const isFolderOpen = expandedFolders[folderPath] || false; | ||
|
|
||
| return ( | ||
| <View style={styles.flagContainer}> | ||
| <TouchableOpacity onPress={() => toggleFolder(folderPath)}> | ||
| <Text style={styles.flagName}>{item.name}</Text> | ||
| </TouchableOpacity> | ||
| {isFolderOpen && item.folder && ( | ||
| <FlatList | ||
| data={flags.filter((flag) => flag.folder?.startsWith(`${folderPath}/`))} | ||
| keyExtractor={(flag) => flag.id} | ||
| renderItem={renderFlagItem} | ||
| style={styles.nestedFlags} | ||
| /> | ||
| )} | ||
| </View> | ||
| ); | ||
| }; | ||
|
|
||
| return ( | ||
| <FlatList | ||
| data={flags} | ||
| keyExtractor={(flag) => flag.id} | ||
| renderItem={renderFlagItem} | ||
| style={styles.flagList} | ||
| /> | ||
| ); | ||
| }; | ||
|
|
||
| const styles = StyleSheet.create({ | ||
| flagList: { | ||
| width: Dimensions.get('window').width, | ||
| }, | ||
| flagContainer: { | ||
| paddingVertical: 10, | ||
| borderBottomWidth: 1, | ||
| borderBottomColor: '#ccc', | ||
| }, | ||
| flagName: { | ||
| fontSize: 16, | ||
| fontWeight: 'bold', | ||
| }, | ||
| nestedFlags: { | ||
| paddingLeft: 20, | ||
| }, | ||
| }); | ||
|
|
||
| export default FeatureFlagFolders;import { isNotNull, isNull } from "drizzle-orm"; | ||
| import { |
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.
syntax: A React Native component has been accidentally added to the database schema file. This is incorrect - FeatureFlagFolders should not be in this file. The file should start with the Drizzle ORM imports on line 1.\n\nThis code needs to be completely removed. The file should begin with:\n\nsuggestion\nimport { isNotNull, isNull } from \"drizzle-orm\";\n
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/db/src/drizzle/schema.ts
Line: 1:70
Comment:
**syntax:** A React Native component has been accidentally added to the database schema file. This is incorrect - `FeatureFlagFolders` should not be in this file. The file should start with the Drizzle ORM imports on line 1.\n\nThis code needs to be completely removed. The file should begin with:\n\n```suggestion\nimport { isNotNull, isNull } from \"drizzle-orm\";\n```
How can I resolve this? If you propose a fix, please make it concise.ae272a2 to
14da028
Compare
No description provided.