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

Removal of UI blockage to access the changeOfferingForVolume API #10135

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

LayonRibeiro
Copy link
Contributor

Description

This PR corrects an incorrect behavior in the UI where users who have access to the changeOfferingForVolume API, but are not admins, cannot use it.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • build/CI
  • test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

Before

2024-12-22_23-01

After

2024-12-22_23-02

How Has This Been Tested?

  1. A role was created (based on the default user role) with permission to access the changeOfferingForVolume API.

  2. An account and a user were created using this role.

  3. The changeOfferingForVolume API icon appeared correctly in the UI (npm run server).

  4. The change in the volume offer was made correctly

@LayonRibeiro LayonRibeiro changed the title Show icon to changeOfferingForVolume for the other users Removal of UI blockage to access the changeOfferingForVolume API Dec 23, 2024
@@ -223,7 +223,7 @@ export default {
label: 'label.change.offering.for.volume',
args: ['id', 'diskofferingid', 'size', 'miniops', 'maxiops', 'automigrate'],
dataView: true,
show: (record, store) => { return ['Allocated', 'Ready'].includes(record.state) && ['Admin'].includes(store.userInfo.roletype) },
show: (record, store) => { return ['Allocated', 'Ready'].includes(record.state) && (['Admin'].includes(store.userInfo.roletype) || !!store.apis.changeOfferingForVolume) },
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we remove the roletype check here?

Copy link
Member

Choose a reason for hiding this comment

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

+1

normally the checks use

'listXXX' in store.getters.apis

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @shwstppr ,
I really can't think of any scenario where checking for admin makes sense.
I'll make a commit to remove the check.
thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @weizhouapache ,
At first I tried to do it the way you explained, but I didn't succeed. So I left it at that.

@shwstppr
Copy link
Contributor

@blueorangutan ui

@blueorangutan
Copy link

@shwstppr a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

Copy link

codecov bot commented Dec 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 16.06%. Comparing base (0b2952c) to head (b8b2163).
Report is 3 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #10135      +/-   ##
============================================
- Coverage     16.06%   16.06%   -0.01%     
  Complexity    12872    12872              
============================================
  Files          5642     5642              
  Lines        493973   493973              
  Branches      59895    59895              
============================================
- Hits          79351    79350       -1     
  Misses       405837   405837              
- Partials       8785     8786       +1     
Flag Coverage Δ
uitests 4.01% <ø> (ø)
unittests 16.90% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@blueorangutan
Copy link

UI build: ✔️
Live QA URL: https://qa.cloudstack.cloud/simulator/pr/10135 (QA-JID-504)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants