Skip to content
This repository was archived by the owner on May 17, 2021. It is now read-only.

Commit da6e669

Browse files
authored
feat(COMPASS-4530): Increase default max time ms to 1 minute (#179)
* feat(COMPASS-4530): Increase default max time ms to 1 minute and add spaces to the field label * fix: Update assertion for the max time ms * chore(deps): Update query parser dev dependency
1 parent 434ce10 commit da6e669

File tree

6 files changed

+39
-25
lines changed

6 files changed

+39
-25
lines changed

package-lock.json

Lines changed: 26 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
"mongodb-connection-model": "^14.5.1",
120120
"mongodb-data-service": "^16.5.2",
121121
"mongodb-js-precommit": "^2.2.0",
122-
"mongodb-query-parser": "^2.1.1",
122+
"mongodb-query-parser": "^2.2.0",
123123
"mongodb-reflux-store": "^0.0.1",
124124
"mongodb-schema": "^8.2.5",
125125
"ms": "^2.1.2",
@@ -159,4 +159,4 @@
159159
"lodash": "^4.17.15",
160160
"mongodb-query-util": "^0.2.1"
161161
}
162-
}
162+
}

src/components/query-bar/query-bar.jsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ import QUERY_PROPERTIES from 'constants/query-properties';
1818

1919
import styles from './query-bar.less';
2020

21+
/**
22+
* @type {Record<string, { type: 'document' | 'numeric' | 'boolean', placeholder: string | null, link: string, label?: string }>}
23+
*/
2124
const OPTION_DEFINITION = {
2225
filter: {
2326
type: 'document',
@@ -51,8 +54,9 @@ const OPTION_DEFINITION = {
5154
link: 'https://docs.mongodb.com/manual/reference/method/cursor.limit/'
5255
},
5356
maxTimeMS: {
57+
label: 'Max Time MS',
5458
type: 'numeric',
55-
placeholder: '5000',
59+
placeholder: '60000',
5660
link: 'https://docs.mongodb.com/manual/reference/method/cursor.maxTimeMS/'
5761
},
5862
sample: {
@@ -210,9 +214,11 @@ class QueryBar extends Component {
210214
const value = OPTION_DEFINITION[option].type === 'boolean' ?
211215
this.props[option] : this.props[`${option}String`];
212216

217+
const label = OPTION_DEFINITION[option].label || option;
218+
213219
return (
214220
<QueryOption
215-
label={option}
221+
label={label}
216222
autoPopulated={autoPopulated}
217223
serverVersion={this.props.serverVersion}
218224
hasToggle={hasToggle}

src/components/query-option/query-option.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
}
2525

2626
.is-numeric-type {
27-
flex-basis: 170px;
27+
flex-basis: 185px;
2828
}
2929

3030
.is-boolean-type {

src/constants/query-bar-store.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const DEFAULT_SKIP = 0;
1313
const DEFAULT_LIMIT = 0;
1414
const DEFAULT_SAMPLE = false;
1515

16-
const DEFAULT_MAX_TIME_MS = ms('5 seconds');
16+
const DEFAULT_MAX_TIME_MS = ms('1m');
1717
const DEFAULT_SAMPLE_SIZE = 1000;
1818
const DEFAULT_STATE = RESET_STATE;
1919

test/renderer/query-changed-store.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ describe('QueryChangedStore [Store]', function() {
7575
expect(state.project).to.be.deep.equal(null);
7676
expect(state.collation).to.be.deep.equal(null);
7777
expect(state.sample).to.be.false;
78-
expect(state.maxTimeMS).to.be.equal(5000);
78+
expect(state.maxTimeMS).to.be.equal(60000);
7979
done();
8080
});
8181

0 commit comments

Comments
 (0)