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 21 commits into
base: development
Choose a base branch
from
Open

Conversation

seedyjahateh
Copy link
Contributor

Completed the backend for both Summer Experience and Other Engagement forms. Also implemented an 'Edt' and 'Withdraw' functionality for both forms.

Fixing issue #1152

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

Copy link

View Code Coverage

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

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.

9 participants