graph: use replyTo instead of from to avoid ErrorSendAsDenied

This commit is contained in:
2026-08-22 22:26:47 +02:00
parent cef7f46718
commit 08bd00f01f
16 changed files with 245 additions and 480 deletions
+17 -8
View File
@@ -1,17 +1,26 @@
'use client';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { useField } from '@payloadcms/ui';
import { useState } from 'react';
export const MaskedField = ({ field, path })=>{
const { setValue, value } = useField({
path
});
export const MaskedField = (props)=>{
const { field, path, value: propValue, setValue: propSetValue, onChange: propOnChange } = props || {};
const [internalValue, setInternalValue] = useState(propValue ?? '');
const [revealed, setRevealed] = useState(false);
const label = typeof field?.label === 'string' ? field.label : field?.name ?? path;
const handleChange = (e)=>{
const newVal = e.target.value;
setInternalValue(newVal);
if (typeof propSetValue === 'function') {
propSetValue(newVal);
}
if (typeof propOnChange === 'function') {
propOnChange(e);
}
};
const currentValue = propValue !== undefined ? propValue : internalValue;
return /*#__PURE__*/ _jsxs("div", {
className: "field-type text",
children: [
/*#__PURE__*/ _jsx("label", {
label && /*#__PURE__*/ _jsx("label", {
className: "field-label",
children: label
}),
@@ -23,12 +32,12 @@ export const MaskedField = ({ field, path })=>{
children: [
/*#__PURE__*/ _jsx("input", {
autoComplete: "off",
onChange: (e)=>setValue(e.target.value),
onChange: handleChange,
style: {
flex: 1
},
type: revealed ? 'text' : 'password',
value: value ?? ''
value: currentValue ?? ''
}),
/*#__PURE__*/ _jsx("button", {
onClick: ()=>setRevealed((r)=>!r),