Skip to content

Commit 991cd76

Browse files
committed
fix bug today/thiw week to be absolute and not relative
1 parent 1373287 commit 991cd76

3 files changed

Lines changed: 16 additions & 9 deletions

File tree

x-pack/plugins/security_solution/public/common/components/search_bar/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ export const dispatchUpdateSearch = (dispatch: Dispatch) => ({
350350
if (updateTime) {
351351
const fromDate = formatDate(start);
352352
let toDate = formatDate(end, { roundUp: true });
353-
if (isQuickSelection) {
353+
if (isQuickSelection && end !== start) {
354354
dispatch(
355355
inputsActions.setRelativeRangeDatePicker({
356356
id,

x-pack/plugins/security_solution/public/common/components/super_date_picker/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ export const dispatchUpdateReduxTime = (dispatch: Dispatch) => ({
230230
}: UpdateReduxTime): ReturnUpdateReduxTime => {
231231
const fromDate = formatDate(start);
232232
let toDate = formatDate(end, { roundUp: true });
233-
if (isQuickSelection) {
233+
if (isQuickSelection && end !== start) {
234234
dispatch(
235235
inputsActions.setRelativeRangeDatePicker({
236236
id,

x-pack/plugins/security_solution/public/common/store/sourcerer/selectors.ts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,18 +86,25 @@ export const defaultIndexNamesSelector = () => {
8686
return mapStateToProps;
8787
};
8888

89-
const EXLCUDE_ELASTIC_CLOUD_INDEX = '-*elastic-cloud-logs-*';
89+
const EXCLUDE_ELASTIC_CLOUD_INDEX = '-*elastic-cloud-logs-*';
9090
export const getSourcererScopeSelector = () => {
9191
const getScopesSelector = scopesSelector();
9292

93-
const mapStateToProps = (state: State, scopeId: SourcererScopeName): ManageScope => ({
94-
...getScopesSelector(state)[scopeId],
95-
selectedPatterns: getScopesSelector(state)[scopeId].selectedPatterns.some(
93+
const mapStateToProps = (state: State, scopeId: SourcererScopeName): ManageScope => {
94+
const selectedPatterns = getScopesSelector(state)[scopeId].selectedPatterns.some(
9695
(index) => index === 'logs-*'
9796
)
98-
? [...getScopesSelector(state)[scopeId].selectedPatterns, EXLCUDE_ELASTIC_CLOUD_INDEX]
99-
: getScopesSelector(state)[scopeId].selectedPatterns,
100-
});
97+
? [...getScopesSelector(state)[scopeId].selectedPatterns, EXCLUDE_ELASTIC_CLOUD_INDEX]
98+
: getScopesSelector(state)[scopeId].selectedPatterns;
99+
return {
100+
...getScopesSelector(state)[scopeId],
101+
selectedPatterns,
102+
indexPattern: {
103+
...getScopesSelector(state)[scopeId].indexPattern,
104+
title: selectedPatterns.join(),
105+
},
106+
};
107+
};
101108

102109
return mapStateToProps;
103110
};

0 commit comments

Comments
 (0)