@@ -199,93 +199,99 @@ export const PolicyTable: React.FunctionComponent<Props> = ({
199199 render : ( { name, inProgress, isManagedPolicy } : SlmPolicy ) => {
200200 return (
201201 < EuiFlexGroup gutterSize = "s" >
202- < PolicyExecuteProvider >
203- { executePolicyPrompt => {
204- return (
205- < EuiToolTip
206- content = {
207- Boolean ( inProgress )
208- ? i18n . translate (
209- 'xpack.snapshotRestore.policyList.table.actionExecuteDisabledTooltip' ,
210- { defaultMessage : 'Policy is running' }
211- )
212- : i18n . translate (
213- 'xpack.snapshotRestore.policyList.table.actionExecuteTooltip' ,
214- { defaultMessage : 'Run now' }
215- )
216- }
217- >
218- < EuiButtonIcon
219- aria-label = { i18n . translate (
220- 'xpack.snapshotRestore.policyList.table.actionExecuteAriaLabel' ,
221- {
222- defaultMessage : `Run '{name}' immediately` ,
223- values : { name } ,
224- }
225- ) }
226- iconType = "play"
227- color = "primary"
228- data-test-subj = "executePolicyButton"
229- onClick = { ( ) => executePolicyPrompt ( name , onPolicyExecuted ) }
230- disabled = { Boolean ( inProgress ) }
231- />
232- </ EuiToolTip >
233- ) ;
234- } }
235- </ PolicyExecuteProvider >
236- < EuiToolTip
237- content = { i18n . translate (
238- 'xpack.snapshotRestore.policyList.table.actionEditTooltip' ,
239- { defaultMessage : 'Edit' }
240- ) }
241- >
242- < EuiButtonIcon
243- aria-label = { i18n . translate (
244- 'xpack.snapshotRestore.policyList.table.actionEditAriaLabel' ,
245- {
246- defaultMessage : `Edit policy '{name}'` ,
247- values : { name } ,
248- }
249- ) }
250- iconType = "pencil"
251- color = "primary"
252- href = { linkToEditPolicy ( name ) }
253- data-test-subj = "editPolicyButton"
254- />
255- </ EuiToolTip >
256- < PolicyDeleteProvider >
257- { deletePolicyPrompt => {
258- const label = ! isManagedPolicy
259- ? i18n . translate (
260- 'xpack.snapshotRestore.policyList.table.actionDeleteTooltip' ,
261- { defaultMessage : 'Delete' }
262- )
263- : i18n . translate (
264- 'xpack.snapshotRestore.policyList.table.deleteManagedPolicyTableActionTooltip' ,
265- {
266- defaultMessage : 'You cannot delete a managed policy.' ,
202+ < EuiFlexItem grow = { false } >
203+ < PolicyExecuteProvider >
204+ { executePolicyPrompt => {
205+ return (
206+ < EuiToolTip
207+ content = {
208+ Boolean ( inProgress )
209+ ? i18n . translate (
210+ 'xpack.snapshotRestore.policyList.table.actionExecuteDisabledTooltip' ,
211+ { defaultMessage : 'Policy is running' }
212+ )
213+ : i18n . translate (
214+ 'xpack.snapshotRestore.policyList.table.actionExecuteTooltip' ,
215+ { defaultMessage : 'Run now' }
216+ )
267217 }
268- ) ;
269- return (
270- < EuiToolTip content = { label } >
271- < EuiButtonIcon
272- aria-label = { i18n . translate (
273- 'xpack.snapshotRestore.policyList.table.actionDeleteAriaLabel' ,
218+ >
219+ < EuiButtonIcon
220+ aria-label = { i18n . translate (
221+ 'xpack.snapshotRestore.policyList.table.actionExecuteAriaLabel' ,
222+ {
223+ defaultMessage : `Run '{name}' immediately` ,
224+ values : { name } ,
225+ }
226+ ) }
227+ iconType = "play"
228+ color = "primary"
229+ data-test-subj = "executePolicyButton"
230+ onClick = { ( ) => executePolicyPrompt ( name , onPolicyExecuted ) }
231+ disabled = { Boolean ( inProgress ) }
232+ />
233+ </ EuiToolTip >
234+ ) ;
235+ } }
236+ </ PolicyExecuteProvider >
237+ </ EuiFlexItem >
238+ < EuiFlexItem grow = { false } >
239+ < EuiToolTip
240+ content = { i18n . translate (
241+ 'xpack.snapshotRestore.policyList.table.actionEditTooltip' ,
242+ { defaultMessage : 'Edit' }
243+ ) }
244+ >
245+ < EuiButtonIcon
246+ aria-label = { i18n . translate (
247+ 'xpack.snapshotRestore.policyList.table.actionEditAriaLabel' ,
248+ {
249+ defaultMessage : `Edit policy '{name}'` ,
250+ values : { name } ,
251+ }
252+ ) }
253+ iconType = "pencil"
254+ color = "primary"
255+ href = { linkToEditPolicy ( name ) }
256+ data-test-subj = "editPolicyButton"
257+ />
258+ </ EuiToolTip >
259+ </ EuiFlexItem >
260+ < EuiFlexItem grow = { false } >
261+ < PolicyDeleteProvider >
262+ { deletePolicyPrompt => {
263+ const label = ! isManagedPolicy
264+ ? i18n . translate (
265+ 'xpack.snapshotRestore.policyList.table.actionDeleteTooltip' ,
266+ { defaultMessage : 'Delete' }
267+ )
268+ : i18n . translate (
269+ 'xpack.snapshotRestore.policyList.table.deleteManagedPolicyTableActionTooltip' ,
274270 {
275- defaultMessage : `Delete policy '{name}'` ,
276- values : { name } ,
271+ defaultMessage : 'You cannot delete a managed policy.' ,
277272 }
278- ) }
279- iconType = "trash"
280- color = "danger"
281- data-test-subj = "deletePolicyButton"
282- onClick = { ( ) => deletePolicyPrompt ( [ name ] , onPolicyDeleted ) }
283- isDisabled = { isManagedPolicy }
284- />
285- </ EuiToolTip >
286- ) ;
287- } }
288- </ PolicyDeleteProvider >
273+ ) ;
274+ return (
275+ < EuiToolTip content = { label } >
276+ < EuiButtonIcon
277+ aria-label = { i18n . translate (
278+ 'xpack.snapshotRestore.policyList.table.actionDeleteAriaLabel' ,
279+ {
280+ defaultMessage : `Delete policy '{name}'` ,
281+ values : { name } ,
282+ }
283+ ) }
284+ iconType = "trash"
285+ color = "danger"
286+ data-test-subj = "deletePolicyButton"
287+ onClick = { ( ) => deletePolicyPrompt ( [ name ] , onPolicyDeleted ) }
288+ isDisabled = { isManagedPolicy }
289+ />
290+ </ EuiToolTip >
291+ ) ;
292+ } }
293+ </ PolicyDeleteProvider >
294+ </ EuiFlexItem >
289295 </ EuiFlexGroup >
290296 ) ;
291297 } ,
0 commit comments