mirror of
https://github.com/hex248/sprint.git
synced 2026-02-08 18:33:01 +00:00
added showLabel to org and proj selects
This commit is contained in:
@@ -219,6 +219,7 @@ function Index() {
|
|||||||
onCreateOrganisation={async (organisationId) => {
|
onCreateOrganisation={async (organisationId) => {
|
||||||
await refetchOrganisations({ selectOrganisationId: organisationId });
|
await refetchOrganisations({ selectOrganisationId: organisationId });
|
||||||
}}
|
}}
|
||||||
|
showLabel
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* project selection - only shown when organisation is selected */}
|
{/* project selection - only shown when organisation is selected */}
|
||||||
@@ -238,6 +239,7 @@ function Index() {
|
|||||||
selectProjectId: projectId,
|
selectProjectId: projectId,
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
|
showLabel
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{selectedOrganisation && selectedProject && (
|
{selectedOrganisation && selectedProject && (
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ export function OrganisationSelect({
|
|||||||
onCreateOrganisation,
|
onCreateOrganisation,
|
||||||
placeholder = "Select Organisation",
|
placeholder = "Select Organisation",
|
||||||
contentClass,
|
contentClass,
|
||||||
|
showLabel = false,
|
||||||
|
label = "Organisation",
|
||||||
labelPosition = "top",
|
labelPosition = "top",
|
||||||
}: {
|
}: {
|
||||||
organisations: OrganisationResponse[];
|
organisations: OrganisationResponse[];
|
||||||
@@ -28,6 +30,8 @@ export function OrganisationSelect({
|
|||||||
onCreateOrganisation?: (organisationId: number) => void | Promise<void>;
|
onCreateOrganisation?: (organisationId: number) => void | Promise<void>;
|
||||||
placeholder?: string;
|
placeholder?: string;
|
||||||
contentClass?: string;
|
contentClass?: string;
|
||||||
|
showLabel?: boolean;
|
||||||
|
label?: string;
|
||||||
labelPosition?: "top" | "bottom";
|
labelPosition?: "top" | "bottom";
|
||||||
}) {
|
}) {
|
||||||
const [open, setOpen] = useState(false);
|
const [open, setOpen] = useState(false);
|
||||||
@@ -48,7 +52,7 @@ export function OrganisationSelect({
|
|||||||
<SelectTrigger
|
<SelectTrigger
|
||||||
className="text-sm"
|
className="text-sm"
|
||||||
isOpen={open}
|
isOpen={open}
|
||||||
label="Organisation"
|
label={showLabel ? label : undefined}
|
||||||
hasValue={!!selectedOrganisation}
|
hasValue={!!selectedOrganisation}
|
||||||
labelPosition={labelPosition}
|
labelPosition={labelPosition}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ export function ProjectSelect({
|
|||||||
onSelectedProjectChange,
|
onSelectedProjectChange,
|
||||||
onCreateProject,
|
onCreateProject,
|
||||||
placeholder = "Select Project",
|
placeholder = "Select Project",
|
||||||
|
showLabel = false,
|
||||||
|
label = "Project",
|
||||||
labelPosition = "top",
|
labelPosition = "top",
|
||||||
}: {
|
}: {
|
||||||
projects: ProjectResponse[];
|
projects: ProjectResponse[];
|
||||||
@@ -28,6 +30,8 @@ export function ProjectSelect({
|
|||||||
onSelectedProjectChange: (project: ProjectResponse | null) => void;
|
onSelectedProjectChange: (project: ProjectResponse | null) => void;
|
||||||
onCreateProject?: (projectId: number) => void | Promise<void>;
|
onCreateProject?: (projectId: number) => void | Promise<void>;
|
||||||
placeholder?: string;
|
placeholder?: string;
|
||||||
|
showLabel?: boolean;
|
||||||
|
label?: string;
|
||||||
labelPosition?: "top" | "bottom";
|
labelPosition?: "top" | "bottom";
|
||||||
}) {
|
}) {
|
||||||
const [open, setOpen] = useState(false);
|
const [open, setOpen] = useState(false);
|
||||||
@@ -48,7 +52,7 @@ export function ProjectSelect({
|
|||||||
<SelectTrigger
|
<SelectTrigger
|
||||||
className="text-sm"
|
className="text-sm"
|
||||||
isOpen={open}
|
isOpen={open}
|
||||||
label="Project"
|
label={showLabel ? label : undefined}
|
||||||
hasValue={!!selectedProject}
|
hasValue={!!selectedProject}
|
||||||
labelPosition={labelPosition}
|
labelPosition={labelPosition}
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user