Skip to content

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

Merged
merged 9 commits into from
May 8, 2025
Merged

Dropdown update #1272

merged 9 commits into from
May 8, 2025

Conversation

prakriti-solankey
Copy link
Collaborator

Adding values to dropdown

Copy link
Contributor

@Copilot Copilot AI left a 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 () => {

Copy link
Collaborator

@kartikpersistent kartikpersistent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@prakriti-solankey prakriti-solankey merged commit 38e952c into dev May 8, 2025
3 checks passed
@kartikpersistent kartikpersistent deleted the dropdown-update branch May 9, 2025 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants