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

Profile UI for CCE Minor Experiences. #1293

Open
wants to merge 58 commits into
base: development
Choose a base branch
from
Open

Conversation

seedyjahateh
Copy link
Contributor

@seedyjahateh seedyjahateh commented Jul 23, 2024

Issue Description

Fixes #1152

  • We needed to create a new page where we could create Summer Experiences with all of the information CELTS needs instead of just one text box.

Changes

  • Created a new tab system for navigating between Sustained Engagements, Summer Experience, and Other Engagements.
  • Created a new form for submitting a Summer Experience.
  • Created a new model for summerExperience.
  • Fixed up and made the Request Other Engagement page accessible.
  • Added phone number validation to the Company/Org part of the form.
  • Modularized the HTML for reusability.
  • Dynamically populated the years drop downs.
  • Wrote tests for the new createSummerExperience function.

Testing

  • After setting up environment and resetting the databases, run tests with ./tests/run_tests.sh
  • Run the application using flask run.
  • Click on the Minor Management tab in the Admin sidebar.
  • Click on any of the names under the CCE Minor Progress table (we did most of our testing on Ebenezer Ayisi.
  • Select the Summer Experience tab to open up the form.
  • Check the styling and then fill out all the information and submit.
  • Once kicked back to the Sustained Community Engagements page, return to Summer Experience and attempt to fill out the form but make sure to select Other for the 3rd to last question and no for the final question to verify the conditional check boxes are working.
  • Check the database with mysql -u root -proot -> use celts -> select * from summerexperience; to make sure the data you just submitted is all there.
  • Merge our PR :)

Copy link
Contributor

@BrianRamsay BrianRamsay left a comment

Choose a reason for hiding this comment

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

  • No text in phone number field
  • Supervisor phone and email should not be required
  • Required fields should have the red * (we have that style from somewhere else)
  • Summer experience should connect through the IndividualRequirement table for the minor. See: Admin minor management page
  • No big duplicate chunks for read-only vs edit
  • Use jquery everywhere instead of vanilla javascript

app/__init__.py Outdated Show resolved Hide resolved
app/controllers/minor/routes.py Outdated Show resolved Hide resolved
app/models/summerExperience.py Outdated Show resolved Hide resolved
app/models/summerExperience.py Outdated Show resolved Hide resolved
app/models/summerExperience.py Outdated Show resolved Hide resolved
app/templates/base.html Outdated Show resolved Hide resolved
app/logic/minor.py Outdated Show resolved Hide resolved


@minor_bp.route('/cceMinor/<username>/updateSummerExperience', methods=['GET', 'POST'])
def updateSummerExperience(username):
Copy link
Contributor

Choose a reason for hiding this comment

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

Update and create need to be combined or otherwise share functionality

app/templates/minor/profile.html Outdated Show resolved Hide resolved
app/static/js/profile.js Outdated Show resolved Hide resolved
@bledsoef
Copy link
Contributor

@ojmakinde ojmakinde self-assigned this Oct 25, 2024
@ojmakinde ojmakinde removed their assignment Nov 8, 2024
@Karina-Agliullova
Copy link
Contributor

app/controllers/minor/routes.py Outdated Show resolved Hide resolved



@minor_bp.route('/profile/<username>/withdrawSummerExperience', methods=['POST'])
Copy link
Contributor

Choose a reason for hiding this comment

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

Lets move this code to a different PR since it can't be tested in this one.



# ################################################## SUMMER EXPERIENCE END ###########################################################
@minor_bp.route('/cceMinor/<username>/addOtherEngagement', methods=['POST'])
Copy link
Contributor

Choose a reason for hiding this comment

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

Lets move this to a different PR where we are implementing the addOtherEngagement functionality.

logging.error(f'An error occurred while adding the engagement: {e}', exc_info=True)
return redirect(url_for('minor.view_other_engagement', username=username))

@minor_bp.route('/cceMinor/<username>/otherEngagement', methods=['GET'])
Copy link
Contributor

Choose a reason for hiding this comment

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

Lets move this to a different PR where we are implementing the addOtherEngagement functionality.

app/controllers/minor/routes.py Outdated Show resolved Hide resolved
})
.catch(error => console.error('Error fetching terms:', error));

const editOtherButton = document.getElementById('edit-other-proposal-button');
Copy link
Contributor

Choose a reason for hiding this comment

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

Use ajax instead of JavaScript


editOtherButton.addEventListener('click', function() {
otherFormFields.forEach(field => field.removeAttribute('disabled'));
document.getElementById('edit-other-buttons').style.display = 'block';
Copy link
Contributor

Choose a reason for hiding this comment

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

Use ajax instead of JavaScript


cancelOtherButton.addEventListener('click', function() {
otherFormFields.forEach(field => field.setAttribute('disabled', 'disabled'));
document.getElementById('edit-other-buttons').style.display = 'none';
Copy link
Contributor

Choose a reason for hiding this comment

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

Use ajax instead of JavaScript

document.getElementById('view-other-buttons').style.display = 'block';
});

withdrawOtherButton.addEventListener('click', function() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Use ajax instead of JavaScript

});

withdrawOtherButton.addEventListener('click', function() {
const experienceId = document.getElementById('other-experience-id').value;
Copy link
Contributor

Choose a reason for hiding this comment

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

Lets put this withdraw logic in a different PR with other withdrawal logic.


cancelOtherButton.addEventListener('click', function() {
otherFormFields.forEach(field => field.setAttribute('disabled', 'disabled'));
document.getElementById('edit-other-buttons').style.display = 'none';

Choose a reason for hiding this comment

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

Use ajax instead.

Comment on lines 116 to 117
document.getElementById('edit-buttons').style.display = isEditMode ? 'block' : 'none';
document.getElementById('view-buttons').style.display = isEditMode ? 'none' : 'block';
Copy link
Contributor

Choose a reason for hiding this comment

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

Use ajax instead of javascript

bledsoef and others added 29 commits January 22, 2025 16:29
…r and changed the header to be of same size like in summerexperience
Copy link

View Code Coverage

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.

Ask for additional information for Community-Engaged Summer Experience
9 participants