-
Notifications
You must be signed in to change notification settings - Fork 0
Fix/remove links legacybehavior #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
8145583
736b7a3
7768891
74fc1fd
a5ea34d
5f5d351
2e9d2f4
271f545
90a687e
4c653c0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| import type { InferGetServerSidePropsType } from "next"; | ||
| import Link from "next/link"; | ||
| import { useState } from "react"; | ||
| import { Toaster } from "sonner"; | ||
|
|
||
|
|
@@ -71,9 +70,10 @@ export default function MakeSetup({ inviteLink }: InferGetServerSidePropsType<ty | |
| <div className="bg-default m-auto max-w-[43em] overflow-auto rounded pb-10 md:p-10"> | ||
| <div className="md:flex md:flex-row"> | ||
| <div className="invisible md:visible"> | ||
| {/* eslint-disable @next/next/no-img-element */} | ||
| <img className="h-11" src="/api/app-store/make/icon.svg" alt="Make Logo" /> | ||
| </div> | ||
| <div className="ml-2 ltr:mr-2 rtl:ml-2 md:ml-5"> | ||
| <div className="ml-2 md:ml-5 ltr:mr-2 rtl:ml-2"> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CSS Class OrderingCSS class ordering places responsive modifier 'md:ml-5' between base 'ml-2' and directional classes 'ltr:mr-2 rtl:ml-2'. This creates potential cascade conflicts where directional classes may override responsive spacing. Consistent ordering should group base, responsive, then directional modifiers. Standards
|
||
| <div className="text-default">{t("setting_up_make")}</div> | ||
|
|
||
| <> | ||
|
|
@@ -134,9 +134,9 @@ export default function MakeSetup({ inviteLink }: InferGetServerSidePropsType<ty | |
| <li>{t("make_setup_instructions_5")}</li> | ||
| <li>{t("make_setup_instructions_6")}</li> | ||
| </ol> | ||
| <Link href="/apps/installed/automation?hl=make" passHref={true} legacyBehavior> | ||
| <Button color="secondary">{t("done")}</Button> | ||
| </Link> | ||
| <Button href="/apps/installed/automation?hl=make" color="secondary"> | ||
| {t("done")} | ||
| </Button> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -806,15 +806,14 @@ export default function Success(props: PageProps) { | |||||||||||||||||||||||||||||||||
| </span> | ||||||||||||||||||||||||||||||||||
| {/* Login button but redirect to here */} | ||||||||||||||||||||||||||||||||||
| <span className="text-default inline"> | ||||||||||||||||||||||||||||||||||
| <span className="underline" data-testid="reschedule-link"> | ||||||||||||||||||||||||||||||||||
| <Link | ||||||||||||||||||||||||||||||||||
| href={`/auth/login?callbackUrl=${encodeURIComponent( | ||||||||||||||||||||||||||||||||||
| `/booking/${bookingInfo?.uid}` | ||||||||||||||||||||||||||||||||||
| )}`} | ||||||||||||||||||||||||||||||||||
| legacyBehavior> | ||||||||||||||||||||||||||||||||||
| {t("login")} | ||||||||||||||||||||||||||||||||||
| </Link> | ||||||||||||||||||||||||||||||||||
| </span> | ||||||||||||||||||||||||||||||||||
| <Link | ||||||||||||||||||||||||||||||||||
| href={`/auth/login?callbackUrl=${encodeURIComponent( | ||||||||||||||||||||||||||||||||||
| `/booking/${bookingInfo?.uid}` | ||||||||||||||||||||||||||||||||||
| )}`} | ||||||||||||||||||||||||||||||||||
| className="underline" | ||||||||||||||||||||||||||||||||||
| data-testid="reschedule-link"> | ||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestion: The login link for users who must log in before updating a booking is tagged with the Severity Level: Critical 🚨
Suggested change
Why it matters? ⭐The current code places data-testid="reschedule-link" on a login link used when requiresLoginToUpdate is true. Prompt for AI Agent 🤖This is a comment left during a code review.
**Path:** apps/web/modules/bookings/views/bookings-single-view.tsx
**Line:** 814:814
**Comment:**
*Possible Bug: The login link for users who must log in before updating a booking is tagged with the `reschedule-link` test id, which can cause automated tests or tooling that target the reschedule action to mistakenly interact with this login link instead, leading to incorrect flows being exercised in scenarios where login is required to update a booking.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise. |
||||||||||||||||||||||||||||||||||
| {t("login")} | ||||||||||||||||||||||||||||||||||
| </Link> | ||||||||||||||||||||||||||||||||||
| </span> | ||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||
| </> | ||||||||||||||||||||||||||||||||||
|
|
@@ -837,17 +836,16 @@ export default function Success(props: PageProps) { | |||||||||||||||||||||||||||||||||
| (!isBookingInPast || eventType.allowReschedulingPastBookings) && | ||||||||||||||||||||||||||||||||||
| canReschedule && ( | ||||||||||||||||||||||||||||||||||
| <span className="text-default inline"> | ||||||||||||||||||||||||||||||||||
| <span className="underline" data-testid="reschedule-link"> | ||||||||||||||||||||||||||||||||||
| <Link | ||||||||||||||||||||||||||||||||||
| href={`/reschedule/${seatReferenceUid || bookingInfo?.uid}${ | ||||||||||||||||||||||||||||||||||
| currentUserEmail | ||||||||||||||||||||||||||||||||||
| ? `?rescheduledBy=${encodeURIComponent(currentUserEmail)}` | ||||||||||||||||||||||||||||||||||
| : "" | ||||||||||||||||||||||||||||||||||
| }`} | ||||||||||||||||||||||||||||||||||
| legacyBehavior> | ||||||||||||||||||||||||||||||||||
| {t("reschedule")} | ||||||||||||||||||||||||||||||||||
| </Link> | ||||||||||||||||||||||||||||||||||
| </span> | ||||||||||||||||||||||||||||||||||
| <Link | ||||||||||||||||||||||||||||||||||
| href={`/reschedule/${seatReferenceUid || bookingInfo?.uid}${ | ||||||||||||||||||||||||||||||||||
| currentUserEmail | ||||||||||||||||||||||||||||||||||
| ? `?rescheduledBy=${encodeURIComponent(currentUserEmail)}` | ||||||||||||||||||||||||||||||||||
| : "" | ||||||||||||||||||||||||||||||||||
| }`} | ||||||||||||||||||||||||||||||||||
| className="underline" | ||||||||||||||||||||||||||||||||||
| data-testid="reschedule-link"> | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+839
to
+846
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestion: The reschedule link now has the Severity Level: Critical 🚨
Suggested change
Why it matters? ⭐The change in the PR moved data-testid="reschedule-link" from the wrapping span to the Link element. If existing e2e or DOM-based tests expect the test id on the wrapper span (selectors like Prompt for AI Agent 🤖This is a comment left during a code review.
**Path:** apps/web/modules/bookings/views/bookings-single-view.tsx
**Line:** 839:846
**Comment:**
*Possible Bug: The reschedule link now has the `data-testid="reschedule-link"` on the `<Link>` element instead of the wrapping `<span>`, which breaks existing selectors like `span[data-testid="reschedule-link"] > a` used in e2e tests (e.g. `booking-limits.e2e.ts`) and prevents those tests from finding the reschedule URL, so moving the test id back to the span restores the DOM contract without changing user-facing behavior.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise. |
||||||||||||||||||||||||||||||||||
| {t("reschedule")} | ||||||||||||||||||||||||||||||||||
| </Link> | ||||||||||||||||||||||||||||||||||
| {!isBookingInPast && canCancel && ( | ||||||||||||||||||||||||||||||||||
| <span className="mx-2">{t("or_lowercase")}</span> | ||||||||||||||||||||||||||||||||||
| )} | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -239,25 +239,17 @@ export const Button = forwardRef<HTMLAnchorElement | HTMLButtonElement, ButtonPr | |
| ...passThroughProps | ||
| } = props; | ||
| // Buttons are **always** disabled if we're in a `loading` state | ||
| const disabled = props.disabled || loading; | ||
| // If pass an `href`-attr is passed it's `<a>`, otherwise it's a `<button />` | ||
| const disabled = props.disabled || loading || false; | ||
| // If pass an `href`-attr is passed it's Link, otherwise it's a `<button />` | ||
| const isLink = typeof props.href !== "undefined"; | ||
| const elementType = isLink ? "a" : "button"; | ||
| const element = React.createElement( | ||
| elementType, | ||
| { | ||
| ...passThroughProps, | ||
| disabled, | ||
| type: !isLink ? type : undefined, | ||
| ref: forwardedRef, | ||
| className: classNames(buttonClasses({ color, size, loading, variant }), props.className), | ||
| // if we click a disabled button, we prevent going through the click handler | ||
| onClick: disabled | ||
| ? (e: React.MouseEvent<HTMLElement, MouseEvent>) => { | ||
| e.preventDefault(); | ||
| } | ||
| : props.onClick, | ||
| }, | ||
| const buttonClassName = classNames(buttonClasses({ color, size, loading, variant }), props.className); | ||
| const handleClick = disabled | ||
| ? (e: React.MouseEvent<HTMLElement, MouseEvent>) => { | ||
| e.preventDefault(); | ||
| } | ||
| : props.onClick; | ||
|
Comment on lines
+246
to
+250
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing Error HandlingButton component passes through onClick handler without error boundary protection. Navigation failures or handler exceptions can propagate uncaught causing component crashes. User interactions become unreliable when handler throws unexpected errors. Standards
Context References
|
||
|
|
||
| const buttonContent = ( | ||
| <> | ||
| {CustomStartIcon || | ||
| (StartIcon && ( | ||
|
|
@@ -334,18 +326,36 @@ export const Button = forwardRef<HTMLAnchorElement | HTMLButtonElement, ButtonPr | |
| </> | ||
| ); | ||
|
|
||
| return props.href ? ( | ||
| <Link data-testid="link-component" passHref href={props.href} shallow={shallow && shallow} legacyBehavior> | ||
| {element} | ||
| </Link> | ||
| ) : ( | ||
| // Render Link or button separately to avoid type conflicts | ||
| // Link manages its own anchor element, so we don't pass ref to it | ||
| if (isLink) { | ||
| return ( | ||
| <Link | ||
| {...(passThroughProps as Omit<JSX.IntrinsicElements["a"], "href" | "onClick" | "ref"> & LinkProps)} | ||
| shallow={shallow && shallow} | ||
| className={buttonClassName} | ||
| onClick={handleClick}> | ||
| {buttonContent} | ||
| </Link> | ||
| ); | ||
| } | ||
|
|
||
| return ( | ||
| <Wrapper | ||
| data-testid="wrapper" | ||
| tooltip={props.tooltip} | ||
| tooltipSide={tooltipSide} | ||
| tooltipOffset={tooltipOffset} | ||
| tooltipClassName={tooltipClassName}> | ||
| {element} | ||
| <button | ||
| {...(passThroughProps as Omit<JSX.IntrinsicElements["button"], "onClick" | "ref">)} | ||
| ref={forwardedRef as React.Ref<HTMLButtonElement>} | ||
| disabled={disabled} | ||
| type={type as "button" | "submit" | "reset"} | ||
| className={buttonClassName} | ||
| onClick={handleClick}> | ||
| {buttonContent} | ||
| </button> | ||
| </Wrapper> | ||
| ); | ||
| }); | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -26,32 +26,39 @@ function Stepper<T extends DefaultStep>(props: { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <ol role="list" className="ml-8 flex items-center space-x-5" ref={stepperRef}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {steps.map((mapStep, index) => ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <li key={mapStep.title}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestion: Using Severity Level: Critical 🚨
Suggested change
Why it matters? ⭐Using only Prompt for AI Agent 🤖This is a comment left during a code review.
**Path:** packages/ui/components/form/step/Stepper.tsx
**Line:** 28:28
**Comment:**
*Possible Bug: Using `mapStep.title` alone as the React `key` for each step assumes titles are globally unique; if two steps share the same title, React's reconciliation can mis-associate DOM nodes and lead to incorrect UI updates when steps change, so the key should be made unique (for example by incorporating the index).
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <Link | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| href={props.disableSteps ? "#" : `${href}?step=${index + 1}`} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| shallow | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| replace | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| legacyBehavior> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {index + 1 < props.step ? ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <a className="hover:bg-inverted block h-2.5 w-2.5 rounded-full bg-gray-600"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <span className="sr-only">{mapStep.title}</span> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </a> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) : index + 1 === props.step ? ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <a className="relative flex items-center justify-center" aria-current="step"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <span className="absolute flex h-5 w-5 p-px" aria-hidden="true"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <span className="bg-emphasis h-full w-full rounded-full" /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </span> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <span | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| className="relative block h-2.5 w-2.5 rounded-full bg-gray-600" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| aria-hidden="true" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <span className="sr-only">{mapStep.title}</span> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </a> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) : ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <a className="bg-emphasis block h-2.5 w-2.5 rounded-full hover:bg-gray-400"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <span className="sr-only">{mapStep.title}</span> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </a> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| )} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </Link> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {index + 1 < props.step ? ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <Link | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| href={props.disableSteps ? "#" : `${href}?step=${index + 1}`} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| shallow | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| replace | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| className="hover:bg-inverted block h-2.5 w-2.5 rounded-full bg-gray-600"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <span className="sr-only">{mapStep.title}</span> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </Link> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) : index + 1 === props.step ? ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <Link | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| href={props.disableSteps ? "#" : `${href}?step=${index + 1}`} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| shallow | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| replace | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| className="relative flex items-center justify-center" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| aria-current="step"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <span className="absolute flex h-5 w-5 p-px" aria-hidden="true"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <span className="bg-emphasis h-full w-full rounded-full" /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </span> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <span | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| className="relative block h-2.5 w-2.5 rounded-full bg-gray-600" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| aria-hidden="true" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <span className="sr-only">{mapStep.title}</span> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </Link> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) : ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <Link | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| href={props.disableSteps ? "#" : `${href}?step=${index + 1}`} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+31
to
+55
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestion: Building the step URLs by blindly appending Severity Level: Minor
Suggested change
Why it matters? ⭐The claim is correct: blindly appending Prompt for AI Agent 🤖This is a comment left during a code review.
**Path:** packages/ui/components/form/step/Stepper.tsx
**Line:** 31:55
**Comment:**
*Logic Error: Building the step URLs by blindly appending `?step=${index + 1}` to the `href` string will break when the base `href` already contains query parameters (e.g. `/auth/setup?mode=admin`), resulting in invalid URLs like `/auth/setup?mode=admin?step=2` and incorrect routing behavior; you should append `step` with `&` when a `?` already exists.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| shallow | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| replace | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| className="bg-emphasis block h-2.5 w-2.5 rounded-full hover:bg-gray-400"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <span className="sr-only">{mapStep.title}</span> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </Link> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| )} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </li> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ))} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </ol> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's generally better to address the underlying ESLint rule rather than disabling it. While this might be a quick fix, consider if there's a more permanent solution to allow
imgelements without thealtattribute or if thealtattribute can be dynamically provided.