Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/apps/code-editor/src/store/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ export function fetchFiles(type) {
dispatch(
notify({
kind: "warn",
message: err.message,
message: err.message || "Failed to load files",
})
);
});
Expand Down Expand Up @@ -502,7 +502,7 @@ export function saveFile(ZUID, status, code = null) {
dispatch(
notify({
kind: "warn",
message: err.message,
message: err.message || "Failed to save file",
})
);
});
Expand Down Expand Up @@ -570,7 +570,7 @@ export function publishFile(fileZUID, fileStatus) {
dispatch(
notify({
kind: "warn",
message: err.message,
message: err.message || "Failed to publish file",
})
);
});
Expand Down
2 changes: 1 addition & 1 deletion src/apps/code-editor/src/store/headers.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export function saveSort(type, headers) {
dispatch(
notify({
kind: "warn",
message: res.error,
message: res.error || "Failed to save sort order",
})
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { useState, useEffect, ChangeEvent } from "react";
import { connect, useDispatch } from "react-redux";
import { TextField, Box } from "@mui/material";

import { notify } from "../../../../../../../../shell/store/notifications";
import { FieldShell } from "../../../../components/Editor/Field/FieldShell";
import { MaxLengths } from "..";
import { hasErrors } from "./util";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,9 @@ export const ItemEditHeaderActions = ({
if ("error" in promise.value) {
dispatch(
notify({
message: promise.value.error.data?.error,
message:
promise.value.error.data?.error ||
"Failed to publish content item.",
kind: "error",
})
);
Expand Down
4 changes: 2 additions & 2 deletions src/apps/leads/src/store/leads.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function fetchLeads() {
dispatch(
notify({
kind: "warn",
message: err.message,
message: err.message || "Failed to fetch leads",
})
);
return [];
Expand Down Expand Up @@ -66,7 +66,7 @@ export function deleteLead(leadZuid) {
dispatch(
notify({
kind: "error",
message: err.message,
message: err.message || "Failed to delete lead",
})
);
});
Expand Down
7 changes: 6 additions & 1 deletion src/apps/schema/src/app/components/SchemaCreateWizard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,12 @@ export const SchemaCreateWizard = () => {
.unwrap()
.then((res) => dispatch(fetchModels()))
.catch((res) => {
dispatch(notify({ kind: "error", message: res?.data?.message }));
dispatch(
notify({
kind: "error",
message: res?.data?.message || "Failed to create model",
})
);
});
};

Expand Down
2 changes: 1 addition & 1 deletion src/apps/schema/src/store/parents.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function fetchParents() {
dispatch(
notify({
kind: "warn",
message: err.message,
message: err.message || "Failed to fetch parents",
})
);
});
Expand Down
2 changes: 1 addition & 1 deletion src/apps/settings/src/app/views/Instance/Instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export default connect((state) => {
props.dispatch(
notify({
kind: "warn",
message: err.message,
message: err.message || "Failed to save settings",
})
);
});
Expand Down
2 changes: 1 addition & 1 deletion src/apps/settings/src/app/views/Styles/Styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export default connect((state, props) => {
props.dispatch(
notify({
kind: "warn",
message: err.message,
message: err.message || "Failed to save settings",
})
);
});
Expand Down
2 changes: 1 addition & 1 deletion src/shell/components/GlobalSearch/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ export const GlobalSearch = () => {
dispatch(
notify({
kind: "warn",
message: newVal.noUrlErrorMessage,
message: newVal.noUrlErrorMessage || "Invalid URL",
})
);
}
Expand Down
3 changes: 2 additions & 1 deletion src/shell/store/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ export function pollTwoFactor() {
dispatch(
notify({
kind: "warn",
message: err.message,
message:
err.message || "Failed to validate Two Factor authentication",
})
);

Expand Down
2 changes: 1 addition & 1 deletion src/shell/store/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ export function fetchItems(modelZUID, options = {}) {
dispatch(
notify({
kind: "warn",
message: res.error,
message: res.error || "Failed to fetch items",
})
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/shell/store/releases.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ export function createRelease(payload) {
dispatch(
notify({
kind: "warn",
message: res.error,
message: res.error || "Failed creating a release",
})
);
}
Expand Down
6 changes: 3 additions & 3 deletions src/shell/store/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export function fetchSettings() {
dispatch(
notify({
kind: "warn",
message: err.message,
message: err.message || "Failed to fetch settings",
})
);
});
Expand All @@ -171,7 +171,7 @@ export function fetchStylesCategories() {
dispatch(
notify({
kind: "warn",
message: err.message,
message: err.message || "Failed to fetch styles categories",
})
);
});
Expand All @@ -193,7 +193,7 @@ export function fetchStylesVariables() {
dispatch(
notify({
kind: "warn",
message: err.message,
message: err.message || "Failed to fetch styles variables",
})
);
});
Expand Down
2 changes: 1 addition & 1 deletion src/shell/store/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function fetchUsers() {
.catch((error) => {
dispatch(
notify({
message: error.message,
message: error.message || "Failed to fetch users",
kind: "error",
})
);
Expand Down
2 changes: 1 addition & 1 deletion src/utility/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export function request(url, opts = {}) {
throw err;
} else {
// Network errors
store.dispatch(notify({ message: err.message, kind: "warn" }));
store.dispatch(notify({ message: err.message || "", kind: "warn" }));
return Promise.reject(
err instanceof Error
? err
Expand Down
Loading