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-6078][ENG-6080] Link to past reports #2296

Conversation

futa-ikeda
Copy link
Contributor

@futa-ikeda futa-ikeda commented Aug 22, 2024

  • Ticket: [ENG-6078][ENG-6080]
  • Feature flag: n/a

Purpose

  • Add new URL field to institution model for getting to archived reports
  • Add link to archived reports to the institutional dashboard pages

Summary of Changes

  • Update institution model and update mirage
  • Update institution-dashboard-wrapper to include new link
  • Update how model hook works so we don't have to pass around a taskInstance
    • Update args and such for this
    • Remove controller
  • Glimmer-ize the institutional-user-list component

Screenshot(s)

image

Side Effects

QA Notes

@futa-ikeda futa-ikeda changed the title Link to past reports [ENG-6078][ENG-6080] Link to past reports Aug 26, 2024
Copy link
Contributor

@brianjgeiger brianjgeiger left a comment

Choose a reason for hiding this comment

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

Seems good. Don't forget to include all changes, especially ones that don't seem immediately relevant to the PR goals, in the changes section.

import Component from '@ember/component';
import { action, computed } from '@ember/object';
import { reads } from '@ember/object/computed';
import Component from '@glimmer/component';
Copy link
Contributor

Choose a reason for hiding this comment

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

You didn't mention in Changes that you were updating this to glimmer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call! I've updated the PR description!

@futa-ikeda futa-ikeda merged commit 6028288 into CenterForOpenScience:feature/insti-dash-improv Aug 26, 2024
9 checks passed
@futa-ikeda futa-ikeda deleted the link-to-past-reports branch August 26, 2024 16:29
Copy link
Contributor

@aaxelb aaxelb left a comment

Choose a reason for hiding this comment

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

just a few nitpicks (oops already merged, glad i'm approving)

Comment on lines +22 to +33
.download-button {
display: inline-block;
border: 1px solid $color-border-gray;
border-radius: 2px;
padding: 6px 12px;
}

.download-button:focus,
.download-button:hover {
color: $color-text-black;
background-color: $color-shadow-dark;
border-color: $color-border-gray-darker;
Copy link
Contributor

Choose a reason for hiding this comment

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

(nitpick) is there a reusable component with style that applies here? (... i guess while Button has a "fake link" mode, OsfLink doesn't have a "fake button" mode... )

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea, this "OsfLink that looks like a button" is a pattern that we've used before. I guess I could just make this a Button that calls a window.open and that might be cleaner to maintain.

Copy link
Contributor

Choose a reason for hiding this comment

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

<a href="..."> is preferable over a <button> with javascript to open a url (for both accessibility and clarity) -- if it's a common pattern to style a link as a button, tho, would recommend putting that consistent style in one place (whether OsfLink with corresponding arg, or in a reusable global css class or scss whatchamadoo) rather than rewriting it each time

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Re: <a> vs <button>, that's a good point. This is opening a URL after all.

I will add an arg to <OsfLink> similar to what we do for <Button>

data-test-link-to-reports-archive
data-analytics-name='Link to archived reports'
local-class='download-button'
@href={{@institution.linkToExternalReportsArchive}}
Copy link
Contributor

Choose a reason for hiding this comment

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

(ux nitpick) as an external link, seems appropriate to open in a new tab/window with target="_blank" (unsure if there's a request either way on that)

@@ -800,7 +800,7 @@ institutions:
preprints: Preprints
content-placeholder: Content coming soon # Delete this eventually pls
title: '{institutionName} Dashboard'
last_update: 'Updated every 24 hours'
download_past_reports_label: Reports
Copy link
Contributor

Choose a reason for hiding this comment

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

(text nitpick) seems less than ideal that the text shown to the user is even less descriptive than the variable names

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea, I'll propose a more descriptive label for this

Johnetordoff pushed a commit to Johnetordoff/ember-osf-web that referenced this pull request Aug 27, 2024
…ForOpenScience/ember-osf-web into sort-users-for-inst-dashboard

* 'feature/insti-dash-improv' of https://github.com/CenterForOpenScience/ember-osf-web:
  [ENG-6078][ENG-6080] Link to past reports (CenterForOpenScience#2296)

# Conflicts:
#	app/institutions/dashboard/-components/institutional-users-list/component.ts
futa-ikeda added a commit that referenced this pull request Aug 30, 2024
-   Ticket: []
-   Feature flag: n/a

## Purpose
- Address some CR comments from prior PR #2296

## Summary of Changes
- Add a new arg `@fakeButton` to `OsfLink` to easily make a link look like a button (which maybe isn't a pattern we want to encourage, but at least now it's DRY when we do it 😬 )
- Update wording for hover text for reports
- Have link open in a new window
@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.

3 participants