Skip to content

Commit ad5f872

Browse files
authored
fix: BROS-44: Fix styles in Storage error modal (#7608)
- error text is not scollable - paddings are missing - colors are broken in dark mode Also - reduced font-size for log for more dense info - reduced modal backdrop blur to not lose to context
1 parent 4c8fe76 commit ad5f872

File tree

2 files changed

+21
-27
lines changed

2 files changed

+21
-27
lines changed

web/apps/labelstudio/src/components/Modal/Modal.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
justify-content: center;
1313
background-color: rgba(var(--color-neutral-shadow-raw) / 70%);
1414
will-change: opacity;
15-
backdrop-filter: blur(30px);
15+
backdrop-filter: blur(2px);
1616

1717
&_optimize &__wrapper {
1818
will-change: transform;

web/apps/labelstudio/src/pages/Settings/StorageSettings/StorageSummary.jsx

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { format } from "date-fns/esm";
2+
import { Space, Tooltip } from "@humansignal/ui";
23
import { Button } from "../../../components";
34
import { DescriptionList } from "../../../components/DescriptionList/DescriptionList";
4-
import { Tooltip } from "@humansignal/ui";
55
import { modal } from "../../../components/Modal/Modal";
66
import { Oneof } from "../../../components/Oneof/Oneof";
77
import { getLastTraceback } from "../../../utils/helpers";
@@ -21,9 +21,10 @@ export const StorageSummary = ({ target, storage, className, storageTypes = [] }
2121

2222
// help text for tasks and annotations
2323
const tasks_added_help = `${last_sync_count} new tasks added during the last sync.`;
24-
const tasks_total_help = `${tasks_existed} tasks that have been found and already synced will not be added to the project again.\n${
25-
tasks_existed + last_sync_count
26-
} tasks have been added in total for this storage.`;
24+
const tasks_total_help = [
25+
`${tasks_existed} tasks that have been found and already synced will not be added to the project again.`,
26+
`${tasks_existed + last_sync_count} tasks have been added in total for this storage.`,
27+
].join("\n");
2728
const annotations_help = `${last_sync_count} annotations successfully saved during the last sync.`;
2829
const total_annotations_help =
2930
typeof storage.meta?.total_annotations !== "undefined"
@@ -36,39 +37,32 @@ export const StorageSummary = ({ target, storage, className, storageTypes = [] }
3637
`storage ${storage.id} in project ${storage.project} and job ${storage.last_sync_job}:\n\n` +
3738
`${getLastTraceback(storage.traceback)}\n\n` +
3839
`meta = ${JSON.stringify(storage.meta)}\n`;
40+
const targetType = target === "export" ? "Target" : "Source";
3941

4042
modal({
4143
title: "Storage error logs",
4244
body: (
4345
<>
44-
<pre style={{ background: "#eee", borderRadius: 5, padding: 10 }}>{msg}</pre>
45-
<Button
46-
size="compact"
47-
onClick={() => {
48-
navigator.clipboard.writeText(msg);
49-
}}
50-
>
51-
Copy
52-
</Button>
53-
{target === "export" ? (
54-
<a
55-
style={{ float: "right" }}
56-
target="_blank"
57-
href="https://labelstud.io/guide/storage.html#Target-storage-permissions"
58-
rel="noreferrer"
46+
<pre className="bg-neutral-surface-inset text-neutral-content-subtler p-base mb-base rounded-md text-xs overflow-scroll">
47+
{msg}
48+
</pre>
49+
<Space spread>
50+
<Button
51+
size="compact"
52+
onClick={() => {
53+
navigator.clipboard.writeText(msg);
54+
}}
5955
>
60-
Check Target Storage documentation
61-
</a>
62-
) : (
56+
Copy
57+
</Button>
6358
<a
64-
style={{ float: "right" }}
6559
target="_blank"
66-
href="https://labelstud.io/guide/storage.html#Source-storage-permissions"
6760
rel="noreferrer"
61+
href={`https://labelstud.io/guide/storage.html#${targetType}-storage-permissions`}
6862
>
69-
Check Source Storage documentation
63+
Check {targetType} Storage documentation
7064
</a>
71-
)}
65+
</Space>
7266
</>
7367
),
7468
style: { width: "700px" },

0 commit comments

Comments
 (0)