Skip to content

Commit e97a341

Browse files
committed
Merge branch 'filip-refactor-user-module' into filip-refactor-users-table
2 parents 91fe98c + c42ce23 commit e97a341

File tree

4 files changed

+35
-14
lines changed

4 files changed

+35
-14
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
--- template/app/src/admin/dashboards/users/UsersTable.tsx
22
+++ opensaas-sh/app/src/admin/dashboards/users/UsersTable.tsx
3-
@@ -9,6 +9,7 @@
3+
@@ -17,6 +17,7 @@
44
const [skip, setskip] = useState(0);
55
const [page, setPage] = useState(1);
66
const [email, setEmail] = useState<string | undefined>(undefined);
77
+
88
const [isAdminFilter, setIsAdminFilter] = useState<boolean | undefined>(undefined);
99
const [statusOptions, setStatusOptions] = useState<SubscriptionStatus[]>([]);
10-
const { data, isLoading, error } = useQuery(getPaginatedUsers, {
11-
@@ -211,7 +212,7 @@
10+
const { data, isLoading } = useQuery(getPaginatedUsers, {
11+
@@ -223,7 +224,7 @@
1212
<p className='text-sm text-black dark:text-white'>{user.subscriptionStatus}</p>
1313
</div>
1414
<div className='col-span-2 flex items-center'>

opensaas-sh/app_diff/src/user/operations.ts.diff

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,35 @@
11
--- template/app/src/user/operations.ts
22
+++ opensaas-sh/app/src/user/operations.ts
3-
@@ -41,7 +41,10 @@
3+
@@ -2,7 +2,7 @@
4+
import { type UpdateIsUserAdminById, type GetPaginatedUsers } from 'wasp/server/operations';
5+
import { type User } from 'wasp/entities';
6+
import { HttpError } from 'wasp/server';
7+
-import { subscriptionStatusSchema, type SubscriptionStatus } from '../payment/plans';
8+
+import { subscriptionStatusSchema } from '../payment/plans';
9+
import { ensureArgsSchemaOrThrowHttpError } from '../server/validation';
10+
11+
const updateUserAdminByIdInputSchema = z.object({
12+
@@ -33,10 +33,7 @@
413
};
514

615
type GetPaginatedUsersOutput = {
7-
- users: Pick<User, 'id' | 'email' | 'username' | 'subscriptionStatus' | 'paymentProcessorUserId'>[];
8-
+ users: Pick<
9-
+ User,
10-
+ 'id' | 'email' | 'username' | 'subscriptionStatus' | 'stripeId'
11-
+ >[];
16+
- users: Pick<
17+
- User,
18+
- 'id' | 'email' | 'username' | 'subscriptionStatus' | 'paymentProcessorUserId' | 'isAdmin'
19+
- >[];
20+
+ users: Pick<User, 'id' | 'email' | 'username' | 'subscriptionStatus' | 'stripeId' | 'isAdmin'>[];
1221
totalPages: number;
1322
};
1423

15-
@@ -85,6 +88,7 @@
24+
@@ -80,6 +77,7 @@
1625
mode: 'insensitive',
1726
},
1827
isAdmin,
1928
+ isMockUser: true,
2029
},
2130
{
2231
OR: [
23-
@@ -108,7 +112,7 @@
32+
@@ -103,7 +101,7 @@
2433
username: true,
2534
isAdmin: true,
2635
subscriptionStatus: true,
@@ -29,7 +38,7 @@
2938
},
3039
orderBy: {
3140
id: 'desc',
32-
@@ -124,6 +128,7 @@
41+
@@ -119,6 +117,7 @@
3342
mode: 'insensitive',
3443
},
3544
isAdmin,

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)