diff --git a/apps/roam/src/components/settings/AdminPanel.tsx b/apps/roam/src/components/settings/AdminPanel.tsx
index 85ba13269..4baac12b4 100644
--- a/apps/roam/src/components/settings/AdminPanel.tsx
+++ b/apps/roam/src/components/settings/AdminPanel.tsx
@@ -14,7 +14,6 @@ import {
} from "@blueprintjs/core";
import Description from "roamjs-components/components/Description";
import { Select } from "@blueprintjs/select";
-import { getSetting, setSetting } from "~/utils/extensionSettings";
import {
getSupabaseContext,
getLoggedInClient,
@@ -27,8 +26,6 @@ import {
type NodeSignature,
type PConceptFull,
} from "@repo/database/lib/queries";
-import migrateRelations from "~/utils/migrateRelations";
-import { countReifiedRelations } from "~/utils/createReifiedBlock";
import type { DGSupabaseClient } from "@repo/database/lib/client";
import internalError from "~/utils/internalError";
import SuggestiveModeSettings from "./SuggestiveModeSettings";
@@ -36,8 +33,6 @@ import { getFormattedConfigTree } from "~/utils/discourseConfigRef";
import refreshConfigTree from "~/utils/refreshConfigTree";
import createBlock from "roamjs-components/writes/createBlock";
import deleteBlock from "roamjs-components/writes/deleteBlock";
-import { USE_REIFIED_RELATIONS } from "~/data/userSettings";
-import posthog from "posthog-js";
import { setFeatureFlag } from "~/components/settings/utils/accessors";
const NodeRow = ({ node }: { node: PConceptFull }) => {
@@ -258,98 +253,7 @@ const NodeListTab = (): React.ReactElement => {
);
};
-const MigrationTab = (): React.ReactElement => {
- let initial = true;
- const [useMigrationResults, setMigrationResults] = useState("");
- const [useOngoing, setOngoing] = useState(false);
- const [useDryRun, setDryRun] = useState(false);
- const enabled = getSetting(USE_REIFIED_RELATIONS, false);
- const doMigrateRelations = async () => {
- setOngoing(true);
- try {
- posthog.capture("Reified Relations: Migration Started", {
- dryRun: useDryRun,
- });
- const before = await countReifiedRelations();
- const numProcessed = await migrateRelations(useDryRun);
- const after = await countReifiedRelations();
- if (after - before < numProcessed)
- setMigrationResults(
- `${after - before} new relations created out of ${numProcessed} distinct relations processed`,
- );
- else setMigrationResults(`${numProcessed} new relations created`);
- posthog.capture("Reified Relations: Migration Completed", {
- dryRun: useDryRun,
- processed: numProcessed,
- before,
- after,
- created: after - before,
- });
- } catch (e) {
- console.error("Relation migration failed", e);
- setMigrationResults(
- `Migration failed: ${(e as Error).message ?? "see console for details"}`,
- );
- posthog.capture("Reified Relations: Migration Failed", {
- dryRun: useDryRun,
- error: (e as Error).message ?? "unknown error",
- });
- } finally {
- setOngoing(false);
- }
- };
- useEffect(() => {
- void (async () => {
- if (initial) {
- const numRelations = await countReifiedRelations();
- setMigrationResults(
- numRelations > 0
- ? `${numRelations} already migrated`
- : "No migrated relations",
- );
- // eslint-disable-next-line react-hooks/exhaustive-deps
- initial = false;
- }
- })();
- return () => {
- initial;
- };
- }, []);
-
- return (
- <>
-
-
- {
- const target = e.target as HTMLInputElement;
- setDryRun(target.checked);
- }}
- labelElement={<>Dry run>}
- />
-
- {useOngoing ? (
-
- ) : (
- {useMigrationResults}
- )}
- >
- );
-};
-
const FeatureFlagsTab = (): React.ReactElement => {
- const [useReifiedRelations, setUseReifiedRelations] = useState(
- getSetting(USE_REIFIED_RELATIONS, false),
- );
const settings = useMemo(() => {
refreshConfigTree();
return getFormattedConfigTree();
@@ -442,31 +346,6 @@ const FeatureFlagsTab = (): React.ReactElement => {
- {
- const target = e.target as HTMLInputElement;
- setUseReifiedRelations(target.checked);
- void setSetting(USE_REIFIED_RELATIONS, target.checked).catch(
- () => undefined,
- );
- setFeatureFlag("Reified relation triples", target.checked);
- posthog.capture("Reified Relations: Toggled", {
- enabled: target.checked,
- });
- }}
- labelElement={
- <>
- Reified relation triples
-
- >
- }
- />
-