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

Judging > Project > Team Member Add/Remove #187

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

naijwu
Copy link
Contributor

@naijwu naijwu commented Mar 4, 2022

Description

"Team Members" field on Livesite > Judging > Project Edit would display [Object object] instead of relevant information

Now, the field shows the names of the team members
image
image
(the Kevin Zou's have different IDs, so allowed behavior)

consideration

there's no "discord" field from the applicants records... where should the list of possible team members be pulled? or should there be a separate editor for each team member? (doesn't seem ideal -- non-dev (execs w/ no access to firebase) won't be able to find the hacker's document ID

@naijwu naijwu linked an issue Mar 4, 2022 that may be closed by this pull request
@naijwu naijwu marked this pull request as draft March 4, 2022 09:33
@naijwu
Copy link
Contributor Author

naijwu commented Mar 4, 2022

@kevin-zou is it common/a necessary feature for judges to add/remove team members?

@github-actions
Copy link

github-actions bot commented Mar 4, 2022

Visit the preview URL for this PR (updated for commit c7d4d6b):

https://nw-admin-portal--pr187-fix-field-display-nc6cngly.web.app

(expires Sun, 13 Mar 2022 01:42:49 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

@kevin-zou
Copy link
Contributor

@kevin-zou is it common/a necessary feature for judges to add/remove team members?

I believe so! This Admin page is often used for when something goes wrong during project submission and the hacker wants us to do something like change a name, email, title, description, etc.

We can do that through Firebase but by putting this functionality in Admin it means that non-dev members can do it as well (and it's also easier to find projects).

@naijwu naijwu marked this pull request as ready for review March 5, 2022 02:06
@naijwu naijwu changed the title fixed team member display, currently read-only field Judging > Project > Team Member Add/Remove Mar 5, 2022
@naijwu
Copy link
Contributor Author

naijwu commented Mar 5, 2022

@kevin-zou
ran into this while working on the ticket: when trying to save a project edit, filling in all the visible fields and hitting save yields a "all fields must be filled in" error... there seems to be a rogue mentorNominees field that is always blank in the data object that the field tries to pass to save. Is this being fixed elsewhere or does it have to be fixed?

@kevin-zou
Copy link
Contributor

@kevin-zou ran into this while working on the ticket: when trying to save a project edit, filling in all the visible fields and hitting save yields a "all fields must be filled in" error... there seems to be a rogue mentorNominees field that is always blank in the data object that the field tries to pass to save. Is this being fixed elsewhere or does it have to be fixed?

Ah that looks like it's being caused by these lines:

if (!Object.values(data).every((field) => field === 0 || !!field)) {
// eslint-disable-next-line no-alert
alert('All fields required');
return;

Since we've added project submission to Portal we've also added some fields that are not required. Maybe instead of checking that all fields are populated we can just check that required ones are filled:

  • title
  • description
  • teamMembers
  • links
  • sponsorPrizes

I also realize that there's a mismatch between how Projects are saved in Portal vs Admin. A Project in Portal is

{
  title: String,
  description: String,
  teamMembers: Array[name: String, email: String, discord: String],
  links: Object {devpost: String, youtube: String, sourceCode: String, other: String},
  sponsorPrizes: Array[String],
  charityChoice: String,
  mentorNominations: String,
  draftStatus: String,
}

This doesn't really match what's happening in judging.js (

const handleNew = () => {
setData({
description: '',
devpostUrl: '',
youtubeUrl: '',
sponsorPrizes: '',
teamMembers: '',
teamMembersEmails: '',
title: '',
});
setActiveModal(NEW);
};
), so we'll need to change this. If you feel like this is out of scope then feel free to merge as much as you can and we can work through the rest later!

@naijwu naijwu requested a review from kevin-zou March 6, 2022 01:41
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.

Fix up the project view page
2 participants