elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.71k stars 8.12k forks source link

[Shared UX] No data card messaging is confusing #151903

Open jasonrhodes opened 1 year ago

jasonrhodes commented 1 year ago

Summary

When there is "no data" in a solution UI and (a) Fleet is disabled, or (b) the currently logged in user/space/role doesn't have permission to access Fleet, the resulting messaging makes it seem like the solution is disabled, when the message intends to say that Fleet/integations UI are not available.

Screenshot 2023-02-22 at 9 54 44 AM

Details

When using the shared KibanaPageTemplate and its associated components, there is a flow for providing so-called noDataConfig to tell the page template that no data has been found. Here is an example of this in the Logs app inside of the infra plugin.

const noDataConfig: NoDataConfig | undefined = hasData
  ? undefined
  : {
      solution: i18n.translate('xpack.infra.logs.noDataConfig.solutionName', {
        defaultMessage: 'Observability',
      }),
      action: {
        beats: {
          title: i18n.translate('xpack.infra.logs.noDataConfig.beatsCard.title', {
            defaultMessage: 'Add a logging integration',
          }),
          description: i18n.translate('xpack.infra.logs.noDataConfig.beatsCard.description', {
            defaultMessage:
              'Use the Elastic Agent or Beats to send logs to Elasticsearch. We make it easy with integrations for many popular systems and apps.',
          }),
          href: basePath + `/app/integrations/browse`,
        },
      },
      docsLink: docLinks.links.observability.guide,
    };

return (
  <PageTemplate
    data-test-subj={hasData ? _dataTestSubj : 'noDataPage'}
    noDataConfig={noDataConfig}
    isPageDataLoaded={isDataLoading === false}
    {...pageTemplateProps}
  />
);

When that noDataConfig prop is present (i.e. NOT undefined), it triggers a NoDataPage component in the shared UX world.

  1. https://github.com/elastic/kibana/blob/main/packages/shared-ux/page/kibana_template/impl/src/page_template.tsx#L30-L39
  2. https://github.com/elastic/kibana/blob/main/packages/shared-ux/page/no_data_config/impl/src/no_data_config_page.tsx#L56
  3. https://github.com/elastic/kibana/blob/main/packages/shared-ux/page/no_data_config/impl/src/no_data_config_page.tsx#L56

The NoDataPage uses a component called the ActionCard (link), which appears to be an abstraction around the NoDataCard (link). The NoDataCard component checks if the current user has access to Fleet (including whether Fleet is enabled at all) and, if not, defaults to a hard-coded "No permission description" which says "This integration is not yet enabled. Your administrator has the required permissions to turn it on."

What all of this means is that in a case where Fleet is disabled or the currently logged in user/role/space doesn't have access to Fleet, navigating to an observability page such as the Logs UI when there are no logs data in the configured indices, the experience looks like this:

Screenshot 2023-02-22 at 9 54 44 AM

Normally, when there are no logs in the configured indices, the experience would look like this:

Screenshot 2023-02-22 at 9 58 00 AM

The wording is confusing because "This integration is not yet enabled" sounds as though the Logs UI is not yet enabled, which isn't true. In addition, for a user who doesn't intend to use Fleet/Integrations or where Fleet is unavailable, this message is inaccurate.

Potential fixes?

  1. Change the hard-coded message that is used when the user has been determined to not have access to Fleet
  2. Allow noDataConfig to specify a message for this scenario
elasticmachine commented 1 year ago

Pinging @elastic/appex-sharedux (Team:SharedUX)