Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
128 commits
Select commit Hold shift + click to select a range
65a7a36
set more explicit node version
RafaelCenzano Sep 27, 2024
6a1aab9
Add code to handle sign in and sign out through the backend and thus …
RafaelCenzano Oct 11, 2024
c82636d
removed old login and logout logic for new system
RafaelCenzano Oct 11, 2024
f3478df
Setup full auth system (#36)
RafaelCenzano Oct 12, 2024
73e388b
Clean up page by removing confusing navigation
RafaelCenzano Oct 12, 2024
6017217
Remove dummy data and connect to backend
RafaelCenzano Oct 12, 2024
a98ce25
Remove uneeded elements and show profile data
RafaelCenzano Oct 12, 2024
a561f30
Readd Profile Opportunities
RafaelCenzano Oct 12, 2024
f70c141
Clean up data for large text card to output opportunities
RafaelCenzano Oct 12, 2024
1ccd9bc
remove dummy data and complete connection to backend
RafaelCenzano Oct 12, 2024
7d7aef5
Connect Profile page to backend (#38)
RafaelCenzano Oct 12, 2024
22e18d6
modified: package-lock.json
WBroadwell Oct 13, 2024
bf02805
modified: package-lock.json
WBroadwell Oct 15, 2024
902496d
modified: src/App.js
WBroadwell Oct 15, 2024
6f27854
Remove uneeded component
RafaelCenzano Oct 16, 2024
f2ae8d4
Remove uneeded component
RafaelCenzano Oct 16, 2024
74a8d35
Renamed file to more relevant name
RafaelCenzano Oct 16, 2024
7bca2fb
Renamed pages to more relevant name
RafaelCenzano Oct 16, 2024
5e08c33
Update routes to new page names
RafaelCenzano Oct 16, 2024
68129a1
remove static data and proptype checking
RafaelCenzano Oct 16, 2024
39a71f8
updare formatting
RafaelCenzano Oct 16, 2024
b99a21b
Clean up formatting
RafaelCenzano Oct 16, 2024
5fb4ed3
Update page to list all the departments in the db
RafaelCenzano Oct 16, 2024
d14b211
request data and show data for an individual department
RafaelCenzano Oct 16, 2024
68bc147
Formatting improvement
RafaelCenzano Oct 16, 2024
554b17f
Update heading to use dynamic data
RafaelCenzano Oct 16, 2024
8f6d8c0
Update component to take a list and map items to LargeImageCards
RafaelCenzano Oct 16, 2024
9b989d7
List staff in this department
RafaelCenzano Oct 16, 2024
2eef256
\staff\
WBroadwell Oct 18, 2024
f2c0669
Convert update pages to TS (#42)
RafaelCenzano Oct 22, 2024
590db72
Update more files to typescript
RafaelCenzano Oct 22, 2024
8c97b33
Move components out of App.tsx
RafaelCenzano Oct 23, 2024
9f76531
New function to check if user is authenticated given local information
RafaelCenzano Oct 23, 2024
92c9f45
hide vscode items
RafaelCenzano Oct 23, 2024
ab67a41
Fix nav bar items and convert to ts
RafaelCenzano Oct 23, 2024
9b9da27
clean up auth items
RafaelCenzano Oct 23, 2024
7aae8b9
improve auth functions (#44)
RafaelCenzano Oct 23, 2024
5f94efd
Rename to Staff.tsx to make less confusing
RafaelCenzano Oct 23, 2024
52b7f5c
Set navbar to be dynamic based on authenticated status
RafaelCenzano Oct 23, 2024
58cb0e9
Set navbar to be dynamic based on authenticated status
RafaelCenzano Oct 23, 2024
94b5a4f
Move callback functionality to page and checks to ensure items are se…
RafaelCenzano Oct 23, 2024
c534edb
Ensure tokens have been removed before redirect
RafaelCenzano Oct 23, 2024
60c991c
cleanup page
RafaelCenzano Oct 23, 2024
962b6de
Check authenticated status and pass to routes
RafaelCenzano Oct 23, 2024
1e51248
Fix auth routes and dynamic navbar and footer (#46)
RafaelCenzano Oct 23, 2024
063f595
remove console.log
RafaelCenzano Oct 25, 2024
4da9a8c
Creation Form Changes
Sidharth4032 Oct 25, 2024
91d22cb
Reorganize components in places that make more sense
RafaelCenzano Oct 26, 2024
c99a850
Update Profile page prepared for backend work on profile data
RafaelCenzano Oct 26, 2024
408aa70
Create component to handle profile items
RafaelCenzano Oct 26, 2024
2fc01bc
Use new profile components
RafaelCenzano Oct 26, 2024
fab0e2c
Update App.tsx for new typescript file
RafaelCenzano Oct 26, 2024
ba8634f
Update routes to pass in JWT token or redirect to login
RafaelCenzano Oct 26, 2024
d1ce41a
Update routes to pass in JWT token or redirect to login (#53)
RafaelCenzano Oct 26, 2024
813f656
change route to callback
RafaelCenzano Oct 29, 2024
ff1f9ca
Remove timing for auth
RafaelCenzano Oct 29, 2024
96899fc
remove timing
RafaelCenzano Oct 29, 2024
6a8c8dd
new file: docs/react_hooks.txt
WBroadwell Oct 29, 2024
e1ad0d7
Update the callback route for new token retrieval system
RafaelCenzano Oct 29, 2024
fb5c6ec
modified: src/index.css
WBroadwell Oct 29, 2024
8770c37
Improve Auth System (#62)
RafaelCenzano Oct 29, 2024
b4a84b5
modified: package-lock.json
WBroadwell Oct 29, 2024
0047c1d
Will-Frontend (#64)
RafaelCenzano Oct 29, 2024
92d7549
add react helmet
RafaelCenzano Oct 29, 2024
4e61179
Bump http-proxy-middleware from 2.0.6 to 2.0.7 in the npm_and_yarn gr…
dependabot[bot] Oct 29, 2024
cff4160
Create react helmet element
RafaelCenzano Oct 30, 2024
4c07d77
add Helmet Provider to base page
RafaelCenzano Oct 30, 2024
b2359a4
Merge branch 'main' into Sid-Frontend
Sidharth4032 Nov 1, 2024
7ac5712
modified: package-lock.json
Sidharth4032 Nov 1, 2024
9bc33b2
modified: package-lock.json
Sidharth4032 Nov 1, 2024
d0d2d12
Create LICENSE
RafaelCenzano Nov 1, 2024
76bba6a
CreatePost commit (#71)
RafaelCenzano Nov 1, 2024
a7a1f77
Bump uuid from 10.0.0 to 11.0.2 (#70)
dependabot[bot] Nov 1, 2024
9772ac9
Bump @testing-library/jest-dom from 6.5.0 to 6.6.3 (#68)
dependabot[bot] Nov 1, 2024
26f621f
Bump eslint-plugin-react from 7.37.1 to 7.37.2 (#67)
dependabot[bot] Nov 1, 2024
bab6a17
modified: src/App.tsx
WBroadwell Nov 1, 2024
794ed06
Bump daisyui from 4.12.10 to 4.12.14 (#66)
dependabot[bot] Nov 1, 2024
2edfc6b
Bump react-router-dom from 6.26.2 to 6.27.0 (#69)
dependabot[bot] Nov 1, 2024
c4603d3
Use healthcheck
RafaelCenzano Nov 1, 2024
464754e
New SEO helmet
RafaelCenzano Nov 2, 2024
d0f6e41
Add SEO helmet to 404
RafaelCenzano Nov 2, 2024
5751cae
Add SEO helmet to Home page
RafaelCenzano Nov 2, 2024
1fb0f2f
Add SEO helmet to Department page
RafaelCenzano Nov 2, 2024
40b61fb
Add SEO helmet to Departments page
RafaelCenzano Nov 2, 2024
b4c04c9
Add SEO helmet to Staff page
RafaelCenzano Nov 2, 2024
0d5155f
Merge branch 'main' of github.com:LabConnect-RCOS/LabConnect-Frontend…
RafaelCenzano Nov 2, 2024
72a239b
fix weird naming
RafaelCenzano Nov 2, 2024
533815f
Create SEO page
RafaelCenzano Nov 2, 2024
c194804
React Helmet (#74)
RafaelCenzano Nov 2, 2024
fa81a2c
Rename route
RafaelCenzano Nov 5, 2024
4f26c74
Convert page to tsx
RafaelCenzano Nov 5, 2024
28de77a
modified: package-lock.json
WBroadwell Nov 5, 2024
e6c3f71
Merge branch 'main' into Will-Frontend
WBroadwell Nov 5, 2024
cf12c78
modified: package-lock.json
WBroadwell Nov 5, 2024
21f9e7a
modified: src/App.tsx
WBroadwell Nov 5, 2024
dfbc89a
Will-Frontend (#78)
RafaelCenzano Nov 5, 2024
bbab6af
Add authenticated to create and edit page
RafaelCenzano Nov 6, 2024
9894f3c
Update to typescript and fetch backend for options
RafaelCenzano Nov 6, 2024
d5a9afe
add prop checks
RafaelCenzano Nov 6, 2024
7495d83
Update page with SEO and arguments
RafaelCenzano Nov 6, 2024
250bd56
Fix missing key error for list items
RafaelCenzano Nov 6, 2024
775528e
Add post/put to backend routes
RafaelCenzano Nov 6, 2024
58db917
Merge branch 'main' of github.com:LabConnect-RCOS/LabConnect-Frontend…
RafaelCenzano Nov 6, 2024
ae846ee
Fix render errors on sticky footer
RafaelCenzano Nov 12, 2024
3a4a4b7
Convert Checkbox to ts
RafaelCenzano Nov 12, 2024
4d192d4
Adjust creation forms to handle create and edit
RafaelCenzano Nov 12, 2024
1a71132
complete the creation forms component
RafaelCenzano Nov 15, 2024
5360174
Merge branch 'main' of github.com:LabConnect-RCOS/LabConnect-Frontend…
RafaelCenzano Nov 15, 2024
39fa1b4
remove uneeded file
RafaelCenzano Nov 15, 2024
0e30ba6
minor fix
RafaelCenzano Nov 15, 2024
d831475
Create and Edit Opportunities (#82)
RafaelCenzano Nov 15, 2024
cabd8a2
Remove old uneeded files
RafaelCenzano Nov 22, 2024
10b4afd
Create new Auth Context
RafaelCenzano Nov 22, 2024
0d93305
Update auth routes to use the new auth context
RafaelCenzano Nov 22, 2024
9f335cb
move location data to ts file
RafaelCenzano Nov 22, 2024
eb68cac
Update pages to use Auth Context
RafaelCenzano Nov 22, 2024
a636162
Minor Corrections
RafaelCenzano Nov 22, 2024
1574503
add auth context (#83)
RafaelCenzano Nov 22, 2024
d90ec07
Merge branch 'main' into update-profile-page
RafaelCenzano Nov 22, 2024
2837a81
clean up auth context use
RafaelCenzano Nov 22, 2024
9f9bb15
minor fixes to auth things
RafaelCenzano Nov 22, 2024
737aff8
Complete profile page
RafaelCenzano Nov 22, 2024
2052a4f
fix key prop error
RafaelCenzano Nov 22, 2024
f3499b7
fix type
RafaelCenzano Nov 22, 2024
f231f87
fix profile components and profile opportunities
RafaelCenzano Nov 22, 2024
dfd9f30
update staff page
RafaelCenzano Nov 22, 2024
dc096c4
ignore js as those files will be convereted and are riddled with lint…
RafaelCenzano Nov 22, 2024
6e2e2ec
Create Profile Page (#84)
RafaelCenzano Nov 22, 2024
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
2 changes: 2 additions & 0 deletions .github/workflows/docker-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
- "**.jsx"
- "**.ts"
- "**.tsx"
- "package.json"
- "package-lock.json"

jobs:
build:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ jobs:
- name: Run EsLint
uses: sibiraj-s/action-eslint@v3
with:
eslint-args: "src/**/*.{js,jsx,ts,tsx} --max-warnings=0"
extensions: "js,jsx,ts,tsx"
eslint-args: "src/**/*.{ts,tsx} --max-warnings=0"
extensions: "ts,tsx"
annotations: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
node_modules
build
.env
.vscode
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM --platform=linux/amd64 node:22-alpine3.20
FROM --platform=linux/amd64 node:22.9.0-alpine3.20

WORKDIR /app

COPY build /app/build
RUN npm install -g serve

HEALTHCHECK --interval=10s --timeout=5s --start-period=5s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://0.0.0.0:3000 || exit 1
CMD wget --no-verbose --tries=1 --spider http://0.0.0.0:3000/health || exit 1

EXPOSE 3000

Expand Down
201 changes: 201 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.

"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.

"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.

"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.

"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.

"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.

"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).

"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.

"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."

"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.

2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.

3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.

4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:

(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and

(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and

(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and

(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.

You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.

5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.

6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.

7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.

8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.

9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright Copyright 2023 Rafael Cenzano

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
125 changes: 125 additions & 0 deletions docs/react_hooks.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
Introduction to React Hooks

Notes based on https://www.youtube.com/watch?v=LlvBzyy-558

UseState
const [counter, setCounter] = useState(initial_val);

-counter is a variable that is immutable unless setCounter is used
-i.e. setCounter(counter + 1) tied to an onClick button increments counter when button is pressed
-this updates the webpage when counter is changed instead of only rendering the var whern first loaded


UseReducer
const [state, dispatch] = useReducer(reducer, {var1: val, var2: val... etc.});
const reducer = (state, action) => {
switch(action.type) {
case X:
code;
return {var1: state.var1, var2: state.var2...}
case Y:
code;
return {var1: state.var1, var2: state.var2...}
default:
return state;
}
}

-useReducer is used as a multivariable useState, reducer is a function that changes the variables
-state.varX = current value of varX, returns in reducer return every variable even if unchanged
-can call case actions in reducer by using: dispath({type: "case"}) where case is the action name


UseEffect
useEffect(( =>) {
function;
},[list of states to listen to]);

-useEffect is called whenever the page rerenders, including refreshes and state changes
-useful with useState for sending response out
-i.e. data, setData useState and data gets set to response in useEffect


UseRef
const nameRef - useRef(null);

-adding ref={nameRef} as an attr of an input lets you access the current input
-useful for accessing attributes of the element
-can access current value of the input is accessed with: nameRef.current.value;
-can focus on an input field using: nameRef.current.focus();
-can empty input field using: inputRef.current.value = "";
-useful for input submissions, signIn page?


UseLayoutEffect
useLayoutEffect(( =>) {
function;
},[list of states to listen to]);

-called before page renders
-can be useful for changes layout of application before being presented to user
-otherwise similar to useEffect


UseImperativeHandle
CHILD.js
import React, { forwardRef, useImperativeHandle } from "react";
const Child = forwardRef((ref) => {
useImperativeHandle(ref, () => ({
FUNC_NAME() {
function;
},
}));

code;
})

PARENT.js
function Parent() {
const childRef = useRef(null);
return (
<Child ref={childRef} />
<button onClick=() => {childRef.current.FUNC_NAME}
)
}

-lets a parent component alter the state in a child component
-i.e. child can have a state that is changed in FUNC_NAME, which can be called from the main component


UseContext
PARENT.js
import React, { createContext } from "react";
export const Context = createContext(null);

function Parent() {
return (
<Context.Provider value={{states}}>
components in here will have access to Context states
</ Context.Provider>
)
}

CHILD.js
import {Context} from "./Parent";

const {states} = useContext(Context);

-uses Context API
-useful when trying to pass numerous states as props
-Context is essentially a collection of states


UseMemo
not needed

essentially only performs computations once instead of a seperate function that would be
run every time page is rerendered / state changes, would make it more efficient

UseCallback
similar to useMemo

when functions are passed into child components they will get
rerendered on refreshes and state changes in the file that the function originates,
useful for making the function more efficient in that specific case

Loading
Loading