Skip to content

Commit

Permalink
refactor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores committed Apr 23, 2024
1 parent 6e9daef commit dd9e75d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 80 deletions.
6 changes: 4 additions & 2 deletions src/app/AppLayout/AuthModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ export const AuthModal: React.FC<AuthModalProps> = ({ onDismiss, onSave: onProps
filter((target) => !!target),
first(),
map((target: Target) => target.connectUrl),
mergeMap((connectUrl) => context.authCredentials.setCredential(connectUrl, username, password)),
mergeMap((connectUrl) =>
context.api.postCredentials(`target.connectUrl == "${connectUrl}"`, username, password),
),
)
.subscribe((ok) => {
setLoading(false);
Expand All @@ -53,7 +55,7 @@ export const AuthModal: React.FC<AuthModalProps> = ({ onDismiss, onSave: onProps
}),
);
},
[addSubscription, context.authCredentials, targetObs, setLoading, onPropsSave],
[addSubscription, context.api, targetObs, setLoading, onPropsSave],
);

return (
Expand Down
31 changes: 0 additions & 31 deletions src/app/Shared/Services/AuthCredentials.service.tsx

This file was deleted.

4 changes: 0 additions & 4 deletions src/app/Shared/Services/Services.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
import * as React from 'react';
import { ApiService } from './Api.service';
import { AuthCredentials } from './AuthCredentials.service';
import { LoginService } from './Login.service';
import { NotificationChannel } from './NotificationChannel.service';
import { NotificationsInstance } from './Notifications.service';
Expand All @@ -28,7 +27,6 @@ export interface Services {
target: TargetService;
targets: TargetsService;
api: ApiService;
authCredentials: AuthCredentials;
notificationChannel: NotificationChannel;
reports: ReportService;
settings: SettingsService;
Expand All @@ -37,7 +35,6 @@ export interface Services {

const target = new TargetService();
const settings = new SettingsService();
const authCredentials = new AuthCredentials(() => api);
const login = new LoginService(settings);
const api = new ApiService(target, NotificationsInstance, login);
const notificationChannel = new NotificationChannel(NotificationsInstance, login);
Expand All @@ -48,7 +45,6 @@ const defaultServices: Services = {
target,
targets,
api,
authCredentials,
notificationChannel,
reports,
settings,
Expand Down
43 changes: 0 additions & 43 deletions src/test/Shared/Services/JmxCredentials.service.test.tsx

This file was deleted.

0 comments on commit dd9e75d

Please sign in to comment.