Skip to content

Commit

Permalink
Merge branch 'develop' into issue/10312/file-capture-upload-workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
rajku-dev authored Jan 31, 2025
2 parents ed68718 + 928bfc6 commit bd81014
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 44 deletions.
2 changes: 1 addition & 1 deletion src/Utils/request/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export function makeHeaders(noAuth: boolean, additionalHeaders?: HeadersInit) {

const authorizationHeader = getAuthorizationHeader();
if (authorizationHeader && !noAuth) {
headers.append("Authorization", authorizationHeader);
headers.set("Authorization", authorizationHeader);
}

return headers;
Expand Down
6 changes: 0 additions & 6 deletions src/components/ui/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<"input">>(
)}
ref={ref}
{...props}
onFocus={(e) => {
if (type === "date" || type === "time") {
e.target.showPicker();
}
props.onFocus?.(e);
}}
/>
);
},
Expand Down
38 changes: 2 additions & 36 deletions src/pages/Facility/settings/locations/LocationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ const formSchema = z.object({
"jdn",
"vi",
] as const),
mode: z.enum(["instance", "kind"] as const),
parent: z.string().optional().nullable(),
organizations: z.array(z.string()).default([]),
availability_status: z.enum(["available", "unavailable"] as const),
Expand All @@ -78,7 +77,6 @@ const defaultValues: FormValues = {
status: "active",
operational_status: "O",
form: "ro",
mode: "instance",
parent: null,
organizations: [],
availability_status: "available",
Expand Down Expand Up @@ -117,7 +115,6 @@ export default function LocationForm({
status: location.status,
operational_status: location.operational_status,
form: location.form,
mode: location.mode,
parent: parentId || null,
organizations: [],
availability_status: location.availability_status || "available",
Expand Down Expand Up @@ -146,6 +143,8 @@ export default function LocationForm({
function onSubmit(values: FormValues) {
const locationData: LocationWrite = {
...values,
// Mode = instance only for beds
mode: values.form === "bd" ? "instance" : "kind",
description: values.description || "",
organizations: values.organizations,
parent: values.parent || undefined,
Expand Down Expand Up @@ -176,11 +175,6 @@ export default function LocationForm({
{ value: "U", label: "Unoccupied" },
];

const modeOptions = [
{ value: "instance", label: "Instance" },
{ value: "kind", label: "Kind" },
];

if (locationId && isLoading) {
return <div className="p-4">Loading...</div>;
}
Expand Down Expand Up @@ -245,34 +239,6 @@ export default function LocationForm({
)}
/>

<FormField
control={form.control}
name="mode"
render={({ field }) => (
<FormItem>
<FormLabel>{t("mode")}</FormLabel>
<Select
onValueChange={field.onChange}
defaultValue={field.value}
>
<FormControl>
<SelectTrigger>
<SelectValue />
</SelectTrigger>
</FormControl>
<SelectContent>
{modeOptions.map((option) => (
<SelectItem key={option.value} value={option.value}>
{option.label}
</SelectItem>
))}
</SelectContent>
</Select>
<FormMessage />
</FormItem>
)}
/>

<FormField
control={form.control}
name="status"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ export default function FacilityOrganizationIndex({

if (!data?.results?.length) {
return (
<Page title={t("organizations")}>
<Page
title={t("organizations")}
breadcrumbs={false}
hideBack={true}
hideTitleOnPage={true}
>
<div className="flex justify-center md:justify-end mt-2 mb-4">
<CreateFacilityOrganizationSheet facilityId={facilityId} />
</div>
Expand Down
2 changes: 2 additions & 0 deletions vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ export default defineConfig(({ mode }) => {
name: "Care",
short_name: "Care",
background_color: "#ffffff",
theme_color: "#ffffff",
display: "standalone",
icons: [
{
Expand Down Expand Up @@ -286,6 +287,7 @@ export default defineConfig(({ mode }) => {
},
server: {
port: 4000,
host: "0.0.0.0",
},
preview: {
headers: {
Expand Down

0 comments on commit bd81014

Please sign in to comment.