mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-22 17:39:12 +01:00
Fix dynamic form defaults
This commit is contained in:
@@ -593,7 +593,6 @@ var plugin = {
|
||||
const headerPrefix = optionalString(values, "headerPrefix") ?? "";
|
||||
const grantType = requiredString(values, "grantType");
|
||||
const credentialsInBody = values.credentials === "body";
|
||||
console.log("Performing OAuth", values);
|
||||
let token;
|
||||
if (grantType === "authorization_code") {
|
||||
const authorizationUrl = requiredString(values, "authorizationUrl");
|
||||
|
||||
@@ -219,18 +219,11 @@ function TextArg({
|
||||
autocompleteVariables: boolean;
|
||||
stateKey: string;
|
||||
}) {
|
||||
const handleChange = useCallback(
|
||||
(value: string) => {
|
||||
onChange(value === '' ? DYNAMIC_FORM_NULL_ARG : value);
|
||||
},
|
||||
[onChange],
|
||||
);
|
||||
|
||||
return (
|
||||
<Input
|
||||
name={arg.name}
|
||||
multiLine={arg.multiLine}
|
||||
onChange={handleChange}
|
||||
onChange={onChange}
|
||||
defaultValue={value === DYNAMIC_FORM_NULL_ARG ? arg.defaultValue : value}
|
||||
required={!arg.optional}
|
||||
disabled={arg.disabled}
|
||||
@@ -238,7 +231,7 @@ function TextArg({
|
||||
label={arg.label ?? arg.name}
|
||||
size={INPUT_SIZE}
|
||||
hideLabel={arg.label == null}
|
||||
placeholder={arg.placeholder ?? arg.defaultValue ?? ''}
|
||||
placeholder={arg.placeholder ?? undefined}
|
||||
autocomplete={arg.completionOptions ? { options: arg.completionOptions } : undefined}
|
||||
useTemplating={useTemplating}
|
||||
autocompleteVariables={autocompleteVariables}
|
||||
@@ -263,13 +256,6 @@ function EditorArg({
|
||||
autocompleteVariables: boolean;
|
||||
stateKey: string;
|
||||
}) {
|
||||
const handleChange = useCallback(
|
||||
(value: string) => {
|
||||
onChange(value === '' ? DYNAMIC_FORM_NULL_ARG : value);
|
||||
},
|
||||
[onChange],
|
||||
);
|
||||
|
||||
const id = `input-${arg.name}`;
|
||||
|
||||
// Read-only editor force refresh for every defaultValue change
|
||||
@@ -296,10 +282,10 @@ function EditorArg({
|
||||
autocomplete={arg.completionOptions ? { options: arg.completionOptions } : undefined}
|
||||
disabled={arg.disabled}
|
||||
language={arg.language}
|
||||
onChange={handleChange}
|
||||
onChange={onChange}
|
||||
heightMode="auto"
|
||||
defaultValue={value === DYNAMIC_FORM_NULL_ARG ? arg.defaultValue : value}
|
||||
placeholder={arg.placeholder ?? arg.defaultValue ?? ''}
|
||||
placeholder={arg.placeholder ?? undefined}
|
||||
useTemplating={useTemplating}
|
||||
autocompleteVariables={autocompleteVariables}
|
||||
stateKey={stateKey}
|
||||
|
||||
@@ -27,7 +27,6 @@ export function HttpAuthenticationEditor({ request }: Props) {
|
||||
|
||||
const handleChange = useCallback(
|
||||
(authentication: Record<string, boolean>) => {
|
||||
console.log('UPDATE', authentication);
|
||||
if (request.model === 'http_request') {
|
||||
updateHttpRequest.mutate({
|
||||
id: request.id,
|
||||
|
||||
Reference in New Issue
Block a user