From 5dbcbbfe042d22da756b69d900e56651ce44c7bd Mon Sep 17 00:00:00 2001 From: zkldi <20380519+zkldi@users.noreply.github.com> Date: Sun, 5 Feb 2023 19:30:04 +0000 Subject: [PATCH] fix: add quick-view-my-local-changes btn --- .../app/pages/dashboard/utils/SeedsViewer.tsx | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/client/src/app/pages/dashboard/utils/SeedsViewer.tsx b/client/src/app/pages/dashboard/utils/SeedsViewer.tsx index ee88e0784..ac326cef6 100644 --- a/client/src/app/pages/dashboard/utils/SeedsViewer.tsx +++ b/client/src/app/pages/dashboard/utils/SeedsViewer.tsx @@ -9,14 +9,17 @@ import useApiQuery from "components/util/query/useApiQuery"; import SelectButton from "components/util/SelectButton"; import { TachiConfig } from "lib/config"; import React, { useEffect, useState } from "react"; -import { Col, Row } from "react-bootstrap"; +import { Alert, Col, Row } from "react-bootstrap"; import { Revision } from "types/git"; +import LinkButton from "components/util/LinkButton"; export default function SeedsViewer() { useSetSubheader(["Developer Utils", "Database Seeds Management"]); const { data, error: failedToGetLocalAPI } = useApiQuery>("/seeds"); + const { data: hasUncommittedRes } = useApiQuery("/seeds/has-uncommitted-changes"); + if (!data && !failedToGetLocalAPI) { return ; } @@ -51,6 +54,31 @@ export default function SeedsViewer() { )} + {hasUncommittedRes && ( + <> + +
You have uncommitted changes on your local disk.
+
+ {/* this deliberately reloads the page. */} + + Click to view what you've changed. + +
+
{" "} + + + )} );