From 44ad46cff3b8a0d63b2a48d047c1272fee953ff0 Mon Sep 17 00:00:00 2001 From: Ari Date: Sat, 23 Apr 2022 18:10:20 -0400 Subject: [PATCH] clean up --- webapp/src/apiService/base.ts | 8 +++++++- .../components/AutomationEditor/AutoInfoBox.stories.tsx | 3 ++- webapp/src/components/AutomationEditor/index.stories.tsx | 2 ++ webapp/src/components/AutomationList/index.tsx | 3 +-- webapp/src/components/Inputs/InputMultiSelect.tsx | 2 -- webapp/src/utils/defaults.ts | 1 + 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/webapp/src/apiService/base.ts b/webapp/src/apiService/base.ts index c9deebe..012fd66 100644 --- a/webapp/src/apiService/base.ts +++ b/webapp/src/apiService/base.ts @@ -33,9 +33,15 @@ export const makeRemoteAPI = (baseURL: string): API => ({ return response } catch (err) { console.error(err) + let error = String(err) + + if (err instanceof Error) { + error += ` ${err.stack}` + } + return { ok: false, - error: `${err} ${err?.stack}`, + error, } } } diff --git a/webapp/src/components/AutomationEditor/AutoInfoBox.stories.tsx b/webapp/src/components/AutomationEditor/AutoInfoBox.stories.tsx index 247e03d..909c478 100644 --- a/webapp/src/components/AutomationEditor/AutoInfoBox.stories.tsx +++ b/webapp/src/components/AutomationEditor/AutoInfoBox.stories.tsx @@ -34,5 +34,6 @@ Basic.args = { 'wowo': '!' }, mode: 'single', - } + tags: {}, + }, } diff --git a/webapp/src/components/AutomationEditor/index.stories.tsx b/webapp/src/components/AutomationEditor/index.stories.tsx index e36363d..663632c 100644 --- a/webapp/src/components/AutomationEditor/index.stories.tsx +++ b/webapp/src/components/AutomationEditor/index.stories.tsx @@ -46,6 +46,7 @@ Simple.args = { 'wowo': '!' }, mode: 'single', + tags: {}, }, trigger: [ { @@ -115,6 +116,7 @@ EmptyStart.args = { 'wowo': '!' }, mode: 'single', + tags: {}, }, trigger: [ ], diff --git a/webapp/src/components/AutomationList/index.tsx b/webapp/src/components/AutomationList/index.tsx index 3dbed71..9d800a3 100644 --- a/webapp/src/components/AutomationList/index.tsx +++ b/webapp/src/components/AutomationList/index.tsx @@ -1,11 +1,10 @@ import "./index.css"; import { AutomationEditor } from "components/AutomationEditor"; -import { Button } from "components/Inputs/Button"; import { FC, useState } from "react"; import { AutomationData } from "types/automations"; import { DAGBoardElmDims } from 'components/DAGSvgs/DAGBoard'; import { defaultAutomation } from '../../utils/defaults'; -import { ArrowIcon, TrashIcon } from "components/Icons"; +import { ArrowIcon } from "components/Icons"; import { ButtonIcon } from "components/Icons/ButtonIcons"; import { ApiService } from "apiService/core"; import { AutomationListBox } from "./AutomationListBox"; diff --git a/webapp/src/components/Inputs/InputMultiSelect.tsx b/webapp/src/components/Inputs/InputMultiSelect.tsx index cab1473..9806019 100644 --- a/webapp/src/components/Inputs/InputMultiSelect.tsx +++ b/webapp/src/components/Inputs/InputMultiSelect.tsx @@ -1,5 +1,4 @@ import { ArrowIcon } from "components/Icons"; -import InputWrapper from "./InputWrapper"; import { useInputMultiSelectStyles } from "./styles"; import { useState } from 'react'; @@ -15,7 +14,6 @@ export interface Props { } export default function InputMultiSelect({ selected = [], options, onChange, label, max, - ...selattr }: Props) { // state const [open, setOpen] = useState(false); diff --git a/webapp/src/utils/defaults.ts b/webapp/src/utils/defaults.ts index 2ebaf55..8c70a55 100644 --- a/webapp/src/utils/defaults.ts +++ b/webapp/src/utils/defaults.ts @@ -47,6 +47,7 @@ export const defaultAutomation = (id: string): AutomationData => ({ alias: "New Automation", description: "", mode: "single", + tags: {}, }, trigger: [], sequence: [],