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

Admin user management #1393

Merged
merged 9 commits into from Feb 10, 2023
Merged

Conversation

notmd
Copy link
Collaborator

@notmd notmd commented Feb 9, 2023

part of #1022

  • Allow updating the show_on_leaderboard field.
  • Add raw JSON of the user object.
  • Add a new user message table.
  • Also fixed style issue: hard to see reaction count when the user also reacted.
  • Rename MessageTable to MessageConversation.

UI
image
image

cell: ({ getValue }) => (
<DataTableAction
as={NextLink}
href={ROUTES.ADMIN_MESSAGE_DETAIL(getValue())}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this page doesn't exists yet, I will add it in the next PR

Copy link
Collaborator

@AbdBarho AbdBarho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! it would be great if you could make upcoming PRs smaller than this, it is easier to review.

});
};

const resetCursor = () => setPagination((old) => ({ ...old, cursor: "" }));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useCallback for these 3 functions.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These 3 function will need a wrapper function to pass data, so useCallback has no effect here.

import { Badge, Flex } from "@chakra-ui/layout";
import { Tooltip } from "@chakra-ui/react";
import { createColumnHelper } from "@tanstack/table-core";
import { formatDistanceToNow, formatISO9075 } from "date-fns";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this is something that next-i18n already provides.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my knowledge, the answer is no. I'm pretty sure we'd have to use some new library to do this so date-fns seems good enough

Copy link
Collaborator

@fozziethebeat fozziethebeat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since @AbdBarho left some good comments, I have nothing else to add. Looks fine after those changes.

Copy link
Collaborator

@fozziethebeat fozziethebeat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By special request by Andreas I'm going to approve and merge this. Maybe make the cleanups in a follow up PR?

@fozziethebeat fozziethebeat merged commit aaa1276 into LAION-AI:main Feb 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants