Refresh HiveGrid Cloud reference snapshot
This commit is contained in:
1 parent
5e99e14772
commit
7f88026f79
5955 files changed
+1177325
-188362
No files matched your search
+12
-5
@@ -12,7 +12,7 @@
|
||||
* engine package before save so bad JSON cannot corrupt a run.
|
||||
*/
|
||||
import { Form, Link, type ActionFunctionArgs, type LoaderFunctionArgs, redirect, useActionData, useLoaderData } from "react-router";
|
||||
import { t as i18nT } from "i18next";
|
||||
import { requestScopedT as i18nT } from "~/locale/request-scoped-t";
|
||||
import { adminPath } from "~/utils/app/CanonicalUrlUtils";
|
||||
import { db, dbRead } from "~/utils/db.server";
|
||||
import { verifyUserHasPermission } from "~/utils/helpers/.server/PermissionsService";
|
||||
@@ -63,7 +63,12 @@ export const action = async ({ params, request }: ActionFunctionArgs) => {
|
||||
|
||||
if (intent === "toggle") {
|
||||
await db.emailSequence.update({ where: { id }, data: { isEnabled: !existing.isEnabled } });
|
||||
return redirect(`${adminPath("email-sequences", { mode: "host-aware" })}/${id}`);
|
||||
const messageKey = existing.isEnabled
|
||||
? "admin.emailSequences.toast.disabled"
|
||||
: "admin.emailSequences.toast.enabled";
|
||||
return redirect(
|
||||
`${adminPath("email-sequences", { mode: "host-aware" })}/${id}?toast=${encodeURIComponent(messageKey)}`
|
||||
);
|
||||
}
|
||||
|
||||
const name = String(formData.get("name") ?? "").trim();
|
||||
@@ -84,10 +89,10 @@ export const action = async ({ params, request }: ActionFunctionArgs) => {
|
||||
const { parseSequenceSteps } = await import("@hivegrid/email-sequences");
|
||||
try {
|
||||
parseSequenceSteps(stepsJson);
|
||||
} catch (error) {
|
||||
} catch {
|
||||
return Response.json({
|
||||
ok: false,
|
||||
error: error instanceof Error ? error.message : t("admin.emailSequences.errors.stepsJsonValidationFailed"),
|
||||
error: t("admin.emailSequences.errors.stepsJsonValidationFailed"),
|
||||
field: "stepsJson",
|
||||
} satisfies ActionResponse);
|
||||
}
|
||||
@@ -113,7 +118,9 @@ export const action = async ({ params, request }: ActionFunctionArgs) => {
|
||||
conditionsJson: conditionsJson as never,
|
||||
},
|
||||
});
|
||||
return redirect(`${adminPath("email-sequences", { mode: "host-aware" })}/${id}`);
|
||||
return redirect(
|
||||
`${adminPath("email-sequences", { mode: "host-aware" })}/${id}?toast=${encodeURIComponent("admin.emailSequences.toast.saved")}`
|
||||
);
|
||||
};
|
||||
|
||||
export default function EmailSequenceDetail() {
|
||||
|
||||
Reference in new issue
Block a user