Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcdd45ad

Browse files
committed
Merge branch 'fix/conditional-fetch-cache' ofhttps://github.com/calcom/cal.com into fix/conditional-fetch-cache
2 parentsdf1b735 +8d26a96 commitcdd45ad

File tree

48 files changed

+1528
-732
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1528
-732
lines changed

‎.changeset/little-rings-repeat.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@calcom/atoms":minor
3+
---
4+
5+
Add defaultPhoneCountry prop to BookerPlatformWrapper with ISO 3166-1 alpha-2 type safety

‎.github/workflows/cleanup-report.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
-name:Checkout GitHub Pages Branch
1515
uses:actions/checkout@v4
1616
with:
17-
repository:calcom/test-results
17+
repository:calcom/test-results-2
1818
ref:gh-pages
1919
token:${{ secrets.GH_ACCESS_TOKEN }}
2020

‎.github/workflows/cleanup.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
-name:Checkout GitHub Pages Branch
2626
uses:actions/checkout@v2
2727
with:
28-
repository:calcom/test-results
28+
repository:calcom/test-results-2
2929
ref:gh-pages
3030
token:${{ secrets.GH_ACCESS_TOKEN }}
3131
-name:Set Git User

‎.github/workflows/integration-tests.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ permissions:
55
contents:read
66
env:
77
NODE_OPTIONS:--max-old-space-size=4096
8+
INTEGRATION_TESTS:"true"
89
ALLOWED_HOSTNAMES:${{ vars.CI_ALLOWED_HOSTNAMES }}
910
CALENDSO_ENCRYPTION_KEY:${{ secrets.CI_CALENDSO_ENCRYPTION_KEY }}
1011
DAILY_API_KEY:${{ secrets.CI_DAILY_API_KEY }}

‎.github/workflows/publish-report.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
-name:Checkout GitHub Pages Branch
1717
uses:actions/checkout@v4
1818
with:
19-
repository:calcom/test-results
19+
repository:calcom/test-results-2
2020
ref:gh-pages
2121
token:${{ secrets.GH_ACCESS_TOKEN }}
2222
-name:Set Git User
@@ -67,7 +67,7 @@ jobs:
6767
-name:Output Report URL as Workflow Annotation
6868
id:url
6969
run:|
70-
FULL_HTML_REPORT_URL=https://calcom.github.io/test-results/$HTML_REPORT_URL_PATH
70+
FULL_HTML_REPORT_URL=https://calcom.github.io/test-results-2/$HTML_REPORT_URL_PATH
7171
echo "::notice title=📋 Published Playwright Test Report::$FULL_HTML_REPORT_URL"
7272
echo "link=$FULL_HTML_REPORT_URL" >> $GITHUB_OUTPUT
7373
-name:Find Comment

