Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ interface TInvite {
organizationName: string;
code: string;
email: string;
name: string;
createdAt: Date;
}

Expand All @@ -60,7 +61,8 @@ interface TMember {
organizationId: string;
fullName: string;
email: string;
created_at: Date;
name: string;
created: Date;
active: boolean;
activation_token: string;
}
Expand Down
9 changes: 3 additions & 6 deletions src/api/organizations/inviteApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,19 @@ import mockApi from '../mockApiData';
const inviteApi = ({
authenticationToken,
name,
email,
}: {
authenticationToken: string;
name: string;
email: string;
}): Promise<void> =>
fetchApiWithAuthRequest({
}): Promise<void> =>
fetchApiWithAuthRequest({
url: apiUrl(endpoints.organizations.invite),
method: httpMethods.post,
authenticationToken,
headers: {
'Content-Type': 'application/json',
},
data: JSON.stringify({
name,
email,
name
}),
}).catch((res) => {
if (process.env.REACT_APP_MOCKAPI_RESPONSE) {
Expand Down
6 changes: 3 additions & 3 deletions src/api/session/emailUpdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import { apiUrl } from '../apiUrl';

const emailUpdate = ({
userId,
email,
fullName,
name,
authenticationToken,
}: {
userId: string,
email: string
fullName: string
name: string;
authenticationToken: string;
}): Promise<TUser> =>
Expand All @@ -21,7 +21,7 @@ const emailUpdate = ({
headers: {
'Content-Type': 'application/json',
},
data: { email, name },
data: { full_name: fullName, name },
});

export default emailUpdate;
5 changes: 3 additions & 2 deletions src/api/session/loginApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ interface Params {
// password: account.password,
// }),
// }).catch((res) => {
// // if (process.env.REACT_APP_MOCKAPI_RESPONSE) {
// if (process.env.REACT_APP_MOCKAPI_RESPONSE) {
// res = {
// data: mockApi.loginMockResponse,
// };
// // }
// }
// return res;
// });

Expand All @@ -50,4 +50,5 @@ const loginApi = ({ account }: Params): Promise<Response> =>
password: account.password,
}),
});

export default loginApi;
7 changes: 4 additions & 3 deletions src/api/session/signUpApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ export interface Response {
}

