feat(scripts): add previewConfigKey to various scripts and enhance UI components
- Added `previewConfigKey` metadata to multiple scripts including fetch-binary, fetch-html, fetch-http, fetch-rss-feed, fingerprint, get-secret, jsonata, ntfy, render-template, and send-email, improving configuration visibility. - Updated the `FieldHelp` and `ScriptCard` components to utilize the new preview configuration, enhancing the user interface for displaying script metadata. - Refactored `TriggerCard` and `WorkflowTestPanel` components to support expanded views, improving user interaction and accessibility of configuration details. - Enhanced the `WorkflowVisualEditor` to manage test panel visibility more effectively. This update improves the overall user experience by providing clearer context and configuration options for scripts and workflows.
This commit is contained in:
@@ -152,7 +152,7 @@ export function WorkflowEditPage() {
|
||||
const [content, setContent] = useState("");
|
||||
const [savedYaml, setSavedYaml] = useState("");
|
||||
const [contentReady, setContentReady] = useState(false);
|
||||
const [testKey, setTestKey] = useState(0);
|
||||
const [testOpen, setTestOpen] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
if (existing.isLoading) return;
|
||||
@@ -192,17 +192,20 @@ export function WorkflowEditPage() {
|
||||
);
|
||||
}
|
||||
|
||||
const yamlOk = !parseWorkflowYaml(content).parseError;
|
||||
const parsedDoc = parseWorkflowYaml(content);
|
||||
const yamlOk = !parsedDoc.parseError;
|
||||
const workflowName = parsedDoc.doc?.name?.trim();
|
||||
const pageTitle = workflowName ? `${workflowName} (${file})` : file;
|
||||
|
||||
return (
|
||||
<WorkflowEditorLayout
|
||||
title={`${owner}/${file}`}
|
||||
title={pageTitle}
|
||||
savePending={save.isPending}
|
||||
saveDisabled={!contentReady}
|
||||
saveError={save.isError ? errorMessage(save.error) : null}
|
||||
saveSuccess={save.isSuccess}
|
||||
onSave={onSave}
|
||||
onTest={() => setTestKey((k) => k + 1)}
|
||||
onTest={() => setTestOpen(true)}
|
||||
onToggleEnabled={() =>
|
||||
setEnabled.mutate({
|
||||
owner,
|
||||
@@ -223,7 +226,8 @@ export function WorkflowEditPage() {
|
||||
file={file}
|
||||
savedYaml={savedYaml}
|
||||
showTest
|
||||
testKey={testKey}
|
||||
testOpen={testOpen}
|
||||
onTestClose={() => setTestOpen(false)}
|
||||
/>
|
||||
</div>
|
||||
</WorkflowEditorLayout>
|
||||
|
||||
Reference in New Issue
Block a user