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

Ieee 259 add description box on teams homepage #509

Merged
merged 47 commits into from
Feb 1, 2024

Conversation

KarandeepLubana
Copy link
Contributor

Overview

  • Resolves #IEEE259
  • Added an input box on the team's home page to describe what their project is

Unit Tests Created

  • Tests were created to verify that the Redux store updates correctly with the new project_description after dispatching the updateProjectDescription thunk.

Steps to QA

  • Navigate to the dashboard page
  • There should be a textbox with text saying "Write your project description here"

Copy link
Contributor

@Mustaballer Mustaballer left a comment

Choose a reason for hiding this comment

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

Great job @KarandeepLubana! This is looking close to merging, I have left some minor comments.

projectDescription: values.projectDescription,
})
);
} catch (error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

you should probably throw an error snackbar in case of an error, and also make a unit test for this snackbar

Copy link
Contributor

Choose a reason for hiding this comment

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

actually is it necessary to have this try and catch block here? Doesn't the thunk already handle the asynchronous logic?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I believe it's not necessary

variant="outlined"
disabled={!isEditing}
rows={4}
style={{ margin: "20px 5px 0 0" }}
Copy link
Contributor

Choose a reason for hiding this comment

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

can you put the styling in this file in ProjectDescription.module.scss. Reminder for scss you need to compile in order for the css to show, refer to README.md on how to do that.

type="submit"
variant="contained"
disabled={!isValid || isSubmitting}
style={{
Copy link
Contributor

Choose a reason for hiding this comment

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

put in ProjectDescription.module.scss

type="button"
variant="contained"
color="secondary"
style={{ width: "120px" }}
Copy link
Contributor

Choose a reason for hiding this comment

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

put in ProjectDescription.module.scss

type="button"
variant="contained"
color="primary"
style={{ width: "120px" }}
Copy link
Contributor

Choose a reason for hiding this comment

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

put in ProjectDescription.module.scss

@@ -122,6 +123,9 @@ const Dashboard = () => {
{fetchOrderError && <AlertBox error={fetchOrderError} />}
{/* TODO: add back in when incident reports are completed on the frontend */}
{/* <BrokenTable items={itemsBroken} openReportAlert={openBrokenTable} /> */}
<ProjectDescription
Copy link
Contributor

Choose a reason for hiding this comment

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

You could do <ProjectDescription teamCode={team_code ?? "None"} /> to make it cleaner

@Mustaballer
Copy link
Contributor

Mustaballer commented Jan 16, 2024

@KarandeepLubana This looks fantastic! I'd like to suggest a small enhancement: we should prevent teams from submitting orders on the cart page unless they have provided a project description. Perhaps we could implement an error message in the project description section, particularly if the description is too brief (consider using a predefined constant for the minimum length). You can modify CartSummary.tsx to include a reminder or guideline about writing a project description or in any other files you think makes sense. If you need any clarification, feel free to ask!

Edit: Please also add the project description to TeamDetail.tsx so admin users can view the project description when they click on a teams detail page.

Edit: You can add an alert suggesting that users need to add a project description like in DateRestrictionAlert.tsx

@@ -283,7 +283,6 @@ class TeamDetailView(
generics.GenericAPIView,
):
serializer_class = TeamSerializer
permission_classes = [FullDjangoModelPermissions]
Copy link
Contributor

Choose a reason for hiding this comment

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

is this necessary to remove, i think thats why the backend checks are failing

@Mustaballer
Copy link
Contributor

Great work, pls copy the changes over to the makeuoft repo as well!

@Mustaballer Mustaballer merged commit 4585976 into develop Feb 1, 2024
3 checks passed
@Mustaballer Mustaballer deleted the IEEE-259-add-description-box-on-teams-homepage branch February 1, 2024 15:22
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.

4 participants