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

Role selection for operator status roles #6706

Merged
merged 60 commits into from
Jul 14, 2023
Merged

Role selection for operator status roles #6706

merged 60 commits into from
Jul 14, 2023

Conversation

michaelrogers
Copy link
Contributor

@michaelrogers michaelrogers commented Jun 1, 2023

Closes #6555

Describe your changes:

Screenshot 2023-06-15 at 11 59 14 AM
Screenshot 2023-06-15 at 12 00 05 PM

Added a role selection component to enable a user to select from available roles and the option to Change Roles from the navbar. The selected role is persisted through session storage and propagated across open tabs using a BroadcastChannel. A non-status reporting role can be selected and any attempts to select one will be rejected and an error notification will be triggered. One potential improvement is to hide the ability to provide a status response from the taskbar. Currently statuses roles (from operator status plugin) and user roles (from user providers) are provided separately and not necessarily 1:1 in matching roles. The ExampleUserProvider was updated to support multiple roles / statuses. Openmct-YAMCS's user provider was updated to match the UserAPI changes in a companion ticket.

If there are more than one possible roles, users should be prompted immediately to select a role if one is not available via session storage. If only one option, the role should be auto selected.

Areas for improvement:

  • Clear the operator status response from taskbar when switching users

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)

@deploysentinel
Copy link

deploysentinel bot commented Jun 1, 2023

Current Playwright Test Results Summary

✅ 14 Passing - ⚠️ 1 Flaky

Run may still be in progress, this comment will be updated as current testing workflow or job completes...

(Last updated on 07/14/2023 07:10:42pm UTC)

Run Details

Running Workflow e2e-couchdb on Github Actions

Commit: a80b094

Started: 07/14/2023 07:07:40pm UTC

⚠️ Flakes

📄   functional/plugins/notebook/notebookWithCouchDB.e2e.spec.js • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Notebook Tests with CouchDB @couchdb Inspect Notebook Entry Network Requests
Retry 1Initial Attempt
10.87% (5) 5 / 46 runs
failed over last 7 days
67.39% (31) 31 / 46 runs
flaked over last 7 days

View Detailed Build Results


Current Playwright Test Results Summary

✅ 133 Passing - ⚠️ 1 Flaky

Run may still be in progress, this comment will be updated as current testing workflow or job completes...

(Last updated on 07/14/2023 07:10:42pm UTC)

Run Details

Running Job e2e-stable on CircleCI

Commit: a80b094

Started: 07/14/2023 06:46:37pm UTC

⚠️ Flakes

📄   functional/plugins/imagery/exampleImagery.e2e.spec.js • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Example Imagery Object Can use Mouse Wheel to zoom in and out of latest image
Retry 1Initial Attempt
0.62% (1) 1 / 162 run
failed over last 7 days
80.86% (131) 131 / 162 runs
flaked over last 7 days

View Detailed Build Results


@codecov
Copy link

codecov bot commented Jun 1, 2023

Codecov Report

Merging #6706 (a80b094) into master (92329b3) will decrease coverage by 0.05%.
The diff coverage is 50.00%.

@@            Coverage Diff             @@
##           master    #6706      +/-   ##
==========================================
- Coverage   53.76%   53.72%   -0.05%     
==========================================
  Files         628      631       +3     
  Lines       25027    25116      +89     
  Branches     2508     2516       +8     
==========================================
+ Hits        13457    13494      +37     
- Misses      10897    10947      +50     
- Partials      673      675       +2     
Flag Coverage Δ *Carryforward flag
e2e-full 42.22% <ø> (+0.08%) ⬆️ Carriedforward from 92329b3
e2e-stable 55.42% <74.19%> (+0.01%) ⬆️
unit 48.25% <30.32%> (-0.05%) ⬇️

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

