Skip to content

Commit

Permalink
Frontend S3 Improvements (#2018)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
oneirocosm authored Feb 21, 2025
1 parent b5a7288 commit 1a90474
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
3 changes: 2 additions & 1 deletion frontend/app/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,12 @@ a.plain-link {
}

.error-boundary {
white-space: pre-wrap;
color: var(--error-color);
}

.error-color {
color: var(--error-color);
color: var(--error-color);
}

/* OverlayScrollbars styling */
Expand Down
6 changes: 2 additions & 4 deletions frontend/app/modals/conntypeahead.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,10 @@ function createS3SuggestionItems(
// behavior
return s3Profiles.map((profileName) => {
const connStatus = connStatusMap.get(profileName);
const connColorNum = computeConnColorNum(connStatus);
const item: SuggestionConnectionItem = {
status: "connected",
icon: "arrow-right-arrow-left",
iconColor:
connStatus?.status == "connected" ? `var(--conn-icon-color-${connColorNum})` : "var(--grey-text-color)",
icon: "database",
iconColor: "var(--accent-color)",
value: profileName,
label: profileName,
current: profileName == connection,
Expand Down
10 changes: 9 additions & 1 deletion frontend/app/view/preview/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,11 @@ export class PreviewModel implements ViewModel {
const fileName = fileInfo?.name;
const connErr = getFn(this.connectionError);
const editMode = getFn(this.editMode);
const genErr = getFn(this.errorMsgAtom);

if (!fileInfo) {
return { errorStr: `Load Error: ${genErr?.text}` };
}
if (connErr != "") {
return { errorStr: `Connection Error: ${connErr}` };
}
Expand Down Expand Up @@ -1072,10 +1076,14 @@ function PreviewView({
const filePath = useAtomValue(model.metaFilePath);
const [errorMsg, setErrorMsg] = useAtom(model.errorMsgAtom);
const connection = useAtomValue(model.connectionImmediate);
const fileInfo = useAtomValue(model.statFile);

useEffect(() => {
if (!fileInfo) {
return;
}
setErrorMsg(null);
}, [connection, filePath]);
}, [connection, filePath, fileInfo]);

if (connStatus?.status != "connected") {
return null;
Expand Down

0 comments on commit 1a90474

Please sign in to comment.