Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENG-6116] Sort User Columns for Institutional Dashboard User table #2300

Conversation

Johnetordoff
Copy link
Collaborator

@Johnetordoff Johnetordoff commented Aug 26, 2024

  • Ticket: [https://openscience.atlassian.net/browse/ENG-6116]
  • Feature flag: n/a

Purpose

This updates the old flaky institutional dashboard table with a new one that

Summary of Changes

  • updates templates and css for new sorting arrow
  • adds new sorting arrow component (Product conversations supported not reusing SortButton)
  • adds tests to new componet
  • add to component code to allow toggling the arrow

Screenshot(s)

Screenshot 2024-09-04 at 3 20 28 PM

Side Effects

QA Notes

Copy link
Contributor

@futa-ikeda futa-ikeda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think my biggest question is if we want to change the sort-button component for this project, as it is used pretty widely in our codebase. My personal preference is use the sort-button component as it was and have it show two arrows, as I feel that is more informative/less confusing, but I would ask Product team folks

@Johnetordoff Johnetordoff force-pushed the sort-users-for-inst-dashboard branch from e11f7f9 to 1d64e48 Compare August 27, 2024 19:57
@Johnetordoff Johnetordoff force-pushed the sort-users-for-inst-dashboard branch 9 times, most recently from 7e3dac8 to 2619eff Compare August 28, 2024 21:23
@Johnetordoff Johnetordoff marked this pull request as ready for review August 28, 2024 22:27
@Johnetordoff Johnetordoff force-pushed the sort-users-for-inst-dashboard branch from 2619eff to 7911d2e Compare August 29, 2024 13:12
Copy link
Contributor

@futa-ikeda futa-ikeda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work so far! Just a few minor things I see, but I think we are quite close!

@@ -12,7 +12,7 @@
>
{{department}}
</PowerSelect>
<ContentPlaceholders as |placeholder|>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems this <ContentPlaceholders> is not being used for anymore, so I think we're good to remove this

</th>
<th local-class='nested-header text-center' colspan='2' width='128'>
{{t 'institutions.dashboard.users_list.projects'}}
<th>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to add a data-test-header-osf-link or something like that here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not? :) 👍

Comment on lines 47 to 81
<th>
<span>{{t 'institutions.dashboard.users_list.private_projects'}}</span>
<SortArrow @sortBy='private_projects' />
</th>
<th data-test-header-private-projects>
{{t 'institutions.dashboard.users_list.public_registration_count'}}
<SortArrow @sortBy='public_registration_count' />
</th>
<th>
{{t 'institutions.dashboard.users_list.private_registration_count'}}
<SortArrow @sortBy='embargoed_registration_count' />
</th>
<th>
{{t 'institutions.dashboard.users_list.published_preprint_count'}}
<SortArrow @sortBy='published_preprint_count' />
</th>
<th>
{{t 'institutions.dashboard.users_list.public_file_count'}}
<SortArrow @sortBy='public_file_count' />
</th>
<th local-class='nested-header text-center' data-test-header-private-projects>
<img src='/assets/images/global/closed-lock.svg'
alt={{t 'institutions.dashboard.users_list.private_projects'}}
>
<th>
{{t 'institutions.dashboard.users_list.storage_byte_count'}}
<SortArrow @sortBy='storage_byte_count' />
</th>
<th>
{{t 'institutions.dashboard.users_list.account_created'}}
<SortArrow @sortBy='account_created' />
</th>
<th>
{{t 'institutions.dashboard.users_list.month_last_login'}}
<SortArrow @sortBy='month_last_login' />
</th>
<th>
{{t 'institutions.dashboard.users_list.month_last_active'}}
<SortArrow @sortBy='month_last_active' />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of these <th>'s don't have any data-test attributes. Could you please add these in for tests later?

Comment on lines 106 to 108
<td data-test-item-account-created>{{moment-format institutionalUser.accountCreationDate 'MM/DD/YYYY HH:mm:SS'}}</td>
<td data-test-item-last-login>{{moment-format institutionalUser.monthLastLogin 'MM/DD/YYYY HH:mm:SS'}}</td>
<td data-test-item-last-active>{{moment-format institutionalUser.monthLastActive 'MM/DD/YYYY HH:mm:SS'}}</td>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would ask for Product team for a bit a clarification, but I think for account creation date, we could just do day-level specificity, and for last-login and last-active, we will only show the month level of specificity

Suggested change
<td data-test-item-account-created>{{moment-format institutionalUser.accountCreationDate 'MM/DD/YYYY HH:mm:SS'}}</td>
<td data-test-item-last-login>{{moment-format institutionalUser.monthLastLogin 'MM/DD/YYYY HH:mm:SS'}}</td>
<td data-test-item-last-active>{{moment-format institutionalUser.monthLastActive 'MM/DD/YYYY HH:mm:SS'}}</td>
<td data-test-item-account-created>{{moment-format institutionalUser.accountCreationDate 'MM/DD/YYYY'}}</td>
<td data-test-item-last-login>{{moment-format institutionalUser.monthLastLogin 'MM/YYYY'}}</td>
<td data-test-item-last-active>{{moment-format institutionalUser.monthLastActive 'MM/YYYY'}}</td>

@@ -0,0 +1,25 @@
import { tagName } from '@ember-decorators/component';
import Component from '@ember/component';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we change this to a glimmer component? This is a "Ember Classic" Component, and we are trying to move away from these, so for new components I'd like to see us using glimmer components. We can pair on this as there are a number of small changes that are a bit cumbersome to go through in PR comments

There's a quick cheatsheet here with some differences between ember classic and glimmer components that I find myself referring to regularly https://ember-learn.github.io/ember-octane-vs-classic-cheat-sheet/

@Johnetordoff Johnetordoff force-pushed the sort-users-for-inst-dashboard branch 3 times, most recently from c6227d2 to d1b9353 Compare September 5, 2024 13:04
@Johnetordoff Johnetordoff force-pushed the sort-users-for-inst-dashboard branch 6 times, most recently from 831baf0 to d38d7de Compare September 5, 2024 16:10
@Johnetordoff Johnetordoff force-pushed the sort-users-for-inst-dashboard branch from d38d7de to ca31526 Compare September 5, 2024 17:04
Copy link
Contributor

@futa-ikeda futa-ikeda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one issue I'd like to see fixed, but that can happen in a later ticket for CSS

translations/en-us.yml Outdated Show resolved Hide resolved
@Johnetordoff Johnetordoff force-pushed the sort-users-for-inst-dashboard branch from ecf2df2 to 352a71d Compare September 6, 2024 10:33
@futa-ikeda futa-ikeda merged commit 5cc1654 into CenterForOpenScience:feature/insti-dash-improv Sep 9, 2024
9 checks passed
@futa-ikeda futa-ikeda added this to the 24.09.0 milestone Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants