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

[Exploratory View] Remove references to Index Pattern in user facing copy #120352

Closed
dominiqueclarke opened this issue Dec 3, 2021 · 3 comments · Fixed by #120353
Closed

[Exploratory View] Remove references to Index Pattern in user facing copy #120352

dominiqueclarke opened this issue Dec 3, 2021 · 3 comments · Fixed by #120353
Assignees
Labels
enhancement New value added to drive a business result Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability v8.0.0 v8.1.0

Comments

@dominiqueclarke
Copy link
Contributor

Exploratory View has 1 reference to "index pattern" in user facing copy. It should be removed in favor of "data view".

The reference can be found here: https://github.com/elastic/kibana/blob/main/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/report_metric_options.tsx#L170

The new copy should be "Unable to create Data View. You don't have the required permission, please contact your admin."

@dominiqueclarke dominiqueclarke added enhancement New value added to drive a business result v8.0.0 Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability v8.1.0 labels Dec 3, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/uptime (Team:uptime)

@lucasfcosta
Copy link
Contributor

@dominiqueclarke could you provide a bit more detail on which permissions you'd expect to trigger this message? I went looking into the code to figure out exactly which permissions are needed and ended up seeing that we actually set the permissions error based on an HttpError within the hook (see below):

// ...

  const loadIndexPattern: IndexPatternContext['loadIndexPattern'] = useCallback(
    async ({ dataType }) => {
      if (typeof hasAppData[dataType] === 'undefined' && !loading[dataType]) {
        setLoading((prevState) => ({ ...prevState, [dataType]: true }));

        try {
          let hasDataT = false;
          let indices: string | undefined = '';
          if (indexPatternsList[dataType]) {
            indices = indexPatternsList[dataType];
            hasDataT = true;
          }
          switch (dataType) {
            case 'ux':
            case 'synthetics':
              const resultUx = await getDataHandler(dataType)?.hasData();
              hasDataT = Boolean(resultUx?.hasData);
              indices = resultUx?.indices;
              break;
            case 'apm':
            case 'mobile':
              const resultApm = await getDataHandler('apm')?.hasData();
              hasDataT = Boolean(resultApm?.hasData);
              indices = resultApm?.indices.transaction;
              break;
          }
          setHasAppData((prevState) => ({ ...prevState, [dataType]: hasDataT }));

          if (hasDataT && indices) {
            const obsvIndexP = new ObservabilityIndexPatterns(data);
            const indPattern = await obsvIndexP.getIndexPattern(dataType, indices);

            setIndexPatterns((prevState) => ({ ...prevState, [dataType]: indPattern }));
          }
          setLoading((prevState) => ({ ...prevState, [dataType]: false }));
        } catch (e) {
          if ((e as HttpFetchError).body.error === 'Forbidden') {
            setIndexPatternErrors((prevState) => ({ ...prevState, [dataType]: e }));
          }
          setLoading((prevState) => ({ ...prevState, [dataType]: false }));
        }
      }
    },
    [data, hasAppData, indexPatternsList, loading]
  );

// ...

Considering the above, which permission would you like me not to have for HttpFetchError to be thrown? Should I simply not give myself permissions to access APM data and try to add mobile series?

Apologies if I'm missing something here, but I was concerned with making sure I'd reproduce the message as you expected given I didn't want to just change the flag for the copy to appear.

@lucasfcosta
Copy link
Contributor

This is waiting on us to actually redo what we were testing. As @dominiqueclarke mentioned yesterday, it seems like we can't test this issue because of other changes upstream.

@dominiqueclarke can you confirm that's accurate? If not, is there anything else we can do to push this forward?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability v8.0.0 v8.1.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants