socialify icon indicating copy to clipboard operation
socialify copied to clipboard

Add option to display Closed Issues/PRs

Open louisefindlay23 opened this issue 3 years ago • 3 comments

It would be great if there was an an option to be able to display how many issue and PRs have been closed for a project. It would be a nice indicator to see how many features/work has been done on a project.

The opposite to #75.

louisefindlay23 avatar Aug 06 '21 18:08 louisefindlay23

Hey happy to accept a PR for this!

I think there would be some UX work needed to accommodate that toggle so would recommend posting them here before making the PR

CryogenicPlanet avatar Aug 07 '21 17:08 CryogenicPlanet

Thanks, @CryogenicPlanet. Sounds great. Sure, would be happy to post screenshots of the example UI.

I see you made this project as part of the MLH Fellowship. Awesome 🚀. I've just completed the Pre-Fellowship and we used Socialify for the header image of our repo. So easy to generate and work with.

I've never used TypeScript or GraphQL before so I've looked at the code and I think I'd need to update repoQuery.ts with a new pullRequests with a state of closed and add that to getOptionalConfig of configHelper.ts? Would that be along the right lines?

Thanks 😊

louisefindlay23 avatar Aug 15 '21 11:08 louisefindlay23

To an extent, you want to be able to get the state of both open and closed issues/prs separately so we can keep the default as open.

Feel free to play with the graphql explorer for GitHub here https://docs.github.com/en/graphql/overview/explorer. It makes it far easier to try things out.

So getOptionalConfig would not be enough here, that just get the default configuration. You have to change the mergeConfig

You want to create a new parameter inside the optional types like description has editable to decide if it is only open (default) or should include closed too. This can either be one toggle for both PRs and Issues or a different toggle for both, really depends on the UI

https://github.com/wei/socialify/blob/beeba2dc65beae3171a06fbc71063513734309fd/common/configHelper.ts#L28-L31

You will have to add it to the QueryType and ConfigType too

https://github.com/wei/socialify/blob/beeba2dc65beae3171a06fbc71063513734309fd/common/types/queryType.ts#L3-L20

Typescript should do its job and tell you everywhere QueryType is used and will have to change it to those places.

Happy to answer any other questions! Also don't worry about not knowing Graphql or Typescript, I didn't know it when we made this and barely knew typescript.

CryogenicPlanet avatar Aug 15 '21 23:08 CryogenicPlanet

Closing due to inactivity.

wei avatar Nov 04 '22 06:11 wei