+
-
Settings
-
- Manage watcher behavior, notifications, and shop defaults in one compact workspace.
-
+
+ Settings
+
+ Manage watcher behavior, notifications, and shop defaults in one compact workspace.
+
+
+
+
+
-
-
+
+
+
+
+
-
-
-
-
-
-
-
- Automation
-
- Fine-tune polling, startup behavior, and desktop notifications.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ Automation
+
+ Fine-tune polling, startup behavior, and desktop notifications.
+
+
+
+
+
+
+
+
+
);
}
diff --git a/src/components/pages/settings/settings.page.styles.scss b/src/components/pages/settings/settings.page.styles.scss
index 79afbf3..0da1df9 100644
--- a/src/components/pages/settings/settings.page.styles.scss
+++ b/src/components/pages/settings/settings.page.styles.scss
@@ -8,11 +8,20 @@
}
.settings-page__hero {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 24px;
padding: 18px 24px;
border-radius: 18px;
- background: linear-gradient(135deg, #ffffff 0%, #f5f9ff 55%, #eef4ff 100%);
- border: 1px solid #dbe7ff;
- box-shadow: 0 10px 24px rgba(23, 43, 77, 0.06);
+ background: linear-gradient(
+ 135deg,
+ var(--settings-hero-bg-start, #ffffff) 0%,
+ var(--settings-hero-bg-mid, #f5f9ff) 55%,
+ var(--settings-hero-bg-end, #eef4ff) 100%
+ );
+ border: 1px solid var(--settings-border, #dbe7ff);
+ box-shadow: var(--settings-shadow, 0 10px 24px rgba(23, 43, 77, 0.06));
.ant-typography {
margin-bottom: 0;
@@ -23,18 +32,47 @@
}
}
-.settings-page__side-stack {
+.settings-page__hero-copy {
+ flex: 1 1 360px;
+ min-width: 0;
+}
+
+.settings-page__hero-status {
+ flex: 0 1 520px;
+ min-width: 360px;
+}
+
+.settings-page__hero-status .settings-watcher-manager {
+ gap: 8px;
+}
+
+.settings-page__hero-status .settings-watcher-manager__content {
+ justify-content: flex-end;
+}
+
+.settings-page__content-stack {
width: 100%;
}
-.settings-page__side-stack > .ant-space-item,
+.settings-page__content-stack > .ant-space-item,
.settings-page__controls > .ant-space-item {
width: 100%;
}
+.settings-page__secondary-grid {
+ display: grid;
+ grid-template-columns: minmax(420px, 0.38fr) minmax(0, 1fr);
+ gap: 16px;
+ width: 100%;
+}
+
+.settings-page__secondary-grid .settings-page__card {
+ height: 100%;
+}
+
.settings-page__card {
border-radius: 18px;
- box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
+ box-shadow: var(--settings-shadow, 0 10px 24px rgba(15, 23, 42, 0.06));
.ant-card-body {
padding: 18px 20px;
@@ -64,8 +102,8 @@
.settings-page__controls > .ant-space-item > * {
padding: 10px 12px;
border-radius: 12px;
- background: #fafcff;
- border: 1px solid #edf2ff;
+ background: var(--settings-control-bg, #fafcff);
+ border: 1px solid var(--settings-border, #edf2ff);
}
.settings-page__controls > .ant-space-item > * > div {
@@ -105,9 +143,9 @@
.settings-filepaths__list {
overflow: hidden;
- border: 1px solid #edf2ff;
+ border: 1px solid var(--settings-border, #edf2ff);
border-radius: 14px;
- background: #fafcff;
+ background: var(--settings-control-bg, #fafcff);
}
.settings-filepaths__list .ant-list-item {
@@ -155,15 +193,19 @@
}
.settings-watcher-status--started {
- color: #389e0d;
- background: #f6ffed;
- border-color: #b7eb8f;
+ color: var(--settings-success-text, #389e0d);
+ background: var(--settings-success-bg, #f6ffed);
+ border-color: var(--settings-success-border, #b7eb8f);
}
.settings-watcher-status--stopped {
- color: #cf1322;
- background: #fff1f0;
- border-color: #ffa39e;
+ color: var(--settings-error-text, #cf1322);
+ background: var(--settings-error-bg, #fff1f0);
+ border-color: var(--settings-error-border, #ffa39e);
+}
+
+.settings-watcher-status .ant-typography {
+ color: inherit;
}
.settings-watcher-status__error {
@@ -176,7 +218,23 @@
padding-bottom: 16px;
}
- .settings-page__hero,
+ .settings-page__hero {
+ align-items: stretch;
+ flex-direction: column;
+ gap: 16px;
+ padding: 20px;
+ }
+
+ .settings-page__hero-status {
+ flex: 1 1 auto;
+ min-width: 0;
+ width: 100%;
+ }
+
+ .settings-page__secondary-grid {
+ grid-template-columns: 1fr;
+ }
+
.settings-page__card .ant-card-body {
padding: 20px;
}
diff --git a/src/ipc/ipc-renderer-handler.js b/src/ipc/ipc-renderer-handler.js
index d70ada6..0b1debd 100644
--- a/src/ipc/ipc-renderer-handler.js
+++ b/src/ipc/ipc-renderer-handler.js
@@ -1,4 +1,4 @@
-import { antdNotification as notification } from "../util/antdFeedback";
+import {antdNotification as notification} from "../util/antdFeedback";
import ipcTypes from "../ipc.types";
import {
setReleaseNotes,
@@ -9,87 +9,91 @@ import {
setWatchedPaths,
setWatcherStatus
} from "../redux/application/application.actions";
-import { calculateAudit, setAuditError } from "../redux/reporting/reporting.actions";
-import { setScanEstimateList } from "../redux/scan/scan.actions";
-import { store } from "../redux/store";
-import { signOutStart } from "../redux/user/user.actions";
-import { GetR4PDateWithClaim, UpsertEstimate } from "./ipc-estimate-utils";
-const { ipcRenderer } = window;
+import {calculateAudit, setAuditError} from "../redux/reporting/reporting.actions";
+import {setScanEstimateList} from "../redux/scan/scan.actions";
+import {store} from "../redux/store";
+import {setDarkMode, signOutStart} from "../redux/user/user.actions";
+import {GetR4PDateWithClaim, UpsertEstimate} from "./ipc-estimate-utils";
+
+const {ipcRenderer} = window;
console.log("----Initializing IPC Listeners in React App.");
ipcRenderer.on("test-toRenderer", (event, obj) => {
- console.log("test-toRenderer", obj);
+ console.log("test-toRenderer", obj);
});
ipcRenderer.on(ipcTypes.fileWatcher.toRenderer.filepathsList, (event, obj) => {
- store.dispatch(setWatchedPaths(obj));
+ store.dispatch(setWatchedPaths(obj));
});
//Filewatcher Status Section
ipcRenderer.on(ipcTypes.fileWatcher.toRenderer.startSuccess, (event, obj) => {
- store.dispatch(setWatcherStatus("Started"));
+ store.dispatch(setWatcherStatus("Started"));
});
ipcRenderer.on(ipcTypes.fileWatcher.toRenderer.stopSuccess, (event, obj) => {
- store.dispatch(setWatcherStatus("Stopped"));
+ store.dispatch(setWatcherStatus("Stopped"));
});
ipcRenderer.on(ipcTypes.fileWatcher.toRenderer.error, (event, obj) => {
- store.dispatch(setWatcherStatus(obj));
+ store.dispatch(setWatcherStatus(obj));
});
//Estimate Section
-ipcRenderer.on(ipcTypes.estimate.toRenderer.getCloseDate, async (event, { filepath, clm_no }) => {
- const close_date = await GetR4PDateWithClaim(clm_no);
- ipcRenderer.send(ipcTypes.app.toMain.importJob, {
- filepath,
- close_date
- });
+ipcRenderer.on(ipcTypes.estimate.toRenderer.getCloseDate, async (event, {filepath, clm_no}) => {
+ const close_date = await GetR4PDateWithClaim(clm_no);
+ ipcRenderer.send(ipcTypes.app.toMain.importJob, {
+ filepath,
+ close_date
+ });
});
ipcRenderer.on(ipcTypes.estimate.toRenderer.estimateDecodeSuccess, async (event, obj) => {
- await UpsertEstimate(obj);
+ await UpsertEstimate(obj);
});
ipcRenderer.on(ipcTypes.store.response, (event, obj) => {
- store.dispatch(setSettings(obj));
+ store.dispatch(setSettings(obj));
+ if (Object.prototype.hasOwnProperty.call(obj, "darkMode")) {
+ store.dispatch(setDarkMode(obj.darkMode));
+ }
});
//FileScan Section
ipcRenderer.on(ipcTypes.fileScan.toRenderer.scanFilePathsResponse, async (event, listOfEstimates) => {
- store.dispatch(setScanEstimateList(listOfEstimates));
+ store.dispatch(setScanEstimateList(listOfEstimates));
});
ipcRenderer.on(ipcTypes.app.toRenderer.updateAvailable, async (event, updateInfo) => {
- store.dispatch(setUpdateAvailable(updateInfo));
+ store.dispatch(setUpdateAvailable(updateInfo));
});
ipcRenderer.on(ipcTypes.app.toRenderer.downloadProgress, async (event, progress) => {
- store.dispatch(setUpdateProgress(progress));
+ store.dispatch(setUpdateProgress(progress));
});
ipcRenderer.on(ipcTypes.app.toRenderer.signOut, async (event, progress) => {
- store.dispatch(signOutStart());
+ store.dispatch(signOutStart());
});
ipcRenderer.on(ipcTypes.app.toRenderer.setReleaseNotes, async (event, releaseNotes) => {
- store.dispatch(setReleaseNotes(releaseNotes));
+ store.dispatch(setReleaseNotes(releaseNotes));
});
ipcRenderer.on(ipcTypes.app.toRenderer.appVersion, async (event, appversion) => {
- window.$crisp.push(["set", "session:data", [[["rps-version", appversion]]]]);
+ window.$crisp.push(["set", "session:data", [[["rps-version", appversion]]]]);
});
//Handle Autdit
ipcRenderer.on(ipcTypes.audit.toRenderer.auditClaimsArray, async (event, claimsArray) => {
- store.dispatch(calculateAudit(claimsArray));
+ store.dispatch(calculateAudit(claimsArray));
});
ipcRenderer.on(ipcTypes.audit.toRenderer.auditError, async (event, error) => {
- store.dispatch(setAuditError(error));
+ store.dispatch(setAuditError(error));
});
ipcRenderer.on(ipcTypes.app.toRenderer.scrubResults, async (event, results) => {
- store.dispatch(setScrubResults(results));
+ store.dispatch(setScrubResults(results));
});
-ipcRenderer.on(ipcTypes.app.toRenderer.scrubError, async (event, { message }) => {
- notification.open({ type: "error", message: "Estimate Scrubber Error", description: message });
+ipcRenderer.on(ipcTypes.app.toRenderer.scrubError, async (event, {message}) => {
+ notification.open({type: "error", message: "Estimate Scrubber Error", description: message});
});
diff --git a/src/redux/user/user.actions.js b/src/redux/user/user.actions.js
index 2aeb89d..42d23fe 100644
--- a/src/redux/user/user.actions.js
+++ b/src/redux/user/user.actions.js
@@ -97,6 +97,11 @@ export const checkForNotification = () => ({
type: UserActionTypes.CHECK_FOR_NOTIFICATION
});
+export const setDarkMode = (darkMode) => ({
+ type: UserActionTypes.SET_DARK_MODE,
+ payload: darkMode
+});
+
export const toggleDarkMode = () => ({
type: UserActionTypes.TOGGLE_DARK_MODE
});
diff --git a/src/redux/user/user.reducer.js b/src/redux/user/user.reducer.js
index c2ea19f..9034ff0 100644
--- a/src/redux/user/user.reducer.js
+++ b/src/redux/user/user.reducer.js
@@ -82,6 +82,11 @@ const userReducer = (state = INITIAL_STATE, action) => {
...action.payload //Spread current user details in.
}
};
+ case UserActionTypes.SET_DARK_MODE:
+ return {
+ ...state,
+ darkMode: action.payload
+ };
case UserActionTypes.TOGGLE_DARK_MODE:
return {
...state,
diff --git a/src/redux/user/user.types.js b/src/redux/user/user.types.js
index a8e173c..7d7324d 100644
--- a/src/redux/user/user.types.js
+++ b/src/redux/user/user.types.js
@@ -30,6 +30,7 @@ const UserActionTypes = {
CHECK_FOR_NOTIFICATION: "CHECK_FOR_NOTIFICATION",
SET_NOTIFICATIONS: "SET_NOTIFICATIONS",
SET_TARGETS: "SET_TARGETS",
+ SET_DARK_MODE: "SET_DARK_MODE",
TOGGLE_DARK_MODE: "TOGGLE_DARK_MODE"
};
export default UserActionTypes;