Browse Source

feat(uptime): Restrict uptime creation on frontend via flag (#84143)

Evan Purkhiser 1 month ago
parent
commit
1f3e7ca8f5

+ 4 - 1
static/app/views/alerts/wizard/options.tsx

@@ -144,7 +144,10 @@ export const getAlertWizardCategories = (org: Organization) => {
       ],
     });
 
-    if (org.features.includes('uptime')) {
+    if (
+      org.features.includes('uptime') &&
+      !org.features.includes('uptime-create-disabled')
+    ) {
       result.push({
         categoryHeading: t('Uptime Monitoring'),
         options: ['uptime_monitor'],

+ 10 - 0
static/app/views/insights/uptime/views/overview.tsx

@@ -78,6 +78,8 @@ export default function UptimeOverview() {
     });
   };
 
+  const creationDisabled = organization.features.includes('uptime-create-disabled');
+
   return (
     <ModulePageProviders moduleName="uptime" pageTitle={t('Overview')}>
       <BackendHeader
@@ -85,6 +87,14 @@ export default function UptimeOverview() {
         headerActions={
           <ButtonBar gap={1}>
             <LinkButton
+              disabled={creationDisabled}
+              title={
+                creationDisabled
+                  ? t(
+                      'Creation of new uptime alerts is temporarily disabled as the beta has ended. Alert creation will be available again in a few days.'
+                    )
+                  : undefined
+              }
               size="sm"
               priority="primary"
               to={`/organizations/${organization.slug}/alerts/new/uptime/`}