Skip to content

Commit

Permalink
fix ui tests and role templates (#1102)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkonie committed Aug 16, 2023
1 parent 7960f85 commit c4b1732
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 125 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<button class="btn btn-secondary dropdown-toggle sodar-list-dropdown
sodar-pr-invite-dropdown"
<button class="btn btn-secondary dropdown-toggle sodar-list-dropdown"
type="button" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
<i class="iconify" data-icon="mdi:gear"></i>
</button>
<div class="dropdown-menu dropdown-menu-right">
<div class="dropdown-menu dropdown-menu-right sodar-pr-invite-dropdown">
<a class="dropdown-item"
href="{% url 'projectroles:invite_resend' projectinvite=invite_uuid %}">
<i class="iconify" data-icon="mdi:send"></i> Resend Invite
Expand Down
13 changes: 6 additions & 7 deletions projectroles/templates/projectroles/_project_role_dropdown.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@
{% load projectroles_common_tags %}
{% load projectroles_role_tags %}

<button class="btn btn-secondary dropdown-toggle sodar-list-dropdown
sodar-pr-role-dropdown"
<button class="btn btn-secondary dropdown-toggle sodar-list-dropdown"
type="button" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
<i class="iconify" data-icon="mdi:gear"></i>
</button>
<div class="dropdown-menu dropdown-menu-right">
<div class="dropdown-menu dropdown-menu-right sodar-pr-role-dropdown">
{% if role_as.project == project %} {# Local member role #}
<a class="dropdown-item sodar-pr-role-link-update"
<a class="dropdown-item sodar-pr-role-item-update"
href="{% url 'projectroles:role_update' roleassignment=role_as_uuid %}">
<i class="iconify" data-icon="mdi:lead-pencil"></i> Update Member
</a>
<a class="dropdown-item text-danger sodar-pr-role-link-delete"
<a class="dropdown-item text-danger sodar-pr-role-item-delete"
href="{% url 'projectroles:role_delete' roleassignment=role_as_uuid %}">
<i class="iconify" data-icon="mdi:account-remove"></i> Remove Member
</a>
Expand All @@ -23,12 +22,12 @@
{# If found, link to update form instead #}
{% get_inactive_role project role_as as inactive_as %}
{% if inactive_as %}
<a class="dropdown-item sodar-pr-role-link-update"
<a class="dropdown-item sodar-pr-role-item-update"
href="{% url 'projectroles:role_update' roleassignment=inactive_as.sodar_uuid %}">
<i class="iconify" data-icon="mdi:lead-pencil"></i> Update Member
</a>
{% else %}
<a class="dropdown-item sodar-pr-role-link-promote"
<a class="dropdown-item sodar-pr-role-item-promote"
href="{% url 'projectroles:role_create_promote' project=project.sodar_uuid promote_as=role_as.sodar_uuid %}">
<i class="iconify" data-icon="mdi:account-arrow-up"></i> Promote Member
</a>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
{% load rules %}
{% load projectroles_common_tags %}

<button class="btn btn-secondary dropdown-toggle sodar-list-dropdown
sodar-pr-role-dropdown-owner"
<button class="btn btn-secondary dropdown-toggle sodar-list-dropdown"
type="button" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
<i class="iconify" data-icon="mdi:gear"></i>
</button>
<div class="dropdown-menu dropdown-menu-right">
<a class="dropdown-item sodar-pr-role-link-transfer
<div class="dropdown-menu dropdown-menu-right sodar-pr-role-dropdown-owner">
<a class="dropdown-item sodar-pr-role-item-transfer
{% if not enable_owner_transfer %}disabled{% endif %}"
href="{% url 'projectroles:role_owner_transfer' project=project.sodar_uuid %}">
<i class="iconify" data-icon="mdi:account-switch"></i> Transfer Ownership
Expand Down
89 changes: 41 additions & 48 deletions projectroles/templates/projectroles/_project_role_ops.html
Original file line number Diff line number Diff line change
@@ -1,49 +1,42 @@
<div class="btn-group ml-auto">
<button class="btn btn-primary dropdown-toggle"
id="sodar-pr-role-ops-dropdown" type="button"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"
{% if project.is_remote %}disabled="disabled"{% endif %}>
Member Operations
</button>
<div class="dropdown-menu dropdown-menu-right">
{# Add Role #}
{% if role_perms.can_update_members %}
<a class="dropdown-item"
href="{% url 'projectroles:role_create' project=project.sodar_uuid %}"
title="Add Member"
id="sodar-pr-role-ops-create">
<i class="iconify" data-icon="mdi:account-plus"></i> Add Member
</a>
{% endif %}

{# Send Invite #}
{% if role_perms.can_invite %}
<a class="dropdown-item"
href="{% url 'projectroles:invite_create' project=project.sodar_uuid %}"
title="Send Invite"
id="sodar-pr-role-ops-invite">
<i class="iconify" data-icon="mdi:send"></i> Send Invite
</a>
{% endif %}

{# View Roles #}
{% if role_perms.can_update_members and request.resolver_match.url_name != 'project_roles' %}
<a class="dropdown-item"
href="{% url 'projectroles:roles' project=project.sodar_uuid %}"
title="View Members"
id="sodar-pr-role-ops-roles">
<i class="iconify" data-icon="mdi:account-multiple"></i> View Members
</a>
{% endif %}

{# View Invites #}
{% if role_perms.can_invite and request.resolver_match.url_name != 'role_invites' %}
<a class="dropdown-item"
href="{% url 'projectroles:invites' project=project.sodar_uuid %}"
title="View Invites"
id="sodar-pr-role-ops-invites">
<i class="iconify" data-icon="mdi:email"></i> View Invites
</a>
{% endif %}
</div>
<button class="btn btn-primary dropdown-toggle"
id="sodar-pr-role-ops-btn"
type="button" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false"
{% if project.is_remote %}disabled="disabled"{% endif %}>
Member Operations
</button>
<div class="dropdown-menu dropdown-menu-right"
id="sodar-pr-role-ops-dropdown">
{% if role_perms.can_update_members %}
<a class="dropdown-item"
href="{% url 'projectroles:role_create' project=project.sodar_uuid %}"
title="Add Member"
id="sodar-pr-role-ops-create">
<i class="iconify" data-icon="mdi:account-plus"></i> Add Member
</a>
{% endif %}
{% if role_perms.can_invite %}
<a class="dropdown-item"
href="{% url 'projectroles:invite_create' project=project.sodar_uuid %}"
title="Send Invite"
id="sodar-pr-role-ops-invite">
<i class="iconify" data-icon="mdi:send"></i> Send Invite
</a>
{% endif %}
{% if role_perms.can_update_members and request.resolver_match.url_name != 'project_roles' %}
<a class="dropdown-item"
href="{% url 'projectroles:roles' project=project.sodar_uuid %}"
title="View Members"
id="sodar-pr-role-ops-roles">
<i class="iconify" data-icon="mdi:account-multiple"></i> View Members
</a>
{% endif %}
{% if role_perms.can_invite and request.resolver_match.url_name != 'role_invites' %}
<a class="dropdown-item"
href="{% url 'projectroles:invites' project=project.sodar_uuid %}"
title="View Invites"
id="sodar-pr-role-ops-invites">
<i class="iconify" data-icon="mdi:email"></i> View Invites
</a>
{% endif %}
</div>
Loading

0 comments on commit c4b1732

Please sign in to comment.