8000 feat: Invite groups to documents by tommoor · Pull Request #7275 · outline/outline · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: Invite groups to documents #7275

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 61 commits into from
Sep 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
1e6fd9c
Add documents.add_group and documents.remove_group endpoints
tommoor Jul 18, 2024
ef76d2e
Add documents.group_memberships endpoint
tommoor Jul 18, 2024
911729d
document group membership
tommoor Jul 18, 2024
91483c7
tsc
tommoor Jul 18, 2024
17659fa
wip: Allow adding groups to docs in UI
tommoor Jul 19, 2024
c3cb06e
tsc
tommoor Jul 20, 2024
2dde998
documents.add_group, documents.remove_group websocket handling
tommoor Jul 20, 2024
ff8a4db
wip: Clientside event handling
tommoor Jul 20, 2024
5266476
Copy memberships from parent document on creation
tommoor Jul 20, 2024
bffc079
Handle groups.add_user, groups.remove_user
tommoor Jul 20, 2024
c359629
GroupUserMembershipsStore -> GroupUsersStore
tommoor Jul 20, 2024
0692733
Group -> document sharing UI
tommoor Jul 21, 2024
3e5d26a
cp error
tommoor Jul 21, 2024
c6fa3a8
Merge main
tommoor Jul 28, 2024
da9a521
Merge main
tommoor Aug 6, 2024
c2ecc32
fix: Incorrect query
tommoor Aug 9, 2024
fc4ded0
Merge main
tommoor Aug 11, 2024
fc05ca9
Merge public/main
tommoor Aug 17, 2024
628c921
Merge public/main
tommoor Aug 17, 2024
61f667e
stash
tommoor Aug 18, 2024
bd5ac68
fix: Allow loading of child documents for group shared documents
tommoor Aug 18, 2024
779bae5
fix: Breadcrumb for shared documents, bug in share popover for admins…
tommoor Aug 18, 2024
a495d63
fix: Breadcrumb icon color
tommoor Aug 18, 2024
15451f4
fix: Non-clickable items have cursor
tommoor Aug 18, 2024
88715ec
Sidebar order
tommoor Aug 18, 2024
5f1b6ca
fix: Sidebar highlight state for shared, starred, regular docs
tommoor Aug 19, 2024
1e8dfb7
test
tommoor Aug 19, 2024
4bee20b
Merge branch 'main' of github.com:outline/outline into tom/document-g…
tommoor Aug 20, 2024
5679ca7
AccessControlList loading state
tommoor Aug 20, 2024
c6c5f78
Merge main
tommoor Aug 28, 2024
ab02e68
WebsocketsProcessor TODOs
tommoor Aug 29, 2024
5973652
Improve post-share toasts
tommoor Aug 29, 2024
abd4efc
fix: Reduce duplicate wss events
tommoor Aug 29, 2024
565e8be
fix: Deleted documents in shared with me, ref #7478
tommoor Aug 29, 2024
3c9d5f3
fix: add_group/remove_group events
tommoor Aug 29, 2024
09f42b7
Send users groups in auth payload
tommoor Aug 29, 2024
e10bd8c
stash
tommoor Aug 29, 2024
7c3a763
Merge public/main
tommoor Aug 29, 2024
2b057ae
Add 'Has access through parent'
tommoor Aug 29, 2024
9c474ae
Group.documentMemberships
tommoor Aug 29, 2024
3adee3d
fix: Empty 'Shared with me' section
tommoor Aug 29, 2024
8bdc225
fix: documents.remove_group event
tommoor Aug 29, 2024
14518c8
Merge branch 'main' of github.com:outline/outline into tom/document-g…
tommoor Aug 30, 2024
aa5aaf7
GroupLink
tommoor Aug 30, 2024
8c792d8
PrivateCollectionIcon
tommoor Aug 30, 2024
cc6999e
GroupAvatar
tommoor Aug 30, 2024
5f0e007
Prefetch group memberships
tommoor Aug 30, 2024
1bb4dcd
fix: Empty group in 'Shared with me' if shared document is already ac…
tommoor Aug 30, 2024
09f20bb
fix: Show group permission when read-only in share popover
tommoor Aug 30, 2024
943e23b
Missing query lock
tommoor Aug 30, 2024
26f8f4a
fix: Ordering of groups in sidebar
tommoor Aug 30, 2024
6451419
Consistent document sharing UI
tommoor Aug 30, 2024
63b5af7
Merge branch 'main' into tom/document-group-permissions
tommoor Aug 31, 2024
a962134
Fetch all root document shares
tommoor Aug 31, 2024
ff1e74f
fix: Root disclosure spacing
tommoor Aug 31, 2024
0200520
fix: Prevent drag of GroupMembership
tommoor Aug 31, 2024
7873167
Remove no longer used query
tommoor Aug 31, 2024
e43ec33
fix: Refactor sidebar context management (#7495)
tommoor Aug 31, 2024
2ac78bb
group.users
tommoor Aug 31, 2024
b0f45c4
perf: Performance of sourced membership queries
tommoor Aug 31, 2024
444010a
feat: Add notifications on 10000 group addition
tommoor Sep 1, 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
12 changes: 6 additions & 6 deletions app/actions/definitions/documents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ export const createDocument = createAction({
!!currentTeamId && stores.policies.abilities(currentTeamId).createDocument
);
},
perform: ({ activeCollectionId, inStarredSection }) =>
perform: ({ activeCollectionId, sidebarContext }) =>
history.push(newDocumentPath(activeCollectionId), {
starred: inStarredSection,
sidebarContext,
}),
});

