Skip to content

Commit

Permalink
chore: ran prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
kituuu committed May 19, 2024
1 parent d976df1 commit 5fb5aa2
Show file tree
Hide file tree
Showing 31 changed files with 173 additions and 218 deletions.
1 change: 0 additions & 1 deletion frontend/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
href="https://fonts.googleapis.com/css?family=Poppins"
rel="stylesheet"
/>


<title>Tracer</title>
</head>
Expand Down
20 changes: 19 additions & 1 deletion frontend/public/site.webmanifest
Original file line number Diff line number Diff line change
@@ -1 +1,19 @@
{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}
{
"name": "",
"short_name": "",
"icons": [
{
"src": "/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}
16 changes: 0 additions & 16 deletions frontend/src/app/api/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,6 @@ export interface IconNameRes {
message: string;
}








export const uploadIcon = async (
authorizationToken: string,
orgName: string,
Expand All @@ -35,10 +28,6 @@ export const uploadIcon = async (
return respnse;
};





export const getIcon = async (authorizationToken: string, orgName: string) => {
const url = BACKEND_URL + '/api/protected/file/getIcon/' + orgName;
const response = await axios.get(
Expand All @@ -55,8 +44,6 @@ export const getIcon = async (authorizationToken: string, orgName: string) => {
return response;
};



export const deleteFile = async (
authorizationToken: string,
fileName: string
Expand All @@ -71,9 +58,6 @@ export const deleteFile = async (
return respnse;
};




export const getIconName = async (
authorizationToken: string,
orgName: string
Expand Down
1 change: 0 additions & 1 deletion frontend/src/app/api/githubData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export interface ProjectStats {
contributors: Contributors;
}


export interface OrgProjectGithubData {
projects: ProjectsGithubData;
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/components/search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import './index.scss';

const SearchBar = () => {
const dispatch = useDispatch();
const [search,setSearch] = useState('')
const [search, setSearch] = useState('');
const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
setSearch(e.target.value);
};
Expand Down
4 changes: 1 addition & 3 deletions frontend/src/app/components/timeRangeSwitch/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ interface Props {
const TimeRangeSwitch: React.FC<Props> = ({ weekly, setWeekly }) => {
// const dispatch = useDispatch();
// const isWeekly = useSelector((state: timeRangeModel) => state.isWeekly.value);
useEffect(()=>{

},[weekly, setWeekly])
useEffect(() => {}, [weekly, setWeekly]);
return (
<div className='timerange-cont'>
<button
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/context/user/userState.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FC, ReactNode, useState } from 'react';
import UserContext from './userContext';
import { UserOrgs } from 'app/api/user';
import { UserOrgs } from 'app/api/user';

interface Props {
children: ReactNode;
Expand Down
5 changes: 2 additions & 3 deletions frontend/src/app/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ a:hover {
border: 1px solid white;
}


.pointer{
.pointer {
cursor: pointer;
}
}
1 change: 0 additions & 1 deletion frontend/src/app/routes/BasicRoutes.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import { Routes, Route } from 'react-router-dom';
import ProjectPage from 'features/project';
import AddProject from 'features/AddProject';
Expand Down
7 changes: 3 additions & 4 deletions frontend/src/envConstants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export const CLIENT_ID =process.env.REACT_APP_CLIENT_ID;
export const BACKEND_URL = process.env.REACT_APP_BACKEND_URL;
export const AVATAR_API = process.env.REACT_APP_AVATAR_API;

export const CLIENT_ID = process.env.CLIENT_ID;
export const BACKEND_URL = process.env.BACKEND_URL;
export const AVATAR_API = process.env.AVATAR_API;
1 change: 0 additions & 1 deletion frontend/src/features/AddProject/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,4 @@
word-wrap: break-word; /* Allows breaking long words */
white-space: normal; /* Ensures normal word wrapping */
margin-top: 5px; /* Adds some spacing above the error message */

}
9 changes: 7 additions & 2 deletions frontend/src/features/AddProject/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ const AddProject = () => {
autoComplete='off'
noValidate
>
<div className='input-title'>Name<span style={{color:'red',paddingLeft:'4px'}}>*</span></div>
<div className='input-title'>
Name<span style={{ color: 'red', paddingLeft: '4px' }}>*</span>
</div>
<input
type='text'
placeholder='Project name'
Expand All @@ -158,7 +160,10 @@ const AddProject = () => {
required
/>
{formErrors.name && <p className='form-error'>{formErrors.name}</p>}
<div className='input-title'>Project link<span style={{color:'red',paddingLeft:'4px'}}>*</span></div>
<div className='input-title'>
Project link
<span style={{ color: 'red', paddingLeft: '4px' }}>*</span>
</div>
<input
type='text'
value={form.link}
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/features/AddProject/utils.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
export function isGitHubRepositoryLink(link: string): boolean {
const githubRepoPattern =
/^https:\/\/github\.com\/[a-zA-Z0-9-]+\/[a-zA-Z0-9-]+$/;
const githubRepoPattern2 =
const githubRepoPattern2 =
/^https:\/\/github\.com\/[a-zA-Z0-9-]+\/[a-zA-Z0-9-]+(\.git)?$/;
return (githubRepoPattern.test(link) || githubRepoPattern2.test(link));
return githubRepoPattern.test(link) || githubRepoPattern2.test(link);
}

export function isValidName(input: string): boolean {
Expand Down
1 change: 0 additions & 1 deletion frontend/src/features/AddWorkspace/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ $breakpoint-tablet: 768px;
}
.add-member-button:disabled {
background-color: grey;

}
}

Expand Down
18 changes: 7 additions & 11 deletions frontend/src/features/AddWorkspace/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,13 @@ const AddWorkspace = () => {
description: desc_error,
});
if (workspace_error || desc_error) {
if (workspace_error)
toast.error('Check workspace field');
if (desc_error) toast.error("Check description field")
}
else {
if (workspace_error) toast.error('Check workspace field');
if (desc_error) toast.error('Check description field');
} else {
if (token) {
const newForm = form;
if (!form.description) {
newForm.description = " "
newForm.description = ' ';
}
const func = async (): Promise<void> => {
const dataRes = await addOrg(token, {
Expand Down Expand Up @@ -217,9 +215,7 @@ const AddWorkspace = () => {
noValidate
>
<div className='single-form-element-container'>
<p className='label'>
Add Icon
</p>
<p className='label'>Add Icon</p>
<div className='file-input-container'>
<label htmlFor='icon-file' className='file-label'>
Choose image files here
Expand Down Expand Up @@ -297,8 +293,8 @@ const AddWorkspace = () => {
type='button'
disabled={
form.member
? (!users.includes(form.member) &&
form.member == userContext?.username)
? !users.includes(form.member) &&
form.member == userContext?.username
: true
}
>
Expand Down
20 changes: 10 additions & 10 deletions frontend/src/features/AddWorkspace/types.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { ChangeEvent, FormEvent } from 'react';

export type _WORKSPACE_FORM_ERROR = {
workspace: string | null;
description: string | null;
image: string | null;
member: string | null;
workspace: string | null;
description: string | null;
image: string | null;
member: string | null;
};
export type _WORKSPACE_FORM = {
workspace: string;
description: string;
image: File | undefined;
members: string[];
member:string;
};
workspace: string;
description: string;
image: File | undefined;
members: string[];
member: string;
};
export type _WORKSPACE_FORM_CHANGE = (
event: ChangeEvent<HTMLInputElement>,
index?: number
Expand Down
13 changes: 4 additions & 9 deletions frontend/src/features/EditProject/index.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
import { ChangeEvent, useEffect, useState } from 'react';
import { ChangeEvent, useEffect, useState } from 'react';
import './index.scss';
// import tick from '../../app/assets/images/tick.png';
import { useNavigate, useParams } from 'react-router-dom';
import toast from 'react-hot-toast';
import {
getProject,
updateProject,
} from 'app/api/project';
import { Projects, getOrgProjects } from 'app/api/organization';


import { getProject, updateProject } from 'app/api/project';
import { Projects, getOrgProjects } from 'app/api/organization';

const EditProject = () => {
const navigate = useNavigate();
Expand Down Expand Up @@ -144,7 +139,7 @@ const EditProject = () => {
</form>
<button className='add-project-btn' onClick={SubmitHandler}>
{/* <img src={tick} alt='' /> */}
Done
Done
</button>
</div>
</div>
Expand Down
22 changes: 6 additions & 16 deletions frontend/src/features/EditWorkspace/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
import { getAllUser, getUser } from 'app/api/user';
import { ChangeEvent, useContext, useEffect, useState } from 'react';
import { ChangeEvent, useContext, useEffect, useState } from 'react';
import { useNavigate, useParams } from 'react-router-dom';
import toast from 'react-hot-toast';
import {

getAllOrgs,
getOrg,
updateOrg,
} from 'app/api/organization';
import { getAllOrgs, getOrg, updateOrg } from 'app/api/organization';
import { uploadIcon } from 'app/api/file';

import './index.scss';
Expand All @@ -25,7 +20,6 @@ const EditWorkspace = () => {
const [validName, setValidName] = useState<boolean>(false);
const [uniqueName, setUniqueName] = useState<boolean>(false);


const [users, setUsers] = useState<string[]>([]);
const [orgs, setOrgs] = useState<string[]>([]);

Expand Down Expand Up @@ -119,15 +113,11 @@ const EditWorkspace = () => {
description: description,
});


if (selectedFile != null) {
try{
if (selectedFile != null) {
try {
const fileRes = await uploadIcon(token, name, selectedFile);
}catch(e){

}
}

} catch (e) {}
}

navigate('/');
};
Expand Down
7 changes: 2 additions & 5 deletions frontend/src/features/ProjectAddMember /index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@

import { ChangeEvent, useContext, useEffect, useState } from 'react';
import { ChangeEvent, useContext, useEffect, useState } from 'react';
import { useNavigate, useParams } from 'react-router-dom';
import { AVATAR_API } from 'envConstants';
import { AVATAR_URL } from 'app/constants/api';
import toast from 'react-hot-toast';
import {
getOrgMembers,
} from 'app/api/organization';
import { getOrgMembers } from 'app/api/organization';

import './index.scss';
import UserContext from 'app/context/user/userContext';
Expand Down
8 changes: 2 additions & 6 deletions frontend/src/features/WorkspaceAddMember/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import { getAllUser, getUser } from 'app/api/user';
import { ChangeEvent, useContext, useEffect, useState } from 'react';
import { ChangeEvent, useContext, useEffect, useState } from 'react';
import { useNavigate, useParams } from 'react-router-dom';
import toast from 'react-hot-toast';
import {
addOrgMembers,
getOrgMembers,
} from 'app/api/organization';

import { addOrgMembers, getOrgMembers } from 'app/api/organization';

import './index.scss';
import UserContext from 'app/context/user/userContext';
Expand Down
1 change: 0 additions & 1 deletion frontend/src/features/login/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import { CLIENT_ID } from '../../envConstants';
import { useNavigate, useSearchParams } from 'react-router-dom';
import { login } from 'app/api/login';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@

import {
changeProjectMembersStatus,
removeProjectMembers,
} from 'app/api/project';
import UserContext from 'app/context/user/userContext';
import {
ChangeEvent,
useContext,
} from 'react';
import { ChangeEvent, useContext } from 'react';
import toast from 'react-hot-toast';

const MemberCard = ({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import './index.scss';
import contributorPropTypes from 'app/models/contributorPropTypes';
import { AVATAR_API } from 'envConstants';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import { changeOrgMembersStatus, removeOrgMembers } from 'app/api/organization';
import UserContext from 'app/context/user/userContext';
import {
ChangeEvent,
useContext,
} from 'react';
import { ChangeEvent, useContext } from 'react';
import toast from 'react-hot-toast';

const MemberCard = ({
Expand Down
Loading

0 comments on commit 5fb5aa2

Please sign in to comment.