Impacted Files Coverage Δ
...s/operatorStatus/operatorStatus/OperatorStatus.vue 1.66% <0.00%> (-0.47%) ⬇️
src/ui/layout/status-bar/NotificationBanner.vue 50.00% <0.00%> (+4.54%) ⬆️
src/api/user/StatusAPI.js 73.68% <30.00%> (-10.74%) ⬇️
...plugins/userIndicator/components/UserIndicator.vue 37.83% <36.11%> (-62.17%) ⬇️
src/api/user/ActiveRoleSynchronizer.js 53.84% <53.84%> (ø)
src/api/user/StoragePersistance.js 66.66% <66.66%> (ø)
src/api/user/UserAPI.js 91.42% <84.61%> (-4.03%) ⬇️
example/exampleUser/ExampleUserProvider.js 88.46% <100.00%> (+0.46%) ⬆️
example/exampleUser/plugin.js 100.00% <100.00%> (ø)
src/api/overlays/OverlayAPI.js 86.66% <100.00%> (+1.48%) ⬆️
... and 4 more

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 92329b3...a80b094. Read the comment docs.

@michaelrogers michaelrogers changed the title Mct6555 Role selection for operator status roles Jun 7, 2023
@michaelrogers michaelrogers marked this pull request as ready for review June 15, 2023 15:24
@unlikelyzero unlikelyzero added the type:feature Feature. Required intentional design label Jun 16, 2023
Copy link
Contributor

@akhenry akhenry left a comment

Choose a reason for hiding this comment

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

Per the implementation notes, StatusAPI.getStatusRoleForCurrentUser() should be completely removed.

@michaelrogers
Copy link
Contributor Author

Per the implementation notes, StatusAPI.getStatusRoleForCurrentUser() should be completely removed.

getStatusRoleForCurrentUser is now removed and all dependencies of it canProvideStatusForRole with the role provided from the UserAPI.

Copy link
Contributor

@scottbell scottbell left a comment

Choose a reason for hiding this comment

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

Looking good @michaelrogers!
Screenshot 2023-06-19 at 11 44 30 AM

Screenshot 2023-06-19 at 11 45 00 AM

I had some code questions/requests below.

example/exampleUser/ExampleUserProvider.js Outdated Show resolved Hide resolved
example/exampleUser/ExampleUserProvider.js Outdated Show resolved Hide resolved
example/exampleUser/ExampleUserProvider.js Outdated Show resolved Hide resolved
example/exampleUser/plugin.js Outdated Show resolved Hide resolved
src/api/user/RoleChannel.js Outdated Show resolved Hide resolved
src/api/user/UserAPI.js Outdated Show resolved Hide resolved
src/api/user/UserAPI.js Outdated Show resolved Hide resolved
src/api/user/UserAPI.js Outdated Show resolved Hide resolved
src/plugins/userIndicator/components/UserIndicator.vue Outdated Show resolved Hide resolved
src/plugins/userIndicator/components/UserIndicator.vue Outdated Show resolved Hide resolved
@scottbell scottbell added the pr:e2e:couchdb npm run test:e2e:couchdb label Jul 12, 2023
@github-actions github-actions bot removed the pr:e2e:couchdb npm run test:e2e:couchdb label Jul 12, 2023
Copy link
Contributor

@scottbell scottbell left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@akhenry akhenry left a comment

Choose a reason for hiding this comment

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

Changes look great, thank you! Just some minor clean up necessary then we're good to go.

src/api/user/ActiveRoleSynchronizer.js Outdated Show resolved Hide resolved
example/exampleUser/ExampleUserProvider.js Outdated Show resolved Hide resolved
src/api/user/StatusAPI.js Show resolved Hide resolved
@khalidadil khalidadil added the pr:e2e:couchdb npm run test:e2e:couchdb label Jul 14, 2023
@github-actions github-actions bot removed the pr:e2e:couchdb npm run test:e2e:couchdb label Jul 14, 2023
@akhenry akhenry added the pr:e2e:couchdb npm run test:e2e:couchdb label Jul 14, 2023
@github-actions github-actions bot removed the pr:e2e:couchdb npm run test:e2e:couchdb label Jul 14, 2023
@michaelrogers michaelrogers merged commit 32529ff into master Jul 14, 2023
@michaelrogers michaelrogers deleted the mct6555 branch July 14, 2023 19:11
@ozyx ozyx added this to the Target:3.0.0 milestone Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature Feature. Required intentional design
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants