Skip to content

Commit

Permalink
Disable profile matching
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanzhou committed Jan 2, 2024
1 parent 5116a41 commit 027d1b4
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 41 deletions.
7 changes: 6 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1868,8 +1868,13 @@ def registrations(globus_user_id):
return show_admin_error("This stage user does not exist!")
else:
# Check if there's any matching profiles in the `wp_connections` found
matching_profiles = get_matching_profiles(stage_user.last_name, stage_user.first_name, stage_user.email, stage_user.organization)
# Disabled by Zhou on 1/2/2024 to prevent decoding issue
# No longer need this matching profile feature for new members.
# matching_profiles = get_matching_profiles(stage_user.last_name, stage_user.first_name, stage_user.email, stage_user.organization)
#pprint(vars(list(matching_profiles)[0]))

# Use an empty list for all new registrations - Zhou 1/2/2024
matching_profiles = []
context = {
'isAuthenticated': True,
'username': session['name'],
Expand Down
76 changes: 36 additions & 40 deletions templates/individual_registration.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ <h5 class="card-header">Registration Detail</h5>
{% endif %}

<br />
SenNet service(s) access requested: <br />
HuBMAP service(s) access requested: <br />
<ul>
{% for req in data.access_requests_list %}
<li>{{ req }} </li>
Expand All @@ -45,20 +45,20 @@ <h5 class="card-header">Registration Detail</h5>

<br />

{% if 'SenNet Data Via Globus' in data.stage_user.access_requests %}
Globus username to be used for SenNet Data group access: {{ data.stage_user.globus_identity }} <br />
{% if 'HuBMAP Data Via Globus' in data.stage_user.access_requests %}
Globus username to be used for HuBMAP Data group access: {{ data.stage_user.globus_identity }} <br />
{% endif %}

{% if 'SenNet Google Drive Share' in data.stage_user.access_requests %}
Google account for SenNet Google Drive Share: {{ data.stage_user.google_email }} <br />
{% if 'HuBMAP Google Drive Share' in data.stage_user.access_requests %}
Google account for HuBMAP Google Drive Share: {{ data.stage_user.google_email }} <br />
{% endif %}

{% if 'SenNet GitHub Repository' in data.stage_user.access_requests %}
{% if 'HuBMAP GitHub Repository' in data.stage_user.access_requests %}
Github username: {{ data.stage_user.github_username }} <br />
{% endif %}

{% if 'SenNet Slack Workspace' in data.stage_user.access_requests %}
Email for SenNet Slack Workspace: {{ data.stage_user.slack_username }} <br />
{% if 'HuBMAP Slack Workspace' in data.stage_user.access_requests %}
Email for HuBMAP Slack Workspace: {{ data.stage_user.slack_username }} <br />
{% endif %}

{% if 'protocols.io' in data.stage_user.access_requests %}
Expand Down Expand Up @@ -126,17 +126,16 @@ <h5 class="modal-title" id="exampleModalLongTitle">Deny registration</h5>
</div>
</div>

<!-- Disabled profile matching by Zhou 10/6/2023 -->
{% if data.matching_profiles|length > 0 %}

<div class="card mt-4">
<h5 class="card-header">Possible Existing Matching Profile</h5>
<div class="card-body">


{% if data.matching_profiles|length > 0 %}

{#
<div class="alert alert-info" role="alert">
Matching profiles found and sorted by the total matching score. Scoring:
Matching profiles found from `wp_connections` table and sorted by the total matching score. Scoring:

<table class="table table-sm">
<thead>
Expand Down Expand Up @@ -170,16 +169,16 @@ <h5 class="card-header">Possible Existing Matching Profile</h5>
<th scope="col">Last Name</th>
<th scope="col">Email</th>
<th scope="col">Organization</th>
<th scope="col">SenNet Component</th>
<th scope="col">HuBMAP Component</th>

{#<th scope="col">Match Score</th>#}

<th scope="col">Action</th>
</tr>
</thead>
<tbody>
{% for profile in data.matching_profiles %}
<tr>
{% for profile in data.matching_profiles %}
<tr>
<th scope="row">{{ loop.index }}</th>
<td>{{ profile.first_name }}</td>
<td>{{ profile.last_name }}</td>
Expand All @@ -193,35 +192,32 @@ <h5 class="card-header">Possible Existing Matching Profile</h5>
</tr>

<!-- Approve by match Modal -->
<div class="modal fade" id="approve_by_match_modal_{{ loop.index }}" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLongTitle">Approve registraiton by using this matched profile</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
Are you sure you want to approve this registration by using the matched profile?
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<a href="{{ config['FLASK_APP_BASE_URI'] }}/match/{{ data.stage_user.globus_user_id }}/{{ profile.id }}" class="btn btn-primary">Yes, approve by using matched profile</a>
</div>
</div>
</div>
</div>
{% endfor %}
<div class="modal fade" id="approve_by_match_modal_{{ loop.index }}" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLongTitle">Approve registraiton by using this matched profile</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
Are you sure you want to approve this registration by using the matched profile?
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<a href="{{ config['FLASK_APP_BASE_URI'] }}/match/{{ data.stage_user.globus_user_id }}/{{ profile.id }}" class="btn btn-primary">Yes, approve by using matched profile</a>
</div>
</div>
</div>
</div>
{% endfor %}
</tbody>
</table>
{% else %}
<div class="alert alert-info" role="alert">
No matching profiles found.

</div>
{% endif %}
</div>
</div>
{% endif %}



Expand Down

0 comments on commit 027d1b4

Please sign in to comment.