Skip to content
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

Disable the addition of sample data #19

Closed
3 tasks done
Tracked by #1
AlexRuiz7 opened this issue Feb 9, 2023 · 3 comments · Fixed by #23 or #56
Closed
3 tasks done
Tracked by #1

Disable the addition of sample data #19

AlexRuiz7 opened this issue Feb 9, 2023 · 3 comments · Fixed by #23 or #56
Assignees
Labels
level/task Task issue type/enhancement New feature or request

Comments

@AlexRuiz7
Copy link
Member

AlexRuiz7 commented Feb 9, 2023

Description

There is a feature in OpenSearch Dashboards which allows the users and adds sample data in order to create a playground on which to create visualizations and explore the features of the platform.

In the future, we'll probably use this feature to add Wazuh's sample data, replacing this same functionality from the plugin, but until then, we need to disable this feature to avoid confusing the users.

There are several places in the app from which this feature can be accessed, so we'll need to study the best approach to disable this feature globally, being the least intrusive as possible in terms of code changes.

Context

Here's the view:

image

Route: app/home#/tutorial_directory

Places from which this view is reference and/or can be accessed:

  1. Home
    image
  2. Feature directory (link View app directory in Home)
    image
  3. Index pattern (on empty state --> no index patterns)

Additional context: search results for tutorial_directory

17 results - 12 files

wazuh-dashboard/src/plugins/home/public/plugin.ts:
  143        showOnHomePage: true,
  144:       path: `${HOME_APP_BASE_PATH}#/tutorial_directory`,
  145        category: 'data' as FeatureCatalogueCategory.DATA,

wazuh-dashboard/src/plugins/home/public/application/components/welcome.tsx:
  81    private redirecToAddData() {
  82:     const path = this.services.addBasePath('#/tutorial_directory');
  83      window.location.href = path;

wazuh-dashboard/src/plugins/index_pattern_management/public/components/index_pattern_table/empty_state/empty_state.tsx:
  157                  className="inpEmptyState__card"
  158:                 onClick={() => navigateToApp('home', { path: '#/tutorial_directory' })}
  159                  icon={<EuiIcon size="xl" type="database" color="subdued" />}

  177                  className="inpEmptyState__card"
  178:                 onClick={() => navigateToApp('home', { path: '#/tutorial_directory/sampleData' })}
  179                  icon={<EuiIcon size="xl" type="heatmap" color="subdued" />}

wazuh-dashboard/src/plugins/opensearch_dashboards_react/public/overview_page/overview_page_header/overview_page_header.tsx:
  166                        flush="both"
  167:                       href={addBasePath('/app/home#/tutorial_directory')}
  168                        iconType="indexOpen"

wazuh-dashboard/test/accessibility/apps/dashboard_panel.ts:
  40      before(async () => {
  41:       await PageObjects.common.navigateToUrl('home', '/tutorial_directory/sampleData', {
  42          useActualUrl: true,

wazuh-dashboard/test/accessibility/apps/dashboard.ts:
  44      before(async () => {
  45:       await PageObjects.common.navigateToUrl('home', '/tutorial_directory/sampleData', {
  46          useActualUrl: true,

wazuh-dashboard/test/accessibility/apps/filter_panel.ts:
  41      before(async () => {
  42:       await PageObjects.common.navigateToUrl('home', '/tutorial_directory/sampleData', {
  43          useActualUrl: true,

wazuh-dashboard/test/accessibility/apps/home.ts:
  46      it('Add OpenSearch Dashboards sample data page', async () => {
  47:       await PageObjects.common.navigateToUrl('home', '/tutorial_directory/sampleData', {
  48          useActualUrl: true,

wazuh-dashboard/test/accessibility/apps/opensearch_dashboards_overview.ts:
  45      after(async () => {
  46:       await PageObjects.common.navigateToUrl('home', '/tutorial_directory/sampleData', {
  47          useActualUrl: true,

  57      it('Overview view', async () => {
  58:       await PageObjects.common.navigateToUrl('home', '/tutorial_directory/sampleData', {
  59          useActualUrl: true,

wazuh-dashboard/test/functional/apps/home/_add_data.ts:
  39      it('directory should not display registered tutorials', async () => {
  40:       await PageObjects.common.navigateToUrl('home', 'tutorial_directory', { useActualUrl: true });
  41        await PageObjects.header.waitUntilLoadingHasFinished();

wazuh-dashboard/test/functional/apps/home/_sample_data.ts:
   50        ]);
   51:       await PageObjects.common.navigateToUrl('home', '/tutorial_directory/sampleData', {
   52          useActualUrl: true,

  101        beforeEach(async () => {
  102:         await PageObjects.common.navigateToUrl('home', '/tutorial_directory/sampleData', {
  103            useActualUrl: true,

  166        beforeEach(async () => {
  167:         await PageObjects.common.navigateToUrl('home', '/tutorial_directory/sampleData', {
  168            useActualUrl: true,

wazuh-dashboard/test/functional/page_objects/common_page.ts:
  135       * @param appName As defined in the apps config, e.g. 'home'
  136:      * @param subUrl The route after the hash (#), e.g. '/tutorial_directory/sampleData'
  137       * @param args additional arguments

  173       * @param appName As defined in the apps config, e.g. 'home'
  174:      * @param subUrl The route after the appUrl, e.g. '/tutorial_directory/sampleData'
  175       * @param args additional arguments

Tasks

In particular, we'll need to:

  • Hide the component Add sample data, present in several views
    image
  • Adjust the parent views as necessary.
  • Disable some or all of the links listed above.
@AlexRuiz7 AlexRuiz7 mentioned this issue Feb 9, 2023
19 tasks
@yenienserrano yenienserrano self-assigned this Feb 13, 2023
@yenienserrano yenienserrano linked a pull request Feb 14, 2023 that will close this issue
8 tasks
@AlexRuiz7 AlexRuiz7 added this to the Wazuh Dashboard first steps milestone Feb 16, 2023
@gdiazlo gdiazlo added type/enhancement New feature or request level/task Task issue and removed untriaged labels Mar 9, 2023
@AlexRuiz7
Copy link
Member Author

AlexRuiz7 commented Mar 22, 2023

@yenienserrano I found a new way to add sample data: the first time the app is accessed, this component shows up.

We'll need to discuss what to do in this case, probably skip this 'first time' view and go to Home directly.

Screenshot from 2023-03-22 20-01-55

@yenienserrano
Copy link
Member

For this sign to appear in the local storage, the property home:welcome:show does not have to be present.

@AlexRuiz7 AlexRuiz7 changed the title Prevent the addition of sample data Disable the addition of sample data Apr 19, 2023
@yenienserrano yenienserrano linked a pull request Apr 28, 2023 that will close this issue
8 tasks
@yenienserrano yenienserrano reopened this Apr 28, 2023
@yenienserrano
Copy link
Member

Re-opened in #56

See #1 (comment) for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
level/task Task issue type/enhancement New feature or request
Projects
No open projects
Status: Done
3 participants