From 0c114e993a8100dfea9b5a011c79f2f92c9cd3c4 Mon Sep 17 00:00:00 2001 From: yssk22 Date: Sun, 22 Dec 2024 13:02:36 +0000 Subject: [PATCH] [expo] remove topological sort **Summary** We found multiple bugs in topological sort and it exposes the risk to create garbage data in the database. We decided to remove the feature and revisit it later. **Test** - yarn test **Issue** - #140 --- expo/features/hpsort/HPSortNewScreen.tsx | 14 +- .../internals/new/HPSortNewConfigForm.tsx | 78 ----- .../internals/new/HPSortNewRoundContainer.tsx | 13 +- .../sort/HPSortTopologicalSort.test.ts | 124 -------- .../internals/sort/HPSortTopologicalSort.ts | 273 ------------------ 5 files changed, 7 insertions(+), 495 deletions(-) delete mode 100644 expo/features/hpsort/internals/new/HPSortNewConfigForm.tsx delete mode 100644 expo/features/hpsort/internals/sort/HPSortTopologicalSort.test.ts delete mode 100644 expo/features/hpsort/internals/sort/HPSortTopologicalSort.ts diff --git a/expo/features/hpsort/HPSortNewScreen.tsx b/expo/features/hpsort/HPSortNewScreen.tsx index b0632c56..8755996f 100644 --- a/expo/features/hpsort/HPSortNewScreen.tsx +++ b/expo/features/hpsort/HPSortNewScreen.tsx @@ -1,25 +1,21 @@ import { WithSafeArea } from '@hpapp/features/common'; import { defineScreen, useScreenTitle } from '@hpapp/features/common/stack'; import { t } from '@hpapp/system/i18n'; -import { useState } from 'react'; -import HPSortNewConfigForm from './internals/new/HPSortNewConfigForm'; import HPSortNewRoundContainer from './internals/new/HPSortNewRoundContainer'; -import { HPSortNewConfig } from './internals/new/types'; export type HPSortNewSceenProps = object; export default defineScreen('/hpsort/new/', function HPSortNewSceen() { useScreenTitle(t('New Sort')); - const [config, setConfig] = useState(null); return ( - {config === null ? ( - setConfig(config)} /> - ) : ( - - )} + ); }); diff --git a/expo/features/hpsort/internals/new/HPSortNewConfigForm.tsx b/expo/features/hpsort/internals/new/HPSortNewConfigForm.tsx deleted file mode 100644 index 74c268e1..00000000 --- a/expo/features/hpsort/internals/new/HPSortNewConfigForm.tsx +++ /dev/null @@ -1,78 +0,0 @@ -import { BetaIcon, RadioButtonGroup, Text } from '@hpapp/features/common'; -import { FontSize, IconSize, Spacing } from '@hpapp/features/common/constants'; -import { t } from '@hpapp/system/i18n'; -import { Button } from '@rneui/themed'; -import { useState } from 'react'; -import { View, StyleSheet, Dimensions } from 'react-native'; - -import { HPSortNewConfig } from './types'; - -export type HPSortNewConfigFormProps = { - onSelect: (config: HPSortNewConfig) => void; -}; - -export default function HPSortNewConfigForm({ onSelect }: HPSortNewConfigFormProps) { - const [numMembersToSelect, setNumMembersToSelect] = useState(null); - return ( - - {[t('Choose the number of members one round shows.')].join(' ')} - 2, - <> - 4 - - - ]} - selectedOption={numMembersToSelect?.toString()} - onSelect={(value) => setNumMembersToSelect(value)} - /> - - - - {t( - "With choosing 4, it's an experiemntal sort feature, where you can complete faster but you may not sort all members." - )} - - -