Skip to content

Commit

Permalink
YDA-5956: remove uneeded API call to retrieve group manager view pref…
Browse files Browse the repository at this point in the history
…erence
  • Loading branch information
lwesterhof committed Oct 4, 2024
1 parent 545d172 commit 2de3982
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
8 changes: 0 additions & 8 deletions group_manager/group_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
@group_manager_bp.route('/')
def index() -> Response:
response = api.call('group_data', data={})

group_hierarchy = response['data']['group_hierarchy']
user_type = response['data']['user_type']
user_zone = response['data']['user_zone']
Expand All @@ -25,15 +24,8 @@ def index() -> Response:
schema_ids = response['data']['schemas']
schema_id_default = response['data']['schema_default']

# Group list view to be presented initially.
response = api.call('settings_load', data={})
show_list = "TREE"
if 'group_manager_view' in response['data']:
show_list = response['data']['group_manager_view']

return render_template('group_manager/index.html',
group_hierarchy=group_hierarchy,
show_list=show_list,
schema_ids=schema_ids,
schema_id_default=schema_id_default,
user_type=user_type,
Expand Down
8 changes: 4 additions & 4 deletions group_manager/templates/group_manager/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ <h1 id="group-manager-text">Group manager</h1>
Groups
<ul class="nav nav-pills float-end" id="pills-tab" role="tablist">
<li class="nav-item" role="presentation">
<button class="btn btn-sm me-1 {% if show_list == "TREE" %}active{% endif %}" id="pills-tree-tab" data-bs-toggle="pill" data-bs-target="#pills-tree" type="button" role="tab" aria-controls="pills-tree" aria-selected="{% if show_list == "TREE" %} true {% else %} false {% endif %}">Tree view</button>
<button class="btn btn-sm me-1 {% if g.settings.group_manager_view == "TREE" %}active{% endif %}" id="pills-tree-tab" data-bs-toggle="pill" data-bs-target="#pills-tree" type="button" role="tab" aria-controls="pills-tree" aria-selected="{% if g.settings.group_manager_view == "TREE" %} true {% else %} false {% endif %}">Tree view</button>
</li>
<li class="nav-item" role="presentation">
<button class="btn btn-sm {% if show_list == "LIST" %}active{% endif %}" id="pills-list-tab" data-bs-toggle="pill" data-bs-target="#pills-list" type="button" role="tab" aria-controls="pills-list" aria-selected="{% if show_list == "LIST" %} true {% else %} false {% endif %}">List view</button>
<button class="btn btn-sm {% if g.settings.group_manager_view == "LIST" %}active{% endif %}" id="pills-list-tab" data-bs-toggle="pill" data-bs-target="#pills-list" type="button" role="tab" aria-controls="pills-list" aria-selected="{% if g.settings.group_manager_view == "LIST" %} true {% else %} false {% endif %}">List view</button>
</li>
</ul>
</div>
Expand All @@ -46,7 +46,7 @@ <h1 id="group-manager-text">Group manager</h1>
</select>
</div>
<div class="tab-content" id="pills-tabContent">
<div class="tab-pane {% if show_list == "TREE" %} show active {% endif %}" id="pills-tree" role="tabpanel" aria-labelledby="pills-tree-tab">
<div class="tab-pane {% if g.settings.group_manager_view == "TREE" %} show active {% endif %}" id="pills-tree" role="tabpanel" aria-labelledby="pills-tree-tab">
<div class="card groups">
<div class="list-group" id="group-list">

Expand Down Expand Up @@ -78,7 +78,7 @@ <h1 id="group-manager-text">Group manager</h1>
</div>
</div>
</div>
<div class="tab-pane {% if show_list == "LIST" %} show active {% endif %}" id="pills-list" role="tabpanel" aria-labelledby="pills-list-tab">
<div class="tab-pane {% if g.settings.group_manager_view == "LIST" %} show active {% endif %}" id="pills-list" role="tabpanel" aria-labelledby="pills-list-tab">
<div class="card groups">

<div id="result-user-search-groups"></div>
Expand Down

0 comments on commit 2de3982

Please sign in to comment.