opensearch-project / OpenSearch-Dashboards

📊 Open source visualization dashboards for OpenSearch.
https://opensearch.org/docs/latest/dashboards/index/
Apache License 2.0
1.64k stars 855 forks source link

Replace `jquery` usage in `vis_type_vega` plugin with native methods #3683

Open joshuarrrr opened 1 year ago

joshuarrrr commented 1 year ago

Prioritize runtime code first, then tests

Imported in:

src/plugins/vis_type_vega/public/vega_visualization.test.js:
  28   * under the License.
  29   */
  30  
  31: import $ from 'jquery';
  32  
  33  import 'leaflet/dist/leaflet.js';
  34  import 'leaflet-vega';

src/plugins/vis_type_vega/public/data_model/url_parser.ts:
  28   * under the License.
  29   */
  30  
  31: import $ from 'jquery';
  32  import { i18n } from '@osd/i18n';
  33  import { UrlObject } from './types';
  34  

src/plugins/vis_type_vega/public/vega_view/vega_base_view.js:
   28   * under the License.
   29   */
   30  
   31: import $ from 'jquery';
   32  import moment from 'moment';
   33  import dateMath from '@elastic/datemath';
   34  import { vega, vegaLite, vegaExpressionInterpreter } from '../lib/vega';

  246  
  247    updateVegaSize(view) {
  248      // For some reason the object is slightly scrollable without the extra padding.
  249:     // This might be due to https://github.com/jquery/jquery/issues/3808
  250      // Which is being fixed as part of jQuery 3.3.0
  251      const heightExtraPadding = 6;
  252      const width = Math.max(0, this._$container.width());
BaurArabov commented 1 year ago

Greetings! I'm interested in working on this issue and I'd like to take on the challenge.

Aigerim-ai commented 1 year ago

Hi! I have a question, which file we use to test OpenSearch-Dashboards/src/plugins/vis_type_vega/public/data_model/url_parser.ts ?

BaurArabov commented 1 year ago

Hello, Aigerim, i'm still working on this issue

Aigerim-ai commented 1 year ago

Thank you for taking this issue, Do you want to team up with me? I have figured out solution, for the second and third(url_parser.ts, vega_base_view.js),can we can merge our solutions and make PR if you have done with first? But I need to make some testing first

CMDWillYang commented 10 months ago

@joshuarrrr I'd love to look at this.