Merging the Recruitment Form (Frontend + Captcha) into Dev Branch #36

Open
ahmad.ahmad1 wants to merge 6 commits from rform into dev
Member
No description provided.
Recruitment Form done
All checks were successful
Deploy to Cloudflare Pages / deploy (push) Successful in 1m23s
226faa1d73
Added captcha
Some checks failed
Deploy to Cloudflare Pages / deploy (push) Failing after 1m2s
ae04b7ba93
Added runes, made the code a bit more PR ready, de-AIed it a little
Some checks failed
Deploy to Cloudflare Pages / deploy (push) Failing after 53s
10dd5ff4be
Added env to yaml
All checks were successful
Deploy to Cloudflare Pages / deploy (push) Successful in 1m29s
Deploy to Cloudflare Pages / deploy (pull_request) Successful in 1m21s
748d78cf77
@ -0,0 +1,535 @@
<script lang="ts">

I see more AI

I see more AI
ahmad.ahmad1 marked this conversation as resolved
Owner

completes #33

completes #33
cnidariaware left a comment

make the changes commented

make the changes commented
@ -0,0 +1,535 @@
<script lang="ts">
import TopBanner from '$lib/components/TopBanner.svelte';

change dir to recruitment

change dir to recruitment
ahmad.ahmad1 marked this conversation as resolved
@ -0,0 +12,4 @@
let email = $state('');
let ucid = $state('');
let isSubmitting = $state(false);
let submitError = $state('');

why are any of these needed, these should be read from a FormObject

why are any of these needed, these should be read from a FormObject
ahmad.ahmad1 marked this conversation as resolved
@ -0,0 +28,4 @@
let major = $state('');
let majorOther = $state('');
let isOtherMajor = $derived(major.startsWith('Other'));

Also not needed

Also not needed
ahmad.ahmad1 marked this conversation as resolved
@ -0,0 +33,4 @@
let year_of_study = $state('');
const availabilityOptions = ['Yes', 'No', 'Partial'];
let availability = $state('');

Again more unneed states

Again more unneed states
ahmad.ahmad1 marked this conversation as resolved
@ -0,0 +53,4 @@
let interest_question = $state('');
const teamQuestionText: Record<string, string> = {

create a lib module instead and just import it

create a lib module instead and just import it
ahmad.ahmad1 marked this conversation as resolved
@ -0,0 +48,4 @@
'Business'
];
let first_preference_sub_team = $state('');

remove

remove
ahmad.ahmad1 marked this conversation as resolved
@ -0,0 +49,4 @@
];
let first_preference_sub_team = $state('');
let second_preference_sub_team = $state('');

remove

remove
ahmad.ahmad1 marked this conversation as resolved
@ -0,0 +51,4 @@
let first_preference_sub_team = $state('');
let second_preference_sub_team = $state('');
let interest_question = $state('');

remove

remove
ahmad.ahmad1 marked this conversation as resolved
@ -0,0 +71,4 @@
// Store answers keyed by team name: answers['Software'] = '...'
let technical_question_internal = $state<Partial<Record<QuestionTeam, string>>>({});

unneeded state

