forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Actionable Observability] Add license modal to rules table (elastic#…
…131232) * Add fix license link * fix localization * fix CI error * fix more translation issues Co-authored-by: Kibana Machine <[email protected]>
- Loading branch information
1 parent
bd18048
commit 775d9fd
Showing
4 changed files
with
103 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
x-pack/plugins/observability/public/pages/rules/components/manage_license_model.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { i18n } from '@kbn/i18n'; | ||
import { FormattedMessage } from '@kbn/i18n-react'; | ||
import { EuiConfirmModal } from '@elastic/eui'; | ||
import { capitalize } from 'lodash'; | ||
|
||
interface Props { | ||
licenseType: string; | ||
ruleTypeId: string; | ||
onConfirm: () => void; | ||
onCancel: () => void; | ||
} | ||
|
||
export function ManageLicenseModal({ licenseType, ruleTypeId, onConfirm, onCancel }: Props) { | ||
const licenseRequired = capitalize(licenseType); | ||
return ( | ||
<EuiConfirmModal | ||
title={i18n.translate('xpack.observability.rules.manageLicense.manageLicenseTitle', { | ||
defaultMessage: '{licenseRequired} license required', | ||
values: { licenseRequired }, | ||
})} | ||
onCancel={onCancel} | ||
onConfirm={onConfirm} | ||
confirmButtonText={i18n.translate( | ||
'xpack.observability.rules.manageLicense.manageLicenseConfirmButtonText', | ||
{ | ||
defaultMessage: 'Manage license', | ||
} | ||
)} | ||
cancelButtonText={i18n.translate( | ||
'xpack.observability.rules.manageLicense.manageLicenseCancelButtonText', | ||
{ | ||
defaultMessage: 'Cancel', | ||
} | ||
)} | ||
defaultFocusedButton="confirm" | ||
data-test-subj="manageLicenseModal" | ||
> | ||
<p> | ||
<FormattedMessage | ||
id="xpack.observability.rules.manageLicense.manageLicenseMessage" | ||
defaultMessage="Rule type {ruleTypeId} is disabled because it requires a {licenseRequired} license. Continue to License Management to view upgrade options." | ||
values={{ ruleTypeId, licenseRequired }} | ||
/> | ||
</p> | ||
</EuiConfirmModal> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters