diff --git a/client/components/alert.scss b/client/components/alert.scss index 9f8bc08e..a336e89b 100644 --- a/client/components/alert.scss +++ b/client/components/alert.scss @@ -14,6 +14,10 @@ &.success{ background: var(--success); } + &.error{ + background: var(--error); + color: var(--bg-color); + } img{ max-width: 100%; diff --git a/client/components/decorator.js b/client/components/decorator.js index 64e8916c..a1f1dcef 100644 --- a/client/components/decorator.js +++ b/client/components/decorator.js @@ -53,6 +53,8 @@ export function ErrorPage(WrappedComponent) { super(props); this.state = { error: null, + trace: null, + showTrace: false, has_back_button: false, }; } @@ -69,7 +71,10 @@ export function ErrorPage(WrappedComponent) { } update(obj) { - this.setState({ error: obj }); + this.setState({ + error: obj, + trace: new URLSearchParams(location.search).get("trace") || null, + }); } navigate(e) { @@ -84,17 +89,19 @@ export function ErrorPage(WrappedComponent) { const message = this.state.error.message || t("There is nothing in here"); return (
- { this.state.has_back_button ? "back" : "home" } - + -
+
this.setState({showTrace: true})}>

{ t("Oops!") }

{ message }

+ { this.state.showTrace && this.state.trace && + { this.state.trace } }
diff --git a/client/components/formbuilder.js b/client/components/formbuilder.js index 8cb50f48..988f43f8 100644 --- a/client/components/formbuilder.js +++ b/client/components/formbuilder.js @@ -106,7 +106,7 @@ export class FormBuilder extends React.Component { + autoComplete="off" /> ); } @@ -119,7 +119,6 @@ export class FormBuilder extends React.Component { const FormElement = (props) => { const id = props.id !== undefined ? { id: props.id } : {}; const struct = props.params; - const autoCompleteProp = props.autoComplete || "off"; let $input = ( props.onChange(e.target.value)} {...id} name={struct.label} type="text" defaultValue={struct.value} placeholder={ t(struct.placeholder) } /> @@ -138,7 +137,7 @@ const FormElement = (props) => { onTextChange(e.target.value)} {...id} name={struct.label} type="text" value={struct.value || ""} placeholder={ t(struct.placeholder) } readOnly={struct.readonly} - autoComplete={autoCompleteProp} autoCorrect="off" autoCapitalize="off" + autoComplete="off" autoCorrect="off" autoCapitalize="off" spellCheck="false" /> ); if (list_id != null) { @@ -190,7 +189,7 @@ const FormElement = (props) => { $input = ( onPasswordChange(e.target.value)} {...id} name={struct.label} type="password" value={struct.value || ""} placeholder={ t(struct.placeholder) } - autoComplete={autoCompleteProp} autoCorrect="off" autoCapitalize="off" + autoComplete="off" autoCorrect="off" autoCapitalize="off" spellCheck="false"/> ); break; @@ -206,7 +205,7 @@ const FormElement = (props) => {