Add two new methods to the server API for getting and setting usage
limits. Both new functions take an attributionId and work for both users
and teams.
For backwards compatibility, leave the `getUsageLimitForTeam` and
`setUsageLimitForTeam` methods as they are still used by the dashboard,
but change them to be implemented in terms of the more general `get/set`
methods.
Generalize the `subscribeTeamToStripe` method so that it works for user
attribution ids too.
Implement the `subscribeTeamToStripe` method in terms of the new general
method.
Add a general method for finding the stripe subscription id for a given
attribution id. Implement the existing `findStripeSubscriptionIdForTeam`
method in terms of the new method.
Currently, The service ping can be disabled by going into the
admin settings. Users are more likely to do that if they have
no clue what is being sent.
This PR tries to improve this experience, by showcasing the
exact data that is being sent below the option. This is possible
by creating a new TelemetryDataProvider and injecting that
both in the `installation-admin-collector` controller
and the `gitpod-service` (`getTelemetryData` func is added here
that can be used).
This PR also adds a gaurd to the `/admin/settings` page which
was missing previously
Signed-off-by: Tarun Pothulapati <tarun@gitpod.io>
replace cluster with gitpod instance in desc
Signed-off-by: Tarun Pothulapati <tarun@gitpod.io>
easy nits around design and TelemetryData naming
Signed-off-by: Tarun Pothulapati <tarun@gitpod.io>
gaurd telemetry method with admin access
Signed-off-by: Tarun Pothulapati <tarun@gitpod.io>
replace TelemetryData at more places
Signed-off-by: Tarun Pothulapati <tarun@gitpod.io>
gaurd access to `admin/settings` like other admin settings
Signed-off-by: Tarun Pothulapati <tarun@gitpod.io>
call useEffect hook early
Signed-off-by: Tarun Pothulapati <tarun@gitpod.io>