@tinacms/app 2.4.3 → 2.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/package.json +3 -3
- package/src/lib/errors.tsx +12 -9
- package/src/lib/graphql-reducer.ts +6 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @tinacms/app
|
|
2
2
|
|
|
3
|
+
## 2.4.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies []:
|
|
8
|
+
- @tinacms/mdx@2.1.3
|
|
9
|
+
- tinacms@3.7.5
|
|
10
|
+
|
|
11
|
+
## 2.4.4
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#6687](https://github.com/tinacms/tinacms/pull/6687) [`a526f9f`](https://github.com/tinacms/tinacms/commit/a526f9f4c37a0aaefb572c9dcc562d89aa9e5c7e) Thanks [@brookjeynes-ssw](https://github.com/brookjeynes-ssw)! - feat: simplify errors shown to users
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [[`4672251`](https://github.com/tinacms/tinacms/commit/4672251c813e51f4471f025943008d2dea700aca), [`ca725ac`](https://github.com/tinacms/tinacms/commit/ca725acb42be499c146d76b12982e05a8127f81e), [`a526f9f`](https://github.com/tinacms/tinacms/commit/a526f9f4c37a0aaefb572c9dcc562d89aa9e5c7e), [`b260b5e`](https://github.com/tinacms/tinacms/commit/b260b5ed4beb5d678b9605357b99a8667fddc8de), [`b56dad4`](https://github.com/tinacms/tinacms/commit/b56dad42d2216ac9c8f90f19b78a4951ca97a61f)]:
|
|
18
|
+
- tinacms@3.7.4
|
|
19
|
+
|
|
3
20
|
## 2.4.3
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tinacms/app",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.5",
|
|
4
4
|
"main": "src/main.tsx",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"devDependencies": {
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"react-router-dom": "6.3.0",
|
|
27
27
|
"typescript": "^5.7.3",
|
|
28
28
|
"zod": "^3.24.2",
|
|
29
|
-
"@tinacms/mdx": "2.1.
|
|
30
|
-
"tinacms": "3.7.
|
|
29
|
+
"@tinacms/mdx": "2.1.3",
|
|
30
|
+
"tinacms": "3.7.5"
|
|
31
31
|
},
|
|
32
32
|
"repository": {
|
|
33
33
|
"url": "https://github.com/tinacms/tinacms.git",
|
package/src/lib/errors.tsx
CHANGED
|
@@ -1,24 +1,27 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TinaCMS } from 'tinacms';
|
|
3
3
|
|
|
4
|
-
const
|
|
5
|
-
|
|
4
|
+
const TROUBLESHOOTING_URL = 'https://tina.io/docs/tinacloud/troubleshooting';
|
|
5
|
+
|
|
6
|
+
const ErrorModalContent = (props: { title: string; message: string }) => {
|
|
7
|
+
const { title, message } = props;
|
|
6
8
|
return (
|
|
7
9
|
<>
|
|
8
10
|
<div>{title}</div>
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
</ul>
|
|
11
|
+
<p>{message}</p>
|
|
12
|
+
<a href={TROUBLESHOOTING_URL} target='_blank' rel='noopener noreferrer'>
|
|
13
|
+
Try these troubleshooting tips
|
|
14
|
+
</a>
|
|
14
15
|
</>
|
|
15
16
|
);
|
|
16
17
|
};
|
|
17
18
|
|
|
18
19
|
export const showErrorModal = (
|
|
19
20
|
title: string,
|
|
20
|
-
|
|
21
|
+
message: string,
|
|
21
22
|
cms: TinaCMS
|
|
22
23
|
) => {
|
|
23
|
-
cms.alerts.
|
|
24
|
+
if (cms.alerts.all.some((a: { level: string }) => a.level === 'error'))
|
|
25
|
+
return;
|
|
26
|
+
cms.alerts.error(() => <ErrorModalContent title={title} message={message} />);
|
|
24
27
|
};
|
|
@@ -613,7 +613,12 @@ export const useGraphQLReducer = (
|
|
|
613
613
|
|
|
614
614
|
React.useEffect(() => {
|
|
615
615
|
if (requestErrors.length) {
|
|
616
|
-
|
|
616
|
+
console.error('Unexpected error querying content:', requestErrors);
|
|
617
|
+
showErrorModal(
|
|
618
|
+
'Unexpected Error',
|
|
619
|
+
'We ran into an unexpected error while fetching your content. If after refreshing the issue persists, reach out to us on Discord.',
|
|
620
|
+
cms
|
|
621
|
+
);
|
|
617
622
|
}
|
|
618
623
|
}, [requestErrors]);
|
|
619
624
|
};
|