Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ export const MainNavigation = ({
);

const switcherIconClasses =
"flex h-9 w-9 items-center justify-center rounded-full bg-slate-100 text-slate-600";
"flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-slate-100 text-slate-600";
const isInitialProjectsLoading = isWorkspaceDropdownOpen && !hasInitializedProjects && !workspaceLoadError;

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,7 @@ export const POST = withV1ApiWrapper({
}
if (survey.environmentId !== environmentId) {
return {
response: responses.badRequestResponse(
"Survey is part of another environment",
{
"survey.environmentId": survey.environmentId,
environmentId,
},
true
),
response: responses.badRequestResponse("Survey does not belong to this environment", undefined, true),
};
}

Expand Down
6 changes: 1 addition & 5 deletions apps/web/app/api/v1/client/[environmentId]/storage/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,7 @@ export const POST = withV1ApiWrapper({

if (survey.environmentId !== environmentId) {
return {
response: responses.badRequestResponse(
"Survey does not belong to the environment",
{ surveyId, environmentId },
true
),
response: responses.badRequestResponse("Survey does not belong to this environment", undefined, true),
};
}

Expand Down
9 changes: 1 addition & 8 deletions apps/web/app/api/v1/management/responses/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,7 @@ const validateSurvey = async (responseInput: TResponseInput, environmentId: stri
}
if (survey.environmentId !== environmentId) {
return {
error: responses.badRequestResponse(
"Survey is part of another environment",
{
"survey.environmentId": survey.environmentId,
environmentId,
},
true
),
error: responses.badRequestResponse("Survey does not belong to this environment", undefined, true),
};
}
return { survey };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,8 @@ describe("checkSurveyValidity", () => {
expect(result).toBeInstanceOf(Response);
expect(result?.status).toBe(400);
expect(responses.badRequestResponse).toHaveBeenCalledWith(
"Survey is part of another environment",
{
"survey.environmentId": "env-2",
environmentId: "env-1",
},
"Survey does not belong to this environment",
undefined,
true
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,7 @@ export const checkSurveyValidity = async (
responseInput: TResponseInputV2
): Promise<Response | null> => {
if (survey.environmentId !== environmentId) {
return responses.badRequestResponse(
"Survey is part of another environment",
{
"survey.environmentId": survey.environmentId,
environmentId,
},
true
);
return responses.badRequestResponse("Survey does not belong to this environment", undefined, true);
}

if (survey.type === "link" && survey.singleUse?.enabled) {
Expand Down
6 changes: 2 additions & 4 deletions packages/survey-ui/src/components/elements/multi-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ function DropdownVariant({
otherOptionPlaceholder,
dir,
otherInputRef,
required,
searchPlaceholder,
searchNoResultsText,
}: Readonly<DropdownVariantProps>): React.JSX.Element {
Expand Down Expand Up @@ -279,7 +278,7 @@ function DropdownVariant({
onChange={handleOtherInputChange}
placeholder={otherOptionPlaceholder}
disabled={disabled}
aria-required={required}
required
aria-invalid={Boolean(errorMessage)}
dir={dir}
className="mt-2 w-full"
Expand Down Expand Up @@ -330,7 +329,6 @@ function ListVariant({
otherOptionPlaceholder,
dir,
otherInputRef,
required,
}: Readonly<ListVariantProps>): React.JSX.Element {
const isNoneSelected = value.includes("none");

Expand Down Expand Up @@ -401,7 +399,7 @@ function ListVariant({
onChange={handleOtherInputChange}
placeholder={otherOptionPlaceholder}
disabled={disabled}
aria-required={required}
required
aria-invalid={Boolean(errorMessage)}
dir={dir}
className="mt-2 w-full"
Expand Down
3 changes: 2 additions & 1 deletion packages/survey-ui/src/components/elements/single-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ function SingleSelect({
onChange={handleOtherInputChange}
placeholder={otherOptionPlaceholder}
disabled={disabled}
required
aria-invalid={Boolean(errorMessage)}
dir={dir}
className="mt-2 w-full"
Expand Down Expand Up @@ -334,7 +335,7 @@ function SingleSelect({
onChange={handleOtherInputChange}
placeholder={otherOptionPlaceholder}
disabled={disabled}
aria-required={required}
required
aria-invalid={Boolean(errorMessage)}
dir={dir}
className="mt-2 w-full"
Expand Down
Loading