[WEB-1255] chore: Refactor existing Space app for project publish (#5107)

* chore: paginated the issues in space app

* chore: storing query using filters

* chore: added filters for priority

* chore: issue view model save function

* chore: votes and reactions added in issues endpoint

* chore: added filters in the public endpoint

* chore: issue detail endpoint

* chore: added labels, modules and assignees

* refactor existing project publish in space app

* fix clear all filters in space App

* chore: removed the extra serialier

* remove optional chaining and fallback to an empty array

---------

Co-authored-by: NarayanBavisetti <narayan3119@gmail.com>
This commit is contained in:
rahulramesha 2024-07-15 18:35:45 +05:30 committed by GitHub
parent 22671ec8a7
commit 08d9e95a86
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
73 changed files with 2245 additions and 651 deletions

View file

@ -17,19 +17,16 @@ export const renderEmoji = (
else return isNaN(parseInt(emoji)) ? emoji : String.fromCodePoint(parseInt(emoji));
};
export const groupReactions: (reactions: any[], key: string) => { [key: string]: any[] } = (
reactions: any,
key: string
) => {
export const groupReactions = <T extends { reaction: string }>(reactions: T[], key: string) => {
const groupedReactions = reactions.reduce(
(acc: any, reaction: any) => {
(acc: { [key: string]: T[] }, reaction: any) => {
if (!acc[reaction[key]]) {
acc[reaction[key]] = [];
}
acc[reaction[key]].push(reaction);
return acc;
},
{} as { [key: string]: any[] }
{} as { [key: string]: T[] }
);
return groupedReactions;