Skip to content
This repository was archived by the owner on Jun 28, 2025. It is now read-only.
Merged

Dev #83

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
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ jobs:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
with:
source-directory: client/build
destination-github-username: ${{secrets.DESTINATION_GITHUB_USERNAME}}
destination-repository-name: ${{secrets.DESTINATION_REPOSITORY_NAME}}
destination-github-username: 'axleshift'
destination-repository-name: 'hr2'
target-branch: "hr2-frontend"
user-email: "pedjovensindol.edu@gmail.com"
commit-message: "Build client"
Expand Down Expand Up @@ -85,8 +85,8 @@ jobs:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
with:
source-directory: server
destination-github-username: ${{secrets.DESTINATION_GITHUB_USERNAME}}
destination-repository-name: ${{secrets.DESTINATION_REPOSITORY_NAME}}
destination-github-username: 'axleshift'
destination-repository-name: 'hr2'
target-branch: "hr2-backend"
user-email: "pedjovensindol.edu@gmail.com"
commit-message: "Build server"
2 changes: 1 addition & 1 deletion .github/workflows/label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
repository: "${{secrets.DESTINATION_GITHUB_USERNAME}}/${{secrets.DESTINATION_REPOSITORY_NAME}}"
repository: "axleshift/hr2"
- uses: actions/labeler@v5
with:
repo-token: "${{ secrets.API_TOKEN_GITHUB }}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
terraform:
runs-on: ubuntu-latest
needs: [ docker ]
if: github.repository == 'freight-capstone/hr2'
if: github.repository == 'axleshift/hr2'
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
server/dist
server/dist/public/applicants
server/src/public/applicants
client/build
node_modules/*

30 changes: 27 additions & 3 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"@fortawesome/free-solid-svg-icons": "^6.6.0",
"@fortawesome/react-fontawesome": "^0.2.2",
"@popperjs/core": "^2.11.8",
"@react-oauth/google": "^0.12.1",
"@react-pdf/renderer": "^3.4.4",
"axios": "^1.7.7",
"chart.js": "^4.4.3",
Expand All @@ -47,6 +48,7 @@
"react": "^18.3.1",
"react-calendar": "^5.0.0",
"react-dom": "^18.3.1",
"react-google-button": "^0.8.0",
"react-google-recaptcha": "^3.1.0",
"react-pdf": "^9.1.1",
"react-redux": "^9.1.2",
Expand Down
14 changes: 6 additions & 8 deletions client/src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import React, { Suspense, useEffect } from 'react'
import { BrowserRouter, Route, Routes } from 'react-router-dom'
import { useSelector } from 'react-redux'
import { GoogleOAuthProvider } from '@react-oauth/google'
import AuthProvider from './context/authContext'
import AppProvider from './context/appContext'
import ProtectedRoute from './components/ProtectedRoute'
import { CSpinner, useColorModes } from '@coreui/react'
import './scss/style.scss'
import { config } from './config'

// Containers
const DefaultLayout = React.lazy(() => import('./layout/DefaultLayout'))
Expand All @@ -14,15 +16,13 @@ const DefaultLayout = React.lazy(() => import('./layout/DefaultLayout'))
const Login = React.lazy(() => import('./views/auth/Login'))
const Register = React.lazy(() => import('./views/auth/Register'))
const VerifyEmail = React.lazy(() => import('./views/auth/VerifyEmail'))
const OTPPage = React.lazy(() => import('./views/auth/Otp'))

const Page404 = React.lazy(() => import('./views/errors/Page404'))
const Page500 = React.lazy(() => import('./views/errors/Page500'))

// const Terms = React.lazy(() => import('./views/legal/Terms'))
const Policy = React.lazy(() => import('./views/legal/PolicyTerms'))

// const ApplicantProfilePage = React.lazy(() => import('./views/applicants/ApplicantProfile'))

const App = () => {
const { isColorModeSet, setColorMode } = useColorModes('theme')
const storedTheme = useSelector((state) => state.theme)
Expand All @@ -42,7 +42,7 @@ const App = () => {
}, []) // eslint-disable-line react-hooks/exhaustive-deps

return (
<>
<GoogleOAuthProvider clientId={config.google.oAuth2.clientId}>
<AuthProvider>
<AppProvider>
<BrowserRouter>
Expand All @@ -56,13 +56,11 @@ const App = () => {
<Routes>
<Route path="/login" name="Login Page" element={<Login />} />
<Route path="/register" name="Register Page" element={<Register />} />
<Route path="/otp" name="OTP Page" element={<OTPPage />} />
<Route path="/404" name="Page 404" element={<Page404 />} />
<Route path="/500" name="Page 500" element={<Page500 />} />
<Route path="/PolicyTerms" name="Privacy Policy And Terms" element={<Policy />} />

{/* <Route path="/terms" name="Terms of Service" element={<Terms />} />
<Route path="/policy" name="Privacy Policy" element={<Policy />} /> */}