Expand All @@ -121,11 +121,11 @@ export const createDocumentFromTemplate = createAction({
!!activeDocumentId &&
!!stores.documents.get(activeDocumentId)?.template &&
stores.policies.abilities(currentTeamId).createDocument,
perform: ({ activeCollectionId, activeDocumentId, inStarredSection }) =>
perform: ({ activeCollectionId, activeDocumentId, sidebarContext }) =>
history.push(
newDocumentPath(activeCollectionId, { templateId: activeDocumentId }),
{
starred: inStarredSection,
sidebarContext,
}
),
});
Expand All @@ -141,9 +141,9 @@ export const createNestedDocument = createAction({
!!activeDocumentId &&
stores.policies.abilities(currentTeamId).createDocument &&
stores.policies.abilities(activeDocumentId).createChildDocument,
perform: ({ activeDocumentId, inStarredSection }) =>
perform: ({ activeDocumentId, sidebarContext }) =>
history.push(newNestedDocumentPath(activeDocumentId), {
starred: inStarredSection,
sidebarContext,
}),
});

Expand Down
2 changes: 1 addition & 1 deletion app/components/Avatar/AvatarWithPresence.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { useTranslation } from "react-i18next";
import styled, { css } from "styled-components";
import { s } from "@shared/styles";
import User from "~/models/User";
import Avatar from "~/components/Avatar";
import Tooltip from "~/components/Tooltip";
import Avatar from "./Avatar";

type Props = {
user: User;
Expand Down
35 changes: 35 additions & 0 deletions app/components/Avatar/GroupAvatar.tsx
427E
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { GroupIcon } from "outline-icons";
import * as React from "react";
import { useTheme } from "styled-components";
import Squircle from "@shared/components/Squircle";
import Group from "~/models/Group";
import { AvatarSize } from "../Avatar";

type Props = {
/** The group to show an avatar for */
group: Group;
/** The size of the icon, 24px is default to match standard avatars */
size?: number;
/** The color of the avatar */
color?: string;
/** The background color of the avatar */
backgroundColor?: string;
className?: string;
};

export function GroupAvatar({
color,
backgroundColor,
size = AvatarSize.Medium,
className,
}: Props) {
const theme = useTheme();
return (
<Squircle color={color ?? theme.text} size={size} className={className}>
<GroupIcon
color={backgroundColor ?? theme.background}
size={size * 0.75}
/>
</Squircle>
);
}
7 changes: 4 additions & 3 deletions app/components/Avatar/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Avatar from "./Avatar";
import Avatar, { IAvatar, AvatarSize } from "./Avatar";
import AvatarWithPresence from "./AvatarWithPresence";
import { GroupAvatar } from "./GroupAvatar";

export { AvatarWithPresence };
export { Avatar, GroupAvatar, AvatarSize, AvatarWithPresence };

export default Avatar;
export type { IAvatar };
2 changes: 1 addition & 1 deletion app/components/Collaborators.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as React from "react";
import { useTranslation } from "react-i18next";
import { usePopoverState, PopoverDisclosure } from "reakit/Popover";
import Document from "~/models/Document";
import AvatarWithPresence from "~/components/Avatar/AvatarWithPresence";
import { AvatarWithPresence } from "~/components/Avatar";
import DocumentViews from "~/components/DocumentViews";
import Facepile from "~/components/Facepile";
import NudeButton from "~/components/NudeButton";
Expand Down
2 changes: 1 addition & 1 deletion app/components/DocumentViews.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useTranslation } from "react-i18next";
import { dateLocale, dateToRelative } from "@shared/utils/date";
import Document from "~/models/Document";
import User from "~/models/User";
import Avatar from "~/components/Avatar";
import { Avatar } from "~/components/Avatar";
import ListItem from "~/components/List/Item";
import PaginatedList from "~/components/PaginatedList";
import useCurrentUser from "~/hooks/useCurrentUser";
Expand Down
2 changes: 1 addition & 1 deletion app/components/EventListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import EventBoundary from "@shared/components/EventBoundary";
import { s } from "@shared/styles";
import Document from "~/models/Document";
import Event from "~/models/Event";
import Avatar from "~/components/Avatar";
import { Avatar } from "~/components/Avatar";
import Item, { Actions, Props as ItemProps } from "~/components/List/Item";
import Time from "~/components/Time";
import useStores from "~/hooks/useStores";
Expand Down
3 changes: 1 addition & 2 deletions app/components/Facepile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ import * as React from "react";
import styled from "styled-components";
import { s } from "@shared/styles";
import User from "~/models/User";
import Avatar from "~/components/Avatar";
import { Avatar, AvatarSize } from "~/components/Avatar";
import Flex from "~/components/Flex";
import { AvatarSize } from "./Avatar/Avatar";

