Skip to content

Commit ca5286d

Browse files
committed
web: Better schema conflicts messaging
1 parent f77551d commit ca5286d

File tree

5 files changed

+29
-13
lines changed

5 files changed

+29
-13
lines changed

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

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import PullConflictBreadcrumbs from "@components/breadcrumbs/PullConflictBreadcrumbs";
2+
import DocsLink from "@components/links/DocsLink";
23
import NotDoltWrapper from "@components/util/NotDoltWrapper";
34
import { Loader } from "@dolthub/react-components";
5+
import { errorMatches } from "@lib/errors/helpers";
46
import { PullDiffParams } from "@lib/params";
57
import { pulls } from "@lib/urls";
68
import ForDefaultBranch from "../ForDefaultBranch";
@@ -46,19 +48,33 @@ type InnerProps = {
4648
function Inner(props: InnerProps) {
4749
const { activeTableName } = useConflictsContext();
4850
const res = useRowConflicts({ ...props.params, tableName: activeTableName });
51+
if (res.loading) return <Loader loaded={!res.loading} />;
52+
if (res.error && errorMatches("schema conflicts found", res.error)) {
53+
return (
54+
<div className={css.container}>
55+
<h3>Schema conflicts found for {activeTableName}</h3>
56+
<p>
57+
Cannot view data conflict rows until schema conflicts have been
58+
resolved. View instructions{" "}
59+
<DocsLink path="/sql-reference/version-control/merges#schema">
60+
here
61+
</DocsLink>
62+
.
63+
</p>
64+
</div>
65+
);
66+
}
4967
return (
5068
<div className={css.container}>
5169
<h3>
5270
Conflicted rows in <code>{activeTableName}</code>
5371
</h3>
54-
<Loader loaded={!res.loading}>
55-
<ConflictsTable
56-
state={res.state}
57-
fetchMore={res.fetchMore}
58-
hasMore={res.hasMore}
59-
error={res.error}
60-
/>
61-
</Loader>
72+
<ConflictsTable
73+
state={res.state}
74+
fetchMore={res.fetchMore}
75+
hasMore={res.hasMore}
76+
error={res.error}
77+
/>
6278
</div>
6379
);
6480
}

web/renderer/components/pageComponents/DatabasePage/ForPulls/PullActions/Merge/ErrorsWithDirections/MergeConflictsDirections.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ export default function MergeConflictsDirections({ params }: Props) {
2626
<h3>Merge and Resolve Conflicts</h3>
2727
<div className={css.innerModal}>
2828
<p>
29-
Conflicts cannot be resolved on the web and must be resolved in a SQL
30-
shell.
29+
If you&apos;d like to manually resolve conflicts before merging,
30+
follow these steps using the SQL shell.
3131
</p>
3232
<p>
3333
<DocsLink path="/sql-reference/version-control/dolt-sql-procedures#dolt_merge">

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export default function ResolveModal(props: Props) {
4646
onClick={async () => props.onClickWithResolve()}
4747
disabled={!!props.err}
4848
>
49-
Resolve tables and merge
49+
Resolve conflicts and merge
5050
</Button>
5151
}
5252
>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export default function Merge(props: Props) {
9090
setState({ showDirections: !state.showDirections })
9191
}
9292
>
93-
merge instructions
93+
manual merge instructions
9494
</Button.Link>
9595
.
9696
</span>

web/renderer/components/pageComponents/DatabasePage/ForPulls/PullActions/Merge/useMergeButton.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export default function useMergeButton(params: PullDiffParams) {
5858
return;
5959
}
6060

61-
const tablesToResolve = state.tablesToResolve;
61+
const { tablesToResolve } = state;
6262
conflictsRes.data.pullConflictsSummary.forEach(conflict => {
6363
tablesToResolve.set(conflict.tableName, ConflictResolveType.Ours);
6464
});

0 commit comments

Comments
 (0)