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 @@ -89,14 +89,17 @@ export const FilterInputCloudFoundry: React.FC<
FilterInputCloudFoundryProps
> = ({ id, values, onDocumentChanged }) => {
const validationSchema = yup.object().shape({
organizations: yup.array().of(
yup.object().shape({
value: yup
.string()
.min(1, "Organization name must be at least 1 character")
.trim(),
})
),
organizations: yup
.array()
.min(1, "At least one organization is required")
.of(
yup.object().shape({
value: yup
.string()
.min(1, "Organization name must be at least 1 character")
.trim(),
})
),
spaces: yup.array().of(
yup.object().shape({
value: yup.string().min(1, "Space must be at least 1 character").trim(),
Expand Down Expand Up @@ -146,8 +149,8 @@ export const FilterInputCloudFoundry: React.FC<
fieldName="organizations"
addLabel="Add an organization"
removeLabel="Remove this organization"
emptyMessage="No organizations specified"
isRequired={false}
emptyMessage="No organizations specified, at least one is required"
isRequired
/>
</StackItem>

Expand All @@ -160,7 +163,6 @@ export const FilterInputCloudFoundry: React.FC<
addLabel="Add a space"
removeLabel="Remove this space"
emptyMessage="No spaces specified"
isRequired={false}
/>
</StackItem>

Expand All @@ -173,7 +175,6 @@ export const FilterInputCloudFoundry: React.FC<
addLabel="Add a name"
removeLabel="Remove this name"
emptyMessage="No application names specified"
isRequired={false}
/>
</StackItem>
</Stack>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const SUPPORTED_SCHEMA: JsonSchemaObject = {
type: "string",
},
type: "array",
minItems: 1,
},
spaces: {
description: "Space names.",
Expand Down
Loading