type Props = {
users: User[];
Expand Down
7 changes: 1 addition & 6 deletions app/components/GroupListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import Flex from "~/components/Flex";
import ListItem from "~/components/List/Item";
import Modal from "~/components/Modal";
import useBoolean from "~/hooks/useBoolean";
import useStores from "~/hooks/useStores";
import { hover } from "~/styles";
import NudeButton from "./NudeButton";

Expand All @@ -26,15 +25,11 @@ type Props = {
};

function GroupListItem({ group, showFacepile, renderActions }: Props) {
const { groupUsers } = useStores();
const { t } = useTranslation();
const [membersModalOpen, setMembersModalOpen, setMembersModalClosed] =
useBoolean();
const memberCount = group.memberCount;
const membershipsInGroup = groupUsers.inGroup(group.id);
const users = membershipsInGroup
.slice(0, MAX_AVATAR_DISPLAY)
.map((gm) => gm.user);
const users = group.users.slice(0, MAX_AVATAR_DISPLAY);
const overflow = memberCount - users.length;

return (
Expand Down
2 changes: 1 addition & 1 deletion app/components/HoverPreview/HoverPreviewIssue.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as React from "react";
import { Trans } from "react-i18next";
import { UnfurlResourceType, UnfurlResponse } from "@shared/types";
import { Avatar } from "~/components/Avatar";
import Flex from "~/components/Flex";
import Avatar from "../Avatar";
import { IssueStatusIcon } from "../Icons/IssueStatusIcon";
import Text from "../Text";
import Time from "../Time";
Expand Down
3 changes: 1 addition & 2 deletions app/components/HoverPreview/HoverPreviewMention.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as React from "react";
import { UnfurlResourceType, UnfurlResponse } from "@shared/types";
import Avatar from "~/components/Avatar";
import { AvatarSize } from "~/components/Avatar/Avatar";
import { Avatar, AvatarSize } from "~/components/Avatar";
import Flex from "~/components/Flex";
import { Preview, Title, Info, Card, CardContent } from "./Components";

Expand Down
2 changes: 1 addition & 1 deletion app/components/HoverPreview/HoverPreviewPullRequest.tsx
< B9B6 /tr>
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as React from "react";
import { Trans } from "react-i18next";
import { UnfurlResourceType, UnfurlResponse } from "@shared/types";
import { Avatar } from "~/components/Avatar";
import Flex from "~/components/Flex";
import Avatar from "../Avatar";
import { PullRequestIcon } from "../Icons/PullRequestIcon";
import Text from "../Text";
import Time from "../Time";
Expand Down
3 changes: 1 addition & 2 deletions app/components/Notifications/NotificationListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import Notification from "~/models/Notification";
import CommentEditor from "~/scenes/Document/components/CommentEditor";
import useStores from "~/hooks/useStores";
import { hover, truncateMultiline } from "~/styles";
import Avatar from "../Avatar";
import { AvatarSize } from "../Avatar/Avatar";
import { Avatar, AvatarSize } from "../Avatar";
import Flex from "../Flex";
import Text from "../Text";
import Time from "../Time";
Expand Down
Loading
Loading
0