Skip to content

Commit 854917f

Browse files
authored
Merge pull request #37 from zenml-io/ahsan/feat/auth-screens
UI updates
2 parents 4e7f302 + 352f537 commit 854917f

File tree

10 files changed

+57
-48
lines changed

10 files changed

+57
-48
lines changed

src/services/locales/zu.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
},
7070
"toasts": {
7171
"successful": {
72-
"text": "Successfully send Password Reset E-Mail."
72+
"text": "Successfully Changed username and full name."
7373
},
7474
"failed": {
7575
"text": "Something went wrong. Please try again."

src/ui/components/forms/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ export const FormPasswordField = (
207207
/>
208208
{props.showPasswordOption && (
209209
<LinkBox
210-
style={{ position: 'absolute', right: '10px', top: '30px' }}
210+
style={{ position: 'absolute', right: '10px', top: '36px' }}
211211
onClick={() => setShowPassword(!showPassword)}
212212
>
213213
<icons.eye

src/ui/layouts/pipelines/Header/CreatePipelineButton.tsx

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,9 @@
3434
// );
3535
// };
3636

37-
import React from 'react';
37+
import React, { useState } from 'react';
3838
import styles from './index.module.scss';
3939

40-
import { useDispatch } from '../../../hooks';
41-
import { showToasterAction } from '../../../../redux/actions';
42-
import { toasterTypes } from '../../../../constants';
43-
4440
import {
4541
Box,
4642
PrimaryButton,
@@ -56,21 +52,20 @@ import { CommandBoxWScroll } from '../../common/CommandBox';
5652
import { constantCommandsToCreatePipeline } from '../../../../constants/constantCommands';
5753

5854
export const CreatePipelineButton: React.FC = () => {
59-
const dispatch = useDispatch();
6055
const [createPipelinePopupOpen, setCreatePipelinePopupOpen] = React.useState<
6156
boolean
6257
>(false);
58+
const [isCopied, setIsCopied] = useState(false)
6359

6460
const codeString = '#!/bin/bash';
6561

6662
const handleCopy = () => {
6763
navigator.clipboard.writeText(codeString);
68-
dispatch(
69-
showToasterAction({
70-
description: 'Command copied to clipboard',
71-
type: toasterTypes.success,
72-
}),
73-
);
64+
65+
setIsCopied(true)
66+
setTimeout(() => {
67+
setIsCopied(false)
68+
}, 2000);
7469
};
7570

7671
return (
@@ -167,7 +162,11 @@ export const CreatePipelineButton: React.FC = () => {
167162
</Box>
168163
</FlexBox> */}
169164

170-
<FlexBox justifyContent="end" marginTop="xl" flexWrap>
165+
<FlexBox justifyContent="space-between" marginTop="xl" flexWrap>
166+
<Box>
167+
{isCopied && (<Paragraph>Copied!</Paragraph>)}
168+
</Box>
169+
171170
<DocumentationLink
172171
text={constantCommandsToCreatePipeline.documentation}
173172
/>

src/ui/layouts/pipelines/Header/index.module.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44
height: 4rem;
55
}
66

7+
.iconStyle {
8+
background-color: #F4F4F4;
9+
text-align: center;
10+
height: 35px;
11+
width: 40px;
12+
border-radius: 3px;
13+
cursor: pointer;
14+
}
15+
716
@media (max-width: $md-breakpoint) {
817
.dynamicHeaderRight {
918
margin-right: auto !important;

src/ui/layouts/settings/EmailPopup.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
} from '../../components';
1212
import { getTranslateByScope } from '../../../services';
1313
import { Popup } from '../common/Popup';
14-
import { showToasterAction } from '../../../redux/actions';
14+
import { showToasterAction, userActions } from '../../../redux/actions';
1515
import { toasterTypes } from '../../../constants';
1616

1717
import { fetchApiWithAuthRequest } from '../../../api/fetchApi';
@@ -40,7 +40,7 @@ export const EmailPopup: React.FC<{
4040
const changeEmail = async () => {
4141
setSubmitting(true);
4242
try {
43-
const v = fetchApiWithAuthRequest({
43+
await fetchApiWithAuthRequest({
4444
url: apiUrl(endpoints.users.updateUser(userId)),
4545
method: httpMethods.put,
4646
authenticationToken,
@@ -57,7 +57,7 @@ export const EmailPopup: React.FC<{
5757
type: toasterTypes.success,
5858
}),
5959
);
60-
60+
await dispatch(userActions.getMy({}));
6161
} catch (err) {
6262
setSubmitting(false);
6363
setPopupOpen(false);

src/ui/layouts/settings/Organization/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const Organization: React.FC = () => {
3131
const members = useSelector(organizationSelectors.myMembers);
3232
const memberHeaderCols = useMemberHeaderCols();
3333

34-
useRequestOnMount(organizationActions.getMy);
34+
// useRequestOnMount(organizationActions.getMy);
3535
useRequestOnMount(organizationActions.getRoles);
3636

3737
useEffect(() => {

src/ui/layouts/settings/Plan/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { ExplorerPlan } from './ExplorerPlan';
1818

1919
export const Plan: React.FC = () => {
2020
useRequestOnMount(() => stripeActions.getSubscription({}));
21-
useRequestOnMount(() => billingActions.getOrganizationBilling({}));
21+
// useRequestOnMount(() => billingActions.getOrganizationBilling({}));
2222
useRequestOnMount(() => stripeActions.getPaymentMethod({}));
2323

2424
const currentSubscription = useSelector(stripeSelectors.currentSubscription);

src/ui/layouts/stackComponents/Header/CreatePipelineButton.tsx

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
import React from 'react';
1+
import React, { useState } from 'react';
22
import styles from './index.module.scss';
33

4-
import { useDispatch, useLocationPath } from '../../../hooks';
5-
import { showToasterAction } from '../../../../redux/actions';
6-
import { toasterTypes } from '../../../../constants';
4+
import { useLocationPath } from '../../../hooks';
75

86
import {
97
Box,
@@ -22,21 +20,20 @@ import { camelCaseToParagraph } from '../../../../utils';
2220

2321
export const CreatePipelineButton: React.FC = () => {
2422
const locationPath = useLocationPath();
25-
const dispatch = useDispatch();
2623
const [createPipelinePopupOpen, setCreatePipelinePopupOpen] = React.useState<
2724
boolean
2825
>(false);
29-
26+
const [isCopied, setIsCopied] = useState(false)
27+
3028
const codeString = '#!/bin/bash';
3129

3230
const handleCopy = () => {
3331
navigator.clipboard.writeText(codeString);
34-
dispatch(
35-
showToasterAction({
36-
description: 'Command copied to clipboard',
37-
type: toasterTypes.success,
38-
}),
39-
);
32+
33+
setIsCopied(true)
34+
setTimeout(() => {
35+
setIsCopied(false)
36+
}, 2000);
4037
};
4138

4239
return (
@@ -162,7 +159,11 @@ export const CreatePipelineButton: React.FC = () => {
162159
</Box>
163160
</FlexBox> */}
164161

165-
<FlexBox justifyContent="end" marginTop="xl" flexWrap>
162+
<FlexBox justifyContent="space-between" marginTop="xl" flexWrap>
163+
<Box>
164+
{isCopied && (<Paragraph>Copied!</Paragraph>)}
165+
</Box>
166+
166167
<DocumentationLink
167168
text={constantCommandsToCreateComponent.documentation}
168169
/>

src/ui/layouts/stackComponents/StackDetail/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ export const StackDetail: React.FC = () => {
152152
<Box>
153153
<Paragraph style={headStyle}>Created</Paragraph>
154154
<Paragraph style={paraStyle}>
155-
{formatDateToDisplay(stackComponent.createdAt)}
155+
{formatDateToDisplay(stackComponent.created)}
156156
</Paragraph>
157157
</Box>
158158
</Box>

src/ui/layouts/stacks/Header/CreateStackButton.tsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
import React from 'react';
1+
import React, { useState } from 'react';
22
import styles from './index.module.scss';
33

4-
import { useDispatch } from '../../../hooks';
5-
import { showToasterAction } from '../../../../redux/actions';
6-
import { toasterTypes } from '../../../../constants';
7-
84
import {
95
Box,
106
PrimaryButton,
@@ -20,21 +16,21 @@ import { CommandBoxWScroll } from '../../common/CommandBox';
2016
import { constantCommandsToCreateStack } from '../../../../constants/constantCommands';
2117

2218
export const CreateStackButton: React.FC = () => {
23-
const dispatch = useDispatch();
2419
const [createStackPopupOpen, setCreateStackPopupOpen] = React.useState<
2520
boolean
2621
>(false);
22+
const [isCopied, setIsCopied] = useState(false)
2723

2824
const codeString = '#!/bin/bash';
2925

3026
const handleCopy = () => {
3127
navigator.clipboard.writeText(codeString);
32-
dispatch(
33-
showToasterAction({
34-
description: 'Command copied to clipboard',
35-
type: toasterTypes.success,
36-
}),
37-
);
28+
29+
setIsCopied(true)
30+
setTimeout(() => {
31+
setIsCopied(false)
32+
}, 2000);
33+
3834
};
3935

4036
return (
@@ -59,7 +55,7 @@ export const CreateStackButton: React.FC = () => {
5955
<FlexBox alignItems="center" marginTop="md">
6056
<CommandBoxWScroll command={item.text} />
6157
<Box
62-
className={styles.iconStyle}
58+
className={styles.iconStyle}
6359
style={{ paddingTop: '7px' }}
6460
onClick={handleCopy}
6561
>
@@ -131,7 +127,11 @@ export const CreateStackButton: React.FC = () => {
131127
</Box>
132128
</FlexBox> */}
133129

134-
<FlexBox justifyContent="end" marginTop="xl" flexWrap>
130+
<FlexBox justifyContent="space-between" marginTop="xl" flexWrap>
131+
<Box>
132+
{isCopied && (<Paragraph>Copied!</Paragraph>)}
133+
</Box>
134+
135135
<DocumentationLink
136136
text={constantCommandsToCreateStack.documentation}
137137
/>

0 commit comments

Comments
 (0)