Skip to content

Commit 0034fe1

Browse files
hide dolt_tests for doltgres
1 parent 3b943f5 commit 0034fe1

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

web/renderer/components/DatabaseNav/index.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import NotDoltWrapper from "@components/util/NotDoltWrapper";
22
import { Tooltip } from "@dolthub/react-components";
3+
import useDatabaseDetails from "@hooks/useDatabaseDetails";
34
import { OptionalRefParams } from "@lib/params";
45
import NavItem from "./Item";
56
import Wrapper from "./Wrapper";
@@ -24,11 +25,18 @@ export default function DatabaseNav(props: Props) {
2425
}
2526

2627
function Inner(props: Props) {
28+
const { isDolt, isPostgres } = useDatabaseDetails();
29+
2730
return (
2831
<div data-cy="db-page-header-nav" className={css.headerNav}>
2932
<Tooltip id="disabled-database-nav-item" />
3033
<ul className={css.tabs}>
3134
{tabs.map((tab, i) => {
35+
// Hide Tests tab for doltgres databases for now
36+
if (tab === "Tests" && isDolt && isPostgres) {
37+
return null;
38+
}
39+
3240
const item = <NavItem {...props} key={tab} name={tab} i={i} />;
3341
if (tab === "Database") {
3442
return item;

web/renderer/components/pageComponents/DatabasePage/ForPulls/PullActions/Merge/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,13 @@ export default function Merge(props: Props) {
4646
mergeState,
4747
resolveState,
4848
} = useMergeButton(props.params);
49+
const { isPostgres } = useDatabaseDetails();
4950
const red = hasConflicts;
5051

5152
return (
5253
<div className={css.wrapper}>
5354
<div className={css.mergeDetails}>
54-
<TestResults params={props.params} />
55+
{!isPostgres && <TestResults params={props.params} />}
5556
<div className={css.outer}>
5657
<span className={cx(css.picContainer, { [css.redIcon]: red })}>
5758
<FiGitPullRequest />

web/renderer/components/pageComponents/DatabasePage/ForTests/index.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ import { tests as testsUrl } from "@lib/urls";
44
import ForDefaultBranch from "../ForDefaultBranch";
55
import TestList from "./TestList";
66
import { TestProvider } from "./context";
7+
import useDatabaseDetails from "@hooks/useDatabaseDetails";
78

89
type Props = {
910
params: RefParams;
1011
};
1112

1213
export default function ForTests(props: Props): JSX.Element {
13-
const feature = "Viewing tests";
14+
const { isPostgres } = useDatabaseDetails();
15+
1416
return (
1517
<ForDefaultBranch
1618
params={props.params}
@@ -19,10 +21,10 @@ export default function ForTests(props: Props): JSX.Element {
1921
title="tests"
2022
routeRefChangeTo={testsUrl}
2123
>
22-
<NotDoltWrapper showNotDoltMsg feature={feature} bigMsg>
23-
<TestProvider params={props.params}>
24+
<NotDoltWrapper showNotDoltMsg feature="Viewing Tests" bigMsg>
25+
{!isPostgres ? <TestProvider params={props.params}>
2426
<TestList params={props.params} />
25-
</TestProvider>
27+
</TestProvider> : <div/>}
2628
</NotDoltWrapper>
2729
</ForDefaultBranch>
2830
);

0 commit comments

Comments
 (0)