fix: typos in several package/ directories (#19495)
* fix: typos in packages/embeds Found via codespell * fix: typos in packages/lib Found via codespell * fix: typos in packages/trpc Found via codespell
This commit is contained in:
@@ -101,7 +101,7 @@ Make `dist/embed.umd.js` servable on URL <http://cal.com/embed.js>
|
||||
|
||||
- Release Issues
|
||||
|
||||
- Compatibility Issue - When embed-iframe.js is updated in such a way that it is not compatible with embed.js, doing a release might break the embed for some time. e.g. iframeReady event let's say get's changed to something else
|
||||
- Compatibility Issue - When embed-iframe.js is updated in such a way that it is not compatible with embed.js, doing a release might break the embed for some time. e.g. iframeReady event let's say gets changed to something else
|
||||
- Best Case scenario - App and Website goes live at the same time. A website using embed loads the same updated and thus compatible versions of embed.js and embed-iframe.js
|
||||
- Worst case scenario - App goes live first, website PR isn't merged yet and thus a website using the embed would load updated version of embed-iframe but outdated version of embed.js possibly breaking the embed.
|
||||
- Ideal Solution: It would be to keep the libraries versioned and embed.js should instruct app within iframe to load a particular version. But if we push a security fix, it is possible that someone is still enforcing embed to load version with security issue. Need to handle this.
|
||||
|
||||
@@ -109,7 +109,7 @@ export async function bookFirstEvent(username: string, frame: Frame, page: Page)
|
||||
});
|
||||
|
||||
// Let current month dates fully render.
|
||||
// There is a bug where if we don't let current month fully render and quickly click go to next month, current month get's rendered
|
||||
// There is a bug where if we don't let current month fully render and quickly click go to next month, current month gets rendered
|
||||
// This doesn't seem to be replicable with the speed of a person, only during automation.
|
||||
// It would also allow correct snapshot to be taken for current month.
|
||||
await frame.waitForTimeout(1000);
|
||||
|
||||
@@ -227,7 +227,7 @@ export const useEmbedTheme = () => {
|
||||
|
||||
/**
|
||||
* It serves following purposes
|
||||
* - Gives consistent values for ui config even after Soft Navigation. When a new React component mounts, it would ensure that the component get's the correct value of ui config
|
||||
* - Gives consistent values for ui config even after Soft Navigation. When a new React component mounts, it would ensure that the component gets the correct value of ui config
|
||||
* - Ensures that all the components using useEmbedUiConfig are updated when ui config changes. It is done by maintaining a list of all non-stale setters.
|
||||
*/
|
||||
export const useEmbedUiConfig = () => {
|
||||
@@ -243,7 +243,7 @@ export const useEmbedUiConfig = () => {
|
||||
return uiConfig;
|
||||
};
|
||||
|
||||
// TODO: Make it usable as an attribute directly instead of styles value. It would allow us to go beyond styles e.g. for debugging we can add a special attribute indentifying the element on which UI config has been applied
|
||||
// TODO: Make it usable as an attribute directly instead of styles value. It would allow us to go beyond styles e.g. for debugging we can add a special attribute identifying the element on which UI config has been applied
|
||||
export const useEmbedStyles = (elementName: keyof EmbedStyles) => {
|
||||
const [, setStyles] = useState<EmbedStyles>({});
|
||||
|
||||
@@ -485,7 +485,7 @@ function keepParentInformedAboutDimensionChanges() {
|
||||
|
||||
// During first render let iframe tell parent that how much is the expected height to avoid scroll.
|
||||
// Parent would set the same value as the height of iframe which would prevent scroll.
|
||||
// On subsequent renders, consider html height as the height of the iframe. If we don't do this, then if iframe get's bigger in height, it would never shrink
|
||||
// On subsequent renders, consider html height as the height of the iframe. If we don't do this, then if iframe gets bigger in height, it would never shrink
|
||||
const iframeHeight = isFirstTime ? documentScrollHeight : contentHeight;
|
||||
const iframeWidth = isFirstTime ? documentScrollWidth : contentWidth;
|
||||
embedStore.parentInformedAboutContentHeight = true;
|
||||
|
||||
@@ -132,7 +132,7 @@ function withColorScheme(
|
||||
// https://fvsch.com/transparent-iframes#:~:text=the%20resolution%20was%3A-,If%20the%20color%20scheme%20of%20an%20iframe%20differs%20from%20embedding%20document%2C%20iframe%20gets%20an%20opaque%20canvas%20background%20appropriate%20to%20its%20color%20scheme.,-So%20the%20dark
|
||||
if (!config["ui.color-scheme"]) {
|
||||
const colorScheme = getColorScheme(containerEl);
|
||||
// Only handle two color-schemes for now. We don't want to have unintented affect by always explicitly adding color-scheme
|
||||
// Only handle two color-schemes for now. We don't want to have unintended affect by always explicitly adding color-scheme
|
||||
if (colorScheme) {
|
||||
config["ui.color-scheme"] = colorScheme;
|
||||
}
|
||||
@@ -388,7 +388,7 @@ export class Cal {
|
||||
// But it's okay to do it here for now because the embedded calLink also keeps itself hidden till it receives `parentKnowsIframeReady` message(It has it's own reasons for that)
|
||||
// Once the embedded calLink starts not hiding the document, we should optimize this line to make the iframe visible earlier than this.
|
||||
|
||||
// Imp: Don't use visiblity:visible as that would make the iframe show even if the host element(A paren tof the iframe) has visiblity:hidden set. Just reset the visibility to default
|
||||
// Imp: Don't use visibility:visible as that would make the iframe show even if the host element(A paren tof the iframe) has visibility:hidden set. Just reset the visibility to default
|
||||
this.iframe.style.visibility = "";
|
||||
}
|
||||
this.doInIframe({ method: "parentKnowsIframeReady" } as const);
|
||||
|
||||
@@ -7,7 +7,7 @@ import { useState } from "react";
|
||||
import ReactDom from "react-dom";
|
||||
|
||||
// Because we don't import from @calcom/embed-react, this file isn't able to test if the build is successful or not and thus npm package would work or not correctly.
|
||||
// There are tests in test/built which verifiy that the types from built package are correctly generated and exported correctly.
|
||||
// There are tests in test/built which verify that the types from built package are correctly generated and exported correctly.
|
||||
import Cal, { getCalApi, type EmbedEvent } from "./src/index";
|
||||
|
||||
const api = getCalApi({
|
||||
|
||||
@@ -18,7 +18,7 @@ test("Check that the API is available", async () => {
|
||||
calLink: "free",
|
||||
config: {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-expect-error We are intentionaly testing invalid value
|
||||
// @ts-expect-error We are intentionally testing invalid value
|
||||
layout: "wrongview",
|
||||
},
|
||||
});
|
||||
|
||||
@@ -477,7 +477,7 @@ export default class CloseCom {
|
||||
body: JSON.stringify(data),
|
||||
}).then(async (response) => {
|
||||
if (!response.ok) {
|
||||
const message = `[Close.com app] An error has occured: ${response.status}`;
|
||||
const message = `[Close.com app] An error has occurred: ${response.status}`;
|
||||
this.log.error(await response.json());
|
||||
throw new Error(message);
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ type EnabledApp = ReturnType<typeof getApps>[number] & { enabled: boolean };
|
||||
*
|
||||
* @param credentials - Can be user or team credentials
|
||||
* @param options
|
||||
* @param options.where Aditional where conditions to filter out apps
|
||||
* @param options.where Additional where conditions to filter out apps
|
||||
* @param options.filterOnCredentials - Only include apps where credentials are present
|
||||
* @returns A list of enabled app metadata & credentials tied to them
|
||||
*/
|
||||
|
||||
@@ -138,7 +138,7 @@ export function availabilityAsString(
|
||||
// append if the range is not complete (but the next day needs adding)
|
||||
days[days.length - 1].push(day);
|
||||
} else if (days[days.length - 1][days[days.length - 1].length - 1] === day - 1) {
|
||||
// range complete, overwrite if the last day directly preceeds the current day
|
||||
// range complete, overwrite if the last day directly precedes the current day
|
||||
days[days.length - 1] = [days[days.length - 1][0], day];
|
||||
} else {
|
||||
// new range
|
||||
|
||||
@@ -21,7 +21,7 @@ describe("CVA Utils", () => {
|
||||
]);
|
||||
});
|
||||
|
||||
it("Should no erorr when no arrays are passed in", () => {
|
||||
it("Should not error when no arrays are passed in", () => {
|
||||
const variants = {
|
||||
color: "blue",
|
||||
size: "large",
|
||||
|
||||
@@ -17,7 +17,7 @@ export function checkForEmptyAssignment({
|
||||
isManagedEventType: boolean;
|
||||
assignAllTeamMembers: boolean;
|
||||
}): boolean {
|
||||
// If Team-events have assignAllTeamMembers checked, return false as assignemnt is complete.
|
||||
// If Team-events have assignAllTeamMembers checked, return false as assignment is complete.
|
||||
if (assignAllTeamMembers) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ describe("getValidRhfFieldName", () => {
|
||||
expect(getValidRhfFieldName("$hello.there")).toEqual("-hello-there");
|
||||
});
|
||||
|
||||
// So that user can freely add spaces and any other character iteratively and it get's converted to - and he can add more characters.
|
||||
// So that user can freely add spaces and any other character iteratively and it gets converted to - and he can add more characters.
|
||||
// We don't really care about a hyphen in the end
|
||||
it("should not remove dashes from start and end.", () => {
|
||||
expect(getValidRhfFieldName("hello-there-")).toEqual("hello-there-");
|
||||
|
||||
@@ -22,7 +22,7 @@ export const redactError = <T extends Error | unknown>(error: T) => {
|
||||
log.debug("Type of Error: ", error.constructor);
|
||||
if (shouldRedact(error) && IS_PRODUCTION) {
|
||||
log.error("Error: ", JSON.stringify(error));
|
||||
return new Error("An error occured while querying the database.");
|
||||
return new Error("An error occurred while querying the database.");
|
||||
}
|
||||
return error;
|
||||
};
|
||||
|
||||
@@ -3,7 +3,7 @@ import { HttpError } from "../http-error";
|
||||
const TURNSTILE_SECRET_ID = process.env.CLOUDFLARE_TURNSTILE_SECRET;
|
||||
|
||||
export async function checkCfTurnstileToken({ token, remoteIp }: { token?: string; remoteIp: string }) {
|
||||
// This means the instance doesnt have turnstile enabled - we skip the check and just return success.
|
||||
// This means the instance doesn't have turnstile enabled - we skip the check and just return success.
|
||||
// OR the instance is running in CI so we skip these checks also
|
||||
if (!TURNSTILE_SECRET_ID || !!process.env.NEXT_PUBLIC_IS_E2E) {
|
||||
return {
|
||||
|
||||
@@ -686,13 +686,13 @@ describe("maximize availability and weights", () => {
|
||||
userId: 1,
|
||||
createdAt: dayjs().startOf("month").add(10, "day").toDate(),
|
||||
}),
|
||||
// happend during OOO
|
||||
// happened during OOO
|
||||
buildBooking({
|
||||
id: 2,
|
||||
userId: 2,
|
||||
createdAt: dayjs().startOf("month").add(5, "hour").toDate(),
|
||||
}),
|
||||
// happend during OOO
|
||||
// happened during OOO
|
||||
buildBooking({
|
||||
id: 3,
|
||||
userId: 2,
|
||||
|
||||
@@ -47,7 +47,7 @@ type GetTeamOrOrgArg<TeamSelect extends Prisma.TeamSelect> = {
|
||||
const log = logger.getSubLogger({ prefix: ["repository", "team"] });
|
||||
|
||||
/**
|
||||
* Get's the team or organization with the given slug or id reliably along with parsed metadata.
|
||||
* Gets the team or organization with the given slug or id reliably along with parsed metadata.
|
||||
*/
|
||||
async function getTeamOrOrg<TeamSelect extends Prisma.TeamSelect>({
|
||||
lookupBy,
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
- [x] Unlocked attribute shouldn't get updates from SCIM but in case they still do, we follow this strategy
|
||||
- If attribute from SCIM, doesn't exist on user, we allow it to be freely set on the user
|
||||
- If attribute from SCIM, exists on user
|
||||
- [x] It is a single select or a non-enum attribute, we don't let it be overriden and completely ignore the SCIM update for that attribute
|
||||
- [x] It is a single select or a non-enum attribute, we don't let it be overridden and completely ignore the SCIM update for that attribute
|
||||
- [x] It is a multi select, we remove the options that were created from SCIM and add the new options from SCIM. AttributeToUser.createdByDSyncId is set to SCIM directorySync id for those options. It allows both SCIM set and User set options to be assigned to the User.
|
||||
- [x] The options created by SCIM aren't deletable from Cal.com UI. User can only remove options created by Cal.com i.e. where AttributeToUser.createdByDSyncId is null.
|
||||
- Restrict setting values
|
||||
@@ -25,9 +25,9 @@
|
||||
## Test
|
||||
- Okta to Cal.com
|
||||
1. Add a user with attribute
|
||||
2. Simular a failure in adding the user
|
||||
2. Simulate a failure in adding the user
|
||||
- Failure could be in user creation or attribute assignment creation
|
||||
3. Remove the user and Re-add the user and see it is correctly synced.
|
||||
3. Remove the user and Re-add the user and see if it's correctly synced.
|
||||
- [x] Try removing a locked attribute assignment from a user.
|
||||
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ describe("slugify", () => {
|
||||
expect(slugify("hello$there")).toEqual("hello-there");
|
||||
});
|
||||
|
||||
// So that user can freely add spaces and any other character iteratively and it get's converted to - later on.
|
||||
// So that user can freely add spaces and any other character iteratively and it gets converted to - later on.
|
||||
it("should remove dashes from start and end.", () => {
|
||||
expect(slugify("hello-there-")).toEqual("hello-there");
|
||||
expect(slugify("hello-there_")).toEqual("hello-there");
|
||||
|
||||
@@ -59,7 +59,7 @@ describe("unlinkConnectedAccount.handler", () => {
|
||||
}
|
||||
`);
|
||||
});
|
||||
it("Should respond with an error message if unlink was unsucessful", async () => {
|
||||
it("Should respond with an error message if unlink was unsuccessful", async () => {
|
||||
const user = await buildMockData(IdentityProvider.CAL);
|
||||
const response = await unlinkConnectedAccountHandler({ ctx: { user } });
|
||||
expect(response).toMatchInlineSnapshot(`
|
||||
|
||||
@@ -23,7 +23,7 @@ const unlinkConnectedAccount = async ({ ctx }: UpdateProfileOptions) => {
|
||||
providerAccountId: user.identityProviderId || "",
|
||||
});
|
||||
} catch {
|
||||
// Fail silenty if we don't have an record in the account table
|
||||
// Fail silently if we don't have a record in the account table
|
||||
}
|
||||
// Fall back to the default identity provider
|
||||
const _user = await prisma.user.update({
|
||||
|
||||
@@ -139,7 +139,7 @@ export const updateProfileHandler = async ({ ctx, input }: UpdateProfileOptions)
|
||||
emailChangeWaitingForVerification: input.email?.toLocaleLowerCase(),
|
||||
};
|
||||
|
||||
// Check to ensure this email isnt in use
|
||||
// Check to ensure this email isn't in use
|
||||
// Don't include email in the data payload if we need to verify
|
||||
delete data.email;
|
||||
}
|
||||
|
||||
@@ -326,7 +326,7 @@ export async function getBookings({
|
||||
};
|
||||
|
||||
const [
|
||||
// Quering these in parallel to save time.
|
||||
// Querying these in parallel to save time.
|
||||
// Note that because we are applying `take` to individual queries, we will usually get more bookings then we need. It is okay to have more bookings faster than having what we need slower
|
||||
bookingsQueryUserId,
|
||||
bookingsQueryAttendees,
|
||||
|
||||
@@ -34,7 +34,7 @@ export const adminVerifyHandler = async ({ input }: AdminVerifyOptions) => {
|
||||
if (!foundOrg)
|
||||
throw new TRPCError({
|
||||
code: "FORBIDDEN",
|
||||
message: "This team isnt a org or doesnt exist",
|
||||
message: "This team isn't an org or doesn't exist",
|
||||
});
|
||||
|
||||
const acceptedEmailDomain = foundOrg.members[0].user.email.split("@")[1];
|
||||
|
||||
@@ -40,7 +40,7 @@ export const updateUserHandler = async ({ ctx, input }: UpdateUserOptions) => {
|
||||
const { id: userId, organizationId } = user;
|
||||
|
||||
if (!organizationId)
|
||||
throw new TRPCError({ code: "UNAUTHORIZED", message: "You must be a memeber of an organizaiton" });
|
||||
throw new TRPCError({ code: "UNAUTHORIZED", message: "You must be a member of an organizaiton" });
|
||||
|
||||
if (!(await isOrganisationAdmin(userId, organizationId))) throw new TRPCError({ code: "UNAUTHORIZED" });
|
||||
|
||||
|
||||
+1
-1
@@ -204,7 +204,7 @@ export const findTeamMembersMatchingAttributeLogicOfRouteHandler = async ({
|
||||
},
|
||||
{
|
||||
enablePerf: _enablePerf,
|
||||
// Reuse same flag for enabling troubleshooter. We would normall use them together
|
||||
// Reuse same flag for enabling troubleshooter. We would normally use them together
|
||||
enableTroubleshooter: _enablePerf,
|
||||
concurrency: _concurrency,
|
||||
}
|
||||
|
||||
@@ -669,7 +669,7 @@ async function _getAvailableSlots({ input, ctx }: GetScheduleOptions): Promise<I
|
||||
}
|
||||
return (
|
||||
!isFutureLimitViolationForTheSlot &&
|
||||
// TODO: Perf Optmization: Slots calculation logic already seems to consider the minimum booking notice and past booking time and thus there shouldn't be need to filter out slots here.
|
||||
// TODO: Perf Optimization: Slots calculation logic already seems to consider the minimum booking notice and past booking time and thus there shouldn't be need to filter out slots here.
|
||||
!isTimeOutOfBounds({ time: slot.time, minimumBookingNotice: eventType.minimumBookingNotice })
|
||||
);
|
||||
});
|
||||
|
||||
@@ -116,7 +116,7 @@ export const updateHandler = async ({ ctx, input }: UpdateOptions) => {
|
||||
});
|
||||
|
||||
if (!parentTeam?.slug) {
|
||||
throw new Error(`Parent team wth slug: ${parentTeam?.slug} not found`);
|
||||
throw new Error(`Parent team with slug: ${parentTeam?.slug} not found`);
|
||||
}
|
||||
|
||||
const orgUrlPrefix = getOrgFullOrigin(parentTeam.slug);
|
||||
|
||||
Reference in New Issue
Block a user