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

fix(#6503): Recently Viewed Items - Disable button if no items #6533

Merged
merged 19 commits into from
Apr 3, 2023

Conversation

vhenckel
Copy link
Contributor

@vhenckel vhenckel commented Mar 30, 2023

Closes #6503

Describe your changes:

Disabling button when recent view list is empty.

Screen.Recording.2023-03-30.at.19.03.57.mov

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Is this change backwards compatible? For example, developers won't need to change how they are calling the API or how they've extended core plugins such as Tables or Plots.

Author Checklist

  • Changes address original issue?
  • Tests included and/or updated with changes?
  • Command line build passes?
  • Has this been smoke tested?
  • Testing instructions included in associated issue OR is this a dependency/testcase change?

Reviewer Checklist

  • Changes appear to address issue?
  • Reviewer has tested changes by following the provided instructions?
  • Changes appear not to be breaking changes?
  • Appropriate automated tests included?
  • Code style and in-line documentation are appropriate?
  • Has associated issue been labelled unverified? (only applicable if this PR closes the issue)
  • Has associated issue been labelled bug? (only applicable if this PR is for a bug fix)

@codecov
Copy link

codecov bot commented Mar 30, 2023

Codecov Report

Merging #6533 (4d66b40) into master (344bf8e) will decrease coverage by 0.08%.
The diff coverage is 75.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6533      +/-   ##
==========================================
- Coverage   54.77%   54.69%   -0.08%     
==========================================
  Files         628      628              
  Lines       26798    26802       +4     
  Branches     2420     2421       +1     
==========================================
- Hits        14678    14659      -19     
- Misses      11453    11478      +25     
+ Partials      667      665       -2     
Flag Coverage Δ *Carryforward flag
e2e-ci 39.34% <ø> (ø) Carriedforward from 15bee18
e2e-full 51.06% <ø> (ø) Carriedforward from 15bee18
e2e-stable 55.46% <ø> (-0.02%) ⬇️
unit 48.91% <75.00%> (-0.08%) ⬇️ Carriedforward from 15bee18

*This pull request uses carry forward flags. Click here to find out more.

Impacted Files Coverage Δ
src/ui/layout/RecentObjectsList.vue 66.12% <66.66%> (+0.02%) ⬆️
src/ui/layout/Layout.vue 20.40% <100.00%> (+1.65%) ⬆️

... and 8 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 344bf8e...4d66b40. Read the comment docs.

@ozyx ozyx added the source:community Community contribution or request label Mar 30, 2023
@ozyx ozyx self-requested a review March 30, 2023 22:37
@ozyx ozyx added this to the Target: 2.2.2 milestone Mar 30, 2023
@unlikelyzero
Copy link
Collaborator

@vhenckel would you be able to add a quick e2e test for this?

/openmct/e2e/tests/functional/recentObjects.e2e.spec.js

@unlikelyzero unlikelyzero self-requested a review March 31, 2023 03:46
@vhenckel
Copy link
Contributor Author

@vhenckel would you be able to add a quick e2e test for this?

/openmct/e2e/tests/functional/recentObjects.e2e.spec.js

@unlikelyzero add e2e test.

Screenshot 2023-03-31 at 12 22 22

Copy link
Contributor

@ozyx ozyx 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! I've left just a few suggestions.

e2e/tests/functional/recentObjects.e2e.spec.js Outdated Show resolved Hide resolved
e2e/tests/functional/recentObjects.e2e.spec.js Outdated Show resolved Hide resolved
src/ui/layout/Layout.vue Outdated Show resolved Hide resolved
Copy link
Contributor

@ozyx ozyx left a comment

Choose a reason for hiding this comment

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

Thanks for the quick update! We're getting close. I've got just a few more change requests:

e2e/tests/functional/recentObjects.e2e.spec.js Outdated Show resolved Hide resolved
src/ui/layout/RecentObjectsList.vue Outdated Show resolved Hide resolved
src/ui/layout/Layout.vue Outdated Show resolved Hide resolved
src/ui/layout/Layout.vue Show resolved Hide resolved
expect(await recentObjectsList.locator('.c-recentobjects-listitem').count()).toBe(3);

// Assert that the button is enabled
expect(
Copy link
Contributor

Choose a reason for hiding this comment

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

Great!

Copy link
Contributor

@ozyx ozyx left a comment

Choose a reason for hiding this comment

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

Found one issue-- we should disable the clear button only after the user has confirmed the clear action.

src/ui/layout/Layout.vue Outdated Show resolved Hide resolved
src/ui/layout/Layout.vue Outdated Show resolved Hide resolved
@vhenckel vhenckel requested a review from ozyx April 3, 2023 14:14
Copy link
Contributor

@ozyx ozyx left a comment

Choose a reason for hiding this comment

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

LGTM. Smoke-tested this and it works well.
Excellent work, thank you!

Quick sidenote:
I went ahead and fixed the failing e2e test (it was failing because we were already focused on the clock object when navigating to it, so Recent Objects did not populate). Also, our initial state assertions were just checking for toBeTruthy(), which evaluates to true whether or not the locator exists-- I switched those to toBeVisible().

@ozyx ozyx enabled auto-merge (squash) April 3, 2023 17:13
@ozyx ozyx merged commit bc3a540 into nasa:master Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
source:community Community contribution or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Recently Viewed Items] Disable button if no items
3 participants