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
[Feature:HelpQueue] Setting required contact info per queue #7128
Merged
Merged
Changes from all commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
43dd312
twig fixes
loadedskiffer 2d07eca
Revert "twig fixes"
loadedskiffer eafe21b
Merge branch 'master' of https://github.com/Submitty/Submitty
loadedskiffer 9647971
Merge branch 'master' of https://github.com/Submitty/Submitty
loadedskiffer 20c7c1d
Merge branch 'master' of https://github.com/Submitty/Submitty
loadedskiffer 2fc22b9
Merge branch 'master' of https://github.com/Submitty/Submitty
loadedskiffer aa4927b
Merge branch 'master' of https://github.com/Submitty/Submitty
loadedskiffer bdad325
Merge branch 'master' of https://github.com/Submitty/Submitty
loadedskiffer 4483d4a
Merge branch 'master' of https://github.com/Submitty/Submitty
loadedskiffer 9f214d9
add alert message
loadedskiffer d2931b9
lint
loadedskiffer b3a45b6
requested changes
loadedskiffer 1872b16
add tooltip
loadedskiffer 9276513
Merge branch 'master' into locked-gradeable-message
loadedskiffer eed421e
change tooltip
loadedskiffer 3852134
new add queue modal
loadedskiffer 38351c9
get post request
loadedskiffer 3817eb2
database migration
loadedskiffer 8c6d11b
new ui for joining queue
loadedskiffer 344b622
allow students to join without info
loadedskiffer ef3c5d6
remove contact information from queue settings
loadedskiffer ada646b
allow editing of contact info field
loadedskiffer 3d55ff6
enhance edit queue UI
loadedskiffer e0122bf
linter
loadedskiffer 735255d
fix unit tests
loadedskiffer 35171c4
remove tests for course config
loadedskiffer 70fa5e7
fix e2e
loadedskiffer 04b3fcf
fix accesibilty test
loadedskiffer 81347fc
requested changes
loadedskiffer 0a0789b
Merge branch 'master' into refactor-queue-contact-info
loadedskiffer f660efc
linter again
loadedskiffer 87212cd
Merge branch 'refactor-queue-contact-info' of https://github.com/Subm…
loadedskiffer fd9cbb3
e2e again
loadedskiffer ea68544
hopefully fix accesibilty check
loadedskiffer 252bff4
fix col length
loadedskiffer 969b017
Merge branch 'master' into refactor-queue-contact-info
loadedskiffer 061006c
requested changes
loadedskiffer c436d90
fix migration
loadedskiffer a9ca759
fix migration
loadedskiffer 43f719c
add check for field in migration
loadedskiffer 6d074ac
Update migration/migrator/migrations/course/20210921195244_add_queue_…
MasterOdin File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
migration/migrator/migrations/course/20210921195244_add_queue_contact_info_column.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
"""Migration for a given Submitty course database.""" | ||
from pathlib import Path | ||
import json | ||
|
||
def up(config, database, semester, course): | ||
""" | ||
Run up migration. | ||
|
||
:param config: Object holding configuration details about Submitty | ||
:type config: migrator.config.Config | ||
:param database: Object for interacting with given database for environment | ||
:type database: migrator.db.Database | ||
:param semester: Semester of the course being migrated | ||
:type semester: str | ||
:param course: Code of course being migrated | ||
:type course: str | ||
""" | ||
sql = "ALTER TABLE queue_settings ADD COLUMN IF NOT EXISTS contact_information BOOLEAN NOT NULL DEFAULT TRUE;" | ||
database.execute(sql) | ||
course_dir = Path(config.submitty['submitty_data_dir'], 'courses', semester, course) | ||
# add boolean to course config | ||
config_file = Path(course_dir, 'config', 'config.json') | ||
if config_file.is_file(): | ||
with config_file.open() as in_file: | ||
j = json.load(in_file) | ||
if 'queue_contact_info' in j['course_details']: | ||
contact_information_enabled = j['course_details']['queue_contact_info'] | ||
query = """ | ||
UPDATE queue_settings | ||
SET contact_information = :contact_information_enabled; | ||
""" | ||
params = {'contact_information_enabled' : contact_information_enabled} | ||
database.session.execute(query, params) | ||
|
||
|
||
def down(config, database, semester, course): | ||
""" | ||
Run down migration (rollback). | ||
|
||
:param config: Object holding configuration details about Submitty | ||
:type config: migrator.config.Config | ||
:param database: Object for interacting with given database for environment | ||
:type database: migrator.db.Database | ||
:param semester: Semester of the course being migrated | ||
:type semester: str | ||
:param course: Code of course being migrated | ||
:type course: str | ||
""" | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should have a follow-up query where we check the current value of
course_config['course_details']['queue_contact_info']
and update all existingqueue_settings
in the DB to be true/false respectively.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed queue_contact_information from the course config, will the new migration still work when it gets installed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should. If you wanted to have extra confidence, add an existence check for the field before attempting to read it.