‎apps/api/v1/lib/utils/isAdmin.ts‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ export const isAdminGuard = async (req: NextApiRequest) => {
1919
team:{
2020
isOrganization:true,
2121
organizationSettings:{
22-
is:{
23-
isAdminAPIEnabled:true,
24-
},
22+
isAdminAPIEnabled:true,
2523
},
2624
},
2725
OR:[{role:MembershipRole.OWNER},{role:MembershipRole.ADMIN}],

‎apps/api/v1/test/lib/bookings/[id]/_patch.integration-test.ts‎

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
importtype{Request,Response}from"express";
22
importtype{NextApiRequest,NextApiResponse}from"next";
33
import{createMocks}from"node-mocks-http";
4-
import{describe,it,expect}from"vitest";
4+
import{describe,it,expect,beforeAll}from"vitest";
55

66
importprismafrom"@calcom/prisma";
77

@@ -11,6 +11,30 @@ type CustomNextApiRequest = NextApiRequest & Request;
1111
typeCustomNextApiResponse=NextApiResponse&Response;
1212

1313
describe("PATCH /api/bookings",()=>{
14+
beforeAll(async()=>{
15+
constacmeOrg=awaitprisma.team.findFirst({
16+
where:{
17+
slug:"acme",
18+
isOrganization:true,
19+
},
20+
});
21+
22+
if(acmeOrg){
23+
awaitprisma.organizationSettings.upsert({
24+
where:{
25+
organizationId:acmeOrg.id,
26+
},
27+
update:{
28+
isAdminAPIEnabled:true,
29+
},
30+
create:{
31+
organizationId:acmeOrg.id,
32+
orgAutoAcceptEmail:"acme.com",
33+
isAdminAPIEnabled:true,
34+
},
35+
});
36+
}
37+
});
1438
it("Returns 403 when user has no permission to the booking",async()=>{
1539
constmemberUser=awaitprisma.user.findFirstOrThrow({where:{email:"member2-acme@example.com"}});
1640
constproUser=awaitprisma.user.findFirstOrThrow({where:{email:"pro@example.com"}});

‎apps/api/v1/test/lib/bookings/_get.integration-test.ts‎

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,33 @@ const DefaultPagination = {
1616
skip:0,
1717
};
1818

19-
describe("GET /api/bookings",()=>{
20-
letproUser:Awaited<ReturnType<typeofprisma.user.findFirstOrThrow>>;
21-
letproUserBooking:Awaited<ReturnType<typeofprisma.booking.findFirstOrThrow>>;
22-
19+
describe("GET /api/bookings",async()=>{
2320
beforeAll(async()=>{
24-
proUser=awaitprisma.user.findFirstOrThrow({where:{email:"pro@example.com"}});
25-
proUserBooking=awaitprisma.booking.findFirstOrThrow({where:{userId:proUser.id}});
21+
constacmeOrg=awaitprisma.team.findFirst({
22+
where:{
23+
slug:"acme",
24+
isOrganization:true,
25+
},
26+
});
27+
28+
if(acmeOrg){
29+
awaitprisma.organizationSettings.upsert({
30+
where:{
31+
organizationId:acmeOrg.id,
32+
},
33+
update:{
34+
isAdminAPIEnabled:true,
35+
},
36+
create:{
37+
organizationId:acmeOrg.id,
38+
orgAutoAcceptEmail:"acme.com",
39+
isAdminAPIEnabled:true,
40+
},
41+
});
42+
}
2643
});
44+
constproUser=awaitprisma.user.findFirstOrThrow({where:{email:"pro@example.com"}});
45+
constproUserBooking=awaitprisma.booking.findFirstOrThrow({where:{userId:proUser.id}});
2746

2847
it("Does not return bookings of other users when user has no permission",async()=>{
2948
constmemberUser=awaitprisma.user.findFirstOrThrow({where:{email:"member2-acme@example.com"}});

‎apps/api/v1/test/lib/utils/isAdmin.integration-test.ts‎

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
importtype{Request,Response}from"express";
22
importtype{NextApiRequest,NextApiResponse}from"next";
33
import{createMocks}from"node-mocks-http";
4-
import{describe,it,expect}from"vitest";
4+
import{describe,it,expect,beforeAll}from"vitest";
55

66
importprismafrom"@calcom/prisma";
77

@@ -12,6 +12,53 @@ type CustomNextApiRequest = NextApiRequest & Request;
1212
typeCustomNextApiResponse=NextApiResponse&Response;
1313

1414
describe("isAdmin guard",()=>{
15+
beforeAll(async()=>{
16+
constacmeOrg=awaitprisma.team.findFirst({
17+
where:{
18+
slug:"acme",
19+
isOrganization:true,
20+
},
21+
});
22+
23+
if(acmeOrg){
24+
awaitprisma.organizationSettings.upsert({
25+
where:{
26+
organizationId:acmeOrg.id,
27+
},
28+
update:{
29+
isAdminAPIEnabled:true,
30+
},
31+
create:{
32+
organizationId:acmeOrg.id,
33+
orgAutoAcceptEmail:"acme.com",
34+
isAdminAPIEnabled:true,
35+
},
36+
});
37+
}
38+
39+
constdunderOrg=awaitprisma.team.findFirst({
40+
where:{
41+
slug:"dunder-mifflin",
42+
isOrganization:true,
43+
},
44+
});
45+
46+
if(dunderOrg){
47+
awaitprisma.organizationSettings.upsert({
48+
where:{
49+
organizationId:dunderOrg.id,
50+
},
51+
update:{
52+
isAdminAPIEnabled:false,
53+
},
54+
create:{
55+
organizationId:dunderOrg.id,
56+
orgAutoAcceptEmail:"dunder-mifflin.com",
57+
isAdminAPIEnabled:false,
58+
},
59+
});
60+
}
61+
});
1562
it("Returns false when user does not exist in the system",async()=>{
1663
const{ req}=createMocks<CustomNextApiRequest,CustomNextApiResponse>({
1764
method:"POST",

‎apps/api/v1/test/lib/utils/retrieveScopedAccessibleUsers.integration-test.ts‎

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import{describe,it,expect}from"vitest";
1+
import{describe,it,expect,beforeAll}from"vitest";
22

33
importprismafrom"@calcom/prisma";
44

@@ -8,6 +8,30 @@ import {
88
}from"../../../lib/utils/retrieveScopedAccessibleUsers";
99

1010
describe("retrieveScopedAccessibleUsers tests",()=>{
11+
beforeAll(async()=>{
12+
constacmeOrg=awaitprisma.team.findFirst({
13+
where:{
14+
slug:"acme",
15+
isOrganization:true,
16+
},
17+
});
18+
19+
if(acmeOrg){
20+
awaitprisma.organizationSettings.upsert({
21+
where:{
22+
organizationId:acmeOrg.id,
23+
},
24+
update:{
25+
isAdminAPIEnabled:true,
26+
},
27+
create:{
28+
organizationId:acmeOrg.id,
29+
orgAutoAcceptEmail:"acme.com",
30+
isAdminAPIEnabled:true,
31+
},
32+
});
33+
}
34+
});
1135
describe("getAccessibleUsers",()=>{
1236
it("Does not return members when only admin user ID is supplied",async()=>{
1337
constadminUser=awaitprisma.user.findFirstOrThrow({where:{email:"owner1-acme@example.com"}});

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp