Skip to content

Do not show operator status for roles without status capability#8321

Merged
akhenry merged 8 commits into
masterfrom
VIPERGC-1002-operator-polls
May 14, 2026
Merged

Do not show operator status for roles without status capability#8321
akhenry merged 8 commits into
masterfrom
VIPERGC-1002-operator-polls

Conversation

@davetsay

@davetsay davetsay commented May 8, 2026

Copy link
Copy Markdown
Contributor

Closes #8320

Describe your changes:

Setting Poll updates in Operator Status indicator is now limited by this.openmct.user.canProvideStatusForRole().
This is the same check that will hide Operator Status, but the Poll Question update was overriding this and adding the operator status for that poll regardless of user role.

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 a notable change that will require a special callout in the release notes? For example, will this break compatibility with existing APIs or projects that consume these plugins?

Author Checklist

  • Changes address original issue?
  • Tests included and/or updated with changes?
  • Has this been smoke tested?
  • Have you associated this PR with a type: label? Note: this is not necessarily the same as the original issue.
  • Have you associated a milestone with this PR? Note: leave blank if unsure.
  • 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?

@davetsay davetsay added this to the Next milestone May 8, 2026
@davetsay davetsay requested a review from akhenry May 8, 2026 22:36
@codecov

codecov Bot commented May 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 54.54545% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.16%. Comparing base (1e6f04f) to head (81c3aef).

Files with missing lines Patch % Lines
...s/operatorStatus/operatorStatus/OperatorStatus.vue 20.00% 4 Missing ⚠️
...ugins/operatorStatus/pollQuestion/PollQuestion.vue 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8321      +/-   ##
==========================================
- Coverage   57.17%   57.16%   -0.01%     
==========================================
  Files         728      728              
  Lines       29702    29703       +1     
  Branches     2810     2811       +1     
==========================================
- Hits        16981    16979       -2     
- Misses      12381    12384       +3     
  Partials      340      340              
Flag Coverage Δ
e2e-ci 64.42% <100.00%> (-0.02%) ⬇️
e2e-full 39.48% <0.00%> (-0.03%) ⬇️
unit 46.37% <36.36%> (+<0.01%) ⬆️
Files with missing lines Coverage Δ
example/exampleUser/ExampleUserProvider.js 83.87% <100.00%> (+0.26%) ⬆️
example/exampleUser/plugin.js 100.00% <ø> (ø)
...eratorStatus/pollQuestion/PollQuestionIndicator.js 100.00% <100.00%> (ø)
...ugins/operatorStatus/pollQuestion/PollQuestion.vue 0.00% <0.00%> (ø)
...s/operatorStatus/operatorStatus/OperatorStatus.vue 1.61% <20.00%> (ø)

... and 2 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 1e6f04f...81c3aef. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@@ -0,0 +1,33 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2024, United States Government

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

dates are wrong

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

anyone still here in 2026?

Thanks @evenstensberg. I've just created #8323 to address this permanently.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@davetsay hard to get someone from the team to review these days, can you have a look at #8313 when you got time?

this.indicator.text(pollQuestion?.question || '');
const isStatusCapable = await this.openmct.user.canProvideStatusForRole();
if (isStatusCapable) {
this.indicator.text(pollQuestion?.question || '');

@akhenry akhenry May 13, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we should avoid installing the indicator at all if they cannot set their own status. I think this is what this line is achieving, but in a round-about way?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Actually, UserAPI.canProvideStatusForRole looks for the active role of the user, so we should still install the indicator in case the user has multiple roles.

@akhenry akhenry self-requested a review May 14, 2026 19:52
@akhenry akhenry merged commit 3aaa0f0 into master May 14, 2026
33 of 34 checks passed
@akhenry akhenry deleted the VIPERGC-1002-operator-polls branch May 14, 2026 19:53
akhenry added a commit that referenced this pull request May 14, 2026
… (#8326)

* Do not show operator status for roles without status capability (#8321)
(cherry picked from commit 3aaa0f0)
---------

Co-authored-by: Andrew Henry <akhenry@gmail.com>

* single/multi indicators does not exist in `#gold`

---------

Co-authored-by: Andrew Henry <akhenry@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Operator Status should not be visible for roles that cannot provide status

3 participants