-
Notifications
You must be signed in to change notification settings - Fork 0
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
[ENH] Implemented upload data dictionary component #50
Conversation
Reviewer's Guide by SourceryThis pull request introduces the ability to upload a data dictionary file to enhance column descriptions, and enhances the Sequence diagram for uploading a data dictionary filesequenceDiagram
participant User
participant UploadCard
participant FileUploader
participant DataStore
User->>UploadCard: Clicks to upload data dictionary
UploadCard->>FileUploader: handleClickToUpload()
FileUploader->>User: Selects a .json file
User->>FileUploader: Chooses file
FileUploader->>FileUploader: handleFileUpload(event)
FileUploader->>UploadCard: onFileUpload(file)
UploadCard->>DataStore: processDataDictionaryFile(file)
DataStore->>DataStore: Reads file content
DataStore->>DataStore: Parses JSON to DataDictionary
DataStore->>DataStore: Updates columns with descriptions
DataStore->>DataStore: setUploadedDataDictionaryFileName(fileName)
DataStore->>DataStore: setDataDictionary(dataDictionary)
DataStore-->>UploadCard: Resolves promise
UploadCard-->>User: Updates UI with preview
Updated class diagram for FileUploader componentclassDiagram
class FileUploader {
+displayText: string
+handleClickToUpload: () => void
+handleDrop: (event: React.DragEvent<HTMLDivElement>) => void
+handleDragOver: (event: React.DragEvent<HTMLDivElement>) => void
+handleFileUpload: (event: React.ChangeEvent<HTMLInputElement>) => void
+fileInputRef: React.RefObject<HTMLInputElement>
+allowedFileType: string
+disabled?: boolean
+tooltipContent?: string
}
note for FileUploader "Added 'disabled' and 'tooltipContent' properties"
Updated class diagram for DataStoreclassDiagram
class DataStore {
+dataTable: DataTable
+columns: Columns
+uploadedDataDictionary: DataDictionary
+uploadedDataTableFileName: string | null
+uploadedDataDictionaryFileName: string | null
+setDataTable: (data: DataTable) => void
+initializeColumns: (data: Columns) => void
+setDataDictionary: (data: DataDictionary) => void
+setUploadedDataTableFileName: (fileName: string | null) => void
+setUploadedDataDictionaryFileName: (fileName: string | null) => void
+processDataTableFile: (file: File) => Promise<void>
+processDataDictionaryFile: (file: File) => Promise<void>
}
note for DataStore "Added data dictionary related properties and methods"
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
✅ Deploy Preview for staging-annotation ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #50 +/- ##
==========================================
+ Coverage 81.11% 81.77% +0.65%
==========================================
Files 18 20 +2
Lines 143 225 +82
Branches 23 46 +23
==========================================
+ Hits 116 184 +68
- Misses 27 41 +14
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
Hey @rmanaem, thanks a lot for the PR! The UI looks really very nice, and the functionality is great. My comments are mainly about the structure of the components and readability. I think now is the best time to set the theme for keeping things clean and easy to understand, it'll only get more complex from here.
So I left comments in a couple of places where I currently find it tricky to follow the component. the main issue is, as they say, debugging is twice as hard as writing code - so if we barely get it while we write it / it's fresh, then we won't get it when it breaks....
Take a look
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.
Thanks @rmanaem, this looks great!
🧑🍳
This reverts commit de333c8.
Checklist
This section is for the PR reviewer
[ENH]
,[FIX]
,[REF]
,[TST]
,[CI]
,[MNT]
,[INF]
,[MODEL]
,[DOC]
) (see our Contributing Guidelines for more info)skip-release
(to be applied by maintainers only)Closes #XXXX
For new features:
For bug fixes:
Summary by Sourcery
Implements a data dictionary upload feature, allowing users to upload a JSON file to provide metadata descriptions for data table columns. The file uploader component is enhanced with disabled state and tooltip support. This pull request closes issues #39 and #41.
New Features:
Enhancements:
Build:
ramda
and@microlink/react-json-view
as project dependencies.Chores: