From b6ba23d0eeb793219f9dc1cd1dc7a12a5a113283 Mon Sep 17 00:00:00 2001
From: stacksmash76 <98354295+stacksmash76@users.noreply.github.com>
Date: Thu, 10 Nov 2022 12:27:09 +0100
Subject: [PATCH] fix(web): download client table overflow, filter alerts,
dubious wording (#521)
* fix table overflow in settings -> download client
* fixed uneven line height in CellLine component
* filters/details: rename "Cancel" to "Reset form values"
Added log level and log path to Application settings.
Added column truncation to Download Client settings.
* feat: change settings debug toggle wording
* fix: typo in irc add form
---
web/src/components/data-table/Cells.tsx | 3 +-
web/src/components/debug.tsx | 5 +-
web/src/forms/settings/IrcForms.tsx | 2 +-
web/src/screens/dashboard/ActivityTable.tsx | 2 +-
web/src/screens/filters/details.tsx | 56 ++++++++++++++++-----
web/src/screens/settings/Application.tsx | 55 +++++++++++---------
web/src/screens/settings/DownloadClient.tsx | 14 +++---
7 files changed, 88 insertions(+), 49 deletions(-)
diff --git a/web/src/components/data-table/Cells.tsx b/web/src/components/data-table/Cells.tsx
index decec4a..08c2b7c 100644
--- a/web/src/components/data-table/Cells.tsx
+++ b/web/src/components/data-table/Cells.tsx
@@ -115,8 +115,7 @@ const CellLine = ({ title, children }: { title: string; children?: string; }) =>
return (
- {title}
- {": "}
+ {title}:
{children}
);
diff --git a/web/src/components/debug.tsx b/web/src/components/debug.tsx
index b96dd31..16bcdc3 100644
--- a/web/src/components/debug.tsx
+++ b/web/src/components/debug.tsx
@@ -1,11 +1,14 @@
import { FC } from "react";
+import { SettingsContext } from "../utils/Context";
interface DebugProps {
values: unknown;
}
const DEBUG: FC = ({ values }) => {
- if (process.env.NODE_ENV !== "development") {
+ const settings = SettingsContext.useValue();
+
+ if (process.env.NODE_ENV !== "development" || !settings.debug) {
return null;
}
diff --git a/web/src/forms/settings/IrcForms.tsx b/web/src/forms/settings/IrcForms.tsx
index d95ca74..7044b05 100644
--- a/web/src/forms/settings/IrcForms.tsx
+++ b/web/src/forms/settings/IrcForms.tsx
@@ -163,7 +163,7 @@ export function IrcNetworkAddForm({ isOpen, toggle }: AddFormProps) {
>
{(values) => (
-
ADD NETWORKS VIA INDEXERS! ONLY USE THIS IS YOU DELETED NETWORKS
+
ADD NETWORKS VIA INDEXERS! ONLY USE THIS IF YOU DELETED NETWORKS
-
+
{headerGroups.map((headerGroup) => {
diff --git a/web/src/screens/filters/details.tsx b/web/src/screens/filters/details.tsx
index 1b6eeb6..34a0a08 100644
--- a/web/src/screens/filters/details.tsx
+++ b/web/src/screens/filters/details.tsx
@@ -108,17 +108,22 @@ const FormButtonsGroup = ({ values, deleteAction, reset }: FormButtonsGroupProps
className="inline-flex items-center justify-center px-4 py-2 rounded-md text-red-700 dark:text-red-500 light:bg-red-100 light:hover:bg-red-200 dark:hover:text-red-400 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:text-sm"
onClick={toggleDeleteModal}
>
- Remove
+ Remove
{/* {dirty &&
Unsaved changes.. } */}
{
+ e.preventDefault();
+ reset();
+
+ toast.custom((t) => );
+ }}
>
- Cancel
+ Reset form values
} />
} />
} />
-
} />
+
} />
} />
-
}
- />
+
} />
@@ -452,7 +456,11 @@ export function Music() {
);
}
-export function Advanced() {
+interface AdvancedProps {
+ values: FormikValues;
+}
+
+export function Advanced({ values }: AdvancedProps) {
return (
@@ -461,6 +469,24 @@ export function Advanced() {
+ {values.match_releases ? (
+ Do you have a good reason to use Match releases instead of one of the other tabs?>
+ }
+ colors="text-cyan-700 bg-cyan-100 dark:bg-cyan-200 dark:text-cyan-800"
+ />
+ ) : null}
+ {values.except_releases ? (
+ Do you have a good reason to use Except releases instead of one of the other tabs?>
+ }
+ colors="text-fuchsia-700 bg-fuchsia-100 dark:bg-fuchsia-200 dark:text-fuchsia-800"
+ />
+ ) : null}
@@ -514,13 +540,18 @@ export function Advanced() {
}
interface WarningAlertProps {
- text: string;
+ text: string | JSX.Element;
+ alert?: string;
+ colors?: string;
}
-function WarningAlert({ text }: WarningAlertProps) {
+function WarningAlert({ text, alert, colors }: WarningAlertProps) {
return (
@@ -530,7 +561,8 @@ function WarningAlert({ text }: WarningAlertProps) {
Info
- Warning! {text}
+ {alert ?? "Warning!"}
+ {" "}{text}
);
diff --git a/web/src/screens/settings/Application.tsx b/web/src/screens/settings/Application.tsx
index 1527f81..6dee184 100644
--- a/web/src/screens/settings/Application.tsx
+++ b/web/src/screens/settings/Application.tsx
@@ -3,6 +3,26 @@ import { APIClient } from "../../api/APIClient";
import { Checkbox } from "../../components/Checkbox";
import { SettingsContext } from "../../utils/Context";
+interface RowItemProps {
+ label: string;
+ value?: string;
+ title?: string;
+}
+
+const RowItem = ({ label, value, title }: RowItemProps) => {
+ if (!value)
+ return null;
+
+ return (
+
+
{label}:
+
+ {value}
+
+
+ );
+};
+
function ApplicationSettings() {
const [settings, setSettings] = SettingsContext.use();
@@ -31,7 +51,7 @@ function ApplicationSettings() {