Skip to content

Commit

Permalink
added user-management to design-system
Browse files Browse the repository at this point in the history
  • Loading branch information
hiderr committed Feb 21, 2025
1 parent 07e6436 commit c9f36a2
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
6 changes: 6 additions & 0 deletions apps/design-system/src/pages/view-preview/view-preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import { RepoWebhooksList } from '@subjects/views/repo-webhooks-list/repo-webhoo
import { SignInView } from '@subjects/views/signin'
import { SignUpView } from '@subjects/views/signup'
import { SpaceSettingsMembers } from '@subjects/views/space-settings-members/space-settings-members'
import UserManagementWrapper from '@subjects/views/user-management/user-management'
import { useTranslationStore } from '@utils/viewUtils'

import { ChatEmptyPreviewWrapper, ChatPreviewWrapper } from '@harnessio/ui/components'
Expand Down Expand Up @@ -286,6 +287,11 @@ export const viewPreviews: Record<string, ReactNode> = {
<RootViewWrapper>
<ExecutionGraphViewWrapper />
</RootViewWrapper>
),
'user-management': (
<RootViewWrapper>
<UserManagementWrapper />
</RootViewWrapper>
)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import { FC } from 'react'

import { noop, useTranslationStore } from '@utils/viewUtils'

import { IUserManagementPageProps, UserManagementPage } from '@harnessio/ui/views'

const UserManagementWrapper: FC<Partial<IUserManagementPageProps>> = () => {
const user = {
uid: 'user-1',
email: '[email protected]',
display_name: 'User 1',
admin: true,
blocked: false
}

const useAdminListUsersStore = () => ({
users: [user],
totalPages: 1,
page: 1,
password: null,
user: user,
generatePassword: false,
setPage: noop,
setUser: noop,
setUsers: noop,
setTotalPages: noop,
setPassword: noop,
setGeteneratePassword: noop
})

return (
<UserManagementPage
useAdminListUsersStore={useAdminListUsersStore}
useTranslationStore={useTranslationStore}
handlers={{
handleUpdateUser: async () => {},
handleDeleteUser: async () => {},
handleUpdateUserAdmin: async () => {},
handleUpdatePassword: async () => {},
handleCreateUser: async () => {}
}}
loadingStates={{
isFetchingUsers: false,
isUpdatingUser: false,
isDeletingUser: false,
isUpdatingUserAdmin: false,
isCreatingUser: false
}}
errorStates={{
fetchUsersError: '',
updateUserError: '',
deleteUserError: '',
updateUserAdminError: '',
createUserError: ''
}}
searchQuery={''}
setSearchQuery={noop}
/>
)
}

export default UserManagementWrapper

0 comments on commit c9f36a2

Please sign in to comment.