Skip to content

Commit 03c8280

Browse files
Merge branch 'dev' into QA-Fixes
2 parents 6d27dfd + c6342b5 commit 03c8280

File tree

10 files changed

+106
-85
lines changed

10 files changed

+106
-85
lines changed
Lines changed: 5 additions & 7 deletions
Loading
Lines changed: 5 additions & 3 deletions
Loading

src/ui/components/inputs/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const InputWithLabel = ({
1919
optional?: string;
2020
}): JSX.Element => (
2121
<FlexBox.Column fullWidth>
22-
<Box paddingBottom="xs">
22+
<Box paddingBottom="sm">
2323
<Paragraph
2424
size="body"
2525
style={{ color: labelColor ? labelColor : 'black' }}

src/ui/layouts/NonEditableConfig/index.tsx

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
Container,
88
FullWidthSpinner,
99
} from '../../components';
10+
import { ToggleField } from '../common/FormElement';
1011
import styles from './index.module.scss';
1112
import { useService } from './useService';
1213

@@ -106,15 +107,22 @@ export const NonEditableConfig: React.FC<{ details: any }> = ({ details }) => {
106107
if (typeof elementSchema === 'boolean') {
107108
return (
108109
<Box marginVertical={'md'} style={{ width: '100%' }}>
109-
<Box>
110+
<ToggleField
111+
name={titleCase(elementName)}
112+
value={elementSchema}
113+
onHandleChange={() => {}}
114+
label={titleCase(elementName)}
115+
disabled={true}
116+
/>
117+
{/* <Box>
110118
<FlexBox.Row justifyContent="space-between">
111119
<Paragraph>{titleCase(elementName)}</Paragraph>
112120
<label className={styles.switch}>
113121
<input type="checkbox" checked={elementSchema} />
114122
<span className={`${styles.slider} ${styles.round}`}></span>
115123
</label>
116124
</FlexBox.Row>
117-
</Box>
125+
</Box> */}
118126
</Box>
119127
);
120128
}
@@ -161,13 +169,20 @@ export const NonEditableConfig: React.FC<{ details: any }> = ({ details }) => {
161169
className={styles.field}
162170
/>
163171
</Box>
164-
<FlexBox.Row justifyContent="space-between" style={{ width: '80%' }}>
172+
{/* <FlexBox.Row justifyContent="space-between" style={{ width: '80%' }}>
165173
<Paragraph>Share Component with public</Paragraph>
166174
<label className={styles.switch}>
167175
<input type="checkbox" checked={details.is_shared} />
168176
<span className={`${styles.slider} ${styles.round}`}></span>
169177
</label>
170-
</FlexBox.Row>
178+
</FlexBox.Row> */}
179+
<ToggleField
180+
name='Share Component with public'
181+
value={details.is_shared}
182+
onHandleChange={() => {}}
183+
label='Share Component with public'
184+
disabled={true}
185+
/>
171186
</Container>
172187
{/* <Container>
173188

src/ui/layouts/common/CustomStackBox/index.module.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
justify-content: center;
2424
align-items: center;
2525
.imageContainer {
26-
// max-height: 60px;
27-
// max-width: 60px;
2826

2927
height: 59px;
3028
width: 119px;

src/ui/layouts/common/FormElement/index.module.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
letter-spacing: 0em;
8484
text-align: right;
8585
margin-right: 15px;
86+
width: 20px;
8687
}
8788

8889
.sliderBlue {

src/ui/layouts/common/FormElement/index.tsx

Lines changed: 27 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -26,33 +26,32 @@ export function TextField(props: any) {
2626
);
2727
}
2828

29-
export function ToggleField(props: any) {
30-
const { name, onHandleChange, label } = props;
31-
return (
32-
<Box marginVertical="md">
33-
<FlexBox.Row justifyContent="space-between" alignItems="center">
34-
<Box>
35-
<Paragraph size="body" style={{ color: '#000' }}>
36-
{label}
37-
</Paragraph>
38-
</Box>
39-
<Box>
40-
<label className={styles.switch}>
41-
<input
42-
defaultChecked={props?.default}
43-
type="checkbox"
44-
onChange={(event) => onHandleChange(name, event.target.checked)}
45-
/>
46-
<span className={`${styles.slider} ${styles.round}`}></span>
47-
</label>
48-
</Box>
49-
</FlexBox.Row>
50-
</Box>
51-
);
52-
}
29+
// export function ToggleField(props: any) {
30+
// const { name, onHandleChange, label } = props;
31+
// return (
32+
// <Box marginVertical="md">
33+
// <FlexBox.Row justifyContent="space-between" alignItems="center">
34+
// <Box>
35+
// <Paragraph size="body" style={{ color: '#000' }}>
36+
// {label}
37+
// </Paragraph>
38+
// </Box>
39+
// <Box>
40+
// <label className={styles.switch}>
41+
// <input
42+
// type="checkbox"
43+
// onChange={(event) => onHandleChange(name, event.target.checked)}
44+
// />
45+
// <span className={`${styles.slider} ${styles.round}`}></span>
46+
// </label>
47+
// </Box>
48+
// </FlexBox.Row>
49+
// </Box>
50+
// );
51+
// }
5352

54-
export function ToggleFieldBlock(props: any) {
55-
const { name, value, onHandleChange, label } = props;
53+
export function ToggleField(props: any) {
54+
const { name, value, onHandleChange, label, disabled } = props;
5655
return (
5756
<Box style={{ height: '68px' }}>
5857
<FlexBox.Row justifyContent="space-between" flexDirection="column">
@@ -62,16 +61,13 @@ export function ToggleFieldBlock(props: any) {
6261
</Paragraph>
6362
</Box>
6463
<FlexBox.Row className={styles.switchContainer}>
65-
<div>
66-
<span className={styles.switchLabel}>
67-
{value ? <>Yes</> : <>No</>}
68-
</span>
69-
</div>
64+
<div className={styles.switchLabel}><span>{value ? <>Yes</> : <>No</>}</span></div>
7065
<label className={styles.switch}>
7166
<input
7267
type="checkbox"
7368
defaultChecked={value}
7469
onChange={(event) => onHandleChange(name, event.target.checked)}
70+
disabled={disabled}
7571
/>
7672
<span className={`${styles.sliderBlue} ${styles.round}`}></span>
7773
</label>

src/ui/layouts/common/StackBox/index.module.scss

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
padding: 10px;
77
background-color: #fff;
88
box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.05);
9+
cursor: pointer;
910
}
1011

1112
.checkbox {
@@ -25,9 +26,9 @@
2526
height: 59px;
2627
width: 119px;
2728
background-color: #fff;
28-
display: flex;
29-
justify-content: center;
30-
align-items: center;
29+
// display: flex;
30+
// justify-content: center;
31+
// align-items: center;
3132

3233
img {
3334
height: 100%;

src/ui/layouts/stacks/CreateStack/ListForAll/index.tsx

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { useState } from 'react';
22
import styles from './index.module.scss';
33
import { Box, FlexBox, H2, FormTextField } from '../../../../components';
4-
import { ToggleFieldBlock } from '../../../common/FormElement';
4+
import { ToggleField } from '../../../common/FormElement';
55

66
import {
77
sessionSelectors,
@@ -200,44 +200,44 @@ export const ListForAll: React.FC<Props> = () => {
200200
value={stackName}
201201
/>
202202
</Box>
203-
<Box marginLeft="xl" style={{ width: '30%' }}>
204-
<ToggleFieldBlock
203+
<Box marginLeft='xl' style={{ width: '30%' }}>
204+
<ToggleField
205205
label={'Share Stack with public'}
206206
value={isShared}
207207
onHandleChange={(value: any) => setIshared(!isShared)}
208208
/>
209209
</Box>
210210
</FlexBox.Row>
211211
</Box>
212-
</div>
213212

214-
{selectedStack?.length >= 0 && (
215-
<FlexBox.Row marginTop="md">
216-
{selectedStack?.map((stack: any) => (
217-
<Box
218-
onClick={() => selectStack(stack)}
219-
marginLeft="sm"
220-
style={{
221-
border:
222-
selectedStackBox?.id === stack.id
223-
? '2px solid #431E93'
224-
: '2px solid #fff',
225-
}}
226-
className={styles.selectedBox}
227-
>
228-
{selectedStackBox?.id !== stack.id && (
229-
<input
230-
type="checkbox"
231-
className={styles.selectedBoxCheckbox}
232-
checked
233-
onClick={(e) => handleSelectedBox(e, stack)}
234-
/>
235-
)}
236-
<img src={stack.logoUrl} alt={stack.name} />
237-
</Box>
238-
))}
239-
</FlexBox.Row>
240-
)}
213+
{selectedStack?.length >= 0 && (
214+
<FlexBox.Row marginTop="md">
215+
{selectedStack?.map((stack: any) => (
216+
<Box
217+
onClick={() => selectStack(stack)}
218+
marginLeft="sm"
219+
style={{
220+
border:
221+
selectedStackBox?.id === stack.id
222+
? '2px solid #431E93'
223+
: '2px solid #fff',
224+
}}
225+
className={styles.selectedBox}
226+
>
227+
{selectedStackBox?.id !== stack.id && (
228+
<input
229+
type="checkbox"
230+
className={styles.selectedBoxCheckbox}
231+
checked
232+
onClick={(e) => handleSelectedBox(e, stack)}
233+
/>
234+
)}
235+
<img src={stack.logoUrl} alt={stack.name} />
236+
</Box>
237+
))}
238+
</FlexBox.Row>
239+
)}
240+
</div>
241241

242242
<FlexBox.Column>
243243
{stackComponentsTypes?.map((item) => {

src/ui/layouts/stacks/StackDetail/Configuration/index.tsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
FullWidthSpinner,
1313
// Container,
1414
EditField,
15-
Paragraph,
15+
// Paragraph,
1616
} from '../../../../components';
1717
// import { iconColors, iconSizes } from '../../../../../constants';
1818

@@ -46,6 +46,7 @@ import {
4646
import { toasterTypes } from '../../../../../constants';
4747
import axios from 'axios';
4848
import { routePaths } from '../../../../../routes/routePaths';
49+
import { ToggleField } from '../../../common/FormElement';
4950
// import { SidePopup } from '../../../common/SidePopup';
5051

5152
export const Configuration: React.FC<{
@@ -187,7 +188,16 @@ export const Configuration: React.FC<{
187188
className={styles.field}
188189
/>
189190
</Box>
190-
<FlexBox
191+
<Box marginLeft="xxl2">
192+
<ToggleField
193+
name='Share Component with public'
194+
value={stack.isShared}
195+
onHandleChange={() => onCallApi(stack.name, !stack.isShared)}
196+
label='Share Component with public'
197+
disabled={false}
198+
/>
199+
</Box>
200+
{/* <FlexBox
191201
marginLeft="xxl2"
192202
justifyContent="space-between"
193203
style={{ width: '20%' }}
@@ -203,7 +213,7 @@ export const Configuration: React.FC<{
203213
/>
204214
<span className={`${styles.slider} ${styles.round}`}></span>
205215
</label>
206-
</FlexBox>
216+
</FlexBox> */}
207217
{/* </Container> */}
208218
</FlexBox.Row>
209219
<Box margin="md">

0 commit comments

Comments
 (0)