Skip to content

Commit

Permalink
Revert "added tabs"
Browse files Browse the repository at this point in the history
This reverts commit ca2f3a4.
  • Loading branch information
athens-server committed Jan 27, 2025
1 parent dcaf2e5 commit 887e6f1
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 69 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { create } from 'zustand'

import { IAdminListUsersStore, UsersProps } from '@harnessio/ui/views'

import { EActiveTab, PageResponseHeader } from '../../../types'
import { PageResponseHeader } from '../../../types'

export const useAdminListUsersStore = create<IAdminListUsersStore>(set => ({
users: [],
Expand All @@ -12,7 +12,6 @@ export const useAdminListUsersStore = create<IAdminListUsersStore>(set => ({
user: null,
searchQuery: '',
generatePassword: false,
activeTab: EActiveTab.ACTIVE,
setPage: page =>
set({
page
Expand Down Expand Up @@ -48,10 +47,5 @@ export const useAdminListUsersStore = create<IAdminListUsersStore>(set => ({
set({
searchQuery
})
},
setActiveTab: (activeTab: EActiveTab) => {
set({
activeTab
})
}
}))
5 changes: 0 additions & 5 deletions apps/gitness/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,3 @@ export enum PageResponseHeader {
xNextPage = 'x-next-page',
xPrevPage = 'x-prev-page'
}

export enum EActiveTab {
ACTIVE = 'active',
INACTIVE = 'inactive'
}
4 changes: 0 additions & 4 deletions packages/ui/locales/en/views.json
Original file line number Diff line number Diff line change
Expand Up @@ -401,10 +401,6 @@
"delete": "Delete webhook"
},
"userManagement": {
"tabs": {
"active": "Active users",
"inactive": "Pending users"
},
"searchPlaceholder": "Search",
"newUserButton": "New user",
"usersHeader": "Users"
Expand Down
38 changes: 0 additions & 38 deletions packages/ui/src/views/user-management/components/tabs.tsx

This file was deleted.

7 changes: 0 additions & 7 deletions packages/ui/src/views/user-management/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export interface IAdminListUsersStore {
password: string | null
user: UsersProps | null
searchQuery: string
activeTab: EActiveTab
generatePassword: boolean
setSearchQuery: (searchQuery: string) => void
setPassword: (password: string) => void
Expand All @@ -32,7 +31,6 @@ export interface IAdminListUsersStore {
setUsers: (data: UsersProps[]) => void
setTotalPages: (data: Headers) => void
setGeteneratePassword: (data: boolean) => void
setActiveTab: (data: EActiveTab) => void
}

export interface IDeleteDialogProps {
Expand Down Expand Up @@ -73,8 +71,3 @@ export enum DialogLabels {
RESET_PASSWORD = 'resetPassword',
CREATE_USER = 'createUser'
}

export enum EActiveTab {
ACTIVE = 'active',
INACTIVE = 'inactive'
}
13 changes: 5 additions & 8 deletions packages/ui/src/views/user-management/user-management-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { useMemo } from 'react'
import { Button, ListActions, PaginationComponent, SearchBox, Spacer, Text } from '@/components'
import { SandboxLayout } from '@/views'

import { UserManagementTabs } from './components/tabs'
import { UsersList } from './components/users-list'
import { DialogLabels, IUserManagementPageProps, UsersProps } from './types'

Expand All @@ -24,9 +23,7 @@ export const UserManagementPage: React.FC<IUserManagementPageProps> = ({
page: currentPage,
setPage,
searchQuery,
setSearchQuery,
activeTab,
setActiveTab
setSearchQuery
} = useAdminListUsersStore()
const { t } = useTranslationStore()

Expand All @@ -48,13 +45,13 @@ export const UserManagementPage: React.FC<IUserManagementPageProps> = ({
}

return (
<SandboxLayout.Main fullWidth>
<UserManagementTabs activeTab={activeTab} setActiveTab={setActiveTab} useTranslationStore={useTranslationStore} />
<SandboxLayout.Content className="mx-auto max-w-[1092px]">
<SandboxLayout.Main>
<SandboxLayout.Content maxWidth="3xl">
<Spacer size={10} />
<Text size={5} weight={'medium'}>
{t('views:userManagement.usersHeader', 'Users')}{' '}
<Text size={5} weight={'medium'} color="foreground-4">
({filteredUsers?.length || 0})
({userData?.length || 0})
</Text>
</Text>
<Spacer size={6} />
Expand Down

0 comments on commit 887e6f1

Please sign in to comment.