Skip to content
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

chore(web): Cleanup released feature flags #5207

Merged
merged 5 commits into from
Jan 6, 2025
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
35 changes: 1 addition & 34 deletions app/web/src/components/ApplyChangeSetButton.vue
Original file line number Diff line number Diff line change
@@ -1,29 +1,6 @@
<template>
<VButton
v-if="
featureFlagsStore.DEV_SLICE_REBASING && statusWithBase?.conflictsWithBase
stack72 marked this conversation as resolved.
Show resolved Hide resolved
"
size="md"
tone="destructive"
disabled
square
label="Cannot Merge or Rebase, Resolve Conflicts First"
>
</VButton>
<VButton
stack72 marked this conversation as resolved.
Show resolved Hide resolved
v-else-if="
featureFlagsStore.DEV_SLICE_REBASING && statusWithBase?.baseHasUpdates
"
size="md"
tone="warning"
square
label="Rebase from Head"
@click="rebase"
>
</VButton>
<!-- TODO: we can change this v-else-if to look at `statusWithBase.changeSetHasUpdates` -->
<VButton
v-else-if="!changeSetsStore.headSelected"
v-if="!changeSetsStore.headSelected"
ref="applyButtonRef"
size="md"
tone="success"
Expand Down Expand Up @@ -150,14 +127,4 @@ const statusStoreUpdating = computed(() => {
return statusStore.globalStatus.isUpdating;
} else return false;
});

const statusWithBase = computed(
() =>
changeSetsStore.statusWithBase[changeSetsStore.selectedChangeSetId || ""],
);

const rebase = () => {
if (changeSetsStore.selectedChangeSetId)
changeSetsStore.REBASE_ON_BASE(changeSetsStore.selectedChangeSetId);
};
</script>
19 changes: 4 additions & 15 deletions app/web/src/components/AssetFuncAttachModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ import SelectMenu, {
} from "@/components/SelectMenu.vue";
import { useFuncStore } from "@/store/func/funcs.store";
import { useAssetStore } from "@/store/asset.store";
import { useFeatureFlagsStore } from "@/store/feature_flags.store";
import { nilId } from "@/utils/nilId";
import CodeEditor from "./CodeEditor.vue";

