Skip to content

fix: Transform Google API Key [CAL-1749]#9890

Merged
emrysal merged 2 commits into
mainfrom
fix/admin-google-keys
Jul 3, 2023
Merged

fix: Transform Google API Key [CAL-1749]#9890
emrysal merged 2 commits into
mainfrom
fix/admin-google-keys

Conversation

@joeauyeung
Copy link
Copy Markdown
Contributor

What does this PR do?

This PR fixes when an admin is adding API credentials in the "Apps" section of the admin settings for GCal, it will parse the redirect_uris to an array of strings.

Fixes #9079

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How should this be tested?

  • Remove current Google Calendar (GCal) API keys from the database
  • As an admin go to the "Apps" section under settings
  • Add your valid Google API credentials
    • In your DB under GCal keys, redirect_uris should be an array
  • Test this by adding a GCal to your account

Mandatory Tasks

  • Make sure you have self-reviewed the code. A decent size PR without self-review might be rejected.

Checklist

  • I haven't added tests that prove my fix is effective or that my feature works
  • I haven't checked if new and existing unit tests pass locally with my changes

@linear
Copy link
Copy Markdown

linear Bot commented Jul 3, 2023

CAL-1749 Adding gCal via /admin/apps fails when parsing back

  • As an admin on a new install, enable via Google Calendar via admin UI in /settings/admin/apps
  • As a non-admin user, install Google Calendar
  • Calendars on /apps/installed never finish loading

This is the error in the console

image.png

The issue it that when we're saving redirect_uris we save it as a string when it should be an array of strings.

@vercel
Copy link
Copy Markdown

vercel Bot commented Jul 3, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
api ❌ Failed (Inspect) Mar 19, 2024 2:58pm
cal ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 19, 2024 2:58pm
ui ❌ Failed (Inspect) Mar 19, 2024 2:58pm
web-staging 🔄 Building (Inspect) Mar 19, 2024 2:58pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
dev ⬜️ Ignored (Inspect) Mar 19, 2024 2:58pm

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jul 3, 2023

Thank you for following the naming conventions! 🙏

@github-actions github-actions Bot added bookings area: bookings, availability, timezones, double booking Medium priority Created by Linear-GitHub Sync 🐛 bug Something isn't working labels Jul 3, 2023
Comment on lines +10 to +13
z
.string()
.url()
.transform((url) => [url]),
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When submitting keys, we parse the input so it would automatically transform the redirect_uris to an array. So we either accept an array or a single string and transform it into an array.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jul 3, 2023

📦 Next.js Bundle Analysis for @calcom/web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

@deploysentinel
Copy link
Copy Markdown

deploysentinel Bot commented Jul 3, 2023

Current Playwright Test Results Summary

✅ 111 Passing - ⚠️ 3 Flaky

Run may still be in progress, this comment will be updated as current testing workflow or job completes...

(Last updated on 07/03/2023 05:32:25am UTC)

Run Details

Running Workflow PR Update on Github Actions

Commit: 4ca7ada

Started: 07/03/2023 05:30:44am UTC

⚠️ Flakes

📄   apps/web/playwright/change-theme.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Change Theme Test change theme to dark
Retry 1Initial Attempt
0.94% (2) 2 / 213 runs
failed over last 7 days
4.23% (9) 9 / 213 runs
flaked over last 7 days

📄   apps/web/playwright/integrations-stripe.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Stripe integration Pending payment booking should not be confirmed by default
Retry 1Initial Attempt
0% (0) 0 / 32 runs
failed over last 7 days
12.50% (4) 4 / 32 runs
flaked over last 7 days

📄   apps/web/playwright/embed-code-generator.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Embed Code Generator Tests Event Types Page open Embed Dialog and choose floating-popup for First Event Type
Retry 1Initial Attempt
0% (0) 0 / 217 runs
failed over last 7 days
5.53% (12) 12 / 217 runs
flaked over last 7 days

View Detailed Build Results


Copy link
Copy Markdown
Contributor

@emrysal emrysal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking good

@emrysal emrysal merged commit 9ef8903 into main Jul 3, 2023
@emrysal emrysal deleted the fix/admin-google-keys branch July 3, 2023 05:43
@PeerRich PeerRich added the core area: core, team members only label Jul 24, 2023
fritterhoff pushed a commit to hm-edu/cal.com that referenced this pull request Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 bug Something isn't working core area: core, team members only Medium priority Created by Linear-GitHub Sync

Projects

No open projects
Status: No status

Development

Successfully merging this pull request may close these issues.

[CAL-1749] Adding gCal via /admin/apps fails when parsing back

3 participants