{/* Protect DefaultLayout route */}
<Route
path="*"
Expand All @@ -78,7 +76,7 @@ const App = () => {
</BrowserRouter>
</AppProvider>
</AuthProvider>
</>
</GoogleOAuthProvider>
)
}

Expand Down
32 changes: 16 additions & 16 deletions client/src/_nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ import {
} from '@fortawesome/free-solid-svg-icons'

const _nav = [
// {
// component: CNavItem,
// name: 'Overview',
// to: '/dashboard/overview',
// icon: <FontAwesomeIcon icon={faDashboard} className="nav-icon" />,
// badge: {
// color: 'danger',
// text: 'unfinished',
// },
// },
{
component: CNavItem,
name: 'Overview',
to: '/dashboard/overview',
icon: <FontAwesomeIcon icon={faDashboard} className="nav-icon" />,
badge: {
color: 'danger',
text: 'unfinished',
},
},
{
component: CNavTitle,
name: 'Recruitment',
Expand All @@ -63,12 +63,12 @@ const _nav = [
to: '/recruitment/jobposts',
icon: <FontAwesomeIcon icon={faAt} className="nav-icon" />,
},
{
component: CNavItem,
name: 'Request',
to: '/recruitment/jobposting/request',
icon: <FontAwesomeIcon icon={faFileAlt} className="nav-icon" />,
},
// {
// component: CNavItem,
// name: 'Request',
// to: '/recruitment/jobposting/request',
// icon: <FontAwesomeIcon icon={faFileAlt} className="nav-icon" />,
// },
{
component: CNavTitle,
name: 'Application Tracking',
Expand Down
38 changes: 22 additions & 16 deletions client/src/api/axios.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,54 +8,61 @@ const instance = axios.create({
baseURL: baseUrl,
withCredentials: true,
headers: {
'Content-Type': 'application/json',
'X-API-KEY': apiKey,
},
})

const handleError = (error) => {
if (axios.isAxiosError(error)) {
// This is an Axios error
return {
status: error.response ? error.response.status : null,
message: error.response ? error.response.data : error.message,
}
} else {
// This is a non-Axios error
return { status: null, message: error.message }
}
}

const post = async (url, data) => {
try {
const response = await instance.post(url, data)
const isFormData = data instanceof FormData

const response = await instance.post(url, data, {
headers: isFormData ? { 'Content-Type': 'multipart/form-data' } : undefined,
})

return response
} catch (error) {
const handledError = handleError(error)
console.error('POST Error:', handledError)
return handledError // return error information
return handledError
}
}

const get = async (url) => {
const put = async (url, data) => {
try {
const response = await instance.get(url)
const isFormData = data instanceof FormData

const response = await instance.put(url, data, {
headers: isFormData ? { 'Content-Type': 'multipart/form-data' } : undefined,
})

return response
} catch (error) {
const handledError = handleError(error)
console.error('GET Error:', handledError)
return handledError // return error information
console.error('PUT Error:', handledError)
return handledError
}
}

const put = async (url, data) => {
const get = async (url) => {
try {
const response = await instance.put(url, data)
const response = await instance.get(url)
return response
} catch (error) {
const handledError = handleError(error)
console.error('PUT Error:', handledError)
return handledError // return error information
console.error('GET Error:', handledError)
return handledError
}
}

Expand All @@ -66,11 +73,10 @@ const del = async (url) => {
} catch (error) {
const handledError = handleError(error)
console.error('DELETE Error:', handledError)
return handledError // return error information
return handledError
}
}

// for fetching files from the server
const getFile = async (url, options = {}) => {
const { responseType = 'blob', headers = {} } = options

Expand All @@ -83,7 +89,7 @@ const getFile = async (url, options = {}) => {
} catch (error) {
const handledError = handleError(error)
console.error('Error fetching file:', handledError)
return handledError // return error information
return handledError
}
}

Expand Down
Loading