Skip to content

[Backport 2.x]Add extension point in saved object management to register namespaces and show filter (#2656) #2690

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

zhongnansu
Copy link
Member

@zhongnansu zhongnansu commented Oct 28, 2022

Backport 8ac127a from #2656

Description

[Describe what this change achieves]

Issues Resolved

[List any issues this PR will resolve]

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
    • yarn test:ftr
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

@zhongnansu zhongnansu requested a review from a team as a code owner October 28, 2022 20:44
@zhongnansu zhongnansu force-pushed the backport/backport-2656-to-2.x branch from 06887f9 to adda363 Compare October 28, 2022 20:46
@zhongnansu zhongnansu added the v2.4.0 'Issues and PRs related to version v2.4.0' label Oct 28, 2022
@cliu123
Copy link
Member

cliu123 commented Oct 31, 2022

@zhongnansu / @opensearch-project/opensearch-dashboards-core The test failures do not look related to the changes. Would you please re-run the failed jobs?
Integration test failure:

FAIL  packages/osd-config-schema/src/errors/schema_error.test.ts
  ● includes stack

    expect(received).toMatchSnapshot()

    Snapshot name: `includes stack 1`

    - Snapshot  - 1
    + Received  + 1

      Error: test
          at new SchemaError (packages/osd-config-schema/src/errors/schema_error.ts:35:5)
    -     at Object.<anonymous> (packages/osd-config-schema/src/errors/schema_error.test.ts:61:11)
    +     at Object.<anonymous> (packages/osd-config-schema/src/errors/schema_error.test.ts:59:11)
          at new Promise (<anonymous>)

      59 |     throw new SchemaError('test');
      60 |   } catch (e) {
    > 61 |     expect(cleanStack(e.stack)).toMatchSnapshot();
         |                                 ^
      62 |   }
      63 | });
      64 |

      at Object.<anonymous> (packages/osd-config-schema/src/errors/schema_error.test.ts:61:33)

BWC test failures:

2 failing

  1) check previously loaded data
       eCommerce Revenue Dashboard should function properly
         If set filter for gender, [eCommerce] Sales by Gender should show one gender:
     AssertionError: Timed out retrying after 60000ms: Expected to find element: `[class="label-text"]`, but never found it. Queried from element: <div.visualize.panel-content.panel-content--fullWidth>
      at Context.eval (http://localhost:5601/__cypress/tests?p=cypress/integration/without-security/check_loaded_data.js:154:89)

  2) check previously loaded data
       eCommerce Revenue Dashboard should function properly
         If filter out Women's Clothing, [eCommerce] Sales by Category should not show this category:
     AssertionError: Timed out retrying after 60000ms: Expected to find element: `[data-label="Men's Clothing"]`, but never found it. Queried from element: <div.visualize.panel-content.panel-content--fullWidth>
      at Context.eval (http://localhost:5601/__cypress/tests?p=cypress/integration/without-security/check_loaded_data.js:159:55)

… and show filter (opensearch-project#2656)

* Create filter registry for saved object management to make filters extensible

Signed-off-by: Craig Perkins <[email protected]>

* WIP on making fetchCounts generic

Signed-off-by: Craig Perkins <[email protected]>

* First step at making scroll_counts generic

Signed-off-by: Craig Perkins <[email protected]>

* Work on getting other filter counts with same object count endpoint

Signed-off-by: Craig Perkins <[email protected]>

* Get tenant count options to display

Signed-off-by: Craig Perkins <[email protected]>

* Extend find to work with namespaces for saved objects

Signed-off-by: Craig Perkins <[email protected]>

* Add missing filterFields

Signed-off-by: Craig Perkins <[email protected]>

* Update jest tests

Signed-off-by: Craig Perkins <[email protected]>

* Update saved_objects_table snapshot

Signed-off-by: Craig Perkins <[email protected]>

* Append index to id to make unique

Signed-off-by: Craig Perkins <[email protected]>

* Add semi-colon

Signed-off-by: Craig Perkins <[email protected]>

* Fix saved objects table tests with new id scheme

Signed-off-by: Craig Perkins <[email protected]>

* Only append idx on config type to ensure Advanced Settings have a unique id across tenants

Signed-off-by: Craig Perkins <[email protected]>

* Remove itemsClone in favor of showing only Advanced Settings of current tenant

Signed-off-by: Craig Perkins <[email protected]>

* Revert snapshots in table.test.tsx

Signed-off-by: Craig Perkins <[email protected]>

* Add additional parse_query test

Signed-off-by: Craig Perkins <[email protected]>

* Add comma

Signed-off-by: Craig Perkins <[email protected]>

* Create namespaceRegistry to decouple security dashboards plugin and osd core

Signed-off-by: Craig Perkins <[email protected]>

* Add ability to register an alias

Signed-off-by: Craig Perkins <[email protected]>

* Update parse query and add to CHANGELOG

Signed-off-by: Craig Perkins <[email protected]>

* Remove commented out code

Signed-off-by: Craig Perkins <[email protected]>

* Address code review comments

Signed-off-by: Craig Perkins <[email protected]>

* Override i18n if alias is regitered

Signed-off-by: Craig Perkins <[email protected]>

Signed-off-by: Craig Perkins <[email protected]>
(cherry picked from commit 8ac127a)
Signed-off-by: Su <[email protected]>
@zhongnansu zhongnansu force-pushed the backport/backport-2656-to-2.x branch from adda363 to ce3e235 Compare October 31, 2022 17:05
@joshuarrrr
Copy link
Member

I don't think the DCO failure is valid.

@AMoo-Miki AMoo-Miki merged commit 363c623 into opensearch-project:2.x Oct 31, 2022
@ashwin-pc ashwin-pc changed the title [Backport 2.x]Add extension point in saved object management to register namespaces… [Backport 2.x]Add extension point in saved object management to register namespaces and show filter (#2656) Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v2.4.0 'Issues and PRs related to version v2.4.0'
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants