Skip to content

Commit

Permalink
remove table wrapper and fix pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
John Tordoff committed Oct 31, 2024
1 parent 500d9c7 commit 5b6af65
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 69 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,12 @@
color: $color-select;
}

.table-wrapper {
overflow-x: auto;
display: block;
}

.table {
margin-bottom: 45px;

table {
overflow-x: auto;
display: block;
width: 100%;
margin-bottom: 15px;
table-layout: auto;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,70 +65,68 @@
{{/if}}
</BasicDropdown>
</div>
<div local-class='table-wrapper'>
<PaginatedList::HasMany
local-class='table'
@isTable={{true}}
@model={{@institution}}
@usePlaceholders={{false}}
@relationshipName='userMetrics'
@query={{this.queryUsers}}
@totalCount={{this.totalUsers}}
@pagination='adjustable'
as |list|
>
<list.header local-class='header'>
{{#let (component 'sort-arrow'
class=(local-class 'sort-arrow')
sortAction=this.sortInstitutionalUsers
sort=this.sort
) as |SortArrow|}}
<tr>
{{#each this.columns as |column|}}
{{#if (includes column.key this.selectedColumns)}}
<th data-test-header='{{column.key}}'>
<div local-class='header-content'>
<span local-class='header-text'>{{column.label}}</span>
{{#if column.sort_key}}
<span local-class='sort-arrow-container'>
<SortArrow @sortBy='{{column.sort_key}}' />
</span>
{{/if}}
</div>
</th>
{{/if}}
{{/each}}
</tr>
{{/let}}
</list.header>
<list.item local-class='item' as |institutionalUser|>
{{#each this.columns as |column|}}
{{#if (includes column.key this.selectedColumns)}}
<td data-test-item={{column.key}}>
{{#if (eq column.type 'user_name')}}
<OsfLink @href={{concat '/' institutionalUser.userGuid '/'}}>
{{institutionalUser.userName}}
</OsfLink>
{{else if (eq column.type 'osf_link')}}
<OsfLink @href={{concat '/' institutionalUser.userGuid '/'}}>
{{institutionalUser.userGuid}}
</OsfLink>
{{else if (eq column.type 'date_by_month')}}
{{#if (get institutionalUser column.key)}}
{{moment-format (get institutionalUser column.key) 'MM/YYYY'}}
{{else}}
N/A
{{/if}}
<PaginatedList::HasMany
local-class='table'
@isTable={{true}}
@model={{@institution}}
@usePlaceholders={{false}}
@relationshipName='userMetrics'
@query={{this.queryUsers}}
@totalCount={{this.totalUsers}}
@pagination='adjustable'
as |list|
>
<list.header local-class='header'>
{{#let (component 'sort-arrow'
class=(local-class 'sort-arrow')
sortAction=this.sortInstitutionalUsers
sort=this.sort
) as |SortArrow|}}
<tr>
{{#each this.columns as |column|}}
{{#if (includes column.key this.selectedColumns)}}
<th data-test-header='{{column.key}}'>
<div local-class='header-content'>
<span local-class='header-text'>{{column.label}}</span>
{{#if column.sort_key}}
<span local-class='sort-arrow-container'>
<SortArrow @sortBy='{{column.sort_key}}' />
</span>
{{/if}}
</div>
</th>
{{/if}}
{{/each}}
</tr>
{{/let}}
</list.header>
<list.item local-class='item' as |institutionalUser|>
{{#each this.columns as |column|}}
{{#if (includes column.key this.selectedColumns)}}
<td data-test-item={{column.key}}>
{{#if (eq column.type 'user_name')}}
<OsfLink @href={{concat '/' institutionalUser.userGuid '/'}}>
{{institutionalUser.userName}}
</OsfLink>
{{else if (eq column.type 'osf_link')}}
<OsfLink @href={{concat '/' institutionalUser.userGuid '/'}}>
{{institutionalUser.userGuid}}
</OsfLink>
{{else if (eq column.type 'date_by_month')}}
{{#if (get institutionalUser column.key)}}
{{moment-format (get institutionalUser column.key) 'MM/YYYY'}}
{{else}}
{{get institutionalUser column.key}}
{{t 'institutions.dashboard.users_list.not_found'}}
{{/if}}
</td>
{{/if}}
{{/each}}
</list.item>
<list.empty local-class='empty'>
{{t 'institutions.dashboard.users_list.empty'}}
</list.empty>
</PaginatedList::HasMany>
</div>
{{else}}
{{get institutionalUser column.key}}
{{/if}}
</td>
{{/if}}
{{/each}}
</list.item>
<list.empty local-class='empty'>
{{t 'institutions.dashboard.users_list.empty'}}
</list.empty>
</PaginatedList::HasMany>
{{/if}}
1 change: 1 addition & 0 deletions translations/en-us.yml
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,7 @@ institutions:
has_orcid: 'Has ORCID'
select_columns: 'Customize'
total_users: 'total users'
not_found: 'N/A'
kpi-panel:
users: 'Total Users'
projects: 'OSF Public and Private Projects'
Expand Down

0 comments on commit 5b6af65

Please sign in to comment.