-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add project setting for overriding protected words/senses
- Loading branch information
1 parent
e21032c
commit 04400e2
Showing
20 changed files
with
133 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
src/components/ProjectSettings/ProjectProtectedOverride.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { HelpOutline } from "@mui/icons-material"; | ||
import { Grid, MenuItem, Select, Tooltip } from "@mui/material"; | ||
import { type ReactElement } from "react"; | ||
import { useTranslation } from "react-i18next"; | ||
|
||
import { OffOnSetting } from "api/models"; | ||
import { type ProjectSettingProps } from "components/ProjectSettings/ProjectSettingsTypes"; | ||
|
||
export default function ProjectProtectedOverride( | ||
props: ProjectSettingProps | ||
): ReactElement { | ||
const { t } = useTranslation(); | ||
|
||
const updateProtectOverrideSetting = async ( | ||
protectedDataOverrideEnabled: OffOnSetting | ||
): Promise<void> => { | ||
await props.setProject({ ...props.project, protectedDataOverrideEnabled }); | ||
}; | ||
|
||
return ( | ||
<Grid container> | ||
<Grid> | ||
<Select | ||
variant="standard" | ||
value={props.project.protectedDataOverrideEnabled} | ||
onChange={(e) => | ||
updateProtectOverrideSetting(e.target.value as OffOnSetting) | ||
} | ||
> | ||
<MenuItem value={OffOnSetting.Off}> | ||
{t("projectSettings.autocomplete.off")} | ||
</MenuItem> | ||
<MenuItem value={OffOnSetting.On}> | ||
{t("projectSettings.autocomplete.on")} | ||
</MenuItem> | ||
</Select> | ||
</Grid> | ||
<Grid> | ||
<Tooltip | ||
title={t("projectSettings.protectedDataOverride.hint")} | ||
placement={document.body.dir === "rtl" ? "left" : "right"} | ||
> | ||
<HelpOutline fontSize="small" /> | ||
</Tooltip> | ||
</Grid> | ||
</Grid> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.