Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure search.maxLimit #511

Merged
merged 5 commits into from
Feb 20, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -34,7 +34,7 @@ import * as jaegerApiActions from '../../actions/jaeger-api';
import { formatDate, formatTime } from '../../utils/date';
import reduxFormFieldAdapter from '../../utils/redux-form-field-adapter';
import { DEFAULT_OPERATION, DEFAULT_LIMIT, DEFAULT_LOOKBACK } from '../../constants/search-form';

import getConfigValue from '../../utils/config/get-config';
import './SearchForm.css';

const FormItem = Form.Item;
Expand Down Expand Up @@ -443,7 +443,7 @@ export class SearchFormImpl extends React.PureComponent {
type="number"
component={AdaptedInput}
placeholder="Limit Results"
props={{ disabled, min: 1, max: 1500 }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does the default-config below provide defaults per value, or only as a whole configuration?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It takes default per value.
If we configure maxLimit as 500, It will take 500. If the value "maxLimit" isn't configure, it will take the default value, in this case, 1500.
@everett980 could you tell me if I am wrong?
Thank you!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GabrielDyck you are correct. default-config is consumed per value.

props={{ disabled, min: 1, max: getConfigValue('search.maxLimit') }}
/>
</FormItem>

Expand Down
1 change: 1 addition & 0 deletions packages/jaeger-ui/src/constants/default-config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export default deepFreeze(
label: '2 Days',
value: '2d',
},
maxLimit: 1500,
},
tracking: {
gaID: null,
Expand Down
2 changes: 1 addition & 1 deletion packages/jaeger-ui/src/types/config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export type Config = {
deepDependencies?: { menuEnabled?: boolean };
dependencies?: { dagMaxServicesLen?: number; menuEnabled?: boolean };
menu: (ConfigMenuGroup | ConfigMenuItem)[];
search?: { maxLookback: { label: string; value: string } };
search?: { maxLookback: { label: string; value: string }; maxLimit: number };
scripts?: TScript[];
topTagPrefixes?: string[];
tracking?: {
Expand Down