mirror of
https://github.com/aykhans/slash-e.git
synced 2025-04-20 22:07:15 +00:00
chore: add workspace visibility to collection
This commit is contained in:
parent
0a62579814
commit
168ad39076
@ -36,7 +36,15 @@ const CreateCollectionDrawer: React.FC<Props> = (props: Props) => {
|
|||||||
const requestState = useLoading(false);
|
const requestState = useLoading(false);
|
||||||
const isCreating = isUndefined(collectionId);
|
const isCreating = isUndefined(collectionId);
|
||||||
const unselectedShortcuts = shortcutList
|
const unselectedShortcuts = shortcutList
|
||||||
.filter((shortcut) => (state.collectionCreate.visibility === Visibility.PUBLIC ? shortcut.visibility === "PUBLIC" : true))
|
.filter((shortcut) => {
|
||||||
|
if (state.collectionCreate.visibility === Visibility.PUBLIC) {
|
||||||
|
return shortcut.visibility === "PUBLIC";
|
||||||
|
} else if (state.collectionCreate.visibility === Visibility.WORKSPACE) {
|
||||||
|
return shortcut.visibility === "PUBLIC" || shortcut.visibility === "WORKSPACE";
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
})
|
||||||
.filter((shortcut) => !selectedShortcuts.find((selectedShortcut) => selectedShortcut.id === shortcut.id));
|
.filter((shortcut) => !selectedShortcuts.find((selectedShortcut) => selectedShortcut.id === shortcut.id));
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -191,6 +199,7 @@ const CreateCollectionDrawer: React.FC<Props> = (props: Props) => {
|
|||||||
<div className="w-full flex flex-row justify-start items-center text-base">
|
<div className="w-full flex flex-row justify-start items-center text-base">
|
||||||
<RadioGroup orientation="horizontal" value={state.collectionCreate.visibility} onChange={handleVisibilityInputChange}>
|
<RadioGroup orientation="horizontal" value={state.collectionCreate.visibility} onChange={handleVisibilityInputChange}>
|
||||||
<Radio value={Visibility.PRIVATE} label={t(`shortcut.visibility.private.self`)} />
|
<Radio value={Visibility.PRIVATE} label={t(`shortcut.visibility.private.self`)} />
|
||||||
|
<Radio value={Visibility.WORKSPACE} label={t(`shortcut.visibility.workspace.self`)} />
|
||||||
<Radio value={Visibility.PUBLIC} label={t(`shortcut.visibility.public.self`)} />
|
<Radio value={Visibility.PUBLIC} label={t(`shortcut.visibility.public.self`)} />
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user