unneeded state
ahmad.ahmad1 marked this conversation as resolved
@ -0,0 +106,4 @@
}
});
function getRecaptchaToken(action: string): Promise<string> {

JS docs please see here

JS docs please see [here](https://forge.ucalgarybaja.ca/ucalgary-baja/Baja-Coding-Practices/src/branch/master/Function%20Standards.md#javascript)
ahmad.ahmad1 marked this conversation as resolved
@ -0,0 +126,4 @@
});
}
async function handleSubmit(e: SubmitEvent) {

JS docs please see here

JS docs please see [here](https://forge.ucalgarybaja.ca/ucalgary-baja/Baja-Coding-Practices/src/branch/master/Function%20Standards.md#javascript)
ahmad.ahmad1 marked this conversation as resolved
@ -0,0 +133,4 @@
submitError = '';
if (!form.reportValidity()) return;

why?

why?
ahmad.ahmad1 marked this conversation as resolved
@ -0,0 +195,4 @@
<div class="wrap">
<h2>UCalgary Baja Recruitment Form</h2>
<p class="sub" style="font-style: italic">

replace the style with an <i> tag

replace the style with an ```<i>``` tag

what?

what?
ahmad.ahmad1 marked this conversation as resolved
@ -0,0 +157,4 @@
recaptchaToken
};
const res = await fetch('/recruitmentform', {

remove with an if statement, and replace later with the actual backend url

In its place just console.log() with the payload

remove with an if statement, and replace later with the actual backend url In its place just console.log() with the payload
ahmad.ahmad1 marked this conversation as resolved
@ -0,0 +159,4 @@
const res = await fetch('/recruitmentform', {
method: 'POST',
headers: {

remove this is not needed

remove this is not needed
ahmad.ahmad1 marked this conversation as resolved
@ -0,0 +191,4 @@
<script
src={`https://www.google.com/recaptcha/api.js?render=${PUBLIC_RECAPTCHA_SITE_KEY}`}
></script>
</svelte:head>

remove svelte:head that is AI

remove svelte:head that is AI
ahmad.ahmad1 marked this conversation as resolved
@ -0,0 +299,4 @@
<div class="row">
<label for="sub-team-descriptions">Sub-Team Descriptions:</label>
<p id="sub-team-descriptions" class="hint">
<b>Chassis</b> – The chassis involves the car's frame, providing support for all the other

AI em dashes, remove

AI em dashes, remove
ahmad.ahmad1 marked this conversation as resolved
@ -0,0 +353,4 @@
{@const team = t as QuestionTeam}
<div class="row" style="margin-top: 12px;">
<label for={`${team}-question-answer`}

this is AI, remove the ` and $

this is AI, remove the ` and $
ahmad.ahmad1 marked this conversation as resolved
@ -0,0 +454,4 @@
font-weight: normal;
white-space: nowrap;
}
@media (max-width: 1000px) {

change to 800px

change to 800px
ahmad.ahmad1 marked this conversation as resolved
@ -0,0 +365,4 @@
{/if}
<input
id={`${team}-question-answer`}

same here as above

same here as above
ahmad.ahmad1 marked this conversation as resolved
@ -0,0 +1,87 @@
import { json } from '@sveltejs/kit';

remove file not needed as we are creating a backend

remove file not needed as we are creating a backend
ahmad.ahmad1 marked this conversation as resolved
@ -0,0 +60,4 @@
color: black;
}
@media (max-width: 600px) {

should be same as the form, 800px

should be same as the form, 800px
ahmad.ahmad1 marked this conversation as resolved
fixed comments
All checks were successful
Deploy to Cloudflare Pages / deploy (push) Successful in 1m20s
Deploy to Cloudflare Pages / deploy (pull_request) Successful in 1m9s
985235c570
cnidariaware left a comment

Make these changes
and rejected
frik

Make these changes and rejected ![frik](/attachments/9a792988-26a8-4162-81ab-7089d9528d21)
frik.gif
17 MiB
@ -0,0 +8,4 @@
execute: (siteKey: string, options: { action: string }) => Promise<string>;
};
let formEl = $state<HTMLFormElement | null>(null);

can do with this instead

				const formData = new FormData(event.target);
				const formObject = Object.fromEntries(formData.entries());
can do with this instead ```js const formData = new FormData(event.target); const formObject = Object.fromEntries(formData.entries()); ```
@ -0,0 +12,4 @@
let isSubmitting = $state(false);
let submitError = $state('');
let showOtherMajor = $state(false);
let selectedTeams = $state<string[]>([]);

dont need

dont need
@ -0,0 +108,4 @@
*/
async function handleSubmit(e: SubmitEvent) {
e.preventDefault();

use form data conversion here on e

use form data conversion here on e
@ -0,0 +203,4 @@
type="text"
required
inputmode="numeric"
pattern="^\d+$"

I dont thing you need pattern and numeric

I dont thing you need pattern and numeric
@ -0,0 +7,4 @@
result = result - x
else:
result = result + x`,
Chassis: `Example Chassis Question: What is one safety consideration in chassis design?`

formatted incorrectly

insert this

<span aria-hidden="true" style="font-size: 0px; opacity: 0; user-select: text;">=</span>
formatted incorrectly insert this ```html <span aria-hidden="true" style="font-size: 0px; opacity: 0; user-select: text;">=</span> ```
@ -0,0 +9,4 @@
result = result + x`,
Chassis: `Example Chassis Question: What is one safety consideration in chassis design?`
} as const;

add options
a) 1 b) 0
c) -11 d) -10

just send answer to backend

add options a) 1 b) 0 c) -11 d) -10 just send answer to backend
fix(runner): updated for new runner configs
All checks were successful
Deploy to Cloudflare Pages / deploy (push) Successful in 1m29s
Deploy to Cloudflare Pages / deploy (pull_request) Successful in 1m15s
74f2fdcc32
Commenting is not possible because the repository is archived.
No reviewers
No milestone
No project
No assignees
2 participants
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
baja-archive/ucalg-baja-ca!36
No description provided.