Skip to content

Commit

Permalink
add intl keys to delete key manager dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
nisan-abeywickrama committed Aug 12, 2024
1 parent 527d12a commit 8f3a52f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 2 additions & 0 deletions portals/admin/src/main/webapp/site/public/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@
"AdminPages.Gateways.table.header.type": "Type",
"AdminPages.Gateways.table.header.vhosts": "Virtual Host(s)",
"AdminPages.KeyManager.Delete.form.delete.confirmation.message": "Are you sure you want to delete this KeyManager ?",
"AdminPages.KeyManagers.Delete.form.delete.dialog.btn": "Delete",
"AdminPages.KeyManagers.Delete.form.delete.dialog.title": "Delete KeyManager ?",
"AdminPages.KeyManagers.Delete.form.delete.successful": "KeyManager deleted successfully",
"AdminPages.KeyManagers.List.empty.content.keymanagers": "It is possible to register an OAuth Provider.",
"AdminPages.KeyManagers.Usages.dialog.close.btn": "Close",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import React from 'react';
import API from 'AppData/api';
import PropTypes from 'prop-types';
import { FormattedMessage } from 'react-intl';
import { FormattedMessage, useIntl } from 'react-intl';
import DialogContentText from '@mui/material/DialogContentText';
import DeleteForeverIcon from '@mui/icons-material/DeleteForever';
import FormDialogBase from 'AppComponents/AdminPages/Addons/FormDialogBase';
Expand All @@ -34,7 +34,7 @@ function Delete({ updateList, dataRow, isDisabled }) {
const { id, type, isGlobal } = dataRow;
const { isSuperTenant, user: { _scopes } } = useAppContext();
const isSuperAdmin = isSuperTenant && _scopes.includes('apim:admin_settings');

const intl = useIntl();
const formSaveCallback = () => {
// todo: don't create a new promise
const promiseAPICall = new Promise((resolve, reject) => {
Expand All @@ -61,8 +61,14 @@ function Delete({ updateList, dataRow, isDisabled }) {

return (
<FormDialogBase
title='Delete KeyManager ?'
saveButtonText='Delete'
title={intl.formatMessage({
id: 'AdminPages.KeyManagers.Delete.form.delete.dialog.title',
defaultMessage: 'Delete KeyManager ?',
})}
saveButtonText={intl.formatMessage({
id: 'AdminPages.KeyManagers.Delete.form.delete.dialog.btn',
defaultMessage: 'Delete',
})}
icon={<DeleteForeverIcon aria-label='key-manager-delete-icon' />}
formSaveCallback={formSaveCallback}
triggerIconProps={{
Expand Down

0 comments on commit 8f3a52f

Please sign in to comment.