Skip to content
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

Enhancement of Linked Issues Feature in IssueModal Component #11

Merged
merged 3 commits into from
Dec 20, 2023

Conversation

claygorman
Copy link
Contributor

@claygorman claygorman commented Dec 20, 2023

Type

Enhancement


Description

This PR enhances the linked issues feature in the IssueModal component. The main changes include:

  • Fetching additional data from the GraphQL server side.
  • Restructuring the IssueLinkedIssues component to group issues by link type.
  • Adjusting the backend to include linked issues data in the issue GraphQL query.
  • Updating the IssueOverview component to include the projectKey in the IssueLinkedIssues component.
  • Modifying the gql-queries-mutations file to include links in the GET_ISSUE_QUERY.
  • Updating the resolvers in the backend to include linked issues data.
  • Adjusting the issueResolvers to handle possible undefined linked issues.

PR changes walkthrough

Relevant files                                                                                                                                 
Enhancement
4 files
IssueLinkedIssues.tsx                                                                             
    frontend/components/IssueModal/IssueLinkedIssues.tsx

    The IssueLinkedIssues component has been restructured to
    fetch linked issues data from the backend and group them by
    link type. The component now also accepts a projectKey prop.
+59/-46
IssueOverview.tsx                                                                                     
    frontend/components/IssueModal/IssueOverview.tsx

    The IssueOverview component has been updated to include the
    projectKey in the IssueLinkedIssues component.
+4/-1
gql-queries-mutations.ts                                                                       
    frontend/gql/gql-queries-mutations.ts

    The GET_ISSUE_QUERY has been modified to include links in
    the fetched data.
+5/-0
resolvers.js                                                                                               
    backend/src/resolvers.js

    The issue resolver in the backend has been updated to
    include linked issues data.
+26/-1
Error handling
1 files
issue.js                                                                                                       
    backend/src/resolvers/issue.js

    The issueResolvers file has been adjusted to handle possible
    undefined linked issues.
+2/-2

Implemented a new feature to display linked issues in the IssueModal component. This is achieved by fetching additional data from the GraphQL server side, and restructuring the IssueLinkedIssues component to group issues by link type. The backend has also been adjusted to include linked issues data in the `issue` GraphQL query.
@claygorman
Copy link
Contributor Author

/describe

Copy link
Contributor

PR Analysis

  • 🎯 Main theme: Implementing linked issues feature in IssueModal component
  • 📝 PR summary: This PR implements a feature to display linked issues in the IssueModal component. It fetches additional data from the GraphQL server side, and restructures the IssueLinkedIssues component to group issues by link type. The backend has also been adjusted to include linked issues data in the issue GraphQL query.
  • 📌 Type of PR: Enhancement
  • ⏱️ Estimated effort to review [1-5]: 3, because the PR involves both frontend and backend changes, and requires understanding of GraphQL queries and React component structure.
  • 🔒 Security concerns: No security concerns found

PR Feedback

  • 💡 General suggestions: The PR is well-structured and the code is clean. The use of GraphQL for data fetching is a good approach. However, error handling for the GraphQL query could be improved. Also, consider adding tests to ensure the new feature works as expected.

  • 🤖 Code feedback:
    relevant filefrontend/components/IssueModal/IssueLinkedIssues.tsx
    suggestion      Add error handling for the GraphQL query. If the query fails, the component should handle this gracefully and not crash the application. [important]
    relevant line"+ const { data, error } = useQuery(GET_ISSUE_QUERY, {"

    relevant filefrontend/components/IssueModal/IssueLinkedIssues.tsx
    suggestion      Consider adding a loading state while the GraphQL query is being executed. This will improve the user experience by providing feedback that data is being loaded. [medium]
    relevant line"+ const { data, error } = useQuery(GET_ISSUE_QUERY, {"

    relevant filebackend/src/resolvers.js
    suggestion      It would be more efficient to use a single SQL query to fetch the linked issues, rather than two separate queries. This can be achieved by using a JOIN clause in the SQL query. [medium]
    relevant line"+ model: db.sequelize.models.Issue,"

    relevant filebackend/src/resolvers/issue.js
    suggestion      Consider checking if the linkedToIssues and linkedByIssues arrays are not null before mapping over them. This will prevent potential runtime errors. [important]
    relevant line"+ ...parent.linkedToIssues?.map((issue) => ({"

How to use

Instructions

To invoke the PR-Agent, add a comment using one of the following commands:
/review: Request a review of your Pull Request.
/describe: Update the PR title and description based on the contents of the PR.
/improve [--extended]: Suggest code improvements. Extended mode provides a higher quality feedback.
/ask <QUESTION>: Ask a question about the PR.
/update_changelog: Update the changelog based on the PR's contents.
/add_docs: Generate docstring for new components introduced in the PR.
/generate_labels: Generate labels for the PR based on the PR's contents.
see the tools guide for more details.

To edit any configuration parameter from the configuration.toml, add --config_path=new_value.
For example: /review --pr_reviewer.extra_instructions="focus on the file: ..."
To list the possible configuration parameters, add a /config comment.

@github-actions github-actions bot changed the title Updating links issues component Enhancement of Linked Issues Feature in IssueModal Component Dec 20, 2023
Copy link
Contributor

PR Description updated to latest commit (2f138e8)

@github-actions github-actions bot added the enhancement New feature or request label Dec 20, 2023
@claygorman
Copy link
Contributor Author

/improve

claygorman and others added 2 commits December 20, 2023 15:50
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@claygorman claygorman merged commit ec94586 into master Dec 20, 2023
2 checks passed
@claygorman claygorman deleted the linked-issues-fe-1 branch December 20, 2023 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant