-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
974 additions
and
316 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,4 +29,4 @@ module.exports = async () => { | |
destination: `${cmsGraphQLEndpoint}/:path*`, | ||
}, | ||
] | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import { atom } from 'jotai'; | ||
import { MFDSortBy, OrderBy, Pagination } from 'types/globalTypes'; | ||
|
||
export type ACHighlight = { | ||
index: number; | ||
rowIndex: number; | ||
withinLimit: boolean; | ||
maximumDistance: string; | ||
furthestPointIndex: number; | ||
value: string; | ||
clusterValue: string; | ||
}; | ||
|
||
export type ACCluster = { | ||
value: string; | ||
highlightsTotalCount: number; | ||
highlights: ACHighlight[]; | ||
}; | ||
|
||
type ACTaskAtom = { | ||
taskID: string; | ||
result: boolean | undefined; | ||
clustersTotalCount: number; | ||
clusterIndex: number; | ||
cluster: ACCluster; | ||
pagination: Pagination; | ||
sortBy: MFDSortBy; | ||
orderBy: OrderBy; | ||
}; | ||
|
||
export const ACAtomDefaultValues: ACTaskAtom = { | ||
// general task data | ||
taskID: '', | ||
result: undefined, | ||
clustersTotalCount: 0, | ||
// current cluster data | ||
clusterIndex: 0, | ||
cluster: { | ||
value: '', | ||
highlightsTotalCount: 0, | ||
highlights: [], | ||
}, | ||
pagination: { | ||
offset: 0, | ||
limit: 0, | ||
}, | ||
sortBy: MFDSortBy.MAXIMUM_DISTANCE, | ||
orderBy: OrderBy.ASC, | ||
}; | ||
|
||
export const MFDAtomDefaultValuesWithParams = ( | ||
taskID: string, | ||
clusterIndex = 0, | ||
limit = 0, | ||
sortBy = MFDSortBy.MAXIMUM_DISTANCE, | ||
orderBy = OrderBy.ASC | ||
) => ({ | ||
...ACAtomDefaultValues, | ||
taskID, | ||
clusterIndex, | ||
pagination: { | ||
offset: 0, | ||
limit, | ||
}, | ||
sortBy, | ||
orderBy, | ||
}); | ||
|
||
const ACAtom = atom<ACTaskAtom>(ACAtomDefaultValues); | ||
|
||
export default ACAtom; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
web-app/client/src/components/AlgorithmFormConfigurator/FormHeader.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ | |
align-items: center; | ||
padding: 0; | ||
position: relative; | ||
text-align: center; | ||
} | ||
|
||
.footer { | ||
|
9 changes: 9 additions & 0 deletions
9
...client/src/constants/configuratorForm/ACForm/SeedCustomInputs/SeedCustomInput.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.seedCustomInput { | ||
display: flex; | ||
gap: 16px; | ||
align-items: flex-end; | ||
} | ||
|
||
.input { | ||
width: 100%; | ||
} |
41 changes: 41 additions & 0 deletions
41
web-app/client/src/constants/configuratorForm/ACForm/SeedCustomInputs/SeedCustomInput.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import Button from '@components/Button'; | ||
import styles from './SeedCustomInput.module.scss'; | ||
import { NumberInput } from '@components/Inputs'; | ||
import { | ||
FormCustomProps, | ||
FormFieldProps, | ||
FormNumberInputProps, | ||
} from 'types/form'; | ||
import { | ||
BaseSyntheticEvent, | ||
FC, | ||
ForwardRefRenderFunction, | ||
forwardRef, | ||
} from 'react'; | ||
import { ControllerRenderProps } from 'react-hook-form'; | ||
import { ACDefaults } from '../index'; | ||
|
||
//Omit<FormFieldProps<Defaults, string>, "rules"> & Record<string, any> & ControllerRenderProps<Defaults> | ||
|
||
type Props = Omit<FormCustomProps<typeof ACDefaults, 'seed'>, 'rules'> & | ||
ControllerRenderProps<typeof ACDefaults, 'seed'>; | ||
|
||
const SeedCustomInput: ForwardRefRenderFunction<HTMLInputElement, Props> = ( | ||
props, | ||
ref, | ||
) => { | ||
const handlerRandomSeed = () => { | ||
const newSeed = Math.round(Math.random() * 999_999); | ||
props.onChange(newSeed); | ||
}; | ||
return ( | ||
<div className={styles.seedCustomInput}> | ||
<NumberInput className={styles.input} {...props} ref={ref} /> | ||
<Button variant="secondary" onClick={handlerRandomSeed}> | ||
Random | ||
</Button> | ||
</div> | ||
); | ||
}; | ||
|
||
export default forwardRef(SeedCustomInput); |
Empty file.
Oops, something went wrong.