-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TSVB] Introducing Timerange Data Mode for Metric Style Visualizations (
#37185) * Add Time Range input to Panel on TSVB * Disable YesNo Component * Remove redundant translations * add timerange_data_modes * Fix reviews * BE part * add new ui restriction * add new ui restriction - ui part * override index pattern issue * Take TIME_RANGE_MODE_KEY out * Make TimeRange more stable * Small improvements * Small improvements - BE part * Small improvements - BE part * Small improvements - BE part * Bind uiRestrictions to UI of the Time Range * Get rid of context consumers * Remove console.log * Add translation and refactor a little * Pretty Panel config
- Loading branch information
1 parent
ade8a2f
commit eeb92b4
Showing
20 changed files
with
564 additions
and
147 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
src/legacy/core_plugins/metrics/common/timerange_data_modes.js
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
/** | ||
* Time Range data modes. | ||
* @constant | ||
* @public | ||
*/ | ||
export const TIME_RANGE_DATA_MODES = { | ||
/** | ||
* Entire timerange mode will match all the documents selected in the | ||
* timerange timepicker | ||
*/ | ||
ENTIRE_TIME_RANGE: 'entire_time_range', | ||
|
||
/** | ||
* Last value mode will match only the documents for the specified interval | ||
* from the end of the timerange. | ||
*/ | ||
LAST_VALUE: 'last_value', | ||
}; | ||
|
||
/** | ||
* Key for getting the Time Range mode from the Panel configuration object. | ||
* @constant | ||
* @public | ||
*/ | ||
export const TIME_RANGE_MODE_KEY = 'time_range_mode'; |
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
/** | ||
* UI Restrictions keys | ||
* @constant | ||
* @public | ||
*/ | ||
export const RESTRICTIONS_KEYS = { | ||
/** | ||
* Key for getting the white listed group by fields from the UIRestrictions object. | ||
*/ | ||
WHITE_LISTED_GROUP_BY_FIELDS: 'whiteListedGroupByFields', | ||
|
||
/** | ||
* Key for getting the white listed metrics from the UIRestrictions object. | ||
*/ | ||
WHITE_LISTED_METRICS: 'whiteListedMetrics', | ||
|
||
/** | ||
* Key for getting the white listed Time Range modes from the UIRestrictions object. | ||
*/ | ||
WHITE_LISTED_TIMERANGE_MODES: 'whiteListedTimerangeModes', | ||
}; | ||
|
||
/** | ||
* Default value for the UIRestriction | ||
* @constant | ||
* @public | ||
*/ | ||
export const DEFAULT_UI_RESTRICTION = { | ||
'*': true, | ||
}; |
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
Oops, something went wrong.