θΏ™ζ˜―indexlocζδΎ›ηš„ζœεŠ‘οΌŒδΈθ¦θΎ“ε…₯任何密码
Skip to content
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
346ad96
add writible fields to dev api new workspace endpoint
shatfield4 Dec 16, 2024
d2a55c4
Merge branch 'master' into 2840-feat-api-endpoint-workspacenew-append…
shatfield4 Dec 16, 2024
c0462c3
lint
shatfield4 Dec 16, 2024
e719740
implement validations for workspace model
shatfield4 Dec 16, 2024
0170e06
update swagger comments
shatfield4 Dec 16, 2024
af55d5c
Merge branch 'master' into 2840-feat-api-endpoint-workspacenew-append…
shatfield4 Dec 16, 2024
9dd9170
Merge branch 'master' into 2840-feat-api-endpoint-workspacenew-append…
timothycarambat Dec 16, 2024
3d2b036
simplify validations for workspace on frontend and API
timothycarambat Dec 16, 2024
4a41c2d
Merge branch '2840-feat-api-endpoint-workspacenew-append-writable-fie…
timothycarambat Dec 16, 2024
6907348
cleanup validations
timothycarambat Dec 16, 2024
e8d31e9
Enable default users to be able to add attachments, but not files to …
timothycarambat Dec 16, 2024
baf4afc
Merge branch 'master' into 2840-feat-api-endpoint-workspacenew-append…
timothycarambat Dec 16, 2024
9f96199
add writible fields to dev api new workspace endpoint
shatfield4 Dec 16, 2024
af1f822
lint
shatfield4 Dec 16, 2024
e330087
implement validations for workspace model
shatfield4 Dec 16, 2024
04d051a
update swagger comments
shatfield4 Dec 16, 2024
1e3fe5f
simplify validations for workspace on frontend and API
timothycarambat Dec 16, 2024
fac34a8
cleanup validations
timothycarambat Dec 16, 2024
5f19e5b
Enable default users to be able to add attachments, but not files to …
timothycarambat Dec 16, 2024
59f8360
Merge branch '2840-feat-api-endpoint-workspacenew-append-writable-fie…
timothycarambat Dec 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export function DnDFileUploaderProvider({ workspace, children }) {
const { user } = useUser();

useEffect(() => {
if (!!user && user.role === "default") return;
System.checkDocumentProcessorOnline().then((status) => setReady(status));
}, [user]);

Expand Down Expand Up @@ -111,6 +110,8 @@ export function DnDFileUploaderProvider({ workspace, children }) {
type: "attachment",
});
} else {
// If the user is a default user, we do not want to allow them to upload files.
if (!!user && user.role === "default") continue;
newAccepted.push({
uid: v4(),
file,
Expand Down Expand Up @@ -146,6 +147,8 @@ export function DnDFileUploaderProvider({ workspace, children }) {
type: "attachment",
});
} else {
// If the user is a default user, we do not want to allow them to upload files.
if (!!user && user.role === "default") continue;
newAccepted.push({
uid: v4(),
file,
Expand Down Expand Up @@ -216,6 +219,8 @@ export default function DnDFileUploaderWrapper({ children }) {
onDragEnter: () => setDragging(true),
onDragLeave: () => setDragging(false),
});
const { user } = useUser();
const canUploadAll = !user || user?.role !== "default";

return (
<div
Expand All @@ -229,10 +234,21 @@ export default function DnDFileUploaderWrapper({ children }) {
<div className="w-full h-full flex justify-center items-center rounded-xl">
<div className="flex flex-col gap-y-[14px] justify-center items-center">
<img src={DndIcon} width={69} height={69} />
<p className="text-white text-[24px] font-semibold">Add anything</p>
<p className="text-white text-[24px] font-semibold">
Add {canUploadAll ? "anything" : "an image"}
</p>
<p className="text-white text-[16px] text-center">
Drop your file here to embed it into your <br />
workspace auto-magically.
{canUploadAll ? (
<>
Drop your file here to embed it into your <br />
workspace auto-magically.
</>
) : (
<>
Drop your image here to chat with it <br />
auto-magically.
</>
)}
</p>
</div>
</div>
Expand Down