-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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: Use Client Count export API #27455
Conversation
CI Results: |
Build Results: |
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.
Just a comment about a conditional. Great work!
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.
Could you add a screenshot of how the new export csv data looks?
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.
Looking great! Just a couple comments/questions for now! Will continue reviewing once tests updates are complete 😄
async generateCsvData() { | ||
const adapter = this.store.adapterFor('clients/activity'); | ||
const currentNs = this.namespace.path; | ||
const { startTimestamp, endTimestamp, selectedNamespace } = this.args; |
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.
CC work has had so many iterations 🫠 - these start/end timestamps update when the date params change, right?
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.
Correct!
return `This export will include the namespace path, mount path and associated total entity, non-entity${ | ||
isSecretsSyncActivated ? ', ACME and secrets sync clients' : ' and ACME clients' | ||
} for the ${this.formattedEndDate ? 'date range' : 'month'} below.`; | ||
exportChartData = task({ drop: true }, async (filename) => { |
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.
Is there a difference between using this syntax vs:
@task({ drop: true })
*exportChartData(filename) {...}
(aside from this changing the await
below to a yield
)
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.
What I used is the latest recommended syntax -- in my experience, it also has a better TS experience (although that is not relevant here) https://ember-concurrency.com/docs/task-concurrency
*/ | ||
|
||
/** | ||
* queryParamString converts an object to a query param string with URL encoded keys and values. |
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.
great idea making this a util!
import queryParamString from 'vault/utils/query-param-string'; | ||
import { module, test } from 'qunit'; | ||
|
||
module('Unit | Utility | query-param-string', function () { |
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 reverts commit d9a4d40.
return resp.blob(); | ||
} | ||
// If it's an empty response (eg 204), there's no data so return an error | ||
errorMsg = 'no data to export in provided time range.'; |
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.
NIT: caps 'no' -> 'No'
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'm matching the casing of the API error messages, which don't have capitalization
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.
🤩 nice work!
Description
This PR updates the Client Count Dashboard to use the dedicated export API. Relies on enterprise PR 6171
sudo
capabilities to export at the given namespaceUpdated modal content
Updated CSV content
Previous CSV content