From bb31bd399c5581719d51de8071310107994da7e2 Mon Sep 17 00:00:00 2001 From: John Tordoff <> Date: Thu, 19 Sep 2024 10:15:04 -0400 Subject: [PATCH] make clicking apply close dropdown and make table scrollable for mobile --- .../institutional-users-list/styles.scss | 17 +++ .../institutional-users-list/template.hbs | 122 +++++++++--------- config/environment.js | 2 +- translations/en-us.yml | 10 +- 4 files changed, 85 insertions(+), 66 deletions(-) diff --git a/app/institutions/dashboard/-components/institutional-users-list/styles.scss b/app/institutions/dashboard/-components/institutional-users-list/styles.scss index c330aece44..8d8e0c5dc3 100644 --- a/app/institutions/dashboard/-components/institutional-users-list/styles.scss +++ b/app/institutions/dashboard/-components/institutional-users-list/styles.scss @@ -270,3 +270,20 @@ input:checked + .slider::before { margin-right: 5px; font-weight: bold; } + +/* Add media query for mobile devices */ +@media (max-width: 1000px) { + .table-wrapper { + overflow-x: auto; + -webkit-overflow-scrolling: touch; /* For smooth scrolling on iOS */ + } + + .table table { + min-width: 1000px; /* Set the table's width to be wider than the viewport */ + } + + .table th, + .table td { + white-space: nowrap; /* Prevent text from wrapping */ + } +} diff --git a/app/institutions/dashboard/-components/institutional-users-list/template.hbs b/app/institutions/dashboard/-components/institutional-users-list/template.hbs index 543de8f498..a5d8c87ab0 100644 --- a/app/institutions/dashboard/-components/institutional-users-list/template.hbs +++ b/app/institutions/dashboard/-components/institutional-users-list/template.hbs @@ -57,7 +57,7 @@ - @@ -65,63 +65,65 @@ {{/if}} - - - {{#let (component 'sort-arrow' - class=(local-class 'sort-arrow') - sortAction=this.sortInstitutionalUsers - sort=this.sort - ) as |SortArrow|}} - - {{#each this.columns as |column|}} - {{#if (includes column.key this.selectedColumns)}} - -
- {{column.label}} - {{#if column.sort_key}} - - - - {{/if}} -
- - {{/if}} - {{/each}} - - {{/let}} -
- - {{#each this.columns as |column|}} - {{#if (includes column.key this.selectedColumns)}} - - {{#if (eq column.type 'user_name')}} - - {{institutionalUser.userName}} - - {{else if (eq column.type 'osf_link')}} - - {{institutionalUser.userGuid}} - - {{else if (eq column.type 'date_by_month')}} - {{moment-format (get institutionalUser column.key) 'MM/YYYY'}} - {{else}} - {{get institutionalUser column.key}} - {{/if}} - - {{/if}} - {{/each}} - - - {{t 'institutions.dashboard.users_list.empty'}} - -
+
+ + + {{#let (component 'sort-arrow' + class=(local-class 'sort-arrow') + sortAction=this.sortInstitutionalUsers + sort=this.sort + ) as |SortArrow|}} + + {{#each this.columns as |column|}} + {{#if (includes column.key this.selectedColumns)}} + +
+ {{column.label}} + {{#if column.sort_key}} + + + + {{/if}} +
+ + {{/if}} + {{/each}} + + {{/let}} +
+ + {{#each this.columns as |column|}} + {{#if (includes column.key this.selectedColumns)}} + + {{#if (eq column.type 'user_name')}} + + {{institutionalUser.userName}} + + {{else if (eq column.type 'osf_link')}} + + {{institutionalUser.userGuid}} + + {{else if (eq column.type 'date_by_month')}} + {{moment-format (get institutionalUser column.key) 'MM/YYYY'}} + {{else}} + {{get institutionalUser column.key}} + {{/if}} + + {{/if}} + {{/each}} + + + {{t 'institutions.dashboard.users_list.empty'}} + +
+
{{/if}} diff --git a/config/environment.js b/config/environment.js index 864e31cea9..56f12bae31 100644 --- a/config/environment.js +++ b/config/environment.js @@ -60,7 +60,7 @@ const { KEEN_CONFIG: keenConfig, LINT_ON_BUILD: lintOnBuild = false, WATER_BUTLER_ENABLED = true, - MIRAGE_ENABLED = true, + MIRAGE_ENABLED = false, MIRAGE_SCENARIOS = [ 'cedar', 'collections', diff --git a/translations/en-us.yml b/translations/en-us.yml index 32b0c18212..6d0a7a0ee4 100644 --- a/translations/en-us.yml +++ b/translations/en-us.yml @@ -822,11 +822,11 @@ institutions: has_orcid: 'Has ORCID' select_columns: 'Customize' total_users: 'total users' - panel: - users: 'Total Users' - projects: 'OSF Projects' - registrations: 'OSF Registrations' - preprints: 'OSF Preprints' + panel: + users: 'Total Users' + projects: 'OSF Projects' + registrations: 'OSF Registrations' + preprints: 'OSF Preprints' projects_panel: 'Total Projects' departments_panel: Departments public: Public