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
57 changes: 0 additions & 57 deletions src/components/Questionnaire/QuestionLabel.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ import {

import { CATEGORY_ICONS } from "@/components/Patient/allergy/list";
import { EntitySelectionDrawer } from "@/components/Questionnaire/EntitySelectionDrawer";
import { QuestionLabel } from "@/components/Questionnaire/QuestionLabel";
import ValueSetSelect from "@/components/Questionnaire/ValueSetSelect";

import useBreakpoints from "@/hooks/useBreakpoints";
Expand Down Expand Up @@ -552,7 +551,6 @@ const AllergyItem = ({
};

export function AllergyQuestion({
question,
questionnaireResponse,
updateQuestionnaireResponseCB,
disabled,
Expand Down Expand Up @@ -676,7 +674,6 @@ export function AllergyQuestion({

return (
<div className="space-y-4">
<QuestionLabel question={question} />
{allergies.length > 0 && (
<div className="rounded-lg lg:border lg:border-gray-200">
<div className="hidden lg:block overflow-x-auto">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
SheetTrigger,
} from "@/components/ui/sheet";

import { QuestionLabel } from "@/components/Questionnaire/QuestionLabel";
import { ScheduleResourceFormState } from "@/components/Schedule/ResourceSelector";
import useAuthUser from "@/hooks/useAuthUser";
import { AppointmentDateSelection } from "@/pages/Appointments/BookAppointment/AppointmentDateSelection";
Expand Down Expand Up @@ -180,7 +179,6 @@ export function AppointmentQuestion({

return (
<div className="space-y-4">
<QuestionLabel question={question} />
<AppointmentFormSection
facilityId={facilityId}
selectedTags={selectedTags}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import {
import ChargeItemPriceDisplay from "@/components/Billing/ChargeItem/ChargeItemPriceDisplay";
import { FieldError } from "@/components/Questionnaire/QuestionTypes/FieldError";

import { QuestionLabel } from "@/components/Questionnaire/QuestionLabel";
import { MonetaryDisplay } from "@/components/ui/monetary-display";
import { ResourceCategoryResourceType } from "@/types/base/resourceCategory/resourceCategory";
import { ApplyChargeItemDefinitionRequest } from "@/types/billing/chargeItem/chargeItem";
Expand Down Expand Up @@ -201,7 +200,6 @@ export function ChargeItemQuestion({
facilityId,
encounterId,
errors,
question,
}: ChargeItemQuestionProps) {
const { t } = useTranslation();
const [selectedChargeItemDefinition, setSelectedChargeItemDefinition] =
Expand Down Expand Up @@ -286,7 +284,6 @@ export function ChargeItemQuestion({

return (
<div className="space-y-4">
<QuestionLabel question={question} />
{chargeItems.length > 0 && (
<Table>
<TableHeader>
Expand Down
6 changes: 1 addition & 5 deletions src/components/Questionnaire/QuestionTypes/DeathQuestion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import { format } from "date-fns";

import { DateTimeInput } from "@/components/Common/DateTimeInput";

import { QuestionLabel } from "@/components/Questionnaire/QuestionLabel";

import {
QuestionnaireResponse,
ResponseValue,
Expand All @@ -22,8 +20,7 @@ interface TimeOfDeathQuestionProps {
}

export function TimeOfDeathQuestion(props: TimeOfDeathQuestionProps) {
const { question, questionnaireResponse, updateQuestionnaireResponseCB } =
props;
const { questionnaireResponse, updateQuestionnaireResponseCB } = props;

const values = (questionnaireResponse.values?.[0]?.value as string[]) || [];

Expand All @@ -42,7 +39,6 @@ export function TimeOfDeathQuestion(props: TimeOfDeathQuestionProps) {

return (
<div className="space-y-4">
<QuestionLabel question={question} />
<DateTimeInput
value={values[0]}
onDateChange={(val) => val !== undefined && handleUpdate(val)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ import {

import { HistoricalRecordSelector } from "@/components/HistoricalRecordSelector";
import { EntitySelectionDrawer } from "@/components/Questionnaire/EntitySelectionDrawer";
import { QuestionLabel } from "@/components/Questionnaire/QuestionLabel";
import ValueSetSelect from "@/components/Questionnaire/ValueSetSelect";

import useBreakpoints from "@/hooks/useBreakpoints";
Expand Down Expand Up @@ -349,7 +348,6 @@ export function DiagnosisQuestion({
questionnaireResponse,
updateQuestionnaireResponseCB,
disabled,
question,
}: DiagnosisQuestionProps) {
const { t } = useTranslation();

Expand Down Expand Up @@ -546,8 +544,7 @@ export function DiagnosisQuestion({
sortedDiagnoses.length > 0 ? "md:max-w-fit" : "max-w-4xl",
)}
>
<div className="flex justify-between items-center flex-wrap">
<QuestionLabel question={question} />
<div className="flex flex-wrap items-center justify-end">
<HistoricalRecordSelector<DiagnosisRequest>
title={t("past_diagnoses")}
structuredTypes={[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ import {
import { Switch } from "@/components/ui/switch";
import { Textarea } from "@/components/ui/textarea";

import { QuestionLabel } from "@/components/Questionnaire/QuestionLabel";

import query from "@/Utils/request/query";
import { cn } from "@/lib/utils";
import {
Expand Down Expand Up @@ -91,7 +89,6 @@ export function validateEncounterQuestion(
}

export function EncounterQuestion({
question,
questionnaireResponse,
updateQuestionnaireResponseCB,
disabled,
Expand Down Expand Up @@ -245,7 +242,6 @@ export function EncounterQuestion({

return (
<div className="space-y-6">
<QuestionLabel question={question} />
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
{/* Basic Details */}
<div className="space-y-2">
Expand Down
2 changes: 0 additions & 2 deletions src/components/Questionnaire/QuestionTypes/FileQuestion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import FileUploadDropdown from "@/components/Files/FileUploadDropdown";

import useFileUpload from "@/hooks/useFileUpload";

import { QuestionLabel } from "@/components/Questionnaire/QuestionLabel";
import {
BACKEND_ALLOWED_EXTENSIONS,
FileCategory,
Expand Down Expand Up @@ -153,7 +152,6 @@ export function FilesQuestion(props: FilesQuestionProps) {

return (
<div className="flex flex-col gap-2">
<QuestionLabel question={props.question} />
{values.map((value, index) => (
<div key={index} className="flex items-stretch gap-2">
<Input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ import { formatName } from "@/Utils/utils";

import { filterStructuredQuestionnaireSlugs } from "@/components/Questionnaire/data/StructuredFormData";
import ManageResponseTemplatesSheet from "@/components/Questionnaire/ManageResponseTemplatesSheet";
import { QuestionLabel } from "@/components/Questionnaire/QuestionLabel";
import { Alert, AlertDescription } from "@/components/ui/alert";
import { Question } from "@/types/questionnaire/question";

Expand Down Expand Up @@ -349,7 +348,6 @@ export function MedicationRequestQuestion({
errors,
questionnaireId: _questionnaireId,
questionnaireSlug,
question,
}: MedicationRequestQuestionProps) {
const authUser = useAuthUser();
const { t } = useTranslation();
Expand Down Expand Up @@ -908,9 +906,7 @@ export function MedicationRequestQuestion({
confirmText={t("remove")}
variant="destructive"
/>
<div className="flex justify-between items-center flex-wrap">
<QuestionLabel question={question} />

<div className="flex flex-wrap items-center justify-end">
{/* Add to Template Dialog */}
<AddToTemplateDialog
open={!!medicationToAddToTemplate}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ import {
} from "@/types/questionnaire/validation";

import { PaginatedResponse } from "@/Utils/request/types";
import { QuestionLabel } from "@/components/Questionnaire/QuestionLabel";
import { FieldError } from "./FieldError";

interface MedicationStatementQuestionProps {
Expand Down Expand Up @@ -322,8 +321,7 @@ export function MedicationStatementQuestion({
variant="destructive"
/>

<div className="flex justify-between items-center flex-wrap">
<QuestionLabel question={question} />
<div className="flex flex-wrap items-center justify-end">
<HistoricalRecordSelector<
MedicationRequestRead | MedicationStatementRead
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import { add } from "@/Utils/decimal";
import mutate from "@/Utils/request/mutate";
import query from "@/Utils/request/query";
import { formatName } from "@/Utils/utils";
import { QuestionLabel } from "@/components/Questionnaire/QuestionLabel";
import { getBasePrice } from "@/types/base/monetaryComponent/monetaryComponent";
import { ChargeItemDefinitionBase } from "@/types/billing/chargeItemDefinition/chargeItemDefinition";
import {
Expand Down Expand Up @@ -409,7 +408,6 @@ export function ServiceRequestQuestion({
encounterId,
errors,
questionnaireSlug,
question,
}: ServiceRequestQuestionProps) {
const { t } = useTranslation();
const currentUser = useAuthUser() as CurrentUserRead;
Expand Down Expand Up @@ -915,7 +913,6 @@ export function ServiceRequestQuestion({

return (
<div className="space-y-4">
<QuestionLabel question={question} />
<AddToTemplateDialog
open={!!serviceRequestToAddToTemplate}
onOpenChange={(open) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ import {

import { HistoricalRecordSelector } from "@/components/HistoricalRecordSelector";
import { EntitySelectionDrawer } from "@/components/Questionnaire/EntitySelectionDrawer";
import { QuestionLabel } from "@/components/Questionnaire/QuestionLabel";
import ValueSetSelect from "@/components/Questionnaire/ValueSetSelect";

import useBreakpoints from "@/hooks/useBreakpoints";
Expand Down Expand Up @@ -653,7 +652,6 @@ export function SymptomQuestion({
updateQuestionnaireResponseCB,
disabled,
encounterId,
question,
}: SymptomQuestionProps) {
const { t } = useTranslation();

Expand Down Expand Up @@ -799,8 +797,7 @@ export function SymptomQuestion({

return (
<div className="space-y-2">
<div className="flex justify-between items-center flex-wrap">
<QuestionLabel question={question} />
<div className="flex flex-wrap items-center justify-end">
<HistoricalRecordSelector<SymptomRequest>
title={t("past_symptoms")}
structuredTypes={[
Expand Down
2 changes: 1 addition & 1 deletion src/components/QuestionnaireV2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ pseudo-questionnaires), `QuestionnaireSearch` (the fill picker state), the
`QuestionTypes/*` structured components — exclusively via
`structured/definitions/*`, whose typed adapters replaced the renderer's
old "one permitted `any`" — and `OrgSelector`. Everything else in that
directory (`QuestionLabel`, `FieldError`, `EntitySelectionDrawer`,
directory (`FieldError`, `EntitySelectionDrawer`,
`ValueSetSearchContent`, the response-template sheets) exists only because
those structured components use it; nothing in v2 may import it directly.
A new legacy dependency needs an allowlist entry here, not an ad-hoc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
* clone dialog's `-copy` suffix clamp, so a bound change lands everywhere.
*/
export const SLUG_MIN_LENGTH = 5;
export const SLUG_MAX_LENGTH = 25;
export const SLUG_MAX_LENGTH = 50;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

SLUG_MAX_LENGTH jumped from 25 to 50 with zero mention in the PR description. This is a stack fixing a visual label duplication bug — why is the slug validation limit changing here? If this is load-bearing for a fixed questionnaire slug, say so. Otherwise it's a drive-by change that belongs in its own PR with its own explanation.


/**
* The `title`/`slug`/`description`/`status` validation shared by the three
Expand Down
Loading
Loading