-
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
40 changed files
with
975 additions
and
726 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 |
---|---|---|
|
@@ -43,4 +43,4 @@ cmsTypes.ts | |
.graphqlconfig | ||
schema.graphql | ||
|
||
web-app\client\proxy.config.js | ||
proxy.config.js |
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 |
---|---|---|
@@ -0,0 +1,86 @@ | ||
import DivisionIcon from '@assets/icons/division.svg?component'; | ||
import MinusIcon from '@assets/icons/minus.svg?component'; | ||
import MultiplicationIcon from '@assets/icons/multiplication.svg?component'; | ||
import PlusIcon from '@assets/icons/plus.svg?component'; | ||
import ACAtom, { | ||
ACAtomDefaultValuesWithParams, | ||
ACInstance, | ||
} from '@atoms/ACTaskAtom'; | ||
import { | ||
GetMainTaskDeps_taskInfo_TaskInfo_data_result_ACTaskResult_ACs_attributes, | ||
GetMainTaskDeps_taskInfo_TaskInfo_data_result_ACTaskResult_ACs_intervals, | ||
GetMainTaskDeps_taskInfo_TaskInfo_data_result_ACTaskResult_ACs_outliers, | ||
Operation, | ||
} from '@graphql/operations/queries/__generated__/GetMainTaskDeps'; | ||
import cn from 'classnames'; | ||
import { useAtom } from 'jotai'; | ||
import { FC } from 'react'; | ||
import CollapsableView from '../CollapsableView'; | ||
import styles from './ACInstance.module.scss'; | ||
|
||
type Props = { | ||
id: string; | ||
attributes: GetMainTaskDeps_taskInfo_TaskInfo_data_result_ACTaskResult_ACs_attributes; | ||
operation: Operation; | ||
outliers: GetMainTaskDeps_taskInfo_TaskInfo_data_result_ACTaskResult_ACs_outliers; | ||
intervals: GetMainTaskDeps_taskInfo_TaskInfo_data_result_ACTaskResult_ACs_intervals; | ||
}; | ||
|
||
export const operationIcons = { | ||
[Operation.ADDITION]: PlusIcon, | ||
[Operation.MULTIPLICATION]: MultiplicationIcon, | ||
[Operation.DIVISION]: DivisionIcon, | ||
[Operation.SUBTRACTION]: MinusIcon, | ||
}; | ||
|
||
const ACInstance: FC<Props> = ({ | ||
id, | ||
attributes, | ||
operation, | ||
outliers, | ||
intervals, | ||
}) => { | ||
const [atom, setAtom] = useAtom(ACAtom); | ||
const handleSelect = () => { | ||
const instance: ACInstance = { | ||
id: id, | ||
attribute1: attributes.attr1, | ||
attribute2: attributes.attr2, | ||
intervals: intervals.intervals, | ||
outliers: outliers.outliers, | ||
}; | ||
setAtom({ ...ACAtomDefaultValuesWithParams(atom.taskID, instance) }); | ||
}; | ||
|
||
const OperationIcon = operationIcons[operation as Operation]; | ||
|
||
const isSelected = atom.instanceSelected?.id === id; | ||
|
||
return ( | ||
<div | ||
className={cn(styles.containerOuter, isSelected && styles.selected)} | ||
onClick={handleSelect} | ||
> | ||
<div className={styles.containerInner}> | ||
Operation | ||
<div className={styles.attributes}> | ||
<div className={styles.attr}>{attributes.attr1}</div> | ||
<OperationIcon className={styles.icons}/> | ||
|
||
<div className={styles.attr}>{attributes.attr2}</div> | ||
</div> | ||
</div> | ||
<CollapsableView | ||
title="Intervals" | ||
output={intervals.intervals.map((elem) => `[${elem[0]}, ${elem[1]}]`)} | ||
amount={intervals.amount} | ||
/> | ||
<CollapsableView | ||
title="Outliers" | ||
output={outliers.outliers.map((elem) => elem.toString())} | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ACInstance; |
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 @@ | ||
export { default } from './ACInstance'; |
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
Oops, something went wrong.