Skip to content

Commit

Permalink
Updates the links to Logs Explorer and Discover in the Data Set detai…
Browse files Browse the repository at this point in the history
…ls page (elastic#201916)

Updates the links to Logs Explorer and Discover in the Data Set details
page:
- Removes the link from the degraded docs chart action popup
- Update the link which is next to the field selector in the degraded
docs chart to include the breakdown field when navigating to Logs
Explorer or Discover

### Before

https://github.com/user-attachments/assets/3586c22e-64e5-40c3-9b5e-f729c19a6816

### After

https://github.com/user-attachments/assets/fe53b5a2-b986-4343-8773-75e97c0fbc43

Closes elastic#198856

(cherry picked from commit b680557)
  • Loading branch information
gbamparop committed Nov 29, 2024
1 parent 7c0c54f commit fb0590e
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 75 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export default function DegradedDocs({ lastReloadTime }: { lastReloadTime: numbe
dataStreamStat: datasetDetails,
timeRangeConfig: timeRange,
query: { language: 'kuery', query: `${_IGNORED}: *` },
breakdownField: breakdownDataViewField?.name,
sendTelemetry,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,12 @@ import { useCreateDataView } from './use_create_dataview';
import { useKibanaContextForPlugin } from '../utils';
import { useDatasetQualityDetailsState } from './use_dataset_quality_details_state';
import { getLensAttributes } from '../components/dataset_quality_details/overview/document_trends/degraded_docs/lens_attributes';
import { useRedirectLink } from './use_redirect_link';
import { useDatasetDetailsTelemetry } from './use_dataset_details_telemetry';
import { useDatasetDetailsRedirectLinkTelemetry } from './use_redirect_link_telemetry';

const exploreDataInLogsExplorerText = i18n.translate(
'xpack.datasetQuality.details.chartExploreDataInLogsExplorerText',
{
defaultMessage: 'Explore data in Logs Explorer',
}
);

const exploreDataInDiscoverText = i18n.translate(
'xpack.datasetQuality.details.chartExploreDataInDiscoverText',
{
defaultMessage: 'Explore data in Discover',
}
);

const openInLensText = i18n.translate('xpack.datasetQuality.details.chartOpenInLensText', {
defaultMessage: 'Open in Lens',
});

const ACTION_EXPLORE_IN_LOGS_EXPLORER = 'ACTION_EXPLORE_IN_LOGS_EXPLORER';
const ACTION_OPEN_IN_LENS = 'ACTION_OPEN_IN_LENS';

export const useDegradedDocsChart = () => {
Expand Down Expand Up @@ -154,45 +137,7 @@ export const useDegradedDocsChart = () => {
};
}, [openInLensCallback]);

const { sendTelemetry } = useDatasetDetailsRedirectLinkTelemetry({
query: { language: 'kuery', query: '_ignored:*' },
navigationSource: navigationSources.Chart,
});

const redirectLinkProps = useRedirectLink({
dataStreamStat: datasetDetails,
query: { language: 'kuery', query: '_ignored:*' },
timeRangeConfig: timeRange,
breakdownField: breakdownDataViewField?.name,
sendTelemetry,
});

const getOpenInLogsExplorerAction = useMemo(() => {
return {
id: ACTION_EXPLORE_IN_LOGS_EXPLORER,
type: 'link',
getDisplayName(): string {
return redirectLinkProps?.isLogsExplorerAvailable
? exploreDataInLogsExplorerText
: exploreDataInDiscoverText;
},
getHref: async () => {
return redirectLinkProps.linkProps.href;
},
getIconType(): string | undefined {
return 'visTable';
},
async isCompatible(): Promise<boolean> {
return true;
},
async execute(): Promise<void> {
return redirectLinkProps.navigate();
},
order: 18,
};
}, [redirectLinkProps]);

const extraActions: Action[] = [getOpenInLensAction, getOpenInLogsExplorerAction];
const extraActions: Action[] = [getOpenInLensAction];

const breakdown = useMemo(() => {
return {
Expand Down
8 changes: 3 additions & 5 deletions x-pack/plugins/translations/translations/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -15292,8 +15292,6 @@
"xpack.datasetQuality.degradedDocsColumnTooltip": "Le pourcentage de documents avec la propriété {ignoredProperty} dans votre ensemble de données.",
"xpack.datasetQuality.degradedDocsQualityDescription": "{quality} -{comparator} {minimimPercentage}%",
"xpack.datasetQuality.detail.degradedFieldsSectionTitle": "Problèmes de qualité",
"xpack.datasetQuality.details.chartExploreDataInDiscoverText": "Explorer les données dans Discover",
"xpack.datasetQuality.details.chartExploreDataInLogsExplorerText": "Explorer les données dans l'Explorateur de logs",
"xpack.datasetQuality.details.chartOpenInLensText": "Ouvrir dans Lens",
"xpack.datasetQuality.details.checkBreakdownFieldEcsFailed": "Nous n'avons pas pu récupérer les métadonnées du champ de répartition.",
"xpack.datasetQuality.details.datasetCreatedOnText": "Créé le",
Expand Down Expand Up @@ -26522,16 +26520,14 @@
"xpack.lens.editorFrame.suggestionPanelTitle": "Suggestions",
"xpack.lens.editorFrame.tooManyDimensionsSingularWarningLabel": "Veuillez retirer {dimensionsTooMany, plural, one {une dimension} other {{dimensionsTooMany} dimensions}}",
"xpack.lens.editorFrame.workspaceLabel": "Espace de travail",
"xpack.lens.featureBadge.iconDescription": "{count} {count, plural, one {modificateur} other {modificateurs}} de visualisation",
"xpack.lens.fixErrors": "Effectuez des modifications dans l'éditeur Lens pour corriger l'erreur",
"xpack.lens.moreErrors": "Effectuez des modifications dans l'éditeur Lens pour afficher plus d'erreurs",
"xpack.lens.endValue.nearest": "La plus proche",
"xpack.lens.endValue.none": "Masquer",
"xpack.lens.endValue.zero": "Zéro",
"xpack.lens.endValueDescription.nearest": "Étendre la série avec la première/dernière valeur au bord du graphique",
"xpack.lens.endValueDescription.none": "Ne pas étendre la série au bord du graphique",
"xpack.lens.endValueDescription.zero": "Étendre la série au bord du graphique avec la valeur zéro",
"xpack.lens.experimentalLabel": "Version d'évaluation technique",
"xpack.lens.featureBadge.iconDescription": "{count} {count, plural, one {modificateur} other {modificateurs}} de visualisation",
"xpack.lens.fieldFormats.longSuffix.d": "par jour",
"xpack.lens.fieldFormats.longSuffix.h": "par heure",
"xpack.lens.fieldFormats.longSuffix.m": "par minute",
Expand All @@ -26551,6 +26547,7 @@
"xpack.lens.fittingFunctionsTitle.lookahead": "Suivant",
"xpack.lens.fittingFunctionsTitle.none": "Masquer",
"xpack.lens.fittingFunctionsTitle.zero": "Zéro",
"xpack.lens.fixErrors": "Effectuez des modifications dans l'éditeur Lens pour corriger l'erreur",
"xpack.lens.formula.disableWordWrapLabel": "Désactiver le renvoi à la ligne des mots",
"xpack.lens.formula.editorHelpInlineHideLabel": "Masquer la référence des fonctions",
"xpack.lens.formula.editorHelpInlineHideToolTip": "Masquer la référence des fonctions",
Expand Down Expand Up @@ -27093,6 +27090,7 @@
"xpack.lens.modalTitle.title.deleteAnnotations": "Supprimer le groupe d'annotations ?",
"xpack.lens.modalTitle.title.deleteReferenceLines": "Supprimer le calque de lignes de référence ?",
"xpack.lens.modalTitle.title.deleteVis": "Supprimer le calque de visualisation ?",
"xpack.lens.moreErrors": "Effectuez des modifications dans l'éditeur Lens pour afficher plus d'erreurs",
"xpack.lens.pageTitle": "Lens",
"xpack.lens.paletteHeatmapGradient.label": "Couleur",
"xpack.lens.paletteMetricGradient.label": "Couleur",
Expand Down
16 changes: 7 additions & 9 deletions x-pack/plugins/translations/translations/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -15271,8 +15271,6 @@
"xpack.datasetQuality.degradedDocsColumnTooltip": "データセットにおける{ignoredProperty}プロパティのドキュメントの割合。",
"xpack.datasetQuality.degradedDocsQualityDescription": "{quality} -{comparator} {minimimPercentage}%",
"xpack.datasetQuality.detail.degradedFieldsSectionTitle": "品質の問題",
"xpack.datasetQuality.details.chartExploreDataInDiscoverText": "Discoverでデータを探索",
"xpack.datasetQuality.details.chartExploreDataInLogsExplorerText": "ログエクスプローラーでデータを探索",
"xpack.datasetQuality.details.chartOpenInLensText": "Lensで開く",
"xpack.datasetQuality.details.checkBreakdownFieldEcsFailed": "内訳フィールドメタデータを取得できませんでした。",
"xpack.datasetQuality.details.datasetCreatedOnText": "作成日時",
Expand Down Expand Up @@ -26494,20 +26492,15 @@
"xpack.lens.editorFrame.suggestionPanelTitle": "提案",
"xpack.lens.editorFrame.tooManyDimensionsSingularWarningLabel": "{dimensionsTooMany, plural, other {{dimensionsTooMany} ディメンション}}を削除してください",
"xpack.lens.editorFrame.workspaceLabel": "ワークスペース",
"xpack.lens.failure": "ビジュアライゼーションを表示できませんでした",
"xpack.lens.featureBadge.iconDescription": "{count}個のビジュアライゼーション{count, plural, other {修飾子}}",
"xpack.lens.fixErrors": "Lensエディターで編集し、エラーを修正",
"xpack.lens.legacyURLConflict.shortMessage": "URLの競合が発生しました",
"xpack.lens.missingTimeRangeParam.longMessage": "指定された構成にはtimeRangeプロパティが必須です",
"xpack.lens.missingTimeRangeParam.shortMessage": "timeRangeプロパティがありません",
"xpack.lens.moreErrors": "Lensエディターで編集すると、エラーの詳細が表示されます",
"xpack.lens.endValue.nearest": "最も近い",
"xpack.lens.endValue.none": "非表示",
"xpack.lens.endValue.zero": "ゼロ",
"xpack.lens.endValueDescription.nearest": "最初/最後の値の系列をグラフの端まで拡張",
"xpack.lens.endValueDescription.none": "系列をグラフの端まで拡張しない",
"xpack.lens.endValueDescription.zero": "系列をゼロとしてグラフの端まで拡張",
"xpack.lens.experimentalLabel": "テクニカルプレビュー",
"xpack.lens.failure": "ビジュアライゼーションを表示できませんでした",
"xpack.lens.featureBadge.iconDescription": "{count}個のビジュアライゼーション{count, plural, other {修飾子}}",
"xpack.lens.fieldFormats.longSuffix.d": "日単位",
"xpack.lens.fieldFormats.longSuffix.h": "時間単位",
"xpack.lens.fieldFormats.longSuffix.m": "分単位",
Expand All @@ -26527,6 +26520,7 @@
"xpack.lens.fittingFunctionsTitle.lookahead": "次へ",
"xpack.lens.fittingFunctionsTitle.none": "非表示",
"xpack.lens.fittingFunctionsTitle.zero": "ゼロ",
"xpack.lens.fixErrors": "Lensエディターで編集し、エラーを修正",
"xpack.lens.formula.disableWordWrapLabel": "単語の折り返しを無効にする",
"xpack.lens.formula.editorHelpInlineHideLabel": "関数リファレンスを非表示",
"xpack.lens.formula.editorHelpInlineHideToolTip": "関数リファレンスを非表示",
Expand Down Expand Up @@ -27009,6 +27003,7 @@
"xpack.lens.legacyMetric.titlePositions.bottom": "一番下",
"xpack.lens.legacyMetric.titlePositions.top": "トップ",
"xpack.lens.legacyUrlConflict.objectNoun": "Lensビジュアライゼーション",
"xpack.lens.legacyURLConflict.shortMessage": "URLの競合が発生しました",
"xpack.lens.lineCurve.smooth": "平滑化",
"xpack.lens.lineCurve.step": "手順",
"xpack.lens.lineCurve.straight": "直線",
Expand Down Expand Up @@ -27063,11 +27058,14 @@
"xpack.lens.metric.supportingVisualization.none": "なし",
"xpack.lens.metric.supportingVisualization.trendline": "折れ線",
"xpack.lens.metric.timeField": "時間フィールド",
"xpack.lens.missingTimeRangeParam.longMessage": "指定された構成にはtimeRangeプロパティが必須です",
"xpack.lens.missingTimeRangeParam.shortMessage": "timeRangeプロパティがありません",
"xpack.lens.modalTitle.revertAnnotationGroupTitle": "\"{title}\"の変更を元に戻しますか?",
"xpack.lens.modalTitle.title.clearVis": "ビジュアライゼーションレイヤーを消去しますか?",
"xpack.lens.modalTitle.title.deleteAnnotations": "注釈グループを削除しますか?",
"xpack.lens.modalTitle.title.deleteReferenceLines": "基準線レイヤーを削除しますか?",
"xpack.lens.modalTitle.title.deleteVis": "ビジュアライゼーションレイヤーを削除しますか?",
"xpack.lens.moreErrors": "Lensエディターで編集すると、エラーの詳細が表示されます",
"xpack.lens.pageTitle": "Lens",
"xpack.lens.paletteHeatmapGradient.label": "色",
"xpack.lens.paletteMetricGradient.label": "色",
Expand Down
8 changes: 3 additions & 5 deletions x-pack/plugins/translations/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -15308,8 +15308,6 @@
"xpack.datasetQuality.degradedDocsColumnTooltip": "您的数据集中包含 {ignoredProperty} 属性的文档的百分比。",
"xpack.datasetQuality.degradedDocsQualityDescription": "{quality} -{comparator} {minimimPercentage}%",
"xpack.datasetQuality.detail.degradedFieldsSectionTitle": "质量问题",
"xpack.datasetQuality.details.chartExploreDataInDiscoverText": "在 Discover 中浏览数据",
"xpack.datasetQuality.details.chartExploreDataInLogsExplorerText": "在日志浏览器中浏览数据",
"xpack.datasetQuality.details.chartOpenInLensText": "在 Lens 中打开",
"xpack.datasetQuality.details.checkBreakdownFieldEcsFailed": "无法检索细目字段元数据。",
"xpack.datasetQuality.details.datasetCreatedOnText": "创建日期",
Expand Down Expand Up @@ -26551,16 +26549,14 @@
"xpack.lens.editorFrame.suggestionPanelTitle": "建议",
"xpack.lens.editorFrame.tooManyDimensionsSingularWarningLabel": "请移除{dimensionsTooMany, plural, one {一个维度} other {{dimensionsTooMany} 个维度}}",
"xpack.lens.editorFrame.workspaceLabel": "工作区",
"xpack.lens.featureBadge.iconDescription": "{count} 个可视化{count, plural, other {修饰符}}",
"xpack.lens.fixErrors": "在 Lens 编辑器中编辑以修复该错误",
"xpack.lens.moreErrors": "在 Lens 编辑器中编辑以查看更多错误",
"xpack.lens.endValue.nearest": "最近",
"xpack.lens.endValue.none": "隐藏",
"xpack.lens.endValue.zero": "零",
"xpack.lens.endValueDescription.nearest": "将包含第一个/最后一个值的序列扩展到图表边缘",
"xpack.lens.endValueDescription.none": "不将序列扩展到图表边缘",
"xpack.lens.endValueDescription.zero": "将为零序列扩展到图表边缘",
"xpack.lens.experimentalLabel": "技术预览",
"xpack.lens.featureBadge.iconDescription": "{count} 个可视化{count, plural, other {修饰符}}",
"xpack.lens.fieldFormats.longSuffix.d": "每天",
"xpack.lens.fieldFormats.longSuffix.h": "每小时",
"xpack.lens.fieldFormats.longSuffix.m": "每分钟",
Expand All @@ -26580,6 +26576,7 @@
"xpack.lens.fittingFunctionsTitle.lookahead": "下一个",
"xpack.lens.fittingFunctionsTitle.none": "隐藏",
"xpack.lens.fittingFunctionsTitle.zero": "零",
"xpack.lens.fixErrors": "在 Lens 编辑器中编辑以修复该错误",
"xpack.lens.formula.disableWordWrapLabel": "禁用自动换行",
"xpack.lens.formula.editorHelpInlineHideLabel": "隐藏函数引用",
"xpack.lens.formula.editorHelpInlineHideToolTip": "隐藏函数引用",
Expand Down Expand Up @@ -27122,6 +27119,7 @@
"xpack.lens.modalTitle.title.deleteAnnotations": "删除标注组?",
"xpack.lens.modalTitle.title.deleteReferenceLines": "删除参考线图层?",
"xpack.lens.modalTitle.title.deleteVis": "删除可视化图层?",
"xpack.lens.moreErrors": "在 Lens 编辑器中编辑以查看更多错误",
"xpack.lens.pageTitle": "Lens",
"xpack.lens.paletteHeatmapGradient.label": "颜色",
"xpack.lens.paletteMetricGradient.label": "颜色",
Expand Down

0 comments on commit fb0590e

Please sign in to comment.