From 0b54e843107b9c75cf142711347e288d86310f26 Mon Sep 17 00:00:00 2001 From: Matt Provost Date: Mon, 26 Jun 2023 09:33:05 -0700 Subject: [PATCH 1/3] Refactor hardcode color to use OUI in `maps_legacy` (#4294) * Refactor color to use OUI * Pull theme value from actual active theme * Update changelog --------- Signed-off-by: Matt Provost Signed-off-by: Josh Romero Co-authored-by: Anan Zhuang Co-authored-by: Josh Romero --- CHANGELOG.md | 5 +++-- .../maps_legacy/public/map/opensearch_dashboards_map.js | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e17268e160..f3dd8b7fd11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,8 +60,9 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Remove unused Sass in `tile_map` plugin ([#4110](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4110)) - [Table Visualization] Remove custom styling for text-align:center in favor of OUI utility class. ([#4164](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4164)) - Replace the use of `bluebird` in `saved_objects` plugin ([#4026](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4026)) -- [Vis Colors] Update default color in TSVB to use `ouiPaletteColorBlind()[0]`([#4363](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4363)) -- [Vis Colors] Replace vis_type_timeline colors with `ouiPaletteColorBlind()` ([#4366](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4366)) +- [Vis Colors] [Maps] Replace hardcoded color to OUI color in `maps_legacy` plugin ([#4294](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4294)) +- [Vis Colors] [TSVB] Update default color in `vis_type_timeseries` to use `ouiPaletteColorBlind()[0]`([#4363](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4363)) +- [Vis Colors] [Timeline] Replace `vis_type_timeline` colors with `ouiPaletteColorBlind()` ([#4366](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4366)) ### 🔩 Tests diff --git a/src/plugins/maps_legacy/public/map/opensearch_dashboards_map.js b/src/plugins/maps_legacy/public/map/opensearch_dashboards_map.js index 3ca067c2779..6f4af0e47c1 100644 --- a/src/plugins/maps_legacy/public/map/opensearch_dashboards_map.js +++ b/src/plugins/maps_legacy/public/map/opensearch_dashboards_map.js @@ -41,6 +41,7 @@ import { i18n } from '@osd/i18n'; import { ORIGIN } from '../common/constants/origin'; import { getToasts } from '../opensearch_dashboards_services'; import { L } from '../leaflet'; +import { euiThemeVars } from '@osd/ui-shared-deps/theme'; function makeFitControl(fitContainer, opensearchDashboardsMap) { // eslint-disable-next-line no-undef @@ -474,7 +475,7 @@ export class OpenSearchDashboardsMap extends EventEmitter { } addDrawControl() { - const drawColor = '#000'; + const drawColor = euiThemeVars.euiColorInk; const drawOptions = { draw: { polyline: false, From fc4e696b0c32f71c886ea307038cbb6842389f7b Mon Sep 17 00:00:00 2001 From: Josh Romero Date: Mon, 26 Jun 2023 10:19:24 -0700 Subject: [PATCH 2/3] Remove broken flot documentation link for Ruby API (#4384) * Remove broken documentation link for Ruby API https://apidock.com/ruby/Time/to_i is currently down for maintenance But we don't need this link anyway, because it's talking about standard methods. And we plan to deprecate flot_charts altogether: https://github.com/opensearch-project/OpenSearch-Dashboards/issues/4267 Signed-off-by: Josh Romero * remove leftover link brackets Signed-off-by: Josh Romero --------- Signed-off-by: Josh Romero --- .../osd-ui-shared-deps/flot_charts/API.md | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/packages/osd-ui-shared-deps/flot_charts/API.md b/packages/osd-ui-shared-deps/flot_charts/API.md index 699e2500f49..4fd076f1ac2 100644 --- a/packages/osd-ui-shared-deps/flot_charts/API.md +++ b/packages/osd-ui-shared-deps/flot_charts/API.md @@ -167,7 +167,7 @@ var options = { points: { show: true } } }; - + $.plot(placeholder, data, options); ``` @@ -254,10 +254,10 @@ xaxis, yaxis: { min: null or number max: null or number autoscaleMargin: null or number - + transform: null or fn: number -> number inverseTransform: null or fn: number -> number - + ticks: null or number or ticks array or (fn: axis -> ticks array) tickSize: number or array minTickSize: number or array @@ -267,7 +267,7 @@ xaxis, yaxis: { labelWidth: null or number labelHeight: null or number reserveSpace: null or true - + tickLength: null or number alignTicksWithAxis: null or number @@ -415,7 +415,7 @@ ticks: [[0, "zero"], [1.2, "one mark"], [2.4, "two marks"]] ``` You can mix the two if you like. - + For extra flexibility you can specify a function as the "ticks" parameter. The function will be called with an object with the axis min and max and should return a ticks array. Here's a simplistic tick @@ -575,7 +575,7 @@ In Python you can get it with something like: calendar.timegm(datetime_object.timetuple()) * 1000 ``` In Ruby you can get it using the `#to_i` method on the -[`Time`](http://apidock.com/ruby/Time/to_i) object. If you're using the +`Time` object. If you're using the `active_support` gem (default for Ruby on Rails applications) `#to_i` is also available on the `DateTime` and `ActiveSupport::TimeWithZone` objects. You simply need to multiply the result by 1000: @@ -765,7 +765,7 @@ The options inside "series: {}" are copied to each of the series. So you can specify that all series should have bars by putting it in the global options, or override it for individual series by specifying bars in a particular the series object in the array of data. - + The most important options are "lines", "points" and "bars" that specify whether and how lines, points and bars should be shown for each data series. In case you don't specify anything at all, Flot will @@ -801,8 +801,8 @@ the y axis if "horizontal" is true), contrary to most other measures that are specified in pixels. For instance, for time series the unit is milliseconds so 24 * 60 * 60 * 1000 produces bars with the width of a day. "align" specifies whether a bar should be left-aligned -(default), right-aligned or centered on top of the value it represents. -When "horizontal" is on, the bars are drawn horizontally, i.e. from the +(default), right-aligned or centered on top of the value it represents. +When "horizontal" is on, the bars are drawn horizontally, i.e. from the y axis instead of the x axis; note that the bar end points are still defined in the same way so you'll probably want to swap the coordinates if you've been plotting vertical bars first. @@ -1004,7 +1004,7 @@ item: { } ``` -For instance, if you have specified the data like this +For instance, if you have specified the data like this ```js $.plot($("#placeholder"), [ { label: "Foo", data: [[0, 10], [7, 3]] } ], ...); @@ -1155,7 +1155,7 @@ can call: Returns the calculated offset of the data point at (x, y) in data space within the placeholder div. If you are working with multiple - axes, you can specify the x and y axis references, e.g. + axes, you can specify the x and y axis references, e.g. ```js o = pointOffset({ x: xpos, y: ypos, xaxis: 2, yaxis: 3 }) @@ -1215,8 +1215,8 @@ Flot to keep track of its state, so be careful. With multiple axes, the extra axes are returned as x2axis, x3axis, etc., e.g. getAxes().y2axis is the second y axis. You can check y2axis.used to see whether the axis is associated with any data - points and y2axis.show to see if it is currently shown. - + points and y2axis.show to see if it is currently shown. + - getPlaceholder() Returns placeholder that the plot was put into. This can be useful @@ -1226,7 +1226,7 @@ Flot to keep track of its state, so be careful. Returns the canvas used for drawing in case you need to hack on it yourself. You'll probably need to get the plot offset too. - + - getPlotOffset() Gets the offset that the grid has within the canvas as an object @@ -1242,7 +1242,7 @@ Flot to keep track of its state, so be careful. if you modify the values in here, Flot will use the new values. If you change something, you probably have to call draw() or setupGrid() or triggerRedrawOverlay() to see the change. - + ## Hooks ## @@ -1254,7 +1254,7 @@ gets access to the internal data structures in Flot. Here's an overview of the phases Flot goes through: 1. Plugin initialization, parsing options - + 2. Constructing the canvases used for drawing 3. Set data: parsing data specification, calculating colors, @@ -1270,7 +1270,7 @@ Here's an overview of the phases Flot goes through: 7. Responding to events, if any - 8. Shutdown: this mostly happens in case a plot is overwritten + 8. Shutdown: this mostly happens in case a plot is overwritten Each hook is simply a function which is put in the appropriate array. You can add them through the "hooks" option, and they are also available @@ -1295,22 +1295,22 @@ hooks in the plugins bundled with Flot. - processOptions [phase 1] ```function(plot, options)``` - + Called after Flot has parsed and merged options. Useful in the instance where customizations beyond simple merging of default values is needed. A plugin might use it to detect that it has been enabled and then turn on or off other options. - + - processRawData [phase 3] ```function(plot, series, data, datapoints)``` - + Called before Flot copies and normalizes the raw data for the given series. If the function fills in datapoints.points with normalized points and sets datapoints.pointsize to the size of the points, Flot will skip the copying/normalization step for this series. - + In any case, you might be interested in setting datapoints.format, an array of objects for specifying how a point is normalized and how it interferes with axis scaling. It accepts the following options: @@ -1430,7 +1430,7 @@ hooks in the plugins bundled with Flot. state by drawing something (add a drawOverlay hook and call triggerRedrawOverlay) or firing an externally visible event for user code. See the crosshair plugin for an example. - + Currently, eventHolder actually contains both the static canvas used for the plot itself and the overlay canvas used for interactive features because some versions of IE get the stacking @@ -1469,7 +1469,7 @@ hooks in the plugins bundled with Flot. add a callback to clean up after you. Take a look at the section in the [PLUGINS](PLUGINS.md) document for more info. - + ## Plugins ## Plugins extend the functionality of Flot. To use a plugin, simply From 6cee1a97c25b9d40ea95a5e5488ec6660d611332 Mon Sep 17 00:00:00 2001 From: Sergey Myssak Date: Tue, 27 Jun 2023 00:39:53 +0600 Subject: [PATCH 3/3] [CCI] Fix relationships header overflow (#4070) * Fix relationships header overflow (#3967) Co-authored-by: Andrey Myssak Signed-off-by: Sergey Myssak * Replace relationships css file with oui classname (#3967) Co-authored-by: Andrey Myssak Signed-off-by: Sergey Myssak * Make title overflow wrap instead of truncation (#3967) Co-authored-by: Andrey Myssak Signed-off-by: Sergey Myssak * Remove icon from flyout header and wrap title Signed-off-by: Josh Romero --------- Signed-off-by: Sergey Myssak Signed-off-by: Josh Romero Co-authored-by: Andrey Myssak Co-authored-by: Josh Romero --- CHANGELOG.md | 1 + .../__snapshots__/relationships.test.tsx.snap | 130 ++---------------- .../components/relationships.tsx | 14 +- 3 files changed, 13 insertions(+), 132 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f3dd8b7fd11..8f001e85918 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - [Chore] Update deprecated url methods (url.parse(), url.format()) ([#2910](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2910)) - Cleanup unused url ([#3847](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3847)) +- [Saved Objects Management] Fix relationships header overflow ([#4070](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4070)) ### 🚞 Infrastructure diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/relationships.test.tsx.snap b/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/relationships.test.tsx.snap index b4842f28913..293b8c2e30d 100644 --- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/relationships.test.tsx.snap +++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/relationships.test.tsx.snap @@ -8,21 +8,10 @@ exports[`Relationships from legacy app should render dashboards normally 1`] = ` hasBorder={true} >

- - - -    MyDashboard

@@ -167,21 +156,10 @@ exports[`Relationships from legacy app should render errors 1`] = ` hasBorder={true} >

- - - -    MyDashboard

@@ -211,21 +189,10 @@ exports[`Relationships from legacy app should render index patterns normally 1`] hasBorder={true} >

- - - -    MyIndexPattern*

@@ -375,21 +342,10 @@ exports[`Relationships from legacy app should render searches normally 1`] = ` hasBorder={true} >

- - - -    MySearch

@@ -539,21 +495,10 @@ exports[`Relationships from legacy app should render visualizations normally 1`] hasBorder={true} >

- - - -    MyViz

@@ -698,21 +643,10 @@ exports[`Relationships should render dashboards normally 1`] = ` hasBorder={true} >

- - - -    MyDashboard

@@ -857,21 +791,10 @@ exports[`Relationships should render errors 1`] = ` hasBorder={true} >

- - - -    MyDashboard

@@ -901,21 +824,10 @@ exports[`Relationships should render index patterns normally 1`] = ` hasBorder={true} >

- - - -    MyIndexPattern*

@@ -1065,21 +977,10 @@ exports[`Relationships should render searches normally 1`] = ` hasBorder={true} >

- - - -    MySearch

@@ -1229,21 +1130,10 @@ exports[`Relationships should render visualizations normally 1`] = ` hasBorder={true} >

- - - -    MyViz

diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/relationships.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/components/relationships.tsx index ff42351d83a..68e1ffec8e3 100644 --- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/relationships.tsx +++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/relationships.tsx @@ -336,18 +336,8 @@ export class Relationships extends Component - -

- - - -    - {savedObject.meta.title || getDefaultTitle(savedObject)} -

+ +

{savedObject.meta.title || getDefaultTitle(savedObject)}