Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes #110 : [V2] Cohort Application Page #117

Merged
merged 20 commits into from
Mar 23, 2024
Merged

Conversation

keraliss
Copy link
Collaborator

Created a basic ui for applying to the cohorts. we can change the design based on the revamped design

Screenshot from 2024-01-22 14-52-25
Screenshot from 2024-01-22 14-52-35
Screenshot from 2024-01-22 14-52-38

src/components/common/Application.jsx Outdated Show resolved Hide resolved
src/components/common/Application.jsx Outdated Show resolved Hide resolved
Copy link
Collaborator

@emjshrx emjshrx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a new state submitted:boolean and after handleSubmit, disable the button so that people dont spam it. Maybe we can render, already submitted and disable inputs?

src/components/common/Application.tsx Outdated Show resolved Hide resolved
src/components/common/Application.tsx Outdated Show resolved Hide resolved
src/components/common/Application.tsx Outdated Show resolved Hide resolved
<input type="submit" value="Submit" />
</form>
</section>
</>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We dont need <></>

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This. SInce there is only one child section we dont need <></>

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My mistake. this is needed now

@emjshrx
Copy link
Collaborator

emjshrx commented Feb 7, 2024

Screenshot 2024-02-07 at 5 34 02 PM

Pls add styling for background and submit button

@keraliss
Copy link
Collaborator Author

Screenshot from 2024-02-19 13-57-08
Screenshot from 2024-02-19 13-57-28

package.json Outdated
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-icons": "^4.12.0",
"react-select": "^5.8.0",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we already have material-ui so can we use those components? https://mui.com/material-ui/react-select?

src/components/common/Application.tsx Outdated Show resolved Hide resolved
import Select from 'react-select';

const Application = (
{name}: {name: string}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we might need one more prop isRegOpen. We will not be accepting applications for all cohorts simultaneously

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we change to cohortName, as name is misleading

required
/>
<p>Location*</p>
<input
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inputs can be made into a single component and looped over

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also check if material-ui has input component, it will look prettier

src/components/common/Application.tsx Outdated Show resolved Hide resolved
src/components/common/Application.tsx Outdated Show resolved Hide resolved
src/components/common/Application.tsx Outdated Show resolved Hide resolved
src/components/common/Application.tsx Outdated Show resolved Hide resolved
import Select from 'react-select';

const Application = (
{name}: {name: string}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we change to cohortName, as name is misleading

Comment on lines 31 to 32
const [selectedSkills, setSelectedSkills] = useState([]);
const [selectedBooks, setSelectedBooks] = useState([]);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use formData.Skills and formData.books?

Comment on lines 104 to 105
formData.skills = selectedSkills;
formData.books = selectedBooks;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can set this in handleChange itself

@@ -0,0 +1,194 @@
import React, { useState, type FormEvent } from "react";
import axios from "axios";
import { Alert, Autocomplete, Input, TextField } from "@mui/material";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work reusing MUI

<input type="submit" value="Submit" />
</form>
</section>
</>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This. SInce there is only one child section we dont need <></>

];

const Application = (
{ cohortName }: { cohortName: string }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add a boolean isRegOpen so that we open applications only for some cohorts?

@keraliss keraliss assigned keraliss and unassigned setusaurabh and paperpsych Feb 21, 2024
Copy link
Collaborator

@emjshrx emjshrx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also pls check with @rajarshimaitra which cohort applications should be open when we merge this PR

enrolled: false,
role: cohortName
});
const [isRegOpen, setIsRegOpen] = useState(regOpen);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We dont need this state. We can directly use regOpen

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense!

onChange={(e, value) => {
setFormData(prevState => ({
...prevState,
skills: value
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type of value is string[]. This doesnt match the type of skills. Can you fix the type issue?

onChange={(e, value) => {
setFormData(prevState => ({
...prevState,
books: value
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type issue just as skills

<input type="submit" value="Submit" />
</form>
</section>
</>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My mistake. this is needed now

@emjshrx
Copy link
Collaborator

emjshrx commented Feb 26, 2024

Also we need to add some validations so that user enters all the fields as right now we allow submission of empty fields

@rajarshimaitra
Copy link
Collaborator

Also pls check with @rajarshimaitra which cohort applications should be open when we merge this PR

We will start with the BPD cohort.

@keraliss
Copy link
Collaborator Author

Fixed the type issues, and also changed the order of the questions. here is the new order. @setusaurabh does this look alright to you? also added validation for the required fields.
Screenshot from 2024-02-26 17-54-14

@rajarshimaitra
Copy link
Collaborator

@emjshrx lets hold on to this until we finalize the date for BPD. Then we can merge this with only the BPD application open and everything else closed.

Copy link
Collaborator

@rajarshimaitra rajarshimaitra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

@rajarshimaitra rajarshimaitra merged commit 0dd8e8c into main Mar 23, 2024
@rajarshimaitra rajarshimaitra deleted the applicationPage branch March 23, 2024 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants