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