pierrejeambrun commented on code in PR #74039:
URL: https://github.com/apache/airflow/pull/74039#discussion_r4164593616


##########
airflow-core/src/airflow/ui/src/components/TriggerDag/TriggerDAGButton.tsx:
##########
@@ -92,84 +113,84 @@ export const TriggerDAGButton = ({
     onClose();
   };
 
-  // If there's a selected DAG Run with config, show menu with options
-  if (selectedDagRun?.conf !== undefined) {
-    return (
-      <Box>
-        <Menu.Root>
-          <Tooltip content={translate("triggerDag.manualRunDenied")} 
disabled={!isManualRunDenied}>
+  // The main part always triggers in one click, as it did before the config 
menu existed. When the
+  // selected run carried a config, a caret next to it offers re-triggering 
with that config, instead
+  // of turning the whole button into a menu (which cost everyone an extra 
click).
+  const triggerButton = withText ? (
+    <Button
+      aria-label={translate("triggerDag.title")}
+      data-testid="trigger-dag-button"
+      disabled={isManualRunDenied}
+      onClick={handleNormalTrigger}
+      variant={variant}
+    >
+      <FiPlay />
+      {translate("triggerDag.button")}
+    </Button>
+  ) : (
+    <IconButton
+      aria-label={translate("triggerDag.title")}
+      data-testid="trigger-dag-button"
+      disabled={isManualRunDenied}
+      onClick={handleNormalTrigger}
+      variant={variant}
+    >
+      <FiPlay />
+    </IconButton>
+  );
+
+  const triggerButtonWithTooltip = (
+    <Tooltip
+      content={isManualRunDenied ? translate("triggerDag.manualRunDenied") : 
translate("triggerDag.button")}
+      disabled={withText ? !isManualRunDenied : undefined}
+    >
+      {triggerButton}
+    </Tooltip>
+  );
+
+  return (
+    <>
+      {selectedDagRun?.conf === undefined ? (

Review Comment:
   Yes i had the exact same reasoning when looking at this, but it was like 
this on main (probably wrongly) so I didn't want to mix everything in this PR. 
   
   I'll open a follow up to check `{}` as well as a 'missing' conf.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to