Expand All @@ -195,7 +194,6 @@ const props = defineProps<{

const funcStore = useFuncStore();
const assetStore = useAssetStore();
const featureFlagsStore = useFeatureFlagsStore();

const createFuncStarted = ref(false);

Expand All @@ -209,19 +207,10 @@ const schemaVariantId = computed(() =>

const showLoading = computed(() => createFuncReqStatus.value.isPending);

const funcKindOptions = Object.keys(CUSTOMIZABLE_FUNC_TYPES)
.filter((kind) => {
if (
kind === CustomizableFuncKind.Management &&
!featureFlagsStore.MANAGEMENT_FUNCTIONS
)
return false;
return true;
})
.map((kind) => ({
label: CUSTOMIZABLE_FUNC_TYPES[kind as CustomizableFuncKind]?.singularLabel,
value: kind as FuncKind,
}));
const funcKindOptions = Object.keys(CUSTOMIZABLE_FUNC_TYPES).map((kind) => ({
label: CUSTOMIZABLE_FUNC_TYPES[kind as CustomizableFuncKind]?.singularLabel,
value: kind as FuncKind,
}));

const attachExisting = ref(false);

Expand Down
23 changes: 0 additions & 23 deletions app/web/src/components/ChangesPanelHistory.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<template>
<div
v-if="featureFlagsStore.MANAGEMENT_FUNCTIONS"
class="w-full h-full flex flex-col overflow-hidden relative"
@click="deselectOnClickEmptySpace"
>
Expand Down Expand Up @@ -82,26 +81,6 @@
:selectedTab="selectedTab"
/>
</div>
<div v-else ref="actionDivRef" class="py-2xs w-full h-full">
<template v-if="actionsStore.historyActions.length > 0">
<ActionsList
v-for="[detail, actions] in actionsStore.historyActionsGrouped"
:key="detail.changeSetId"
:actions="actions"
:changeSet="getChangeSet(detail)"
:clickAction="clickActionOrMgmtRun"
:selectedFuncRunIds="selectedFuncRunId ? [selectedFuncRunId] : []"
kind="history"
@history="openHistory"
/>
</template>
<EmptyStateCard
v-else
iconName="actions"
primaryText="No Actions Have Been Executed"
secondaryText="There is no action history to display for this change set."
/>
</div>
</template>

<script lang="ts" setup>
Expand All @@ -115,7 +94,6 @@ import {
useActionsStore,
} from "@/store/actions.store";
import { FuncRun, FuncRunId, useFuncRunsStore } from "@/store/func_runs.store";
import { useFeatureFlagsStore } from "@/store/feature_flags.store";
import { ChangeSet, ChangeSetStatus } from "@/api/sdf/dal/change_set";
import { useChangeSetsStore } from "@/store/change_sets.store";
import {
Expand All @@ -131,7 +109,6 @@ const actionsStore = useActionsStore();
const funcRunsStore = useFuncRunsStore();
const managementRunsStore = useManagementRunsStore();
const changeSetsStore = useChangeSetsStore();
const featureFlagsStore = useFeatureFlagsStore();

const actionDivRef = ref();
const managementDivRef = ref();
Expand Down
5 changes: 1 addition & 4 deletions app/web/src/components/ComponentDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,7 @@
<AssetActionsDetails :component="props.component" />
</TabGroupItem>
<TabGroupItem
v-if="
featureFlagsStore.MANAGEMENT_FUNCTIONS &&
funcStore.managementFunctionsForSelectedComponent.length > 0
"
v-if="funcStore.managementFunctionsForSelectedComponent.length > 0"
slug="management"
label="Mgmt Fns"
>
Expand Down
8 changes: 0 additions & 8 deletions app/web/src/components/FuncEditor/FuncList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ import {
FUNC_TYPES,
FuncSummary,
} from "@/api/sdf/dal/func";
import { useFeatureFlagsStore } from "@/store/feature_flags.store";

const featureFlagsStore = useFeatureFlagsStore();

// filtering out a func type if FF for mgmt functions is off
// When you use an enum as keys in a record
Expand All @@ -66,11 +63,6 @@ const featureFlagsStore = useFeatureFlagsStore();
// So, I can Partial to make all keys optional
const funcKindOptions: Partial<FUNC_TYPES> = {};
Object.entries(CUSTOMIZABLE_FUNC_TYPES).forEach(([key, value]) => {
if (
!featureFlagsStore.MANAGEMENT_FUNCTIONS &&
key === CustomizableFuncKind.Management
)
return;
funcKindOptions[key] = value;
});

Expand Down
5 changes: 1 addition & 4 deletions app/web/src/components/ModelingDiagram/DiagramEdge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ import {
useTheme,
} from "@si/vue-lib/design-system";
import { isDevMode } from "@/utils/debug";
import { useFeatureFlagsStore } from "@/store/feature_flags.store";
import { useViewsStore } from "@/store/views.store";
import { SELECTION_COLOR, SOCKET_SIZE } from "./diagram_constants";
import { DiagramEdgeData } from "./diagram_types";
Expand Down Expand Up @@ -108,8 +107,6 @@ const { theme } = useTheme();
const diagramContext = useDiagramContext();
const { drawEdgeState } = diagramContext;

const featureFlagsStore = useFeatureFlagsStore();

const isDeleted = computed(
() => props.edge.def.changeStatus === "deleted" || props.edge.def.toDelete,
);
Expand Down Expand Up @@ -174,7 +171,7 @@ const showEdge = computed(() => {
return false;
}

if (props.edge.def.isManagement && featureFlagsStore.MANAGEMENT_EDGES) {
if (props.edge.def.isManagement) {
return isFromOrToSelected.value || props.isSelected;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,10 +361,7 @@ const rightClickMenuItems = computed(() => {
}

// management funcs for a single selected component
if (
funcStore.managementFunctionsForSelectedComponent.length > 0 &&
featureFlagsStore.MANAGEMENT_FUNCTIONS
) {
if (funcStore.managementFunctionsForSelectedComponent.length > 0) {
const submenuItems: DropdownMenuItemObjectDef[] = [];
funcStore.managementFunctionsForSelectedComponent.forEach((fn) => {
submenuItems.push({
Expand Down
3 changes: 0 additions & 3 deletions app/web/src/components/layout/navbar/NavbarPanelCenter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
/>

<NavbarButton
v-if="featureFlagsStore.AUDIT_PAGE"
tooltipText="Audit"
icon="eye"
:selected="route.matched.some((r) => r.name === 'workspace-audit')"
Expand All @@ -36,13 +35,11 @@

<script setup lang="ts">
import { useRoute } from "vue-router";
import { useFeatureFlagsStore } from "@/store/feature_flags.store";
import { useViewsStore } from "@/store/views.store";
import { useChangeSetsStore } from "@/store/change_sets.store";
import NavbarButton from "./NavbarButton.vue";

const route = useRoute();
const featureFlagsStore = useFeatureFlagsStore();

const modelingLink = () => {
const viewsStore = useViewsStore();
Expand Down
8 changes: 1 addition & 7 deletions app/web/src/store/components.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,6 @@ export const processRawComponent = (
component: RawComponent,
allComponents: Record<ComponentId, RawComponent>,
) => {
const featureFlagsStore = useFeatureFlagsStore();
const typeIcon = getAssetIcon(component?.schemaCategory);

const ancestorIds = getAncestorIds(allComponents, component.id);
Expand All @@ -418,10 +417,6 @@ export const processRawComponent = (
schemaId: component.schemaId,
}));

if (!featureFlagsStore.MANAGEMENT_EDGES) {
component.sockets = component.sockets.filter((s) => !s.isManagement);
}

const fullComponent = {
...component,
ancestorIds,
Expand Down Expand Up @@ -756,8 +751,7 @@ export const useComponentsStore = (forceChangeSetId?: ChangeSetId) => {
: [];

const management =
response.managementEdges?.length > 0 &&
featureFlagsStore.MANAGEMENT_EDGES
response.managementEdges?.length > 0
? response.managementEdges.map(
edgeFromRawEdge({ isInferred: false, isManagement: true }),
)
Expand Down
5 changes: 0 additions & 5 deletions app/web/src/store/feature_flags.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,8 @@ import { posthog } from "@/utils/posthog";
const FLAG_MAPPING = {
// STORE_FLAG_NAME: "posthogFlagName",
MODULES_TAB: "modules_tab",
FIRST_TIME_TUTORIAL_MODAL: "first_time_tutorial_modal",
DEV_SLICE_REBASING: "dev-slice-rebasing",
ADMIN_PANEL_ACCESS: "si_admin_panel_access",
ON_DEMAND_ASSETS: "on_demand_assets",
MANAGEMENT_FUNCTIONS: "management-functions",
MANAGEMENT_EDGES: "management-edges",
AUDIT_PAGE: "audit-page",
AI_GENERATOR: "ai-generator",
REBAC: "rebac",
OUTLINER_VIEWS: "diagram-outline-show-views",
Expand Down
3 changes: 0 additions & 3 deletions app/web/src/store/management_runs.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { useWorkspacesStore } from "./workspaces.store";
import { useChangeSetsStore } from "./change_sets.store";
import handleStoreError from "./errors";
import { useRealtimeStore } from "./realtime/realtime.store";
import { useFeatureFlagsStore } from "./feature_flags.store";
import { FuncRun, FuncRunId, useFuncRunsStore } from "./func_runs.store";

export interface ManagementHistoryItem {
Expand All @@ -30,7 +29,6 @@ export const useManagementRunsStore = () => {

const changeSetsStore = useChangeSetsStore();
const changeSetId = changeSetsStore.selectedChangeSetId;
const featureFlagsStore = useFeatureFlagsStore();
const funcRunsStore = useFuncRunsStore();

const API_PREFIX = `v2/workspaces/${workspaceId}/change-sets/${changeSetId}`;
Expand All @@ -54,7 +52,6 @@ export const useManagementRunsStore = () => {
},
actions: {
async GET_MANAGEMENT_RUN_HISTORY() {
if (!featureFlagsStore.MANAGEMENT_FUNCTIONS) return;
return new ApiRequest<ManagementHistoryItem[]>({
url: `${API_PREFIX}/management/history`,
headers: { accept: "application/json" },
Expand Down
Loading