diff --git a/web-console/src/components/auto-form/auto-form.tsx b/web-console/src/components/auto-form/auto-form.tsx index 67f45923cbe..59561aca1f7 100644 --- a/web-console/src/components/auto-form/auto-form.tsx +++ b/web-console/src/components/auto-form/auto-form.tsx @@ -308,6 +308,11 @@ export class AutoForm> extends React.PureComponent this.fieldChange(field, v); }} placeholder={AutoForm.evaluateFunctor(field.placeholder, model, '')} + intent={ + AutoForm.evaluateFunctor(field.required, model, false) && modelValue == null + ? AutoForm.REQUIRED_INTENT + : undefined + } /> ); } diff --git a/web-console/src/components/interval-input/__snapshots__/interval-input.spec.tsx.snap b/web-console/src/components/interval-input/__snapshots__/interval-input.spec.tsx.snap index 2ff93507b8a..19a16790143 100644 --- a/web-console/src/components/interval-input/__snapshots__/interval-input.spec.tsx.snap +++ b/web-console/src/components/interval-input/__snapshots__/interval-input.spec.tsx.snap @@ -2,7 +2,7 @@ exports[`interval calendar component matches snapshot 1`] = `
{ interval={'2010-01-01/2020-01-01'} placeholder={'2010-01-01/2020-01-01'} onValueChange={() => {}} + intent={Intent.PRIMARY} /> ); const { container } = render(intervalInput); diff --git a/web-console/src/components/interval-input/interval-input.tsx b/web-console/src/components/interval-input/interval-input.tsx index 3f9fa02f73d..b56780e6662 100644 --- a/web-console/src/components/interval-input/interval-input.tsx +++ b/web-console/src/components/interval-input/interval-input.tsx @@ -16,7 +16,7 @@ * limitations under the License. */ -import { Button, InputGroup, Popover, Position } from '@blueprintjs/core'; +import { Button, InputGroup, Intent, Popover, Position } from '@blueprintjs/core'; import { DateRange, DateRangePicker } from '@blueprintjs/datetime'; import { IconNames } from '@blueprintjs/icons'; import React from 'react'; @@ -66,10 +66,11 @@ export interface IntervalInputProps { interval: string; placeholder: string | undefined; onValueChange: (interval: string) => void; + intent?: Intent; } export const IntervalInput = React.memo(function IntervalInput(props: IntervalInputProps) { - const { interval, placeholder, onValueChange } = props; + const { interval, placeholder, onValueChange, intent } = props; return ( ); });