Skip to content

Commit

Permalink
chore: enable diagnostics for SME (#14140)
Browse files Browse the repository at this point in the history
  • Loading branch information
chandlerprall committed Sep 26, 2024
1 parent 9cc71dd commit ebbd873
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions airbyte-webapp/src/core/services/features/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const defaultEnterpriseFeatures = [
...defaultOssFeatures,
FeatureItem.AllowAllRBACRoles,
FeatureItem.ConnectionHistoryGraphs,
FeatureItem.DiagnosticsExport,
FeatureItem.DisplayOrganizationUsers,
FeatureItem.EnterpriseBranding,
FeatureItem.EnterpriseLicenseChecking,
Expand Down
1 change: 1 addition & 0 deletions airbyte-webapp/src/core/services/features/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export enum FeatureItem {
CloudForTeamsBranding = "CLOUD_FOR_TEAMS_BRANDING",
ConnectionHistoryGraphs = "CONNECTION_HISTORY_GRAPHS",
ConnectorBreakingChangeDeadlines = "CONNECTOR_BREAKING_CHANGE_DEADLINES",
DiagnosticsExport = "DIAGNOSTICS_EXPORT",
DisplayOrganizationUsers = "DISPLAY_ORGANIZATION_USERS",
EmailNotifications = "EMAIL_NOTIFICATIONS",
EnterpriseBranding = "ENTERPRISE_BRANDING",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Text } from "components/ui/Text";

import { useCurrentWorkspace } from "core/api";
import { PageTrackingCodes, useTrackPage } from "core/services/analytics";
import { FeatureItem, useFeature } from "core/services/features";
import { useIntent } from "core/utils/rbac";
import { useExperiment } from "hooks/services/Experiment";
import { DiagnosticsButton } from "pages/SettingsPage/components/DiagnosticButton";
Expand All @@ -19,7 +20,13 @@ export const GeneralOrganizationSettingsPage: React.FC = () => {
useTrackPage(PageTrackingCodes.SETTINGS_ORGANIZATION);
const { formatMessage } = useIntl();
const { workspaceId, organizationId } = useCurrentWorkspace();
const isDownloadDiagnosticsEnabled = useExperiment("settings.downloadDiagnostics");
const isDownloadDiagnosticsFlagEnabled = useExperiment("settings.downloadDiagnostics");
const isDownloadDiagnosticsFeatureEnabled = useFeature(FeatureItem.DiagnosticsExport);

// if EITHER flag OR feature is enabled, provide diagnostics
// effectively: flag controls OSS+Cloud, feature controls SME
const isDownloadDiagnosticsEnabled = isDownloadDiagnosticsFlagEnabled || isDownloadDiagnosticsFeatureEnabled;

const canDownloadDiagnostics = useIntent("DownloadDiagnostics", { workspaceId }) && isDownloadDiagnosticsEnabled;

return (
Expand Down

0 comments on commit ebbd873

Please sign in to comment.