diff --git a/packages/jaeger-ui/src/components/SearchTracePage/SearchForm.js b/packages/jaeger-ui/src/components/SearchTracePage/SearchForm.js
index 5db0e88b80..57657f48a6 100644
--- a/packages/jaeger-ui/src/components/SearchTracePage/SearchForm.js
+++ b/packages/jaeger-ui/src/components/SearchTracePage/SearchForm.js
@@ -38,9 +38,13 @@ import './SearchForm.css';
const FormItem = Form.Item;
const Option = Select.Option;
-const AdaptedInput = reduxFormFieldAdapter(Input);
-const AdaptedSelect = reduxFormFieldAdapter(Select);
-const AdaptedVirtualSelect = reduxFormFieldAdapter(VirtSelect, option => (option ? option.value : null));
+const AdaptedInput = reduxFormFieldAdapter({ AntInputComponent: Input });
+const AdaptedSelect = reduxFormFieldAdapter({ AntInputComponent: Select });
+const AdaptedVirtualSelect = reduxFormFieldAdapter({
+ AntInputComponent: VirtSelect,
+ onChangeAdapter: option => (option ? option.value : null),
+});
+const ValidatedAdaptedInput = reduxFormFieldAdapter({ AntInputComponent: Input, isValidatedInput: true });
export function getUnixTimeStampInMSFromForm({ startDate, startDateTime, endDate, endDateTime }) {
const start = `${startDate} ${startDateTime}`;
@@ -74,6 +78,17 @@ export function traceIDsToQuery(traceIDs) {
return traceIDs.split(',');
}
+export const placeholderDurationFields = 'e.g. 1.2s, 100ms, 500us';
+export function validateDurationFields(value) {
+ if (!value) return undefined;
+ return /\d[\d\\.]*(us|ms|s|m|h)$/.test(value)
+ ? undefined
+ : {
+ content: `Please enter a number followed by a duration unit, ${placeholderDurationFields}`,
+ title: 'Please match the requested format.',
+ };
+}
+
export function convertQueryParamsToFormDates({ start, end }) {
let queryStartDate;
let queryStartDateTime;
@@ -155,6 +170,7 @@ export class SearchFormImpl extends React.PureComponent {
render() {
const {
handleSubmit,
+ invalid,
selectedLookback,
selectedService = '-',
services,
@@ -322,14 +338,21 @@ export class SearchFormImpl extends React.PureComponent {
-
+
@@ -342,7 +365,11 @@ export class SearchFormImpl extends React.PureComponent {
/>
-