Skip to content

Commit 0a0ed94

Browse files
committed
made Ifield data type any temporarily
1 parent 6cccea8 commit 0a0ed94

3 files changed

Lines changed: 7 additions & 14 deletions

File tree

app/components/ApplicationsCard/ApplicationsCard.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,23 @@ const ApplicationsCard = (props) => {
2626
// v10 info: when card is clicked (not on the delete button) if the service is an AWS instance,
2727
// you are redirected to AWSGraphsContainer passing in the state object containing typeOfService
2828
const handleClick = (
29-
event: ClickEvent,
3029
selectedApp: string,
3130
selectedService: string,
3231
i: number
3332
) => {
3433
const services = ['auth','client','event-bus','items','inventory','orders']
35-
//delRef refers to the delete button
36-
if (delRef.current[i] && !delRef.current[i].contains(event.target)) {
34+
// if (delRef.current[i] && !delRef.current[i].contains(event.target)) {
35+
setAppIndex(i);
36+
setApp(selectedApp);
3737
if (
3838
selectedService === 'AWS' ||
3939
selectedService === 'AWS/EC2' ||
4040
selectedService === 'AWS/ECS' ||
4141
selectedService === 'AWS/EKS'
4242
) {
43-
setAppIndex(i);
44-
setApp(selectedApp);
4543
navigate(`/aws/:${app}`, { state: { typeOfService: selectedService } });
4644
}
4745
else if(example) {
48-
setAppIndex(i);
49-
setApp(selectedApp);
5046
setServicesData([]);
5147
setChart('communications')
5248

app/context/DashboardContext.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,15 @@ const DashboardContextProvider = React.memo((props: any) => {
4747

4848
const [user, setUser] = useState<string>('guest');
4949
const [applications, setApplications] = useState<string[][]>([]);
50-
// console.log({applications})
50+
console.log({applications})
5151
const [mode, setMode] = useState<string>('light');
5252

53-
5453
const getApplications = useCallback(() => {
5554
const result = ipcRenderer.sendSync('getApps');
5655
setApplications(result);
5756
}, []);
5857

59-
const addApp = useCallback((fields: IFields) => {
58+
const addApp = useCallback((fields: any) => {
6059

6160
for(let field of Object.keys(fields)) {
6261
const { typeOfService, database, URI, name, description } = fields[field];
@@ -65,8 +64,6 @@ const DashboardContextProvider = React.memo((props: any) => {
6564
JSON.stringify([name, database, URI, description, typeOfService])
6665
);
6766
setApplications(result);
68-
// console.log({result})
69-
// console.log('the current application that was added is : ', result);
7067
}
7168

7269

app/modals/AddModal/AddModal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ interface IFields {
1616
}
1717

1818
interface IDashboard {
19-
addApp: (fields: IFields) => void;
19+
addApp: (fields:any) => void;
2020
setApplications: any;
2121
}
2222

@@ -26,7 +26,7 @@ type FormElement = React.FormEvent<HTMLFormElement>;
2626
const AddModal: React.FC<TModalSetter> = React.memo(({ setModal }) => {
2727
const { addApp }: IDashboard = useContext(DashboardContext);
2828

29-
const [fields, setFields] = useState<IFields>({
29+
const [fields, setFields] = useState<any>({
3030
typeOfService: 'Docker',
3131
database: 'SQL',
3232
URI: '',

0 commit comments

Comments
 (0)