Individual document sharing with permissions (#5814)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Tom Moor <tom@getoutline.com>
This commit is contained in:
Apoorv Mishra
2024-01-31 07:18:22 +05:30
committed by GitHub
parent 717c9b5d64
commit 1490c3a14b
91 changed files with 4004 additions and 1166 deletions

View File

@@ -2,6 +2,7 @@ import * as React from "react";
import { useTranslation } from "react-i18next";
import { $Diff } from "utility-types";
import { CollectionPermission } from "@shared/types";
import { EmptySelectValue } from "~/types";
import InputSelect, { Props, Option } from "./InputSelect";
export default function InputSelectPermission(
@@ -17,7 +18,7 @@ export default function InputSelectPermission(
const { t } = useTranslation();
const handleChange = React.useCallback(
(value) => {
if (value === "no_access") {
if (value === EmptySelectValue) {
value = null;
}
@@ -31,7 +32,7 @@ export default function InputSelectPermission(
label={t("Default access")}
options={[
{
label: t("View and edit"),
label: t("Can edit"),
value: CollectionPermission.ReadWrite,
},
{
@@ -40,11 +41,11 @@ export default function InputSelectPermission(
},
{
label: t("No access"),
value: "no_access",
value: EmptySelectValue,
},
]}
ariaLabel={t("Default access")}
value={value || "no_access"}
value={value || EmptySelectValue}
onChange={handleChange}
{...rest}
/>