|
31 | 31 | let terminateConfirmationModalOpen = false;
|
32 | 32 | let resetConfirmationModalOpen = false;
|
33 | 33 | let signalConfirmationModalOpen = false;
|
34 |
| - let resetTooltipText: string; |
| 34 | + let resetDescription: string; |
35 | 35 | let coreUser = coreUserStore();
|
36 | 36 |
|
37 | 37 | $: cancelEnabled = workflowCancelEnabled(
|
|
71 | 71 | enabled: boolean;
|
72 | 72 | testId: string;
|
73 | 73 | destructive?: boolean;
|
74 |
| - tooltip?: string; |
| 74 | + description?: string; |
75 | 75 | }[];
|
76 | 76 |
|
77 | 77 | $: {
|
78 | 78 | if (!resetAuthorized) {
|
79 |
| - resetTooltipText = translate('workflows.reset-disabled-unauthorized'); |
| 79 | + resetDescription = translate('workflows.reset-disabled-unauthorized'); |
80 | 80 | } else if (resetAuthorized && workflow?.pendingChildren?.length > 0) {
|
81 |
| - resetTooltipText = translate('workflows.reset-disabled-pending-children'); |
| 81 | + resetDescription = translate('workflows.reset-disabled-pending-children'); |
82 | 82 | } else if (
|
83 | 83 | resetAuthorized &&
|
84 | 84 | workflow?.pendingChildren?.length === 0 &&
|
85 | 85 | $resetEvents.length === 0
|
86 | 86 | ) {
|
87 |
| - resetTooltipText = translate('workflows.reset-disabled-no-events'); |
| 87 | + resetDescription = translate('workflows.reset-disabled-no-events'); |
88 | 88 | }
|
89 | 89 | }
|
90 | 90 |
|
|
94 | 94 | onClick: () => (resetConfirmationModalOpen = true),
|
95 | 95 | testId: 'reset-button',
|
96 | 96 | enabled: resetEnabled,
|
97 |
| - tooltip: resetEnabled ? '' : resetTooltipText, |
| 97 | + description: resetEnabled ? '' : resetDescription, |
98 | 98 | },
|
99 | 99 | {
|
100 | 100 | label: translate('workflows.signal'),
|
101 | 101 | onClick: () => (signalConfirmationModalOpen = true),
|
102 | 102 | testId: 'signal-button',
|
103 | 103 | enabled: signalEnabled,
|
104 |
| - tooltip: signalEnabled ? '' : translate('workflows.signal-disabled'), |
| 104 | + description: signalEnabled ? '' : translate('workflows.signal-disabled'), |
105 | 105 | },
|
106 | 106 | {
|
107 | 107 | label: translate('workflows.terminate'),
|
108 | 108 | onClick: () => (terminateConfirmationModalOpen = true),
|
109 | 109 | testId: 'terminate-button',
|
110 | 110 | enabled: terminateEnabled,
|
111 | 111 | destructive: true,
|
112 |
| - tooltip: terminateEnabled |
| 112 | + description: terminateEnabled |
113 | 113 | ? ''
|
114 | 114 | : translate('workflows.terminate-disabled'),
|
115 | 115 | },
|
|
119 | 119 | {#if isRunning}
|
120 | 120 | <SplitButton
|
121 | 121 | id="workflow-actions"
|
| 122 | + menuClass="w-[24rem]" |
122 | 123 | position="right"
|
123 | 124 | disabled={actionsDisabled}
|
124 | 125 | primaryActionDisabled={!cancelEnabled || cancelInProgress}
|
125 | 126 | on:click={() => (cancelConfirmationModalOpen = true)}
|
126 | 127 | label={translate('workflows.request-cancellation')}
|
127 | 128 | menuLabel={translate('workflows.workflow-actions')}
|
128 | 129 | >
|
129 |
| - {#each workflowActions as { onClick, destructive, label, enabled, testId, tooltip }} |
| 130 | + {#each workflowActions as { onClick, destructive, label, enabled, testId, description }} |
130 | 131 | {#if destructive}
|
131 | 132 | <MenuDivider />
|
132 | 133 | {/if}
|
133 |
| - <Tooltip text={tooltip} hide={!tooltip} width={200} left> |
134 |
| - <MenuItem |
135 |
| - on:click={onClick} |
136 |
| - {destructive} |
137 |
| - disabled={!enabled} |
138 |
| - data-testid={testId} |
139 |
| - > |
140 |
| - {label} |
141 |
| - </MenuItem> |
142 |
| - </Tooltip> |
| 134 | + <MenuItem |
| 135 | + on:click={onClick} |
| 136 | + {destructive} |
| 137 | + disabled={!enabled} |
| 138 | + data-testid={testId} |
| 139 | + {description} |
| 140 | + > |
| 141 | + {label} |
| 142 | + </MenuItem> |
143 | 143 | {/each}
|
144 | 144 | {#if !workflowCreateDisabled($page)}
|
145 | 145 | <MenuDivider />
|
|
162 | 162 | {:else if !workflowCreateDisabled($page)}
|
163 | 163 | <SplitButton
|
164 | 164 | id="workflow-actions"
|
| 165 | + menuClass="w-[16rem]" |
165 | 166 | position="right"
|
166 | 167 | primaryActionDisabled={!resetEnabled}
|
167 | 168 | on:click={() => (resetConfirmationModalOpen = true)}
|
|
184 | 185 | </MenuItem>
|
185 | 186 | </SplitButton>
|
186 | 187 | {:else}
|
187 |
| - <Tooltip bottomRight width={200} text={resetTooltipText} hide={resetEnabled}> |
| 188 | + <Tooltip bottomRight width={200} text={resetDescription} hide={resetEnabled}> |
188 | 189 | <Button
|
189 | 190 | aria-label={translate('workflows.reset')}
|
190 | 191 | disabled={!resetEnabled}
|
|
0 commit comments