Skip to content

Commit 356117f

Browse files
authored
fix: other reported issues (#11015)
* fix: weird margin top in avatar * fix: pending users are shown on booking page * fix: avatar and naming issues * fix: toast alignment and removing unneeded titles * missing changes from toast improvements * feat: empty state for teams without event types * Removing console.log
1 parent 1bf68d5 commit 356117f

File tree

21 files changed

+102
-53
lines changed

21 files changed

+102
-53
lines changed

apps/web/components/eventtype/EventTeamTab.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import type { Options } from "react-select";
99
import type { CheckedSelectOption } from "@calcom/features/eventtypes/components/CheckedTeamSelect";
1010
import CheckedTeamSelect from "@calcom/features/eventtypes/components/CheckedTeamSelect";
1111
import ChildrenEventTypeSelect from "@calcom/features/eventtypes/components/ChildrenEventTypeSelect";
12-
import { WEBAPP_URL } from "@calcom/lib/constants";
1312
import { useLocale } from "@calcom/lib/hooks/useLocale";
1413
import { SchedulingType } from "@calcom/prisma/enums";
1514
import { Label, Select } from "@calcom/ui";
@@ -18,13 +17,14 @@ interface IUserToValue {
1817
id: number | null;
1918
name: string | null;
2019
username: string | null;
20+
avatar: string;
2121
email: string;
2222
}
2323

24-
const mapUserToValue = ({ id, name, username, email }: IUserToValue, pendingString: string) => ({
24+
const mapUserToValue = ({ id, name, username, avatar, email }: IUserToValue, pendingString: string) => ({
2525
value: `${id || ""}`,
2626
label: `${name || email || ""}${!username ? ` (${pendingString})` : ""}`,
27-
avatar: `${WEBAPP_URL}/${username}/avatar.png`,
27+
avatar,
2828
email,
2929
});
3030

apps/web/pages/event-types/[type]/index.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,7 @@ const EventTypePage = (props: EventTypeSetupProps) => {
183183
created: true,
184184
}))
185185
);
186-
showToast(
187-
t("event_type_updated_successfully", {
188-
eventTypeTitle: eventType.title,
189-
}),
190-
"success"
191-
);
186+
showToast(t("event_type_updated_successfully"), "success");
192187
},
193188
async onSettled() {
194189
await utils.viewer.eventTypes.get.invalidate();

apps/web/pages/event-types/index.tsx

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -830,6 +830,25 @@ const SetupProfileBanner = ({ closeAction }: { closeAction: () => void }) => {
830830
);
831831
};
832832

833+
const EmptyEventTypeList = ({ group }: { group: EventTypeGroup }) => {
834+
const { t } = useLocale();
835+
return (
836+
<>
837+
<EmptyScreen
838+
headline={t("team_no_event_types")}
839+
buttonRaw={
840+
<Button
841+
href={`?dialog=new&eventPage=${group.profile.slug}&teamId=${group.teamId}`}
842+
variant="button"
843+
className="mt-5">
844+
{t("create")}
845+
</Button>
846+
}
847+
/>
848+
</>
849+
);
850+
};
851+
833852
const Main = ({
834853
status,
835854
errorMessage,
@@ -871,12 +890,16 @@ const Main = ({
871890
orgSlug={orgBranding?.slug}
872891
/>
873892

874-
<EventTypeList
875-
types={group.eventTypes}
876-
group={group}
877-
groupIndex={index}
878-
readOnly={group.metadata.readOnly}
879-
/>
893+
{group.eventTypes.length ? (
894+
<EventTypeList
895+
types={group.eventTypes}
896+
group={group}
897+
groupIndex={index}
898+
readOnly={group.metadata.readOnly}
899+
/>
900+
) : (
901+
<EmptyEventTypeList group={group} />
902+
)}
880903
</div>
881904
))
882905
)}

apps/web/playwright/booking-seats.e2e.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ test.describe("Booking with Seats", () => {
6464
await page.waitForSelector('[data-testid="event-types"]');
6565
const eventTitle = "My 2-seated event";
6666
await createNewSeatedEventType(page, { eventTitle });
67-
await expect(page.locator(`text=${eventTitle} event type updated successfully`)).toBeVisible();
67+
await expect(page.locator(`text=Event type updated successfully`)).toBeVisible();
6868
});
6969

