Skip to content
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
3 changes: 3 additions & 0 deletions site/src/components/Filter/filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ export const Filter = ({
"& .MuiInputAdornment-root": {
marginLeft: 0,
},
"&.Mui-error": {
zIndex: 3,
},
},
startAdornment: (
<InputAdornment position="start">
Expand Down
1 change: 1 addition & 0 deletions site/src/pages/AuditPage/AuditPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ const AuditPage: FC = () => {
dashboard.experiments.includes("workspace_filter")
? {
filter,
error,
menus: {
user: userMenu,
action: actionMenu,
Expand Down
8 changes: 4 additions & 4 deletions site/src/pages/AuditPage/AuditPageView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ export const AuditPageView: FC<AuditPageViewProps> = ({
}) => {
const { t } = useTranslation("auditLog")

const isLoading = auditLogs === undefined || count === undefined
const isEmpty = !isLoading && auditLogs.length === 0
const isLoading = (auditLogs === undefined || count === undefined) && !error
const isEmpty = !isLoading && auditLogs?.length === 0

return (
<Margins>
Expand Down Expand Up @@ -104,8 +104,8 @@ export const AuditPageView: FC<AuditPageViewProps> = ({

<PaginationStatus
isLoading={Boolean(isLoading)}
showing={auditLogs?.length}
total={count}
showing={auditLogs?.length ?? 0}
total={count ?? 0}
label="audit logs"
/>

Expand Down
1 change: 1 addition & 0 deletions site/src/pages/UsersPage/UsersPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ export const UsersPage: FC<{ children?: ReactNode }> = () => {
dashboard.experiments.includes("workspace_filter")
? {
filter: useFilterResult,
error: getUsersError,
menus: {
status: statusMenu,
},
Expand Down
4 changes: 3 additions & 1 deletion site/src/pages/UsersPage/UsersPageView.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const meta: Meta<typeof UsersPageView> = {
isNonInitialPage: false,
users: [MockUser, MockUser2],
roles: MockAssignableSiteRoles,
count: 2,
canEditUsers: true,
filterProps: {
onFilter: action("onFilter"),
Expand All @@ -41,12 +42,13 @@ export const Member = {
}

export const Empty = {
args: { users: [] },
args: { users: [], count: 0 },
}

export const EmptyPage = {
args: {
users: [],
count: 0,
isNonInitialPage: true,
},
}
Expand Down
4 changes: 2 additions & 2 deletions site/src/pages/UsersPage/UsersPageView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ export const UsersPageView: FC<React.PropsWithChildren<UsersPageViewProps>> = ({

<PaginationStatus
isLoading={Boolean(isLoading)}
showing={users?.length}
total={count}
showing={users?.length ?? 0}
total={count ?? 0}
label="users"
/>

Expand Down
6 changes: 3 additions & 3 deletions site/src/pages/WorkspacesPage/WorkspacesPageView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ export const WorkspacesPageView: FC<
</Stack>

<PaginationStatus
isLoading={!workspaces}
showing={workspaces?.length}
total={count}
isLoading={!workspaces && !error}
showing={workspaces?.length ?? 0}
total={count ?? 0}
label="workspaces"
/>

Expand Down
13 changes: 1 addition & 12 deletions site/src/xServices/users/usersXService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,7 @@ export const usersMachine =
onError: [
{
target: "idle",
actions: [
"clearUsers",
"assignGetUsersError",
"displayGetUsersErrorMessage",
],
actions: ["clearUsers", "assignGetUsersError"],
},
],
},
Expand Down Expand Up @@ -487,13 +483,6 @@ export const usersMachine =
clearUpdateUserRolesError: assign({
updateUserRolesError: (_) => undefined,
}),
displayGetUsersErrorMessage: (context) => {
const message = getErrorMessage(
context.getUsersError,
Language.getUsersError,
)
displayError(message)
},
displaySuspendSuccess: () => {
displaySuccess(Language.suspendUserSuccess)
},
Expand Down