Merge branch 'dev' of https://github.com/umami-software/umami into analytics

This commit is contained in:
Francis Cao 2024-02-16 13:09:42 -08:00
commit c6f656e142
2 changed files with 5 additions and 5 deletions

View File

@ -12,16 +12,16 @@ export function TeamWebsitesPage({ teamId }: { teamId: string }) {
const { formatMessage, labels } = useMessages(); const { formatMessage, labels } = useMessages();
const { user } = useLogin(); const { user } = useLogin();
const canEdit = team?.teamUser?.find( const allowEdit = !!team?.teamUser?.find(
({ userId, role }) => role !== ROLES.viewOnly && userId === user.id, ({ userId, role }) => userId === user.id && role !== ROLES.teamViewOnly,
); );
return ( return (
<> <>
<PageHeader title={formatMessage(labels.websites)}> <PageHeader title={formatMessage(labels.websites)}>
{canEdit && <WebsiteAddButton teamId={teamId} />} {allowEdit && <WebsiteAddButton teamId={teamId} />}
</PageHeader> </PageHeader>
<TeamWebsitesDataTable teamId={teamId} allowEdit={canEdit} /> <TeamWebsitesDataTable teamId={teamId} allowEdit={allowEdit} />
</> </>
); );
} }

View File

@ -26,7 +26,7 @@ export function UsersTable({
) )
} }
</GridColumn> </GridColumn>
<GridColumn name="created" label={formatMessage(labels.created)} width={'120px'}> <GridColumn name="created" label={formatMessage(labels.created)} width={'150px'}>
{row => {row =>
formatDistance(new Date(row.createdAt), new Date(), { formatDistance(new Date(row.createdAt), new Date(), {
addSuffix: true, addSuffix: true,