Skip to content

[dashboard] Remove superfluous usage_view feature flag #17285

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

Merged
merged 1 commit into from
Apr 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions components/dashboard/src/contexts/FeatureFlagContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ type FeatureFlagsType = {

const defaultFeatureFlags = {
startWithOptions: false,
showUsageView: false,
showUseLastSuccessfulPrebuild: false,
usePublicApiWorkspacesService: false,
enablePersonalAccessTokens: false,
Expand All @@ -40,7 +39,6 @@ const FeatureFlagContextProvider: React.FC = ({ children }) => {
const { project } = useContext(ProjectContext);
const currentOrg = useCurrentOrg();
const [startWithOptions, setStartWithOptions] = useState<boolean>(false);
const [showUsageView, setShowUsageView] = useState<boolean>(false);
const [showUseLastSuccessfulPrebuild, setShowUseLastSuccessfulPrebuild] = useState<boolean>(false);
const [enablePersonalAccessTokens, setPersonalAccessTokensEnabled] = useState<boolean>(false);
const [usePublicApiWorkspacesService, setUsePublicApiWorkspacesService] = useState<boolean>(false);
Expand All @@ -55,7 +53,6 @@ const FeatureFlagContextProvider: React.FC = ({ children }) => {
(async () => {
const featureFlags: FeatureFlagConfig = {
start_with_options: { defaultValue: false, setter: setStartWithOptions },
usage_view: { defaultValue: false, setter: setShowUsageView },
showUseLastSuccessfulPrebuild: { defaultValue: false, setter: setShowUseLastSuccessfulPrebuild },
personalAccessTokensEnabled: { defaultValue: false, setter: setPersonalAccessTokensEnabled },
publicApiExperimentalWorkspaceService: {
Expand Down Expand Up @@ -107,7 +104,6 @@ const FeatureFlagContextProvider: React.FC = ({ children }) => {
const flags = useMemo(() => {
return {
startWithOptions,
showUsageView,
showUseLastSuccessfulPrebuild,
enablePersonalAccessTokens,
usePublicApiWorkspacesService,
Expand All @@ -123,7 +119,6 @@ const FeatureFlagContextProvider: React.FC = ({ children }) => {
newSignupFlow,
oidcServiceEnabled,
orgGitAuthProviders,
showUsageView,
showUseLastSuccessfulPrebuild,
startWithOptions,
usePublicApiWorkspacesService,
Expand Down
4 changes: 1 addition & 3 deletions components/dashboard/src/menu/OrganizationSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { OrgIcon, OrgIconProps } from "../components/org-icon/OrgIcon";
import { useCurrentUser } from "../user-context";
import { BillingMode } from "@gitpod/gitpod-protocol/lib/billing-mode";
import { useUserBillingMode } from "../data/billing-mode/user-billing-mode-query";
import { useFeatureFlags } from "../contexts/FeatureFlagContext";
import { useCurrentOrg, useOrganizations } from "../data/organizations/orgs-query";
import { useOrgBillingMode } from "../data/billing-mode/org-billing-mode-query";
import { useLocation } from "react-router";
Expand All @@ -23,7 +22,6 @@ export default function OrganizationSelector(p: OrganizationSelectorProps) {
const currentOrg = useCurrentOrg();
const { data: userBillingMode } = useUserBillingMode();
const { data: orgBillingMode } = useOrgBillingMode();
const { showUsageView } = useFeatureFlags();
const getOrgURL = useGetOrgURL();

const userFullName = user?.fullName || user?.name || "...";
Expand Down Expand Up @@ -74,7 +72,7 @@ export default function OrganizationSelector(p: OrganizationSelectorProps) {
BillingMode.showUsageBasedBilling(userBillingMode) &&
!user?.additionalData?.isMigratedToTeamOnlyAttribution;

const showUsageForOrg = currentOrg.data?.isOwner && (orgBillingMode?.mode === "usage-based" || showUsageView);
const showUsageForOrg = currentOrg.data?.isOwner && orgBillingMode?.mode === "usage-based";

if (showUsageForPersonalAccount || showUsageForOrg) {
linkEntries.push({
Expand Down