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">
Owner

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';
Owner

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('');
Owner

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'));
Owner

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('');
Owner

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> = {
Owner

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('');
Owner

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('');
Owner

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('');
Owner

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>>>({});
Owner

unneeded state

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

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) {
Owner

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;
Owner

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">
Owner

replace the style with an <i> tag

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

what?

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

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: {
Owner

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>
Owner

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
Owner

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`}
Owner

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) {
Owner

change to 800px

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

same here as above

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

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) {
Owner

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)
18 MiB
@ -0,0 +8,4 @@
execute: (siteKey: string, options: { action: string }) => Promise<string>;
};
let formEl = $state<HTMLFormElement | null>(null);
Owner

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[]>([]);
Owner

dont need

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

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+$"
Owner

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?`
Owner

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;
Owner

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
All checks were successful
Deploy to Cloudflare Pages / deploy (push) Successful in 1m29s
Deploy to Cloudflare Pages / deploy (pull_request) Successful in 1m15s
Required
Details
This pull request has changes conflicting with the target branch.
  • .forgejo/workflows/deploy_to_cloudflare.yaml
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin rform:rform
git switch rform
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
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
ucalgary-baja/ucalg-baja-ca!36
No description provided.