Skip to content

Commit 490f32b

Browse files
committed
Merge branch 'filip-refactor-users-table' into filip-dry-subscription-status
2 parents ae1be71 + d67ae93 commit 490f32b

File tree

4 files changed

+24
-28
lines changed

4 files changed

+24
-28
lines changed

opensaas-sh/app_diff/src/admin/dashboards/users/UsersTable.tsx.diff

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
--- template/app/src/admin/dashboards/users/UsersTable.tsx
22
+++ opensaas-sh/app/src/admin/dashboards/users/UsersTable.tsx
3-
@@ -9,6 +9,7 @@
4-
const [skip, setskip] = useState(0);
5-
const [page, setPage] = useState(1);
6-
const [email, setEmail] = useState<string | undefined>(undefined);
7-
+
8-
const [isAdminFilter, setIsAdminFilter] = useState<boolean | undefined>(undefined);
9-
const [statusOptions, setStatusOptions] = useState<SubscriptionStatus[]>([]);
10-
const { data, isLoading, error } = useQuery(getPaginatedUsers, {
11-
@@ -211,7 +212,7 @@
3+
@@ -202,7 +202,7 @@
124
<p className='text-sm text-black dark:text-white'>{user.subscriptionStatus}</p>
135
</div>
146
<div className='col-span-2 flex items-center'>
Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,31 @@
11
--- template/app/src/user/operations.ts
22
+++ opensaas-sh/app/src/user/operations.ts
3-
@@ -41,7 +41,10 @@
3+
@@ -34,10 +34,7 @@
44
};
55

66
type GetPaginatedUsersOutput = {
7-
- users: Pick<User, 'id' | 'email' | 'username' | 'subscriptionStatus' | 'paymentProcessorUserId'>[];
8-
+ users: Pick<
9-
+ User,
10-
+ 'id' | 'email' | 'username' | 'subscriptionStatus' | 'stripeId'
11-
+ >[];
7+
- users: Pick<
8+
- User,
9+
- 'id' | 'email' | 'username' | 'subscriptionStatus' | 'paymentProcessorUserId' | 'isAdmin'
10+
- >[];
11+
+ users: Pick<User, 'id' | 'email' | 'username' | 'subscriptionStatus' | 'stripeId' | 'isAdmin'>[];
1212
totalPages: number;
1313
};
1414

15-
@@ -85,6 +88,7 @@
15+
@@ -85,6 +82,7 @@
1616
mode: 'insensitive',
1717
},
1818
isAdmin,
1919
+ isMockUser: true,
2020
},
2121
{
2222
OR: [
23-
@@ -108,7 +112,7 @@
23+
@@ -106,7 +104,7 @@
2424
username: true,
2525
isAdmin: true,
2626
subscriptionStatus: true,
2727
- paymentProcessorUserId: true,
2828
+ stripeId: true,
2929
},
3030
orderBy: {
31-
id: 'desc',
32-
@@ -124,6 +128,7 @@
33-
mode: 'insensitive',
34-
},
35-
isAdmin,
36-
+ isMockUser: true,
37-
},
38-
{
39-
OR: [
31+
username: 'asc',

template/app/src/admin/elements/forms/SwitcherOne.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@ function SwitcherOne({ isOn, onChange }: { isOn: boolean; onChange: (value: bool
88
<div className='relative'>
99
<label htmlFor={id} className='flex cursor-pointer select-none items-center'>
1010
<div className='relative'>
11-
<input id={id} type='checkbox' className='sr-only' onChange={(e) => onChange(e.target.checked)} />
11+
<input
12+
id={id}
13+
type='checkbox'
14+
className='sr-only'
15+
checked={isOn}
16+
onChange={(e) => onChange(e.target.checked)}
17+
/>
1218
<div className='reblock h-8 w-14 rounded-full bg-meta-9 dark:bg-[#5A616B]'></div>
1319
<div
1420
className={cn('absolute left-1 top-1 h-6 w-6 rounded-full bg-white dark:bg-gray-400 transition', {

template/app/src/admin/elements/forms/SwitcherTwo.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@ function SwitcherTwo({ isOn, onChange }: { isOn: boolean; onChange: (value: bool
88
<div>
99
<label htmlFor={id} className='flex cursor-pointer select-none items-center'>
1010
<div className='relative'>
11-
<input type='checkbox' id={id} className='sr-only' onChange={(e) => onChange(e.target.checked)} />
11+
<input
12+
type='checkbox'
13+
id={id}
14+
className='sr-only'
15+
checked={isOn}
16+
onChange={(e) => onChange(e.target.checked)}
17+
/>
1218
<div className='block h-8 w-14 rounded-full bg-meta-9 dark:bg-[#5A616B]'></div>
1319
<div
1420
className={cn(

0 commit comments

Comments
 (0)