interface NewAccount {
userId: string;
username: string;
fullname: any;
fullName: any;
email: string;
password: string;
token: string;
Expand All @@ -22,14 +23,14 @@ interface Params {

const signUpApi = ({ account }: Params): Promise<void> =>
fetchApi({
url: apiUrl(endpoints.signup(account.username)),
url: apiUrl(endpoints.signup(account.userId)),
method: httpMethods.put,
headers: {
'Content-Type': 'application/json',
},
data: JSON.stringify({
name: account.username,
full_name: account.fullname,
full_name: account.fullName,
email: account.email,
password: account.password,
activation_token: account.token
Expand Down
2 changes: 1 addition & 1 deletion src/api/users/getMyUserApi.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { fetchApiWithAuthRequest } from '../fetchApi';
import { endpoints } from '../endpoints';
import { endpoints } from '../endpoints';
import { httpMethods } from '../constants';
import { apiUrl } from '../apiUrl';
import mockApi from '../mockApiData';
Expand Down
4 changes: 1 addition & 3 deletions src/redux/actions/organizations/inviteAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ import inviteApi from '../../../api/organizations/inviteApi';

export const inviteAction = ({
name,
email,
onFailure,
onSuccess,
}: {
name: string;
email: string;
onFailure?: (err: any) => void;
onSuccess?: () => void;
}): TRequestAction => ({
Expand All @@ -18,7 +16,7 @@ export const inviteAction = ({
isAuthenticated: true,
failureActionType: organizationActionTypes.invite.failure,
successActionType: organizationActionTypes.invite.success,
params: { name, email },
params: { name },
onFailure,
onSuccess,
},
Expand Down
6 changes: 3 additions & 3 deletions src/redux/actions/session/emailUpdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import emailUpdateApi from '../../../api/session/emailUpdate';

export const emailUpdateAction = ({
userId,
email,
fullName,
name,
onSuccess,
onFailure,
}: {
userId: string;
email: string;
fullName: string;
name: string;
onSuccess?: () => void;
onFailure?: () => void;
Expand All @@ -22,6 +22,6 @@ export const emailUpdateAction = ({
successActionType: updateEmailTypes.success,
onSuccess,
onFailure,
params: { userId, email, name },
params: { userId, fullName, name },
},
});
3 changes: 3 additions & 0 deletions src/redux/actions/session/signupAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { signupActionTypes } from '../../actionTypes';
import signUpApi from '../../../api/session/signUpApi';

export const signUpAction = ({
userId,
username,
email,
fullName,
Expand All @@ -10,6 +11,7 @@ export const signUpAction = ({
onSuccess,
onFailure,
}: {
userId: string;
username: string;
email: string;
fullName: string;
Expand All @@ -28,6 +30,7 @@ export const signUpAction = ({
onFailure,
params: {
account: {
userId,
username,
email,
fullName,
Expand Down
23 changes: 11 additions & 12 deletions src/services/locales/zu.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@
"label": "Change Password",
"button": "Change Password"
},
"emailNameReset": {
"label": "Change Email and Username",
"button": "Change Email and Username"
"nameReset": {
"label": "Save Changes",
"button": "Save Changes"
},
"toasts": {
"successful": {
Expand All @@ -76,8 +76,8 @@
}
},
"popup": {
"title": "Change Email and Username",
"text": "Are you sure to change your email and username",
"title": "Change full name and Username",
"text": "Are you sure to change your full name and username",
"successButton": {
"text": "Yes"
},
Expand Down Expand Up @@ -165,11 +165,10 @@
},
"popup": {
"title": "Add a new Member",
"email": {
"label": "Email",
"placeholder": "Email",
"required": "Email is required",
"invalidEmail": "Email is not valid"
"username": {
"label": "Username",
"placeholder": "Username",
"required": "Username is required"
},
"role": {
"label": "Role",
Expand All @@ -180,8 +179,8 @@
"text": "Invite"
},
"generateInviteModal": {
"title": "Invitation Token",
"text": "Click generate token to re-generate invitation for",
"title": "New Invitation Token",
"text": " Generate a new invite token for",
"button": {
"text": "Generate Token"
}
Expand Down
2 changes: 1 addition & 1 deletion src/ui/components/forms/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export const CopyField = (
};

return (
<FlexBox.Column fullWidth>
<FlexBox.Column fullWidth style={{ height: '100px' }}>
<FlexBox alignItems="center" fullWidth style={{ position: 'relative' }}>
<InputWithLabel
name={props.name}
Expand Down
5 changes: 2 additions & 3 deletions src/ui/layouts/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import React, { useState, useEffect } from 'react';
import { AuthenticatedLayout } from './common/layouts/AuthenticatedLayout';

import { SidebarContainer } from './common/layouts/SidebarContainer';
import {
Box,
Expand Down Expand Up @@ -66,15 +65,15 @@ export const Home: React.FC = () => {

useEffect(() => {
const getDashboardData = async () => {
const { data } = await axios.get(`http://localhost:8080/v1/projects/${DEFAULT_PROJECT_NAME}/statistics`, {
const { data } = await axios.get(`${process.env.REACT_APP_BASE_API_URL}/projects/${DEFAULT_PROJECT_NAME}/statistics`, {
headers: {
'Authorization': `bearer ${authToken}`
}
})
setDashboardData(data)
}
getDashboardData()
}, [])
}, [authToken])

const preData = Object.entries(dashboardData)
const data = preData?.map(([key, value]) => {
Expand Down
2 changes: 0 additions & 2 deletions src/ui/layouts/common/Table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
H3,
Truncate,
FullWidthSpinner,
// FullWidthSpinner,
} from '../../../components';
import { getPaginationData } from '../../../../utils/pagination';
import { Pagination } from '../Pagination';
Expand Down Expand Up @@ -69,7 +68,6 @@ export const Table: React.FC<TableProps> = ({
<FlexBox.Column className={styles.tableWrapper} fullWidth>
<IfElse
condition={tableRows.length > 0 && !loading}
// condition={tableRows.length > 0}
renderWhenTrue={() => (
<>
<table className={styles.table}>
Expand Down
Loading