mirror of
https://github.com/aykhans/slash-e.git
synced 2025-04-16 04:13:12 +00:00
chore: update error message toast
This commit is contained in:
parent
3a86e1338c
commit
ca9590a49b
@ -66,7 +66,7 @@ const ChangePasswordDialog: React.FC<Props> = (props: Props) => {
|
||||
toastHelper.info("Password changed");
|
||||
} catch (error: any) {
|
||||
console.error(error);
|
||||
toastHelper.error(error.response.data.message);
|
||||
toastHelper.error(JSON.stringify(error.response.data));
|
||||
}
|
||||
requestState.setFinish();
|
||||
};
|
||||
|
@ -100,7 +100,7 @@ const CreateShortcutDialog: React.FC<Props> = (props: Props) => {
|
||||
}
|
||||
} catch (error: any) {
|
||||
console.error(error);
|
||||
toastHelper.error(error.response.data.error || error.response.data.message);
|
||||
toastHelper.error(JSON.stringify(error.response.data));
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -86,7 +86,7 @@ const CreateWorkspaceDialog: React.FC<Props> = (props: Props) => {
|
||||
}
|
||||
} catch (error: any) {
|
||||
console.error(error);
|
||||
toastHelper.error(error.response.data.error || error.response.data.message);
|
||||
toastHelper.error(JSON.stringify(error.response.data));
|
||||
}
|
||||
requestState.setFinish();
|
||||
};
|
||||
|
@ -38,12 +38,12 @@ const Header: React.FC = () => {
|
||||
<div className="w-full max-w-4xl mx-auto px-3 py-5 flex flex-row justify-between items-center">
|
||||
<div className="flex flex-row justify-start items-center shrink mr-2">
|
||||
<Link to="/" className="text-base font-mono font-medium cursor-pointer flex flex-row justify-start items-center">
|
||||
<img src="/corgi-logo.png" className="w-8 h-auto mr-1" alt="" />
|
||||
<img src="/corgi-logo.png" className="w-8 h-auto mr-2" alt="" />
|
||||
Corgi
|
||||
</Link>
|
||||
{workspaceList.length > 0 && activedWorkspace !== undefined && (
|
||||
<>
|
||||
<span className="font-mono mx-2 text-gray-200">/</span>
|
||||
<span className="font-mono mx-1 text-gray-200">/</span>
|
||||
<Dropdown
|
||||
trigger={
|
||||
<button className="flex flex-row justify-end items-center cursor-pointer">
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { Tooltip } from "@mui/joy";
|
||||
import copy from "copy-to-clipboard";
|
||||
import { useState } from "react";
|
||||
import { shortcutService, workspaceService } from "../services";
|
||||
@ -59,17 +60,21 @@ const ShortcutListView: React.FC<Props> = (props: Props) => {
|
||||
</div>
|
||||
<div className="flex flex-row justify-end items-center">
|
||||
<span className="w-16 truncate mr-2 text-gray-600">{shortcut.creator.name}</span>
|
||||
<button
|
||||
className="cursor-pointer mr-4 hover:opacity-80"
|
||||
onClick={() => {
|
||||
handleCopyButtonClick(shortcut);
|
||||
}}
|
||||
>
|
||||
<Icon.Copy className="w-5 h-auto" />
|
||||
</button>
|
||||
<a className="cursor-pointer mr-4 hover:opacity-80" target="_blank" href={shortcut.link} rel="noreferrer">
|
||||
<Icon.ExternalLink className="w-5 h-auto" />
|
||||
</a>
|
||||
<Tooltip title="Copy link" variant="solid" placement="top">
|
||||
<button
|
||||
className="cursor-pointer mr-4 hover:opacity-80"
|
||||
onClick={() => {
|
||||
handleCopyButtonClick(shortcut);
|
||||
}}
|
||||
>
|
||||
<Icon.Copy className="w-5 h-auto" />
|
||||
</button>
|
||||
</Tooltip>
|
||||
<Tooltip title="Go to link" variant="solid" placement="top">
|
||||
<a className="cursor-pointer mr-4 hover:opacity-80" target="_blank" href={shortcut.link} rel="noreferrer">
|
||||
<Icon.ExternalLink className="w-5 h-auto" />
|
||||
</a>
|
||||
</Tooltip>
|
||||
<Dropdown
|
||||
actions={
|
||||
<>
|
||||
|
@ -69,7 +69,7 @@ const UpsertWorkspaceUserDialog: React.FC<Props> = (props: Props) => {
|
||||
}
|
||||
} catch (error: any) {
|
||||
console.error(error);
|
||||
toastHelper.error(error.response.data.error || error.response.data.message);
|
||||
toastHelper.error(JSON.stringify(error.response.data));
|
||||
}
|
||||
requestState.setFinish();
|
||||
};
|
||||
|
@ -9,6 +9,7 @@ import { unknownWorkspace, unknownWorkspaceUser } from "../store/modules/workspa
|
||||
import { showCommonDialog } from "./Alert";
|
||||
import toastHelper from "./Toast";
|
||||
import CreateWorkspaceDialog from "./CreateWorkspaceDialog";
|
||||
import Icon from "./Icon";
|
||||
|
||||
interface Props {
|
||||
workspaceId: WorkspaceId;
|
||||
@ -93,9 +94,11 @@ const WorkspaceSetting: React.FC<Props> = (props: Props) => {
|
||||
{workspaceUser.role === "ADMIN" ? (
|
||||
<>
|
||||
<Button variant="soft" onClick={handleEditWorkspaceButtonClick}>
|
||||
<Icon.Edit className="w-4 h-auto mr-1" />
|
||||
Edit
|
||||
</Button>
|
||||
<Button variant="soft" color="danger" onClick={handleDeleteWorkspaceButtonClick}>
|
||||
<Icon.Trash className="w-4 h-auto mr-1" />
|
||||
Delete
|
||||
</Button>
|
||||
</>
|
||||
|
@ -76,7 +76,7 @@ const Auth: React.FC = () => {
|
||||
}
|
||||
} catch (error: any) {
|
||||
console.error(error);
|
||||
toastHelper.error(error.response.data.message);
|
||||
toastHelper.error(JSON.stringify(error.response.data));
|
||||
}
|
||||
actionBtnLoadingState.setFinish();
|
||||
};
|
||||
@ -111,7 +111,7 @@ const Auth: React.FC = () => {
|
||||
}
|
||||
} catch (error: any) {
|
||||
console.error(error);
|
||||
toastHelper.error(error.response.data.message);
|
||||
toastHelper.error(JSON.stringify(error.response.data));
|
||||
}
|
||||
actionBtnLoadingState.setFinish();
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Button, Input } from "@mui/joy";
|
||||
import { Button, Input, Tooltip } from "@mui/joy";
|
||||
import { useEffect, useState } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useAppSelector } from "../store";
|
||||
@ -69,22 +69,24 @@ const UserDetail: React.FC = () => {
|
||||
<span className="mr-3 text-gray-500 font-mono">Email: </span>
|
||||
{user?.email}
|
||||
</p>
|
||||
<p className="leading-8 flex flex-row justify-start items-center">
|
||||
<div className="leading-8 flex flex-row justify-start items-center">
|
||||
<span className="mr-3 text-gray-500 font-mono">Password: </span>
|
||||
<Button variant="soft" onClick={handleChangePasswordBtnClick}>
|
||||
Change
|
||||
</Button>
|
||||
</p>
|
||||
<p className="leading-8 flex flex-row justify-start items-center">
|
||||
</div>
|
||||
<div className="leading-8 flex flex-row justify-start items-center">
|
||||
<span className="mr-3 text-gray-500 font-mono">OpenID:</span>
|
||||
<Input type="text" className="w-48" value={user?.openId} readOnly />
|
||||
<button className="-ml-6 z-1 bg-white text-gray-600 hover:text-black" onClick={handleCopyOpenIdBtnClick}>
|
||||
<Icon.Clipboard className="w-4 h-auto" />
|
||||
</button>
|
||||
<Tooltip title="Copy OpenID" variant="solid" placement="top">
|
||||
<button className="-ml-6 z-1 bg-white text-gray-600 hover:text-black" onClick={handleCopyOpenIdBtnClick}>
|
||||
<Icon.Clipboard className="w-4 h-auto" />
|
||||
</button>
|
||||
</Tooltip>
|
||||
<Button className="!ml-6" variant="soft" color="warning" onClick={handleResetOpenIdBtnClick}>
|
||||
Reset
|
||||
</Button>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{state.showChangePasswordDialog && (
|
||||
|
Loading…
x
Reference in New Issue
Block a user