-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
UI: wrap client count card in permission conditional #26848
UI: wrap client count card in permission conditional #26848
Conversation
Build Results: |
CI Results: |
@@ -0,0 +1,3 @@ | |||
```release-note:improvement |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even though I removed the license call in 1.17, I thought a changelog might be prudent because we're changing behavior here.
@@ -9,10 +9,10 @@ | |||
<div class="is-flex-row gap-24"> | |||
{{#if (and @version.isEnterprise @isRootNamespace)}} | |||
<div class="is-flex-column is-flex-1 gap-24"> | |||
<Dashboard::ClientCountCard @isEnterprise={{@version.isEnterprise}} /> | |||
{{#if | |||
(and @isRootNamespace (has-permission "status" routeParams="replication") (not (is-empty-value @replication))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed @isRootNamespace
since that check happens above on line 10
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 Thank you!
@@ -79,7 +79,7 @@ | |||
/> | |||
<small class="has-left-margin-xs has-text-grey"> | |||
Updated | |||
{{date-format @updatedAt "MMM dd, yyyy hh:mm:ss"}} | |||
{{date-format @updatedAt "MMM d yyyy, h:mm:ss aaa" withTimeZone=true}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consistent with our response timestamp format elsewhere in the app
@@ -64,30 +59,19 @@ module('Integration | Component | dashboard/client-count-card', function (hooks) | |||
await click('[data-test-refresh]'); | |||
}); | |||
|
|||
test('it does not query activity for community edition', async function (assert) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this whole component is wrapped in an isEnterprise conditional so moved this assertion to the dashboard/overview-test
@tracked activityData = null; | ||
@tracked updatedAt = timestamp.now().toISOString(); | ||
@tracked hasActivity = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be false instead of null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably good to keep it type consistent! will update
In #26729 I removed the
@license
arg because the card no longer required the start time to pass to the activity log query. Inadvertently, this showed the card for users with just a default policy because the@license
call would fail if a user didn't have permission.This PR wraps the card in an explicit permissions conditional, which is the same one we use to hide the link in the sidebar for users who do not have permission to
/activity
. Tests have also been added to avoid a future regression.User with default policy