Skip to content

Commit 5e06bbb

Browse files
committed
fix some comments 2
1 parent 67f2bdf commit 5e06bbb

File tree

14 files changed

+105
-99
lines changed

14 files changed

+105
-99
lines changed

web-app/client/.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,3 @@ globalTypes.ts
4242
cmsTypes.ts
4343
.graphqlconfig
4444
schema.graphql
45-
46-
proxy.config.js

web-app/client/proxy.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ module.exports = async () => {
2828
source: `${cmsProxyURL}/:path*`,
2929
destination: `${cmsGraphQLEndpoint}/:path*`,
3030
},
31-
]
32-
};
31+
];
32+
};

web-app/client/src/components/ACInstance/ACInstance.module.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
flex-direction: column;
2727
gap: 8px;
2828
width: 100%;
29-
min-width: 0;
29+
min-width: 0;
3030
}
3131

3232
.selected {
@@ -40,10 +40,10 @@
4040
gap: 8px;
4141
}
4242

43-
.attr {
43+
.attribute {
4444
@include paragraph-small;
4545
border: 2px solid transparent;
46-
border-radius: 8px;
46+
border-radius: 8px;
4747
padding-left: 8px;
4848
padding-right: 8px;
4949
background: $black-10;

web-app/client/src/components/ACInstance/ACInstance.tsx

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ const ACInstance: FC<Props> = ({
4343
const [atom, setAtom] = useAtom(ACAtom);
4444
const handleSelect = () => {
4545
const instance: ACInstance = {
46-
id: id,
47-
attribute1: attributes.attr1,
48-
attribute2: attributes.attr2,
46+
id,
47+
attribute1: attributes.attribute1,
48+
attribute2: attributes.attribute2,
4949
intervals: intervals.intervals,
5050
outliers: outliers.outliers,
5151
};
@@ -64,21 +64,31 @@ const ACInstance: FC<Props> = ({
6464
<div className={styles.containerInner}>
6565
Operation
6666
<div className={styles.attributes}>
67-
<div className={styles.attr}>{attributes.attr1}</div>
68-
<OperationIcon className={styles.icons}/>
69-
70-
<div className={styles.attr}>{attributes.attr2}</div>
67+
<div className={styles.attribute}>{attributes.attribute1}</div>
68+
<OperationIcon className={styles.icons} />
69+
70+
<div className={styles.attribute}>{attributes.attribute2}</div>
7171
</div>
7272
</div>
73-
<CollapsableView
74-
title="Intervals"
75-
output={intervals.intervals.map((elem) => `[${elem[0]}, ${elem[1]}]`)}
76-
amount={intervals.amount}
77-
/>
78-
<CollapsableView
79-
title="Outliers"
80-
output={outliers.outliers.map((elem) => elem.toString())}
81-
/>
73+
<CollapsableView title={`Intervals ${intervals.amount}`}>
74+
{intervals.intervals.map((elem) => (
75+
<>
76+
<span
77+
className={styles.spanS}
78+
key={`intervals ${elem[0]} ${elem[1]}`}
79+
>{`[${elem[0]}, ${elem[1]}]`}</span>{' '}
80+
</>
81+
))}
82+
</CollapsableView>
83+
<CollapsableView title={`Outliers ${outliers.amount}`}>
84+
{outliers.outliers.map((elem) => (
85+
<>
86+
<span className={styles.spanS} key={`Outliers ${elem}`}>
87+
{elem}
88+
</span>{' '}
89+
</>
90+
))}
91+
</CollapsableView>
8292
</div>
8393
);
8494
};

web-app/client/src/components/AlgorithmFormConfigurator/ConfigureAlgorithm.module.scss renamed to web-app/client/src/components/AlgorithmFormConfigurator/AlgorithmFormConfigurator.module.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
margin-top: 16px;
55
}
66

7-
.baseFormContainer, .containerLess4Inputs {
7+
.baseFormContainer {
88
display: flex;
99
flex-direction: column;
1010
gap: 24px;
@@ -13,11 +13,11 @@
1313
max-width: 466px;
1414
}
1515

16-
.bigFormContainer {
16+
.expandedFormContainer {
1717
max-width: 1100px;
1818
}
1919

20-
.containerOver4Inputs {
20+
.expandedInputsContainer {
2121
display: grid;
2222
grid-template-columns: 1fr 1fr;
2323
column-gap: 32px;

web-app/client/src/components/AlgorithmFormConfigurator/AlgorithmFormConfigurator.tsx

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import cn from 'classnames';
2-
import { useRouter } from 'next/router';
31
import FormFooter from '@components/AlgorithmFormConfigurator/FormFooter';
42
import FormHeader from '@components/AlgorithmFormConfigurator/FormHeader';
53
import useFormFactory from '@components/AlgorithmFormConfigurator/useFormFactory';
64
import PresetSelector from '@components/PresetSelector';
75
import WizardLayout from '@components/WizardLayout';
86
import { UsedPrimitivesType } from '@constants/formPrimitives';
9-
import styles from './ConfigureAlgorithm.module.scss';
7+
import cn from 'classnames';
8+
import { useRouter } from 'next/router';
9+
import styles from './AlgorithmFormConfigurator.module.scss';
1010

1111
type QueryProps<T extends UsedPrimitivesType> = {
1212
primitive: T;
@@ -33,22 +33,20 @@ const AlgorithmFormConfigurator = <T extends UsedPrimitivesType>({
3333
primitive,
3434
formParams,
3535
});
36-
36+
3737
return (
3838
<WizardLayout header={FormHeader} footer={FormFooter(router, onSubmit)}>
3939
<div
4040
className={cn(
4141
styles.baseFormContainer,
42-
entries.length > 4 && styles.bigFormContainer,
42+
entries.length > 4 && styles.expandedFormContainer,
4343
)}
4444
>
4545
<div
4646
className={
47-
styles[
48-
entries.length > 4
49-
? 'containerOver4Inputs'
50-
: 'baseFormContainer'
51-
]
47+
entries.length > 4
48+
? styles.expandedInputsContainer
49+
: styles.baseFormContainer
5250
}
5351
>
5452
<PresetSelector
@@ -62,11 +60,9 @@ const AlgorithmFormConfigurator = <T extends UsedPrimitivesType>({
6260
<div className={styles.line} />
6361
<div
6462
className={
65-
styles[
66-
entries.length > 4
67-
? 'containerOver4Inputs'
68-
: 'containerLess4Inputs'
69-
]
63+
entries.length > 4
64+
? styles.expandedInputsContainer
65+
: styles.baseFormContainer
7066
}
7167
>
7268
{entries}

web-app/client/src/components/AlgorithmFormConfigurator/FormHeader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import styles from './ConfigureAlgorithm.module.scss';
2+
import styles from './AlgorithmFormConfigurator.module.scss';
33

44
const FormHeader = (
55
<>

web-app/client/src/components/CollapsableView/CollapsableView.tsx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
import cn from 'classnames';
2-
import { FC, useLayoutEffect, useRef, useState } from 'react';
2+
import { useLayoutEffect, useRef, useState } from 'react';
3+
import { FCWithChildren } from 'types/react';
34
import styles from './CollapsableView.module.scss';
45

56
type Props = {
6-
output: string[];
77
title: string;
8-
amount?: number;
98
};
109

1110
const states = ['not required', 'hidden', 'view'] as const;
1211
type CollapseState = (typeof states)[number];
1312

14-
const CollapsableView: FC<Props> = ({ output, title, amount }) => {
13+
const CollapsableView: FCWithChildren<Props> = ({ children, title }) => {
1514
const parentRef = useRef<HTMLDivElement>(null);
1615
const childRef = useRef<HTMLDivElement>(null);
1716
const [collapseState, setCollapseState] =
@@ -32,7 +31,6 @@ const CollapsableView: FC<Props> = ({ output, title, amount }) => {
3231
return (
3332
<div className={styles.container} ref={parentRef}>
3433
{title}
35-
{amount && ` (${amount})`}
3634
<div className={styles.withShowAll}>
3735
<div
3836
className={cn(
@@ -41,11 +39,7 @@ const CollapsableView: FC<Props> = ({ output, title, amount }) => {
4139
)}
4240
ref={childRef}
4341
>
44-
{output.map((elem) => (
45-
<>
46-
<span key={elem.toString()}>{elem}</span>{' '}
47-
</>
48-
))}
42+
{children}
4943
{collapseState === 'view' && (
5044
<button
5145
className={cn(styles.buttonShow, styles.withoutMargin)}

web-app/client/src/graphql/client.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { customFetch } from '@graphql/customFetch';
77
import { pathnameToLocalURL } from '@utils/pathnameToValidURL';
88

99
const isServer = typeof window === 'undefined';
10+
1011
const client = new ApolloClient({
1112
ssrMode: isServer,
1213
uri: isServer ? pathnameToLocalURL(serverProxyURL) : serverProxyURL,

web-app/client/src/pages/create-task/configure-algorithm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
UsedPrimitivesType,
88
} from '@constants/formPrimitives';
99
import { useTaskUrlParams } from '@hooks/useTaskUrlParams';
10-
import styles from '@styles/configure-algorithm.module.scss';
10+
import styles from '@styles/ConfigureAlgorithm.module.scss';
1111

1212
const ConfigureAlgorithm: NextPage = () => {
1313
const router = useRouter();

0 commit comments

Comments
 (0)