Skip to content

Conversation

@DavidCramer
Copy link
Contributor

Alert/Admin notices shown at 70%, 80%, and 90% (with a link to upgrade at 90%)
Screenshot 2020-04-24 at 12 28 16

Dashboard Settings page added usage summary.
Screenshot 2020-04-24 at 12 29 10

@DavidCramer DavidCramer requested a review from pereirinha April 24, 2020 11:37
Copy link
Contributor

@dugajean dugajean 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! Awesome work.

Copy link
Contributor

@pereirinha pereirinha left a comment

Choose a reason for hiding this comment

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

@DavidCramer

I left you a comment for you to consider.
Happy to discuss it on a call.

Thanks.

if ( isset( $usage['credits'] ) ) {
// New credit system.
$usage['credits'] = array(
'limit' => $usage['credits']['limit'],
Copy link
Contributor

Choose a reason for hiding this comment

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

@DavidCramer I notice that we are checking if the credits key is set before we run this logic, but I wonder if that's enough. My concerns here are what about all these child keys, that might not be set. To add to it, it seems that we are getting this information from a source that we don't control. Ideally, this should be addressed on usage_stats() — setting some defaults —, so we can be relaxed using the logic elsewhere. Thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@pereirinha - That is a good suggestion. However, the issue is that there are two different style of settings, although we could switch between the defaults.
Also, this is directly from their API, and is documented. So it shouldn't really change. If it did, we would have it break without breaking.

An ideal way, would be to check when calling the API, then output an error before actually setting the value.
I'll let this pass for now, then loop back with a clean up ticket.

Copy link
Contributor

@pereirinha pereirinha left a comment

Choose a reason for hiding this comment

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

There are a few merge conflicts that need attention, but once resolved, it can be merged.
Great work.

@DavidCramer
Copy link
Contributor Author

@pereirinha - I altered it a little by adding in a method to fetch a specific stat. This will ensure we never reference something that doesn't exist.

@DavidCramer DavidCramer requested a review from pereirinha May 8, 2020 07:31
Copy link
Contributor

@pereirinha pereirinha left a comment

Choose a reason for hiding this comment

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

Thanks for the update @DavidCramer. This update looks more robust solution.
I think I found a problem and I left you a comment.
Can you confirm that there's one?

@pereirinha pereirinha self-requested a review May 8, 2020 14:47
Copy link
Contributor

@pereirinha pereirinha left a comment

Choose a reason for hiding this comment

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

@DavidCramer

Great work. This looks awesome. I was able to test this by tweaking the transient information on transformations and it worked beautifully.

@DavidCramer DavidCramer merged commit 068f235 into develop May 19, 2020
@DavidCramer DavidCramer deleted the feature/CLOUD-396 branch May 19, 2020 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants