Skip to content
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

adding memberIntersection console.log #339

Merged
merged 1 commit into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion src/components/Admin/User/AdminUserTable/AdminUserTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ const AdminUserTable = ({
<td>{user.affiliation}</td>
</tr>
<tr>
<th>Role</th>
<th>Type</th>
<td><AdminRoleBadge role={user.role || 'user'} /></td>
</tr>
<tr>
Expand Down
2 changes: 2 additions & 0 deletions src/components/AnnotationChannel/AnnotationChannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ const AnnotationChannelWithContext = ({
largeFontSize,
setLargeFontSize,
}) => {

console.log('membersIntersection: ', membersIntersection)
const [, documentZoom] = useContext(DocumentContext);
const [channelAnnotations, , expandedAnnotations] = useContext(DocumentAnnotationsContext);
const [documentFilters] = useContext(DocumentFiltersContext);
Expand Down
143 changes: 0 additions & 143 deletions src/pages/groups/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -256,146 +256,3 @@ export async function getServerSideProps(context) {
}

export default GroupList;


/*
<Card>
{((!session && loading) || (session && pageLoading)) && (
<LoadingSpinner />
)}
{!session && !loading && (
<UnauthorizedCard />
)}
{session && !loading && !pageLoading && (
<>
<Card.Header>
<Card.Title className="float-left">
Groups
</Card.Title>
<Button
variant="outline-primary"
size="sm"
href="/groups/new"
className="float-right"
data-testid="grouplist-create-button"
>
<Plus className="mr-1 ml-n1 mt-n1" />
Create New Group
</Button>
</Card.Header>
<Card.Body data-testid="grouplist-card-body">
{groups.length === 0 && (
<>You are not a member of any groups.</>
)}
{groups.length > 0 && (
<>
<Table striped bordered hover variant="light">
<thead>
<tr>
<th style={{ width: '39%' }}>Name</th>
<th>Role</th>
<th>Owner</th>
<th style={{ width: '10%' }}>Members</th>
<th style={{ width: '21%' }}>Actions</th>
</tr>
</thead>
<tbody>
{groups.map((group) => (
<tr key={group.id}>
<td>
<Link href={`/groups/${group.id}`}>
<a title={group.name}>{group.name}</a>
</Link>
</td>
<td><GroupRoleBadge groupRole={group.role} /></td>
<td>{FirstNameLastInitial(group.ownerName)}</td>
<td>{group.memberCount}</td>
<td>
<ButtonGroup>
{(group.role === 'owner' || group.role === 'manager') && (
<Button variant="outline-primary" href={`/groups/${group.id}/edit`}>
<PencilSquare className="align-text-bottom mr-1" />
Manage
</Button>
)}
{(group.role === 'member' || group.role === 'manager') && (
<Button
variant="outline-danger"
onClick={async () => {
setPageLoading(true);
await getUserByEmail(session.user.email).then((user) => {
removeUserFromGroup(group, user).then(() => {
setGroups(groups.filter((g) => g.id !== group.id));
setAlerts((prevState) => [...prevState, {
text: 'You have successfully left the group.',
variant: 'warning',
}]);
setPageLoading(false);
});
}).catch((err) => {
setAlerts((prevState) => [...prevState, { text: err.message, variant: 'danger' }]);
setPageLoading(false);
});
}}
>
<BoxArrowRight className="align-text-bottom mr-1" />
Leave
</Button>
)}
{group.role === 'owner' && (
<>
<Button
variant="outline-danger"
type="button"
onClick={handleShowModal}
data-key={group.id}
>
<TrashFill
data-key={group.id}
className="align-text-bottom mr-1"
/>
Delete
</Button>
<ConfirmationDialog
name={group.name}
type="group"
handleCloseModal={handleCloseModal}
show={showModal === group.id}
onClick={(event) => {
setPageLoading(true);
event.target.setAttribute('disabled', 'true');
deleteGroupById(group.id).then(() => {
setGroups(groups.filter((g) => g.id !== group.id));
setAlerts((prevState) => [...prevState, {
text: 'You have successfully deleted the group.',
variant: 'warning',
}]);
setPageLoading(false);
}).catch((err) => {
setAlerts((prevState) => [...prevState, { text: err.message, variant: 'danger' }]);
setPageLoading(false);
});
handleCloseModal();
}}
/>
</>
)}
</ButtonGroup>
</td>
</tr>
))}
</tbody>
</Table>
<Paginator
page={page}
setPage={setPage}
totalPages={totalPages}
/>
</>
)}
</Card.Body>
</>
)}
</Card>
<GroupRoleSummaries />
*/
Loading