From 2ffceb259f0389540e741ca219bd829e6012cd6f Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Thu, 26 Dec 2024 18:22:28 -0300 Subject: [PATCH] tuning compare page --- .../upgrade-versions/UpgradeVersionsPage.tsx | 11 ------ .../compare/UpgradeButton.tsx | 8 +++++ .../admin/upgrade-versions/compare/page.tsx | 34 ++++++++++++++----- 3 files changed, 33 insertions(+), 20 deletions(-) diff --git a/apps/hub/src/app/admin/upgrade-versions/UpgradeVersionsPage.tsx b/apps/hub/src/app/admin/upgrade-versions/UpgradeVersionsPage.tsx index d06231846d..6fdbd1bfd5 100644 --- a/apps/hub/src/app/admin/upgrade-versions/UpgradeVersionsPage.tsx +++ b/apps/hub/src/app/admin/upgrade-versions/UpgradeVersionsPage.tsx @@ -175,17 +175,6 @@ export const UpgradeVersionsPage: FC<{ return (

Upgrade model versions

-
-

- Check models with their current version and the new version, then - press the upgrade button if everything is ok. -

-

- - {`Code edits won't be saved, "Upgrade" button bumps only the model's version.`} - -

-
Dev models: {devCount}
diff --git a/apps/hub/src/app/admin/upgrade-versions/compare/UpgradeButton.tsx b/apps/hub/src/app/admin/upgrade-versions/compare/UpgradeButton.tsx index 08272bfcf0..2a85e2aca1 100644 --- a/apps/hub/src/app/admin/upgrade-versions/compare/UpgradeButton.tsx +++ b/apps/hub/src/app/admin/upgrade-versions/compare/UpgradeButton.tsx @@ -12,6 +12,14 @@ export const UpgradeButton: FC<{ model: ModelFullDTO; }> = ({ model }) => { const router = useRouter(); + + if ( + model.currentRevision.contentType === "SquiggleSnippet" && + model.currentRevision.squiggleSnippet.version === defaultSquiggleVersion + ) { + return null; + } + return ( - - {model.owner.slug}/{model.slug} - - +

+
+
+ Compare model{" "} + + {model.owner.slug}/{model.slug} + +
+ +
+

+
+

+ Check models with their current version and the new version, then + press the upgrade button if everything is ok. +

+

+ + {`Code edits won't be saved, "Upgrade" button bumps only the model's version.`} + +

+
);