7070
test("Multiple Attendees can book a seated event time slot", async ({ users, page }) => {

apps/web/public/static/locales/en/common.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -678,8 +678,8 @@
678678
"new_event_type_btn": "New event type",
679679
"new_event_type_heading": "Create your first event type",
680680
"new_event_type_description": "Event types enable you to share links that show available times on your calendar and allow people to make bookings with you.",
681-
"event_type_created_successfully": "{{eventTypeTitle}} event type created successfully",
682-
"event_type_updated_successfully": "{{eventTypeTitle}} event type updated successfully",
681+
"event_type_created_successfully": "Event type created successfully",
682+
"event_type_updated_successfully": "Event type updated successfully",
683683
"event_type_deleted_successfully": "Event type deleted successfully",
684684
"hours": "Hours",
685685
"people": "People",
@@ -2032,7 +2032,8 @@
20322032
"mark_dns_configured": "Mark as DNS configured",
20332033
"value": "Value",
20342034
"your_organization_updated_sucessfully": "Your organization updated successfully",
2035-
"seat_options_doesnt_multiple_durations": "Seat option doesn't support multiple durations",
2035+
"team_no_event_types": "This team has no event types",
2036+
"seat_options_doesnt_multiple_durations": "Seat option doesn't support multiple durations",
20362037
"include_calendar_event": "Include calendar event",
20372038
"ADD_NEW_STRINGS_ABOVE_THIS_LINE_TO_PREVENT_MERGE_CONFLICTS": "↑↑↑↑↑↑↑↑↑↑↑↑↑ Add your new strings above here ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑"
20382039
}

packages/features/bookings/Booker/components/DatePicker.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { shallow } from "zustand/shallow";
22

3-
import type { Dayjs } from "@calcom/dayjs";
43
import dayjs from "@calcom/dayjs";
54
import { default as DatePickerComponent } from "@calcom/features/calendars/DatePicker";
65
import { useNonEmptyScheduleDays } from "@calcom/features/schedules";

packages/features/bookings/Booker/store.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ export const useBookerStore = create<BookerStore>((set, get) => ({
161161

162162
// Setting month make sure small calendar in fullscreen layouts also updates.
163163
// If selectedDate is null, prevents setting month to Invalid-Date
164-
if (selectedDate && newSelection.month() !== currentSelection.month() ) {
164+
if (selectedDate && newSelection.month() !== currentSelection.month()) {
165165
set({ month: newSelection.format("YYYY-MM") });
166166
updateQueryParam("month", newSelection.format("YYYY-MM"));
167167
}

packages/features/bookings/components/event-meta/Members.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export const EventMembers = ({ schedulingType, users, profile, entity }: EventMe
3636
(profile.name !== users[0].name && schedulingType === SchedulingType.COLLECTIVE);
3737

3838
const avatars: Avatar[] = shownUsers.map((user) => ({
39-
title: `${user.name}`,
39+
title: `${user.name || user.username}`,
4040
image: "image" in user ? `${user.image}` : `/${user.username}/avatar.png`,
4141
alt: user.name || undefined,
4242
href: `/${user.username}`,
@@ -54,7 +54,7 @@ export const EventMembers = ({ schedulingType, users, profile, entity }: EventMe
5454

5555
// Add profile later since we don't want to force creating an avatar for this if it doesn't exist.
5656
avatars.unshift({
57-
title: `${profile.name}`,
57+
title: `${profile.name || profile.username}`,
5858
image: "logo" in profile && profile.logo ? `${profile.logo}` : undefined,
5959
alt: profile.name || undefined,
6060
href: profile.username ? `${CAL_URL}/${profile.username}` : undefined,

packages/features/ee/organizations/components/AboutOrganizationForm.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ export const AboutOrganizationForm = () => {
6565
<Avatar
6666
alt=""
6767
fallback={<Plus className="text-subtle h-6 w-6" />}
68-
asChild
6968
className="items-center"
7069
imageSrc={image}
7170
size="lg"

packages/features/embed/Embed.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import type { ControlProps } from "react-select";
88
import { components } from "react-select";
99
import { shallow } from "zustand/shallow";
1010

11-
import type { Dayjs } from "@calcom/dayjs";
1211
import dayjs from "@calcom/dayjs";
1312
import { AvailableTimes } from "@calcom/features/bookings";
1413
import { useBookerStore, useInitializeBookerStore } from "@calcom/features/bookings/Booker/store";

0 commit comments

Comments
 (0)