From 913042521abffc1454c734b6ba11aad844bc76ae Mon Sep 17 00:00:00 2001 From: ARREY-ETTA BESSONG EKEP OBASI Date: Fri, 12 Jan 2024 14:09:25 +0100 Subject: [PATCH 1/4] refactor: extracted admin and getBountyStatus logic --- frontend/app/src/hooks/useSuperAdmin.ts | 20 +++++++++ .../utils/__tests__/filterTable.spec.ts | 31 +++++++++++++ .../src/pages/superadmin/utils/filterTable.ts | 44 +++++++++++++++++++ .../app/src/pages/superadmin/utils/index.ts | 4 ++ .../app/src/pages/superadmin/utils/metrics.ts | 12 +++++ 5 files changed, 111 insertions(+) create mode 100644 frontend/app/src/hooks/useSuperAdmin.ts create mode 100644 frontend/app/src/pages/superadmin/utils/__tests__/filterTable.spec.ts create mode 100644 frontend/app/src/pages/superadmin/utils/filterTable.ts create mode 100644 frontend/app/src/pages/superadmin/utils/index.ts create mode 100644 frontend/app/src/pages/superadmin/utils/metrics.ts diff --git a/frontend/app/src/hooks/useSuperAdmin.ts b/frontend/app/src/hooks/useSuperAdmin.ts new file mode 100644 index 000000000..2b9864315 --- /dev/null +++ b/frontend/app/src/hooks/useSuperAdmin.ts @@ -0,0 +1,20 @@ +import { useState, useCallback, useEffect } from 'react'; +import { useStores } from 'store'; + +export const useIsSuperAdmin = () => { + const { main, ui } = useStores(); + const [isSuperAdmin, setIsSuperAdmin] = useState(true); + + const getIsSuperAdmin = useCallback(async () => { + const admin = await main.getSuperAdmin(); + setIsSuperAdmin(admin); + }, [main]); + + useEffect(() => { + if (ui.meInfo?.tribe_jwt) { + getIsSuperAdmin(); + } + }, [main, ui, getIsSuperAdmin]); + + return isSuperAdmin; +}; diff --git a/frontend/app/src/pages/superadmin/utils/__tests__/filterTable.spec.ts b/frontend/app/src/pages/superadmin/utils/__tests__/filterTable.spec.ts new file mode 100644 index 000000000..3f3c88c57 --- /dev/null +++ b/frontend/app/src/pages/superadmin/utils/__tests__/filterTable.spec.ts @@ -0,0 +1,31 @@ +import { getBountyStatus } from '..'; + +describe('getBountyStatus', () => { + test('should return Open status', () => { + const result = getBountyStatus('open'); + expect(result.Open).toBe(true); + expect(result.Assigned).toBe(false); + expect(result.Paid).toBe(false); + }); + + test('should return In Progress status', () => { + const result = getBountyStatus('in-progress'); + expect(result.Open).toBe(false); + expect(result.Assigned).toBe(true); + expect(result.Paid).toBe(false); + }); + + test('should return Completed status', () => { + const result = getBountyStatus('completed'); + expect(result.Open).toBe(false); + expect(result.Assigned).toBe(false); + expect(result.Paid).toBe(true); + }); + + test('should return default status for unknown criterion', () => { + const result = getBountyStatus('unknown' as any); + expect(result.Open).toBe(false); + expect(result.Assigned).toBe(false); + expect(result.Paid).toBe(false); + }); +}); diff --git a/frontend/app/src/pages/superadmin/utils/filterTable.ts b/frontend/app/src/pages/superadmin/utils/filterTable.ts new file mode 100644 index 000000000..1c6189096 --- /dev/null +++ b/frontend/app/src/pages/superadmin/utils/filterTable.ts @@ -0,0 +1,44 @@ +import { BountyStatus, defaultBountyStatus } from 'store/main'; + +type SortCriterion = 'open' | 'in-progress' | 'completed' | 'assignee'; + +export const getBountyStatus = (sortOrder: SortCriterion) => { + let newStatus: BountyStatus; + + switch (sortOrder) { + case 'open': { + newStatus = { ...defaultBountyStatus, Open: true }; + break; + } + case 'in-progress': { + newStatus = { + ...defaultBountyStatus, + Open: false, + Assigned: true + }; + break; + } + case 'completed': { + newStatus = { + ...defaultBountyStatus, + Open: false, + Paid: true + }; + break; + } + default: { + newStatus = { + ...defaultBountyStatus, + Open: false + }; + break; + } + } + + return newStatus; +}; + +export const dateFilterOptions = Object.freeze([ + { id: 'Newest', label: 'Newest', value: 'desc' }, + { id: 'Oldest', label: 'Oldest', value: 'asc' } +]); diff --git a/frontend/app/src/pages/superadmin/utils/index.ts b/frontend/app/src/pages/superadmin/utils/index.ts new file mode 100644 index 000000000..b13cccb7e --- /dev/null +++ b/frontend/app/src/pages/superadmin/utils/index.ts @@ -0,0 +1,4 @@ +import { getBountyStatus, dateFilterOptions } from './filterTable'; +import { normalizeMetrics } from './metrics'; + +export { getBountyStatus, dateFilterOptions, normalizeMetrics }; diff --git a/frontend/app/src/pages/superadmin/utils/metrics.ts b/frontend/app/src/pages/superadmin/utils/metrics.ts new file mode 100644 index 000000000..bcb5aac7c --- /dev/null +++ b/frontend/app/src/pages/superadmin/utils/metrics.ts @@ -0,0 +1,12 @@ +import { BountyMetrics } from 'store/main'; + +export const normalizeMetrics = (data: any): BountyMetrics => ({ + bounties_posted: data.BountiesPosted || data.bounties_posted, + bounties_paid: data.BountiesPaid || data.bounties_paid, + bounties_paid_average: data.bounties_paid_average || data.BountiesPaidPercentage, + sats_posted: data.sats_posted || data.SatsPosted, + sats_paid: data.sats_paid || data.SatsPaid, + sats_paid_percentage: data.sats_paid_percentage || data.SatsPaidPercentage, + average_paid: data.average_paid || data.AveragePaid, + average_completed: data.average_completed || data.AverageCompleted +}); From 2af88ddb58c709c9e3758692de451a625811d17b Mon Sep 17 00:00:00 2001 From: ARREY-ETTA BESSONG EKEP OBASI Date: Fri, 12 Jan 2024 14:10:47 +0100 Subject: [PATCH 2/4] feat: implemented sort by newest and oldest --- frontend/app/src/hooks/index.ts | 1 + frontend/app/src/pages/superadmin/index.tsx | 44 ++--- .../superadmin/tableComponent/TableStyle.tsx | 86 ++++++++-- .../__tests__/TableComponent.spec.tsx | 4 +- .../pages/superadmin/tableComponent/index.tsx | 158 ++++++++++-------- 5 files changed, 180 insertions(+), 113 deletions(-) diff --git a/frontend/app/src/hooks/index.ts b/frontend/app/src/hooks/index.ts index 92f36a0f9..0e76264e6 100644 --- a/frontend/app/src/hooks/index.ts +++ b/frontend/app/src/hooks/index.ts @@ -3,3 +3,4 @@ export * from './useScroll'; export * from './uiHooks'; export * from './usePerson'; export * from './useInViewport'; +export * from './useSuperAdmin'; diff --git a/frontend/app/src/pages/superadmin/index.tsx b/frontend/app/src/pages/superadmin/index.tsx index 23ae4d9e0..2b947e036 100644 --- a/frontend/app/src/pages/superadmin/index.tsx +++ b/frontend/app/src/pages/superadmin/index.tsx @@ -5,14 +5,15 @@ import React, { useCallback, useEffect, useState } from 'react'; import { EuiLoadingSpinner } from '@elastic/eui'; import styled from 'styled-components'; -import { BountyMetrics, BountyStatus } from 'store/main'; +import { BountyMetrics, BountyStatus, defaultBountyStatus } from 'store/main'; import { useStores } from 'store'; import moment from 'moment'; -import { useInViewPort } from 'hooks'; +import { useInViewPort, useIsSuperAdmin } from 'hooks'; import { MyTable } from './tableComponent'; import { Header } from './header'; import { Statistics } from './statistics'; import AdminAccessDenied from './accessDenied'; +import { normalizeMetrics } from './utils/metrics'; const Container = styled.body` height: 100vh; /* Set a fixed height for the container */ @@ -33,16 +34,16 @@ const LoaderContainer = styled.div` export const SuperAdmin = () => { //Todo: Remove all comments when metrcis development is done const { main } = useStores(); - const [isSuperAdmin] = useState(true); const [bounties, setBounties] = useState([]); const [bountyMetrics, setBountyMetrics] = useState(undefined); const [bountyStatus, setBountyStatus] = useState({ - Open: false, - Assigned: false, - Paid: false + ...defaultBountyStatus, + Open: false }); + const [sortOrder, setSortOrder] = useState('desc'); const [dropdownValue, setDropdownValue] = useState('all'); const [loading, setLoading] = useState(false); + const isSuperAdmin = useIsSuperAdmin(); /** * Todo use the same date range, @@ -51,22 +52,13 @@ export const SuperAdmin = () => { const [endDate, setEndDate] = useState(moment().unix()); const [startDate, setStartDate] = useState(moment().subtract(30, 'days').unix()); - const [inView, ref] = useInViewPort({ rootMargin: '0px', threshold: 0.25 }); - // const getIsSuperAdmin = useCallback(async () => { - // const admin = await main.getSuperAdmin(); - // setIsSuperAdmin(admin); - // }, [main]); + const onDateFilterChange = useCallback((option: string) => setSortOrder(option), []); - // useEffect(() => { - // if (ui.meInfo?.tribe_jwt) { - // getIsSuperAdmin(); - // } - // }, [main, ui, getIsSuperAdmin]); const getBounties = useCallback(async () => { setLoading(true); if (startDate && endDate) { @@ -78,7 +70,8 @@ export const SuperAdmin = () => { }, { resetPage: true, - ...bountyStatus + ...bountyStatus, + direction: sortOrder } ); setBounties(bounties); @@ -90,23 +83,12 @@ export const SuperAdmin = () => { setLoading(false); } } - }, [main, startDate, endDate, bountyStatus]); + }, [main, startDate, endDate, bountyStatus, sortOrder]); useEffect(() => { getBounties(); }, [getBounties]); - const normalizeMetrics = (data: any): BountyMetrics => ({ - bounties_posted: data.BountiesPosted || data.bounties_posted, - bounties_paid: data.BountiesPaid || data.bounties_paid, - bounties_paid_average: data.bounties_paid_average || data.BountiesPaidPercentage, - sats_posted: data.sats_posted || data.SatsPosted, - sats_paid: data.sats_paid || data.SatsPaid, - sats_paid_percentage: data.sats_paid_percentage || data.SatsPaidPercentage, - average_paid: data.average_paid || data.AveragePaid, - average_completed: data.average_completed || data.AverageCompleted - }); - const getMetrics = useCallback(async () => { if (startDate && endDate) { try { @@ -125,7 +107,7 @@ export const SuperAdmin = () => { return ( <> - {!isSuperAdmin ? ( + {isSuperAdmin ? ( ) : ( @@ -148,6 +130,8 @@ export const SuperAdmin = () => { headerIsFrozen={inView} bountyStatus={bountyStatus} setBountyStatus={setBountyStatus} + onChangeFilterByDate={onDateFilterChange} + sortOrder={sortOrder} dropdownValue={dropdownValue} setDropdownValue={setDropdownValue} /> diff --git a/frontend/app/src/pages/superadmin/tableComponent/TableStyle.tsx b/frontend/app/src/pages/superadmin/tableComponent/TableStyle.tsx index 4add91d1e..5bcce9e24 100644 --- a/frontend/app/src/pages/superadmin/tableComponent/TableStyle.tsx +++ b/frontend/app/src/pages/superadmin/tableComponent/TableStyle.tsx @@ -4,6 +4,10 @@ type FreezeProps = { freeze: boolean; }; +type styledProps = { + color?: any; +}; + const applyFreezeHeaderStyles = ({ freeze = false }: FreezeProps) => freeze && css` @@ -216,6 +220,7 @@ export const BountyHeader = styled.div` `; export const Options = styled.div` + height: 20px; font-size: 15px; cursor: pointer; outline: none; @@ -226,18 +231,75 @@ export const Options = styled.div` padding-right: 2px; `; -export const StyledSelect = styled.select` - color: var(--Text-2, var(--Hover-Icon-Color, #3c3f41)); - font-family: Barlow; - font-size: 15px; - font-style: normal; - font-weight: 500; - line-height: normal; - border-radius: 4px; - cursor: pointer; - outline: none; - width: 60px; - border: none; +export const DateFilterWrapper = styled.div` + width: 130px; + height: 20px; + display: flex; + gap: 5px; + flex-direction: row; + justify-content: center; + align-items: center !important; + margin-left: 19px; + user-select: none; + .image { + display: flex; + justify-content: space-between; + gap: 5px; + align-items: center; + width: 36px; + .materialIconImage { + color: ${(p: any) => p.color && p.color.grayish.G200}; + cursor: pointer; + font-size: 18px; + margin-top: 4px; + } + } + .filterText { + color: var(--Main-bottom-icons, var(--Hover-Icon-Color, #5f6368)); + font-family: Barlow; + font-size: 15px; + font-style: normal; + font-weight: 500; + line-height: normal; + margin-left: 15px; + } + &:hover { + .image { + .materialIconImage { + color: ${(p: any) => p.color && p.color.grayish.G50} !important; + cursor: pointer; + font-size: 18px; + margin-top: 4px; + } + } + .filterText { + color: ${(p: any) => p.color && p.color.grayish.G50}; + } + } + &:active { + .image { + .materialIconImage { + color: ${(p: any) => p.color && p.color.grayish.G10} !important; + cursor: pointer; + font-size: 18px; + margin-top: 4px; + } + } + .filterText { + color: ${(p: any) => p.color && p.color.grayish.G10}; + } + } +`; + +export const DateFilterContent = styled.div` + width: 100%; + height: 100%; + padding: 15px 18px; + user-select: none; + display: flex; + flex-direction: column; + justify-content: space-between; + gap: 5px; `; export const StyledSelect2 = styled.select` diff --git a/frontend/app/src/pages/superadmin/tableComponent/__tests__/TableComponent.spec.tsx b/frontend/app/src/pages/superadmin/tableComponent/__tests__/TableComponent.spec.tsx index ba8eb11bc..156f71a3e 100644 --- a/frontend/app/src/pages/superadmin/tableComponent/__tests__/TableComponent.spec.tsx +++ b/frontend/app/src/pages/superadmin/tableComponent/__tests__/TableComponent.spec.tsx @@ -72,9 +72,9 @@ it('renders "Sort By:" in the document', () => { expect(getByText('Sort By:')).toBeInTheDocument(); }); -it('renders "Date" twice in the document', () => { +it('renders "Newest" twice in the document', () => { const { getAllByText } = render(); - expect(getAllByText('Date')).toHaveLength(2); + expect(getAllByText('Newest')).toHaveLength(2); }); it('renders "Assignee" twice in the document', () => { diff --git a/frontend/app/src/pages/superadmin/tableComponent/index.tsx b/frontend/app/src/pages/superadmin/tableComponent/index.tsx index b49522e6e..dfbe6a107 100644 --- a/frontend/app/src/pages/superadmin/tableComponent/index.tsx +++ b/frontend/app/src/pages/superadmin/tableComponent/index.tsx @@ -1,11 +1,15 @@ import React, { useCallback, useEffect, useState } from 'react'; import { useStores } from 'store'; -import { BountyStatus, defaultBountyStatus } from 'store/main'; +import { BountyStatus } from 'store/main'; import moment from 'moment'; +import { EuiPopover, EuiText } from '@elastic/eui'; +import MaterialIcon from '@material/react-material-icon'; import paginationarrow1 from '../header/icons/paginationarrow1.svg'; import paginationarrow2 from '../header/icons/paginationarrow2.svg'; import defaultPic from '../../../public/static/profile_avatar.svg'; import copygray from '../header/icons/copygray.svg'; +import { dateFilterOptions, getBountyStatus } from '../utils'; +import { colors } from './../../../config/colors'; import { Bounty } from './interfaces.ts'; import { @@ -23,7 +27,6 @@ import { TableHeaderDataRight, BountyHeader, Options, - StyledSelect, LeadingTitle, AlternativeTitle, Label, @@ -36,11 +39,11 @@ import { TableDataAlternative, BountyData, Paragraph, - BoxImage + BoxImage, + DateFilterWrapper, + DateFilterContent } from './TableStyle'; -//import './styles.css'; - interface TableProps { bounties: Bounty[]; startDate?: number; @@ -49,7 +52,9 @@ interface TableProps { bountyStatus?: BountyStatus; setBountyStatus?: React.Dispatch>; dropdownValue?: string; + sortOrder?: string; setDropdownValue?: React.Dispatch>; + onChangeFilterByDate?: (option: string) => void; } interface ImageWithTextProps { @@ -57,25 +62,23 @@ interface ImageWithTextProps { text: string; } -export const ImageWithText = ({ image, text }: ImageWithTextProps) => { - return ( - <> - - {text} - {text} - - - ); -}; +export const ImageWithText = ({ image, text }: ImageWithTextProps) => ( + <> + + {text} + {text} + + +); interface TextInColorBoxProps { status: string; @@ -126,11 +129,16 @@ export const MyTable = ({ setBountyStatus, dropdownValue, headerIsFrozen, - setDropdownValue + sortOrder, + setDropdownValue, + onChangeFilterByDate }: TableProps) => { const [currentPage, setCurrentPage] = useState(1); const [totalBounties, setTotalBounties] = useState(0); const [activeTabs, setActiveTabs] = useState([]); + const [isPopoverOpen, setIsPopoverOpen] = useState(false); + const onButtonClick = () => setIsPopoverOpen((isPopoverOpen: any) => !isPopoverOpen); + const closePopover = () => setIsPopoverOpen(false); const pageSize = 20; const visibleTabs = 7; @@ -148,42 +156,9 @@ export const MyTable = ({ }; const updateBountyStatus = (e: any) => { - const { value } = e.target; if (bountyStatus && setBountyStatus && setDropdownValue) { - switch (value) { - case 'open': { - const newStatus = { ...defaultBountyStatus, Open: true }; - setBountyStatus(newStatus); - break; - } - case 'in-progress': { - const newStatus = { - ...defaultBountyStatus, - Open: false, - Assigned: true - }; - setBountyStatus(newStatus); - break; - } - case 'completed': { - const newStatus = { - ...defaultBountyStatus, - Open: false, - Paid: true - }; - setBountyStatus(newStatus); - break; - } - default: { - const newStatus = { - ...defaultBountyStatus, - Open: false - }; - setBountyStatus(newStatus); - break; - } - } - setDropdownValue(value); + getBountyStatus(e.target.value); + setDropdownValue(e.target.value); } }; @@ -206,6 +181,7 @@ export const MyTable = ({ dataNumber.shift(); } }; + const paginatePrev = () => { const firtsTab = activeTabs[0]; const lastTab = activeTabs[6]; @@ -250,6 +226,8 @@ export const MyTable = ({ }, [getActiveTabs]); const bountiesLength = bounties && bounties.length; + const color = colors['light']; + return ( <> @@ -257,19 +235,61 @@ export const MyTable = ({ - {' '} - {bountiesLength}{' '} - {bountiesLength === 1 ? 'Bounty' : 'Bounties'}{' '} + {bountiesLength} + {bountiesLength === 1 ? 'Bounty' : 'Bounties'} - - - - - - + + + Sort By: + +
+ {sortOrder === 'desc' ? 'Newest' : 'Oldest'} + +
+ + } + panelStyle={{ + border: 'none', + left: '700px', + maxWidth: '106px', + boxShadow: `0px 1px 20px ${color.black90}`, + background: `${color.pureWhite}`, + borderRadius: '6px' + }} + isOpen={isPopoverOpen} + closePopover={closePopover} + panelPaddingSize="none" + anchorPosition="downRight" + > + + {dateFilterOptions.map((val: { [key: string]: string }) => ( + { + onChangeFilterByDate?.(val.value); + }} + key={val.id} + > + {val.label} + + ))} + +
From e3f3b5a9ed78eb8ef878a80f9fd996edae165df5 Mon Sep 17 00:00:00 2001 From: ARREY-ETTA BESSONG EKEP OBASI Date: Fri, 12 Jan 2024 15:58:50 +0100 Subject: [PATCH 3/4] fix: workflow failures --- .../__tests__/TableComponent.spec.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/frontend/app/src/pages/superadmin/tableComponent/__tests__/TableComponent.spec.tsx b/frontend/app/src/pages/superadmin/tableComponent/__tests__/TableComponent.spec.tsx index e5735df87..753e21c83 100644 --- a/frontend/app/src/pages/superadmin/tableComponent/__tests__/TableComponent.spec.tsx +++ b/frontend/app/src/pages/superadmin/tableComponent/__tests__/TableComponent.spec.tsx @@ -79,19 +79,19 @@ it('renders "Sort By:" in the document', () => { expect(getByText('Sort By:')).toBeInTheDocument(); }); -it('renders "Newest" twice in the document', () => { - const { getAllByText } = render(); - expect(getAllByText('Newest')).toHaveLength(2); +it('renders "Date" in the document', () => { + const { getByText } = render(); + expect(getByText('Date')).toBeInTheDocument(); }); -it('renders "Assignee" twice in the document', () => { - const { getAllByText } = render(); - expect(getAllByText('Assignee')).toHaveLength(2); +it('renders "Assignee" in the document', () => { + const { getByText } = render(); + expect(getByText('Assignee')).toBeInTheDocument(); }); it('renders "Status" twice in the document', () => { const { getAllByText } = render(); - expect(getAllByText('Status')).toHaveLength(2); + expect(getAllByText(/Status/i)).toHaveLength(2); }); it('renders "Status:" in the document', () => { From 81c64d919c30ae918166f67b794458331bb74bce Mon Sep 17 00:00:00 2001 From: ARREY-ETTA BESSONG EKEP OBASI Date: Wed, 17 Jan 2024 13:57:57 +0100 Subject: [PATCH 4/4] fix: workflow failure --- frontend/app/src/hooks/useSuperAdmin.ts | 2 +- frontend/app/src/pages/superadmin/tableComponent/index.tsx | 2 +- .../src/pages/superadmin/utils/__tests__/filterTable.spec.ts | 2 +- frontend/app/src/pages/superadmin/utils/filterTable.ts | 2 +- frontend/app/src/pages/superadmin/utils/metrics.ts | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/app/src/hooks/useSuperAdmin.ts b/frontend/app/src/hooks/useSuperAdmin.ts index 2b9864315..8e4a11464 100644 --- a/frontend/app/src/hooks/useSuperAdmin.ts +++ b/frontend/app/src/hooks/useSuperAdmin.ts @@ -1,5 +1,5 @@ import { useState, useCallback, useEffect } from 'react'; -import { useStores } from 'store'; +import { useStores } from '../store'; export const useIsSuperAdmin = () => { const { main, ui } = useStores(); diff --git a/frontend/app/src/pages/superadmin/tableComponent/index.tsx b/frontend/app/src/pages/superadmin/tableComponent/index.tsx index 942bd7b1f..6cb56b481 100644 --- a/frontend/app/src/pages/superadmin/tableComponent/index.tsx +++ b/frontend/app/src/pages/superadmin/tableComponent/index.tsx @@ -1,9 +1,9 @@ import React, { useCallback, useEffect, useState } from 'react'; import { useStores } from 'store'; -import { BountyStatus } from 'store/main'; import moment from 'moment'; import { EuiPopover, EuiText } from '@elastic/eui'; import MaterialIcon from '@material/react-material-icon'; +import { BountyStatus } from '../../../store/main'; import paginationarrow1 from '../header/icons/paginationarrow1.svg'; import paginationarrow2 from '../header/icons/paginationarrow2.svg'; import defaultPic from '../../../public/static/profile_avatar.svg'; diff --git a/frontend/app/src/pages/superadmin/utils/__tests__/filterTable.spec.ts b/frontend/app/src/pages/superadmin/utils/__tests__/filterTable.spec.ts index 3f3c88c57..8b9912134 100644 --- a/frontend/app/src/pages/superadmin/utils/__tests__/filterTable.spec.ts +++ b/frontend/app/src/pages/superadmin/utils/__tests__/filterTable.spec.ts @@ -1,4 +1,4 @@ -import { getBountyStatus } from '..'; +import { getBountyStatus } from '../filterTable'; describe('getBountyStatus', () => { test('should return Open status', () => { diff --git a/frontend/app/src/pages/superadmin/utils/filterTable.ts b/frontend/app/src/pages/superadmin/utils/filterTable.ts index 1c6189096..a01cefb32 100644 --- a/frontend/app/src/pages/superadmin/utils/filterTable.ts +++ b/frontend/app/src/pages/superadmin/utils/filterTable.ts @@ -1,4 +1,4 @@ -import { BountyStatus, defaultBountyStatus } from 'store/main'; +import { BountyStatus, defaultBountyStatus } from '../../../store/main'; type SortCriterion = 'open' | 'in-progress' | 'completed' | 'assignee'; diff --git a/frontend/app/src/pages/superadmin/utils/metrics.ts b/frontend/app/src/pages/superadmin/utils/metrics.ts index 433c7934a..49281686e 100644 --- a/frontend/app/src/pages/superadmin/utils/metrics.ts +++ b/frontend/app/src/pages/superadmin/utils/metrics.ts @@ -1,4 +1,4 @@ -import { BountyMetrics } from 'store/main'; +import { BountyMetrics } from '../../../store/main'; export const normalizeMetrics = (data: any): BountyMetrics => ({ bounties_posted: data.BountiesPosted || data.bounties_posted,