Skip to content

Commit 6afaa6f

Browse files
authored
Merge pull request #2 from HariPeri/new_develop
New Office Hours FrontEnd
2 parents 31fade7 + 48b7ff7 commit 6afaa6f

File tree

6 files changed

+208
-296
lines changed

6 files changed

+208
-296
lines changed

.env.sample

Lines changed: 0 additions & 2 deletions
This file was deleted.

README.md

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,29 @@ This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next
22

33
## Getting Started
44

5-
First, run the development server:
5+
To run the development server, you must first install node modules
66

77
```bash
8+
npm install
89
npm run dev
910
# or
11+
yarn install
1012
yarn dev
1113
# or
14+
pnpm install
1215
pnpm dev
1316
```
1417

1518
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
1619

17-
18-
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/](http://localhost:3000/api/).
19-
20-
The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
21-
2220
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
23-
24-
This project requires an env for the following variables:
25-
```bash
26-
LDAP_API_KEY
27-
JIRA_API_KEY
2821
```
2922
30-
## Project Structure
23+
## Project Structure
3124
3225
`pages/index.js` is where the form for user input is generated. It uses the `components` directory to generate more complex
3326
dropdowns.
3427
35-
`pages/api/form.js` is the only API route in this project. It is responsible for taking the user input and generating the
36-
appropriate JQL query to send to the JIRA API. It also uses the [LDAP API](https://github.com/uvarc/ldap-api) to get the department and school for the visitor.
37-
3828
## TO DO
3929
4030
Currently, assignees for the JIRA ticket are hard-coded as a list inside of `index.js`. This should eventually be abstracted to some other service, or generated from an API call to JIRA.

bin/setup_for_mac.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# exit if fail
2+
set -e
3+
4+
# Check if homebrew is installed (otherwise tell them to install homebrow)
5+
if !command -v brew >/dev/null 2>&1; then
6+
echo "Homebrew not found. Please install Homebrew first!"
7+
exit 1
8+
fi
9+
10+
# Install npm if missing
11+
if ! command -v npm >/dev/null 2>&1; then
12+
echo "npm not found. Installing via Homebrew..."
13+
brew install npm
14+
else
15+
echo "npm is already installed!"
16+
fi
17+
18+
# Install project dependencies (node modules)
19+
echo "Installing npm packages…"
20+
npm install
21+
22+
# start dev
23+
echo "Starting dev server…"
24+
npm run dev

constants.js

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
// Production URL
2+
// export const endpoint_url = "https://uvarc-unified-service.pods.uvarc.io/uvarc/api/ticket/officehours/create_ticket"
3+
// Dev URL [uncomment when in dev environment]
4+
export const endpoint_url = "http://localhost:5000/uvarc/api/ticket/officehours/create_ticket"
5+
6+
// RC-Staff Info
7+
export const rcStaff = [
8+
{ value: "jus2yw", label: "Ahmad Sheikhzada" },
9+
{ value: "aab5zd", label: "Angela Boakye" },
10+
{ value: "kjl5t", label: "Kathryn Linehan" },
11+
{ value: "gpd6kn", label: "Priyanka Prakash" },
12+
{ value: "teh1m", label: "Ed Hall" },
13+
{ value: "gka6a", label: "Gladys Andino" },
14+
{ value: "jmh5ad", label: "Jackie Huband" },
15+
{ value: "khs3z", label: "Karsten Siller" },
16+
{ value: "kah3f", label: "Katherine Holcomb" },
17+
{ value: "mb5wt", label: "Marcus Bobar" },
18+
{ value: "egg3xa", label: "Paul Orndorff" },
19+
{ value: "rs7wz", label: "Ruoshi Sun" },
20+
{ value: "cmd7ag", label: "Camden Duy" },
21+
{ value: "xve5kj", label: "Hana Parece" },
22+
];
23+
24+
// Details Info
25+
const _details = [
26+
"System: Outage",
27+
"System: Performance",
28+
"Access: Allocation/account",
29+
"Access: VPN",
30+
"Access: SSH",
31+
"Access: MobaXterm",
32+
"Access: FastX",
33+
"Access: OOD",
34+
"Access: other",
35+
"OOD: JupyterLab",
36+
"OOD: RStudio",
37+
"OOD: Matlab",
38+
"OOD: Desktop",
39+
"OOD: other",
40+
"File Transfer: Globus",
41+
"File Transfer: DTN",
42+
"File Transfer: CLI tools",
43+
"File Transfer: other",
44+
"HW: Standard",
45+
"HW: Parallel",
46+
"HW: Largemem",
47+
"HW: GPU",
48+
"HW: Condo",
49+
"HW: DB host",
50+
"HW: other",
51+
"Language: C/C++",
52+
"Language: Fortran",
53+
"Language: Python",
54+
"Language: R",
55+
"Language: Matlab",
56+
"Language: Bash",
57+
"Language: other",
58+
"Domain: General HPC/Slurm",
59+
"Domain: HPC Optimization & Parallelization",
60+
"Domain: Software Installs/Containers",
61+
"Domain: Software Development",
62+
"Domain: Databases",
63+
"Domain: AI/ML/DL",
64+
"Domain: Data Science/Data Analytics",
65+
"Domain: Bioinformatics",
66+
"Domain: Image Processing",
67+
"Domain: Computational Chemistry",
68+
"Domain: Text Analysis",
69+
"Domain: Physics",
70+
"Documentation (answer not yet in documentation)",
71+
];
72+
73+
// disciplines info
74+
const _disciplines = [
75+
"Astronomy",
76+
"Biochemistry",
77+
"Bioinformatics",
78+
"Biology",
79+
"Business",
80+
"Chemistry",
81+
"Commerce",
82+
"Computer Science",
83+
"Data Science",
84+
"Economics",
85+
"Education",
86+
"Environmental Science",
87+
"Engineering",
88+
"Health Sciences",
89+
"Informatics",
90+
"Law",
91+
"Physics",
92+
"Social Sciences",
93+
"Other",
94+
]
95+
96+
// Meeting Types Info
97+
const _meetingTypes = [
98+
"Office Hours (walk-in)",
99+
"Consultation (scheduled)",
100+
"Outreach Event (scheduled)",
101+
"Training",
102+
"Other",
103+
]
104+
105+
// Request Types Info
106+
const _requestTypes = [
107+
"Technical Support Tier 1",
108+
"Technical Support Tier 2",
109+
"Consulting Tier 1",
110+
"Consulting Tier 2",
111+
"Provisioning/Deprovisioning",
112+
"Education/Outreach",
113+
]
114+
115+
// Convert to value, label pairs for easy integration w/ inputs
116+
// These objects are the constants that are exportable
117+
const toOption = (str) => ({ value: str, label: str })
118+
119+
export const detailOptions = [
120+
..._details.map(toOption),
121+
]
122+
123+
export const disciplineOptions = [
124+
{ value: "", label: "Select Option", disabled: true },
125+
..._disciplines.map(toOption),
126+
]
127+
128+
export const meetingTypeOptions = [
129+
..._meetingTypes.map(toOption),
130+
]
131+
132+
export const requestTypeOptions = [
133+
{ value: "", label: "Select Option", disabled: true },
134+
..._requestTypes.map(toOption),
135+
]

pages/api/form.js

Lines changed: 0 additions & 164 deletions
This file was deleted.

0 commit comments

Comments
 (0)