Skip to content

Commit

Permalink
Fix messageKeys import
Browse files Browse the repository at this point in the history
  • Loading branch information
Janelle Law committed Apr 21, 2022
1 parent f54d0b7 commit 3299420
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/SecurityPanel/StoreJmxCredentials.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const StoreJmxCredentials = () => {
}, [context, context.targets, setTargets, refreshStoredTargetsList]);

React.useEffect(() => {
const sub = context.notificationChannel.messages('TargetCredentialsStored' as NotificationCategory.TargetCredentialsStored).subscribe((v) => {
const sub = context.notificationChannel.messages(NotificationCategory.TargetCredentialsStored).subscribe((v) => {
const updatedTarget = targets.filter((t) => t.connectUrl === v.message.target).pop();
if(!updatedTarget) {
return;
Expand All @@ -94,7 +94,7 @@ export const StoreJmxCredentials = () => {
}, [context, context.notificationChannel, targets, setStoredTargets]);

React.useEffect(() => {
const sub = context.notificationChannel.messages('TargetCredentialsDeleted' as NotificationCategory.TargetCredentialsDeleted).subscribe((v) => {
const sub = context.notificationChannel.messages(NotificationCategory.TargetCredentialsDeleted).subscribe((v) => {
setStoredTargets(old => old.filter(t => t.connectUrl !== v.message.target));
});
return () => sub.unsubscribe();
Expand Down
1 change: 1 addition & 0 deletions src/test/SecurityPanel/StoreJmxCredentials.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ jest.mock('@app/Shared/Services/NotificationChannel.service', () => {
const mockNotification = { message: { target: 'service:jmx:rmi://someUrl' } } as NotificationMessage;

return {
...jest.requireActual('@app/Shared/Services/NotificationChannel.service'),
NotificationChannel: jest.fn(() => {
return {
messages: jest
Expand Down

0 comments on commit 3299420

Please sign in to comment.