From a395dcee34c020b2ce0a9e49f21ceeb8a6b7b58c Mon Sep 17 00:00:00 2001 From: Bryann Yeap Kok Keong Date: Tue, 8 Nov 2022 22:47:06 +0800 Subject: [PATCH 1/3] [offers][chore] Add sorting dashboard offers by company name --- apps/portal/prisma/seed-analysis.ts | 7 +++---- apps/portal/src/server/router/offers/offers.ts | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/apps/portal/prisma/seed-analysis.ts b/apps/portal/prisma/seed-analysis.ts index 74d96822..ab249a57 100644 --- a/apps/portal/prisma/seed-analysis.ts +++ b/apps/portal/prisma/seed-analysis.ts @@ -23,17 +23,16 @@ const seedAnalysis = async () => { while (i < profilesWithoutAnalysis.length) { const profile = profilesWithoutAnalysis[i]; + await generateAnalysis({ ctx: { prisma, session: null }, input: { profileId: profile.id }, }); - i++; - - console.log(i, ': Analysis generated for profile with id', profile.id); + console.log(++i, ': Analysis generated for profile with id', profile.id); } - console.log(i, ' analysis generated'); + console.log(i, 'analysis generated'); }; Promise.all([seedAnalysis()]) diff --git a/apps/portal/src/server/router/offers/offers.ts b/apps/portal/src/server/router/offers/offers.ts index ef425121..ff0d16af 100644 --- a/apps/portal/src/server/router/offers/offers.ts +++ b/apps/portal/src/server/router/offers/offers.ts @@ -17,6 +17,7 @@ const getOrder = (prefix: string) => { }; const sortingKeysMap = { + companyName: 'companyName', monthYearReceived: 'monthYearReceived', totalCompensation: 'totalCompensation', totalYoe: 'totalYoe', @@ -138,6 +139,14 @@ export const offersRouter = createRouter().query('list', { monthYearReceived: 'desc', }, ] + : sortingKey === sortingKeysMap.companyName + ? [ + { + company: { + name: order, + }, + }, + ] : { monthYearReceived: 'desc' }, where: { AND: [ @@ -268,6 +277,14 @@ export const offersRouter = createRouter().query('list', { monthYearReceived: 'desc', }, ] + : sortingKey === sortingKeysMap.companyName + ? [ + { + company: { + name: order, + }, + }, + ] : { monthYearReceived: 'desc' }, where: { AND: [ From 6db6c5f3c39203387c026137abdcf7fadfc5235d Mon Sep 17 00:00:00 2001 From: Bryann Yeap Kok Keong Date: Tue, 8 Nov 2022 22:51:48 +0800 Subject: [PATCH 2/3] [offers][chore] Add sorting dashboard offers by job title --- .../portal/src/server/router/offers/offers.ts | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/apps/portal/src/server/router/offers/offers.ts b/apps/portal/src/server/router/offers/offers.ts index ff0d16af..3f4fb790 100644 --- a/apps/portal/src/server/router/offers/offers.ts +++ b/apps/portal/src/server/router/offers/offers.ts @@ -18,6 +18,7 @@ const getOrder = (prefix: string) => { const sortingKeysMap = { companyName: 'companyName', + jobTitle: 'jobTitle', monthYearReceived: 'monthYearReceived', totalCompensation: 'totalCompensation', totalYoe: 'totalYoe', @@ -146,6 +147,20 @@ export const offersRouter = createRouter().query('list', { name: order, }, }, + { + monthYearReceived: 'desc', + }, + ] + : sortingKey === sortingKeysMap.jobTitle + ? [ + { + offersIntern: { + title: order, + }, + }, + { + monthYearReceived: 'desc', + }, ] : { monthYearReceived: 'desc' }, where: { @@ -284,6 +299,20 @@ export const offersRouter = createRouter().query('list', { name: order, }, }, + { + monthYearReceived: 'desc', + }, + ] + : sortingKey === sortingKeysMap.jobTitle + ? [ + { + offersFullTime: { + title: order, + }, + }, + { + monthYearReceived: 'desc', + }, ] : { monthYearReceived: 'desc' }, where: { From a81364e1d98cb793195188adc1e6da3494a28cfc Mon Sep 17 00:00:00 2001 From: Su Yin <53945359+tnsyn@users.noreply.github.com> Date: Tue, 8 Nov 2022 22:57:29 +0800 Subject: [PATCH 3/3] [resumes][fix] Change default shortcut to general (#540) --- apps/portal/src/pages/resumes/index.tsx | 2 +- apps/portal/src/utils/resumes/resumeFilters.ts | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/apps/portal/src/pages/resumes/index.tsx b/apps/portal/src/pages/resumes/index.tsx index 142dd3c0..a2f2be70 100644 --- a/apps/portal/src/pages/resumes/index.tsx +++ b/apps/portal/src/pages/resumes/index.tsx @@ -106,7 +106,7 @@ export default function ResumeHomePage() { '', ); const [shortcutSelected, setShortcutSelected, isShortcutInit] = - useSearchParams('shortcutSelected', 'Unreviewed'); + useSearchParams('shortcutSelected', 'General'); const [currentPage, setCurrentPage, isCurrentPageInit] = useSearchParams( 'currentPage', 1, diff --git a/apps/portal/src/utils/resumes/resumeFilters.ts b/apps/portal/src/utils/resumes/resumeFilters.ts index 6bc79fe4..4d39b772 100644 --- a/apps/portal/src/utils/resumes/resumeFilters.ts +++ b/apps/portal/src/utils/resumes/resumeFilters.ts @@ -97,7 +97,7 @@ export const EXPERIENCES: Array = [ export const INITIAL_FILTER_STATE: FilterState = { experience: [], isTop10: false, - isUnreviewed: true, + isUnreviewed: false, location: [], role: [], }; @@ -106,7 +106,6 @@ export const SHORTCUTS: Array = [ { filters: { ...INITIAL_FILTER_STATE, - isUnreviewed: false, }, name: 'General', sortOrder: 'latest', @@ -129,7 +128,6 @@ export const SHORTCUTS: Array = [ value: 'entry-level', }, ], - isUnreviewed: false, }, name: 'Fresh Grad', sortOrder: 'latest', @@ -138,7 +136,6 @@ export const SHORTCUTS: Array = [ filters: { ...INITIAL_FILTER_STATE, isTop10: true, - isUnreviewed: false, }, name: 'Top 10', sortOrder: 'popular', @@ -146,7 +143,6 @@ export const SHORTCUTS: Array = [ { filters: { ...INITIAL_FILTER_STATE, - isUnreviewed: false, location: [ { id: '231',