Skip to content

Commit 1a90474

Browse files
authored
Frontend S3 Improvements (#2018)
This adds the following changes: - S3 icons have been changed to the database icon - S3 icons always show up in green - frontend crash errors are now wrapped within their block - fileinfo errors have a special case view and display the error in the modal
1 parent b5a7288 commit 1a90474

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

frontend/app/app.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,12 @@ a.plain-link {
7272
}
7373

7474
.error-boundary {
75+
white-space: pre-wrap;
7576
color: var(--error-color);
7677
}
7778

7879
.error-color {
79-
color: var(--error-color);
80+
color: var(--error-color);
8081
}
8182

8283
/* OverlayScrollbars styling */

frontend/app/modals/conntypeahead.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,10 @@ function createS3SuggestionItems(
127127
// behavior
128128
return s3Profiles.map((profileName) => {
129129
const connStatus = connStatusMap.get(profileName);
130-
const connColorNum = computeConnColorNum(connStatus);
131130
const item: SuggestionConnectionItem = {
132131
status: "connected",
133-
icon: "arrow-right-arrow-left",
134-
iconColor:
135-
connStatus?.status == "connected" ? `var(--conn-icon-color-${connColorNum})` : "var(--grey-text-color)",
132+
icon: "database",
133+
iconColor: "var(--accent-color)",
136134
value: profileName,
137135
label: profileName,
138136
current: profileName == connection,

frontend/app/view/preview/preview.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,11 @@ export class PreviewModel implements ViewModel {
485485
const fileName = fileInfo?.name;
486486
const connErr = getFn(this.connectionError);
487487
const editMode = getFn(this.editMode);
488+
const genErr = getFn(this.errorMsgAtom);
488489

490+
if (!fileInfo) {
491+
return { errorStr: `Load Error: ${genErr?.text}` };
492+
}
489493
if (connErr != "") {
490494
return { errorStr: `Connection Error: ${connErr}` };
491495
}
@@ -1072,10 +1076,14 @@ function PreviewView({
10721076
const filePath = useAtomValue(model.metaFilePath);
10731077
const [errorMsg, setErrorMsg] = useAtom(model.errorMsgAtom);
10741078
const connection = useAtomValue(model.connectionImmediate);
1079+
const fileInfo = useAtomValue(model.statFile);
10751080

10761081
useEffect(() => {
1082+
if (!fileInfo) {
1083+
return;
1084+
}
10771085
setErrorMsg(null);
1078-
}, [connection, filePath]);
1086+
}, [connection, filePath, fileInfo]);
10791087

10801088
if (connStatus?.status != "connected") {
10811089
return null;

0 commit comments

Comments
 (0)