Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
66edfd1
refactored settings , updated imports
NyashaMuusha Aug 8, 2024
2c89f76
added handle add row function
NyashaMuusha Aug 12, 2024
20a1e44
Merge pull request #302 from jembi/dev
MatthewErispe Aug 12, 2024
83e04d9
updated common settings
NyashaMuusha Aug 21, 2024
f6bdac6
added add field dialog, updated handle add row
NyashaMuusha Aug 21, 2024
9aa4d2f
removed console log statement
NyashaMuusha Aug 21, 2024
2b7c6ce
added isDisabled field to configuration, added swicth component to da…
NyashaMuusha Aug 23, 2024
7efbab4
add isdisabled field to common setings
NyashaMuusha Aug 26, 2024
4a41b98
added null operator to deterministic rule
NyashaMuusha Aug 27, 2024
cd9339f
updated unit tests
NyashaMuusha Aug 28, 2024
4587460
Update JeMPI_Apps/JeMPI_UI/src/hooks/useAppConfig.tsx
MatthewErispe Sep 2, 2024
2a2ee2c
Update JeMPI_Apps/JeMPI_UI/src/pages/settings/deterministic/Determini…
MatthewErispe Sep 2, 2024
49135cb
revert coderabbitai suggestion
MatthewErispe Sep 2, 2024
8e7ed92
Merge pull request #309 from jembi/CU-86bzx35gd_Deterministic-Add-Nul…
MatthewErispe Sep 2, 2024
86ec748
Merge pull request #297 from jembi/CU-86bzx3500_Hide-Setting-Tabs
MatthewErispe Sep 2, 2024
59deb92
Merge branch 'CU-86bzx3387_UI-Configuration-Improvements' into CU-86b…
MatthewErispe Sep 2, 2024
8f5a9e2
CU-86c065rzw - Closing bracket on index when disable field
NyashaMuusha Sep 2, 2024
c13e89c
Merge remote-tracking branch 'upstream/CU-86bzx34mj_Common-Settings-D…
NyashaMuusha Sep 2, 2024
8fcb8f9
Merge pull request #308 from jembi/CU-86bzx34mj_Common-Settings-Disab…
MatthewErispe Sep 3, 2024
db41a4b
Merge branch 'CU-86bzx3387_UI-Configuration-Improvements' into CU-86b…
MatthewErispe Sep 3, 2024
1ab3780
implement error handling for config update
MatthewErispe Sep 3, 2024
7747be0
Merge pull request #306 from jembi/CU-86bzx34aj_Common-Settings-Add-n…
MatthewErispe Sep 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 13 additions & 15 deletions JeMPI_Apps/JeMPI_UI/src/hooks/useAppConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,23 @@ export const AppConfigProvider = ({
refetchOnWindowFocus: false
})
const availableFields: DisplayField[] = useMemo(() => {
return (fields || [])
.filter(({ scope }) =>
scope.some(path => {
return matchPath(
{
path: path
},
location.pathname
)
})
)
.map(field => {
return {
try {
if (!fields || !Array.isArray(fields)) return []

return fields
.filter(({ scope }) =>
scope?.some(path => matchPath({ path }, location.pathname))
)
.map(field => ({
...field,
formatValue: getFieldValueFormatter(field.fieldType),
isValid: (value: unknown) => isInputValid(value, field?.validation),
getValue: valueGetter
}
})
}))
} catch (error) {
console.error('Error processing available fields:', error)
return []
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [fields, location])

Expand Down
30 changes: 16 additions & 14 deletions JeMPI_Apps/JeMPI_UI/src/pages/settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ import { generateId } from 'utils/helpers'
import Probabilistic from './probabilistic/Probabilistic'
import { useConfig } from 'hooks/useConfig'
import { useSnackbar } from 'notistack'
import { useConfiguration } from 'hooks/useUIConfiguration'

const Settings = () => {
const [value, setValue] = useState(0)
const {configuration} = useConfiguration()
const [configurationData, setConfigurationData] = useState(() => {
const storedData = localStorage.getItem('configuration')
return storedData
Expand Down Expand Up @@ -106,12 +108,12 @@ const Settings = () => {
variant="scrollable"
>
<Tab label="Common" {...a11yProps(0)} />
<Tab label="Unique to Golden Record" {...a11yProps(1)} />
{/* <Tab label="Unique to Golden Record" {...a11yProps(1)} />
<Tab label="Unique to Interaction" {...a11yProps(2)} />
<Tab label="Golden Records Lists" {...a11yProps(3)} />
<Tab label="Deterministic" {...a11yProps(4)} />
<Tab label="Blocking" {...a11yProps(5)} />
<Tab label="Probabilistic" {...a11yProps(6)} />
<Tab label="Golden Records Lists" {...a11yProps(3)} /> */}
<Tab label="Deterministic" {...a11yProps(1)} />
<Tab label="Blocking" {...a11yProps(2)} />
<Tab label="Probabilistic" {...a11yProps(3)} />
</Tabs>
</Box>
<CustomTabPanel value={value} index={0}>
Expand All @@ -120,31 +122,31 @@ const Settings = () => {
</Typography>
<CommonSettings />
</CustomTabPanel>
<CustomTabPanel value={value} index={1}>
{/* <CustomTabPanel value={value} index={1}>
<Typography variant="h5" sx={{ py: 3 }}>
Setup properties that are unique to the golden record
</Typography>
<UniqueToGR />
</CustomTabPanel>
<CustomTabPanel value={value} index={2}>
</CustomTabPanel> */}
{/* <CustomTabPanel value={value} index={2}>
<Typography variant="h5" sx={{ py: 3 }}>
Setup properties that are unique to the interaction
</Typography>
<UniqueToInteraction />
</CustomTabPanel>
<CustomTabPanel value={value} index={3}>
</CustomTabPanel> */}
{/* <CustomTabPanel value={value} index={3}>
<Typography variant="h5" sx={{ py: 3 }}>
Setup properties for Golden record lists
</Typography>
<GoldenRecordLists />
</CustomTabPanel>
<CustomTabPanel value={value} index={4}>
</CustomTabPanel> */}
<CustomTabPanel value={value} index={1}>
<Deterministic />
</CustomTabPanel>
<CustomTabPanel value={value} index={5}>
<CustomTabPanel value={value} index={2}>
<Blocking />
</CustomTabPanel>
<CustomTabPanel value={value} index={6}>
<CustomTabPanel value={value} index={3}>
<Typography variant="h5" sx={{ py: 3 }}>
<Probabilistic />
</Typography>
Expand Down
Loading