-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from metrico/revert-50-alexey-log-label-filters
Revert "Alexey log label filters"
- Loading branch information
Showing
14 changed files
with
27 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
const setLabelValues = (labelValues) => (dispatch) => { | ||
export default (labelValues) => (dispatch) => { | ||
dispatch({ | ||
type: 'SET_LABEL_VALUES', | ||
labelValues | ||
}); | ||
} | ||
export default setLabelValues; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
export const setLabels = (labels) => (dispatch) => { | ||
export default (labels) => (dispatch) => { | ||
dispatch({ | ||
type: 'SET_LABELS', | ||
labels: labels | ||
}); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,19 @@ | ||
import { setQuery } from "../../../actions"; | ||
import store from "../../../store/store"; | ||
|
||
export function queryBuilder(labels) { | ||
const selectedLabels = []; | ||
for (const label of labels) { | ||
if (label.selected && label.values && label.values.length > 0) { | ||
const selectedValues = label.values | ||
.filter((value) => value.selected && !value.inverted) | ||
.filter((value) => value.selected) | ||
.map((value) => value.name); | ||
const invertedSelectedValues = label.values | ||
.filter((value) => value.selected && value.inverted) | ||
.map((value) => value.name); | ||
|
||
if (selectedValues.length > 1) { | ||
selectedLabels.push( | ||
`${label.name}=~"${selectedValues.join("|")}"` | ||
); | ||
} else if (selectedValues.length === 1) { | ||
selectedLabels.push(`${label.name}="${selectedValues[0]}"`); | ||
} | ||
invertedSelectedValues.forEach(value => { | ||
selectedLabels.push(`${label.name}!="${value}"`) | ||
}); | ||
|
||
} | ||
} | ||
return ["{", selectedLabels.join(","), "}"].join(""); | ||
} | ||
export function queryBuilderWithLabels() { | ||
const labels = store.getState().labels; | ||
console.log(labels) | ||
const query = queryBuilder(labels) | ||
store.dispatch(setQuery(query)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters