Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/src/packages/frontend/account/table-error.tsx
Views: 687
/*1Show an error if something goes wrong trying to save2the account settings table to the database.3*/45import { Alert } from "antd";6import { useTypedRedux } from "../app-framework";78export default function AccountTableError() {9const tableError = useTypedRedux("account", "tableError");10if (!tableError) return null;1112const { error, query } = tableError.toJS();1314let obj;15try {16// this should work.17obj = query[0]["accounts"];18delete query["account_id"];19} catch (_err) {20obj = query;21}2223let description;24if (obj["name"] != null) {25// Issue trying to set the username.26description =27"Please try a different username. Names can be between 1 and 39 characters, contain upper and lower case letters, numbers, and dashes.";28} else {29description = (30<>31There was an error trying to save an account setting to the server. In32particular, the following change failed:33<pre style={{ margin: "30px" }}>34{JSON.stringify(obj, undefined, 2)}35</pre>36Try changing the relevant field below.37</>38);39}4041return (42<div style={{ width: "100%" }}>43<Alert44style={{ margin: "15px auto", maxWidth: "900px" }}45message={<b>{error}</b>}46description={description}47type="error"48/>49</div>50);51}525354