-
Notifications
You must be signed in to change notification settings - Fork 0
Adding the Manage Members Page #649
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
Open
brightfietsop-ux
wants to merge
99
commits into
department-portal-base
Choose a base branch
from
Bright_Artem_manage_people
base: department-portal-base
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
99 commits
Select commit
Hold shift + click to select a range
dad0a49
Reverted the merges
ArtemKurasov 0684323
Got all of the changes from the Manage_Members_Bright_Artem branch
ArtemKurasov 8bcd89b
made the portal to work
brightfietsop-ux 24d7ca1
made the isBanned banner to display a popup
brightfietsop-ux 194ff1c
Fixed the Assign Coordinator switch + moved some of the logic to mana…
ArtemKurasov 52b7efc
Used functions from app/logic/manageMembers..py
ArtemKurasov c2052a7
removed a duplicate function
brightfietsop-ux a649439
broke down the mangeMembers into samller functions and moved it app/l…
brightfietsop-ux 6a8185a
added some test cases
brightfietsop-ux a4648dd
fixed the broken import statemnets
brightfietsop-ux 42e0e7c
Add tests for manage members helper functions
BhushanSah 01baa28
Add tests for manage members helper logic
BhushanSah 01ee63a
removed the changes from supervisor.py which was out of scope
BhushanSah 162400e
Removed the extra line
BhushanSah f04fbce
Removed the code which was out of scope
BhushanSah 4f72b3f
Removed the file out of scope
BhushanSah c089049
deleted empty file
brightfietsop-ux 7950862
Removed the file out of scope
BhushanSah 6979e82
Merge branch 'Bright_Artem_manage_people' of https://github.com/BCStu…
brightfietsop-ux 647ba11
Removed the file out of scope
BhushanSah 28bee64
Merge branch 'Bright_Artem_manage_people' of https://github.com/BCStu…
brightfietsop-ux 322f1fd
Removed the extra spaces
BhushanSah c9e7871
Delete app/static/js/addSupervisorsToDepartment.js
brightfietsop-ux 436198f
Made it same as before
BhushanSah 97d0460
Made it same as before as it was out of scope
BhushanSah 28490eb
Removed the unnecessary changes
BhushanSah 0ee4970
Removed Unneccessary spaces
BhushanSah a982310
Removed space
BhushanSah 2fa25e9
Added space same as before
BhushanSah c10d0fe
Removed unnecessary function
BhushanSah 37b715f
Merge branch 'Bright_Artem_manage_people' of https://github.com/BCStu…
brightfietsop-ux 08ef1dd
added test cases for our functions
brightfietsop-ux f5a6924
edited the message and then made it to fade out after 5seconds
brightfietsop-ux fd37b48
Handle missing user in manage members route
BhushanSah 6fd3441
Fix manage members template context and markup
BhushanSah 3aaee60
Restore shared supervisor department helper
BhushanSah 39df63d
Clean up manage members PR scope
BhushanSah e00b702
Address manage members review feedback
BhushanSah 76b2320
Address manage members review feedback
BhushanSah 1a923d3
Clean up manage members review changes
BhushanSah e824434
Clean up manage members review changes
BhushanSah baa19f1
Clean up manage members changes
BhushanSah 5e02f2c
Use existing search helper for manage members
BhushanSah ea2e6eb
Keep manage members search closed on load
BhushanSah 10bc99e
Fixed the test
BhushanSah 300e18f
Implemented a popover for removing members
brightfietsop-ux f648de8
refactored the formatting of the code
brightfietsop-ux 7e4d743
Resolved merge conflict and connected our page to the view all member…
brightfietsop-ux fd16541
Address manage members review comments
BhushanSah 5de6421
Changed g.currentUser to currentUser
BhushanSah e3ddeb4
Address remaining manage members review comments
BhushanSah 39537e4
Update manage members test coverage
BhushanSah 21dacc7
fixed init.py
BhushanSah 8bfaf02
Add current year context variable
BhushanSah 1ae75a2
Removed Space
BhushanSah a869602
Allow department supervisors to access manage members
BhushanSah 5d58f3f
Merged department-portal-base
BhushanSah f90d754
optimised addUserToDept
BhushanSah 9a0112a
Updated js file of addUsertoDept
BhushanSah c6b1424
Fixed error on departmentportal.py
BhushanSah 09346c3
fixed the failing test issues and then properly connected the button …
brightfietsop-ux a083395
changed the flash color msg
brightfietsop-ux 13b50ce
Updated test files
BhushanSah d5f461c
Merge department-portal-base into Bright_Artem_manage_people
BhushanSah 393d9de
made the checks so that labor office and labor students can manage de…
brightfietsop-ux 4723ec7
Removed supervisorsDbToDict() and reused buildSupervisorDisplay()
brightfietsop-ux cd508c4
Removed duplicate helper function getCurrentDeptMembers()
brightfietsop-ux eff7a57
added a test for getSupervisorDepartments
brightfietsop-ux 0971c55
removed the confirmation popup before a member gets removed
brightfietsop-ux 661ff17
added my name to the contributor list
brightfietsop-ux bc46dae
Merge pull request #661 from BCStudentSoftwareDevTeam/Bright-contribu…
brightfietsop-ux 1e234fe
changed the flasher fot consistnecy
brightfietsop-ux d2bda86
Changed supervisor ineligible button to toggle
BhushanSah 9dc49ae
Merge department-portal-base into Bright_Artem_manage_people
BhushanSah 813362e
Address manage members review feedback
BhushanSah 386decf
Refine manage members styling and tests
BhushanSah e805d6f
Removed Comment
BhushanSah 33a891f
Update manage members permissions
BhushanSah 1be130c
Fixed the typo error
BhushanSah 17919f5
Removed a console.log error msg
brightfietsop-ux f6a5a09
Merge department-portal-base into Bright_Artem_manage_people
BhushanSah 09d5b6e
merge
BhushanSah efa9b90
merge
BhushanSah a0fe036
Fix manage members responsive layout
BhushanSah e4436c8
Align manage members action controls
BhushanSah faef000
Fix manage members active and pending counts
BhushanSah 6d68125
Refactored according to Imran commet
BhushanSah 2c4425e
Renamed variables
BhushanSah c506a25
fixed the logic
BhushanSah 2eb341f
Remove demo data changes from manage members PR
BhushanSah 5dc2048
Fixed Toggle
BhushanSah 3c9c643
used g.currentYear, made pewee command as single one and also updated…
BhushanSah 6ef0131
Refresh cached user when login changes
BhushanSah 075f554
Made pewee command into one line
BhushanSah 51ee08a
Made pewee command into one line
BhushanSah ab9f802
Fixed Bug
BhushanSah 705cda1
Merge branch 'department-portal-base', remote-tracking branch 'origin…
BhushanSah 35dbd4d
Update contributors.yaml by removing and editing entries
BhushanSah ea760b5
Restore contributors.yaml
BhushanSah File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,43 +1,65 @@ | ||
| from app.logic.search import usernameFromEmail | ||
| from app.models.supervisor import Supervisor | ||
| from app.models.supervisorDepartment import SupervisorDepartment | ||
| from peewee import fn | ||
|
|
||
|
|
||
|
|
||
| def buildSupervisorDisplay(supervisor): | ||
| try: | ||
| firstName = supervisor.FIRST_NAME | ||
| lastName = supervisor.LAST_NAME | ||
| if not (firstName and lastName): | ||
| raise NameError("First name and last name are required") | ||
| """Build supervisor data used by portal displays and search results.""" | ||
| firstName = ( | ||
| supervisor.preferred_name or | ||
| supervisor.legal_name or | ||
| "" | ||
| ).strip() | ||
| lastName = (supervisor.LAST_NAME or "").strip() | ||
| email = supervisor.EMAIL.strip() if supervisor.EMAIL else None | ||
|
|
||
| except NameError as e: | ||
| if not firstName or not lastName: | ||
| return None | ||
|
|
||
| return { | ||
| "name": f"{firstName} {lastName}".strip(), | ||
| "email": supervisor.EMAIL | ||
| "name": f"{firstName} {lastName}", | ||
| "email": email, | ||
| "username": usernameFromEmail(email) if email else None, | ||
| "firstName": firstName, | ||
| "lastName": lastName, | ||
| "bnumber": supervisor.ID.strip(), | ||
| "department": (supervisor.DEPT_NAME or "").strip(), | ||
| "type": "Supervisor" | ||
| } | ||
| def getSupervisors(dept): | ||
|
|
||
|
|
||
| def getSupervisorDepartments(dept): | ||
| """Return supervisor-department records for a department.""" | ||
| if dept is None: | ||
| return [] | ||
|
|
||
| return list( | ||
| SupervisorDepartment | ||
| .select(SupervisorDepartment, Supervisor) | ||
| .join(Supervisor) | ||
| .where(SupervisorDepartment.department == dept) | ||
| .order_by(Supervisor.LAST_NAME.asc()) | ||
| ) | ||
|
|
||
|
|
||
| def getSupervisors(dept): | ||
| laborCoordinators = [] | ||
| supervisors = [] | ||
|
|
||
| # Avoid querying department members unless the selected department exists. | ||
| if dept is not None: | ||
| supervisorDepartments = (SupervisorDepartment.select().join(Supervisor).where(SupervisorDepartment.department == dept) | ||
| .order_by(Supervisor.LAST_NAME.asc())) | ||
| for supervisorDepartment in supervisorDepartments: | ||
| supervisor = supervisorDepartment.supervisor | ||
| if supervisor is None: | ||
| continue | ||
|
|
||
| supervisorDisplay = buildSupervisorDisplay(supervisor) | ||
| if not supervisorDisplay: | ||
| continue | ||
|
|
||
| if supervisorDepartment.isCoordinator: | ||
| laborCoordinators.append(supervisorDisplay) | ||
| else: | ||
| supervisors.append(supervisorDisplay) | ||
|
|
||
| for supervisorDepartment in getSupervisorDepartments(dept): | ||
| supervisor = supervisorDepartment.supervisor | ||
|
|
||
| if supervisor is None: | ||
| continue | ||
|
|
||
| supervisorDisplay = buildSupervisorDisplay(supervisor) | ||
|
|
||
| if not supervisorDisplay: | ||
| continue | ||
|
|
||
| if supervisorDepartment.isCoordinator: | ||
| laborCoordinators.append(supervisorDisplay) | ||
| else: | ||
| supervisors.append(supervisorDisplay) | ||
|
|
||
| return supervisors, laborCoordinators |
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.
Uh oh!
There was an error while loading. Please reload this page.