Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

chore: remove description

Marc Seitz0d542504c2fe
diff --git a/components/ui/form.tsx b/components/ui/form.tsx
index 682cf7eb..bf2df534 100644
--- a/components/ui/form.tsx
+++ b/components/ui/form.tsx
@@ -36,7 +36,6 @@ export function Form({
validate,
defaultValue,
plan,
- allowEmpty = false,
}: {
title: string;
description: string;
@@ -48,13 +47,12 @@ export function Form({
validate?: (data: string) => boolean;
defaultValue?: string;
plan?: string;
- allowEmpty?: boolean;
}) {
const [saving, setSaving] = useState(false);
const [value, setValue] = useState(defaultValue);
useEffect(() => {
- if (defaultValue !== undefined) setValue(defaultValue);
+ if (defaultValue) setValue(defaultValue);
}, [defaultValue]);
const saveDisabled = useMemo(() => {
@@ -64,12 +62,8 @@ export function Form({
const defaultVal = defaultValue === "true";
return currentValue === defaultVal;
}
- // Allow empty values if allowEmpty is true
- if (allowEmpty) {
- return value === defaultValue;
- }
return !value || value === defaultValue;
- }, [saving, value, defaultValue, inputAttrs.type, allowEmpty]);
+ }, [saving, value, defaultValue, inputAttrs.type]);
const renderInput = () => {
if (inputAttrs.type === "checkbox") {
@@ -96,7 +90,7 @@ export function Form({
{...inputAttrs}
value={value}
type={inputAttrs.type || "text"}
- required={!allowEmpty}
+ required
disabled={!!disabledTooltip}
onChange={(e) => setValue(e.target.value)}
onBlur={(e) => setValue(e.target.value.trim())}
diff --git a/components/view/dataroom/nav-dataroom.tsx b/components/view/dataroom/nav-dataroom.tsx
index c23e2df8..56e8e0f2 100644
--- a/components/view/dataroom/nav-dataroom.tsx
+++ b/components/view/dataroom/nav-dataroom.tsx
@@ -205,17 +205,14 @@ export default function DataroomNav({
<div className="absolute bottom-5 w-fit rounded-r-md bg-white/30 backdrop-blur-md">
<div className="px-5 py-2 sm:px-10">
<div className="text-3xl">{dataroom.name}</div>
- {dataroom.description && (
- <p className="mt-1 text-sm">{dataroom.description}</p>
- )}
- {dataroom.showLastUpdated !== false && (
+ {dataroom.showLastUpdated ? (
<time
className="mt-1 block text-sm"
dateTime={new Date(dataroom.lastUpdatedAt).toISOString()}
>
{`Last updated ${formatDate(dataroom.lastUpdatedAt)}`}
</time>
- )}
+ ) : null}
</div>
</div>
</div>
diff --git a/pages/api/teams/[teamId]/datarooms/[id]/index.ts b/pages/api/teams/[teamId]/datarooms/[id]/index.ts
index 10736bed..6eaff9ce 100644
--- a/pages/api/teams/[teamId]/datarooms/[id]/index.ts
+++ b/pages/api/teams/[teamId]/datarooms/[id]/index.ts
@@ -100,15 +100,19 @@ export default async function handle(
return res.status(401).end("Unauthorized");
}
- const { name, description, enableChangeNotifications, defaultPermissionStrategy, allowBulkDownload, showLastUpdated } =
- req.body as {
- name?: string;
- description?: string;
- enableChangeNotifications?: boolean;
- defaultPermissionStrategy?: DefaultPermissionStrategy;
- allowBulkDownload?: boolean;
- showLastUpdated?: boolean;
- };
+ const {
+ name,
+ enableChangeNotifications,
+ defaultPermissionStrategy,
+ allowBulkDownload,
+ showLastUpdated,
+ } = req.body as {
+ name?: string;
+ enableChangeNotifications?: boolean;
+ defaultPermissionStrategy?: DefaultPermissionStrategy;
+ allowBulkDownload?: boolean;
+ showLastUpdated?: boolean;
+ };
const featureFlags = await getFeatureFlags({ teamId: team.id });
const isDataroomsPlus = team.plan.includes("datarooms-plus");
@@ -131,7 +135,6 @@ export default async function handle(
},
data: {
...(name && { name }),
- ...(description !== undefined && { description }),
...(typeof enableChangeNotifications === "boolean" && {
enableChangeNotifications,
}),
diff --git a/pages/datarooms/[id]/settings/index.tsx b/pages/datarooms/[id]/settings/index.tsx
index 41412e77..b88c50a1 100644
--- a/pages/datarooms/[id]/settings/index.tsx
+++ b/pages/datarooms/[id]/settings/index.tsx
@@ -89,40 +89,6 @@ export default function Settings() {
})
}
/>
- <Form
- title="Dataroom Description"
- description="This is the description of your data room on Papermark."
- inputAttrs={{
- name: "description",
- placeholder: "Add a description for your dataroom",
- maxLength: 500,
- }}
- defaultValue={dataroom.description || ""}
- helpText="Max 500 characters"
- allowEmpty={true}
- handleSubmit={(updateData) =>
- fetch(`/api/teams/${teamId}/datarooms/${dataroom.id}`, {
- method: "PATCH",
- headers: {
- "Content-Type": "application/json",
- },
- body: JSON.stringify({
- description: updateData.description || null,
- }),
- }).then(async (res) => {
- if (res.status === 200) {
- await Promise.all([
- mutate(`/api/teams/${teamId}/datarooms`),
- mutate(`/api/teams/${teamId}/datarooms/${dataroom.id}`),
- ]);
- toast.success("Successfully updated dataroom description!");
- } else {
- const { error } = await res.json();
- toast.error(error.message);
- }
- })
- }
- />
<Form
title="Show Last Updated"
description="Display the last updated date on your dataroom banner."
@@ -391,4 +357,4 @@ export default function Settings() {
</main>
</AppLayout>
);
-}
\ No newline at end of file
+}