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

Added Gh issue filter #215

Merged
merged 43 commits into from
Jul 25, 2024
Merged

Added Gh issue filter #215

merged 43 commits into from
Jul 25, 2024

Conversation

dipanshurdev
Copy link
Collaborator

closes #158

github-actions bot and others added 30 commits July 22, 2024 03:50
Copy link

vercel bot commented Jul 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
web-dev-tools ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 25, 2024 11:33am

@dipanshurdev dipanshurdev changed the title Added filter issue to Gh issue finder Added filter issue to Gh issue filter Jul 23, 2024
@dipanshurdev dipanshurdev changed the title Added filter issue to Gh issue filter Added Gh issue filter Jul 23, 2024
}
onClick={() => setSelected(2)}
>
Github
</button>

Copy link
Owner

Choose a reason for hiding this comment

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

Insert it on a separate line

@@ -39,25 +61,47 @@ export default function GhFinder() {
// Return true if luminance is less than 0.5 (considered dark)
return luminance < 0.5;
}

const issuesToDisplay = filteredIssue.length > 0 ? filteredIssue : data;
Copy link
Owner

Choose a reason for hiding this comment

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

Please revert this

aria-labelledby="modal-modal-title"
aria-describedby="modal-modal-description"
>
<Box sx={style} className="bg-gray-800">
Copy link
Owner

Choose a reason for hiding this comment

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

Make it light on light mode

display: "flex",
};

export default function BasicModal({ selectedLabels, setSelectedLabels }) {
Copy link
Owner

Choose a reason for hiding this comment

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

Integrate these :

  1. Search
  2. Is assigned
  3. Is fork

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hi @Bashamega, I don't understand the use of "isFork is". Is it for displaying the forks in number or else?

Copy link
Owner

Choose a reason for hiding this comment

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

Hi @Bashamega, I don't understand the use of "isFork is". Is it for displaying the forks in number or else?

I mean is there a fork opened for the issue. If someone have opened a fork for the issue

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Like 0 fork, 2k fork?

Copy link
Owner

Choose a reason for hiding this comment

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

Like 0 fork, 2k fork?

No.

I mean if the issue has a fork to close it. So if for this repo if i checked it will hide issue #215 because you have opened a pr that will close it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Linked PR just like mine PR #215 on issue #158

Copy link
Owner

Choose a reason for hiding this comment

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

Linked PR just like mine PR #215 on issue #158

yes. if he checked it all the issues that have a linked pr will disappear

@Bashamega
Copy link
Owner

When i try to search it just disappears. And keeps loading.

@dipanshurdev
Copy link
Collaborator Author

When i try to search it just disappears. And keeps loading.

For getting Linked Pr info I have added another fetch, where it map into data and again fetches the issues timeline details. So GitHub api limit gets exceeded.

@dipanshurdev
Copy link
Collaborator Author

dipanshurdev commented Jul 25, 2024

When i try to search it just disappears. And keeps loading.

For getting Linked Pr info I have added another fetch, where it map into data and again fetches the issues timeline details. So GitHub api limit gets exceeded.

` // New function to fetch PRs linked to issues

const fetchPRsForIssue = async (issue) => {

const timelineUrl = `${issue.url}/timeline`;

const response = await fetch(timelineUrl, {

  headers: {
    Accept: "application/vnd.github.mockingbird-preview+json",

  },
});

const events = await response.json();

const linkedPRs = events?.filter(

  (event) =>
    event.event === "cross-referenced" && event.source?.issue?.pull_request,

);
return linkedPRs.map((pr) => pr.source.issue.pull_request.html_url);

};`

@dipanshurdev
Copy link
Collaborator Author

When i try to search it just disappears. And keeps loading.

For getting Linked Pr info I have added another fetch, where it map into data and again fetches the issues timeline details. So GitHub api limit gets exceeded.

` // New function to fetch PRs linked to issues

const fetchPRsForIssue = async (issue) => {

const timelineUrl = `${issue.url}/timeline`;

const response = await fetch(timelineUrl, {

  headers: {
    Accept: "application/vnd.github.mockingbird-preview+json",

  },
});

const events = await response.json();

const linkedPRs = events?.filter(

  (event) =>
    event.event === "cross-referenced" && event.source?.issue?.pull_request,

);
return linkedPRs.map((pr) => pr.source.issue.pull_request.html_url);

};`

`
// New useEffect to add PRs linked to issues

useEffect(() => {

const fetchPRsInfo = async () => {

  const issuesWithPRsInfo = await Promise.all(
    data.map(async (issue) => {
      const linkedPRs = await fetchPRsForIssue(issue);
      return { ...issue, linkedPRs };
    }),

  );
  setData(issuesWithPRsInfo);
};

if (data?.length > 0) {
  fetchPRsInfo();
}

}, [data]);
`

@Bashamega
Copy link
Owner

@amanr-dev I mean just use the built-in filter function for the search. It will just search the current table. Also for the request limit you need to add error handling to it.

@dipanshurdev
Copy link
Collaborator Author

@amanr-dev I mean just use the built-in filter function for the search. It will just search the current table. Also for the request limit you need to add error handling to it.

Yes, i already use filter method for getting search from Data state, but due to the API limit exceeding it shows loading.

@dipanshurdev
Copy link
Collaborator Author

@amanr-dev I mean just use the built-in filter function for the search. It will just search the current table. Also for the request limit you need to add error handling to it.

Yes, i already use filter method for getting search from Data state, but due to the API limit exceeding it shows loading.

90% of the work is done and just doing small fixes

@dipanshurdev
Copy link
Collaborator Author

@Bashamega , can you review it

@Bashamega Bashamega merged commit eaa64bc into Bashamega:main Jul 25, 2024
2 checks passed
@Bashamega
Copy link
Owner

Great job!

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.

Github Issue filteration
2 participants