-
Notifications
You must be signed in to change notification settings - Fork 621
Dropdown update #1272
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
Dropdown update #1272
Conversation
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.
Pull Request Overview
This PR primarily updates the dropdown functionality by adding new options to dropdown menus and refactoring related types and context usage. Key changes include:
- Adding the new updateSourceTargetTypeOptions function in utils.
- Refactoring state types and hook usage in context, dialogs, and components.
- Updating various components (SchemaFromTextDialog, PredefinedSchemaDialog, LoadExistingSchema, GraphPattern, PageLayout, etc.) to use the new dropdown options API.
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated no comments.
File | Description |
---|---|
frontend/src/utils/Utils.ts | Added updateSourceTargetTypeOptions and deduplicateByValue functions to update dropdown options. |
frontend/src/types.ts | Refactored type definitions for schema options, removing union types. |
frontend/src/context/UsersFiles.tsx | Updated initialization of source, type, and target options from constants to context state. |
Other components (e.g., SchemaFromTextDialog, PredefinedSchemaDialog, NewEntityExtractionSetting, LoadExistingSchema, GraphPattern, PageLayout, etc.) | Updated to use the new options API and adjusted onApply callbacks to pass updated options. |
Comments suppressed due to low confidence (2)
frontend/src/components/Popups/GraphEnhancementDialog/EnitityExtraction/SchemaFromTextDialog.tsx:11
- The folder name 'EnitityExtraction' appears to be misspelled; consider renaming it to 'EntityExtraction' for clarity and consistency.
import { extractOptions, updateSourceTargetTypeOptions } from '../../../../utils/Utils';
frontend/src/components/Popups/GraphEnhancementDialog/EnitityExtraction/SchemaFromTextDialog.tsx:125
- Consider wrapping the asynchronous call to updateSourceTargetTypeOptions in a try-catch block to gracefully handle potential errors.
const handleSchemaTextApply = async () => {
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.
LGTM
Adding values to dropdown