Skip to content

Commit ff55958

Browse files
FIX: Add an error message screen when model fails to load (#1655)
* Added empty string to avoid undefined type * Remove: empty object declaration * Remove: unused model type * task: removed unused imports * fix: show an the not found message when model content is not loaded * task: revert change * task: show error message when models fail to load * task: revert change * task: use modelZUID on url param * chore: removed log * chore: revert change --------- Co-authored-by: Nar Cuenca <[email protected]>
1 parent b372dee commit ff55958

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

src/apps/content-editor/src/app/components/Editor/Editor.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export default memo(function Editor({
1414
model,
1515
onSave,
1616
itemZUID,
17+
modelZUID,
1718
}) {
1819
const dispatch = useDispatch();
1920
const isNewItem = itemZUID.slice(0, 3) === "new";
@@ -170,7 +171,7 @@ export default memo(function Editor({
170171
<h1 className={styles.Display}>No fields have been added</h1>
171172
<h2 className={styles.SubHead}>
172173
Use the{" "}
173-
<AppLink to={`/schema/${model.ZUID}`}>Schema Builder</AppLink> to
174+
<AppLink to={`/schema/${modelZUID}`}>Schema Builder</AppLink> to
174175
define your items content
175176
</h2>
176177
</div>

src/apps/content-editor/src/app/views/ItemEdit/Content/Actions/Actions.js

-5
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ import { WidgetDeleteItem } from "./Widgets/WidgetDeleteItem";
1515
import { ContentLinks } from "./Widgets/ContentLinks";
1616
import { ContentInfo } from "./Widgets/ContentInfo";
1717

18-
import { Release } from "./Widgets/Release";
19-
20-
import styles from "./Actions.less";
2118
export function Actions(props) {
2219
if (!props.item.meta || !props.item.web) {
2320
console.error("Actions:missing item");
@@ -29,7 +26,6 @@ export function Actions(props) {
2926
const canUpdate = usePermission("UPDATE");
3027
const domain = useDomain();
3128

32-
const { type } = props.model;
3329
const { publishing, scheduling, siblings } = props.item;
3430
const { listed, sort, updatedAt, version } = props.item.meta;
3531
const { path, metaTitle, metaLinkText } = props.item.web;
@@ -107,7 +103,6 @@ export function Actions(props) {
107103
itemZUID={props.itemZUID}
108104
modelZUID={props.modelZUID}
109105
metaTitle={metaTitle}
110-
modelType={type}
111106
/>
112107
)}
113108
</Fragment>

src/apps/content-editor/src/app/views/ItemEdit/Content/Content.js

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ export default function Content(props) {
5151
dispatch={props.dispatch}
5252
isDirty={props.item.dirty}
5353
onSave={props.onSave}
54+
modelZUID={props.modelZUID}
5455
/>
5556
</div>
5657

0 commit comments

Comments
 (0)