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