diff --git a/docker-compose.yml b/docker-compose.yml
index fddba50..ae2e1eb 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -10,6 +10,7 @@ services:
ports:
- "8050:8050"
- "3050:3050"
+ - "8051:8051"
depends_on:
- rabbitmq
- nginx
diff --git a/src/client/components/AirDCPPSettingsForm.tsx b/src/client/components/AirDCPPSettingsForm.tsx
new file mode 100644
index 0000000..a1f5d14
--- /dev/null
+++ b/src/client/components/AirDCPPSettingsForm.tsx
@@ -0,0 +1,54 @@
+import React, { ReactElement } from "react";
+import { Form, Field } from "react-final-form";
+
+export const AirDCPPSettingsForm = (): ReactElement => {
+ const onSubmit = () => {};
+ const validate = async () => {};
+
+ return (
+
diff --git a/src/client/components/Settings.tsx b/src/client/components/Settings.tsx
index fec4c1c..221d1ec 100644
--- a/src/client/components/Settings.tsx
+++ b/src/client/components/Settings.tsx
@@ -1,52 +1,71 @@
import React, { useState, useEffect, useCallback, ReactElement } from "react";
+import { AirDCPPSettingsForm } from "./AirDCPPSettingsForm";
+import settingsObject from "../constants/settings/settingsMenu.json";
+import { isUndefined, map } from "lodash";
interface ISettingsProps {}
export const Settings = (props: ISettingsProps): ReactElement => {
+ const [active, setActive] = useState("gen-db");
return (
);
};
diff --git a/src/client/constants/settings/settingsMenu.json b/src/client/constants/settings/settingsMenu.json
new file mode 100644
index 0000000..08e536f
--- /dev/null
+++ b/src/client/constants/settings/settingsMenu.json
@@ -0,0 +1,58 @@
+[
+ {
+ "id": 1,
+ "category": "general",
+ "displayName": "General",
+ "children": [
+ {
+ "id": "gen-db",
+ "displayName": "Dashboard"
+ },
+ {
+ "id": "gen-gls",
+ "displayName": "Global Search"
+ }
+ ]
+ },
+
+ {
+ "id": 2,
+ "category": "acquisition",
+ "displayName": "Acquisition",
+ "children": [
+ {
+ "id": "adc",
+ "displayName": "AirDC++",
+ "children": [
+ {
+ "id": "adc-connection",
+ "displayName": "Connection"
+ },
+ {
+ "id": "adc-hubs",
+ "displayName": "Hubs"
+ },
+ {
+ "id": "adc-add-config",
+ "displayName": "Additional Configuration"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "id": 3,
+ "category": "comicvine",
+ "displayName": "Comic Vine",
+ "children": [
+ {
+ "id": "api",
+ "displayName": "API"
+ },
+ {
+ "id": "options",
+ "displayName": "Options"
+ }
+ ]
+ }
+]
diff --git a/src/client/shared/utils/object.utils.ts b/src/client/shared/utils/object.utils.ts
index 53a26ee..a0fe0d5 100644
--- a/src/client/shared/utils/object.utils.ts
+++ b/src/client/shared/utils/object.utils.ts
@@ -20,3 +20,35 @@ const changes = (object, base) => {
}
});
};
+
+
+export type TraverseFunction
= (
+ obj: T,
+ prop: string,
+ value: unknown,
+ scope: string[],
+) => void;
+
+/**
+ * Deep diff between two object, using lodash
+ * @param {Object} object Object to traverse
+ * @param {Object} fn Callback function
+ * @return {Object} Return a new object who represent the diff
+ */
+export const traverseObject = >(
+ object: T,
+ fn: TraverseFunction,
+): void => traverseInternal(object, fn, []);
+
+const traverseInternal = >(
+ object: T,
+ fn: TraverseFunction,
+ scope: string[] = [],
+): void => {
+ Object.entries(object).forEach(([key, value]) => {
+ fn.apply(this, [object, key, value, scope]);
+ if (value !== null && typeof value === "object") {
+ traverseInternal(value, fn, scope.concat(key));
+ }
+ });
+};