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

Fix beta doc links, truncated help menu label #382

Merged
merged 2 commits into from
May 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/core/public/chrome/ui/header/header_help_menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export type ChromeHelpExtensionMenuDocumentationLink = EuiButtonEmptyProps & {
linkType: 'documentation';
/**
* URL to documentation page.
* i.e. `${OPENSEARARCH_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/${appName}.html`,
* i.e. `${OPENSEARCH_DOCS}${appName}`,
*/
href: string;
};
Expand Down Expand Up @@ -365,7 +365,7 @@ class HeaderHelpMenuUI extends Component<Props, State> {
</EuiFlexGroup>
</EuiPopoverTitle>

<div style={{ maxWidth: 240 }}>
<div style={{ maxWidth: 270 }}>
{defaultContent}
{defaultContent && customContent && <EuiHorizontalRule margin="m" />}
{customContent}
Expand Down
2 changes: 1 addition & 1 deletion src/core/public/doc_links/doc_links_service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe('DocLinksService#start()', () => {
const api = service.start({ injectedMetadata });
expect(api.DOC_LINK_VERSION).toEqual('test-branch');
expect(api.links.opensearchDashboards).toEqual(
'https://www.opensearch.org/guide/en/kibana/test-branch/index.html'
'https://docs-beta.opensearch.org/docs/opensearch-dashboards/'
);
});
});
95 changes: 48 additions & 47 deletions src/core/public/doc_links/doc_links_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,18 @@ export class DocLinksService {
public start({ injectedMetadata }: StartDeps): DocLinksStart {
const DOC_LINK_VERSION = injectedMetadata.getOpenSearchDashboardsBranch();
const OPENSEARCH_WEBSITE_URL = 'https://www.opensearch.org/';
const OPENSEARCH_DOCS = `${OPENSEARCH_WEBSITE_URL}guide/en/elasticsearch/reference/${DOC_LINK_VERSION}/`;
const OPENSEARCH_DOCS = `https://docs-beta.opensearch.org/docs/opensearch/`;
const OPENSEARCH_DASHBOARDS_DOCS = `https://docs-beta.opensearch.org/docs/opensearch-dashboards/`;

return deepFreeze({
DOC_LINK_VERSION,
OPENSEARCH_WEBSITE_URL,
links: {
dashboard: {
drilldowns: `${OPENSEARCH_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/drilldowns.html`,
drilldownsTriggerPicker: `${OPENSEARCH_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/drilldowns.html#url-drilldowns`,
urlDrilldownTemplateSyntax: `${OPENSEARCH_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/url_templating-language.html`,
urlDrilldownVariables: `${OPENSEARCH_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/url_templating-language.html#url-template-variables`,
drilldowns: `${OPENSEARCH_WEBSITE_URL}guide/en/opensearch/${DOC_LINK_VERSION}/drilldowns.html`,
drilldownsTriggerPicker: `${OPENSEARCH_WEBSITE_URL}guide/en/opensearch/${DOC_LINK_VERSION}/drilldowns.html#url-drilldowns`,
urlDrilldownTemplateSyntax: `${OPENSEARCH_WEBSITE_URL}guide/en/opensearch/${DOC_LINK_VERSION}/url_templating-language.html`,
urlDrilldownVariables: `${OPENSEARCH_WEBSITE_URL}guide/en/opensearch/${DOC_LINK_VERSION}/url_templating-language.html#url-template-variables`,
},
filebeat: {
base: `${OPENSEARCH_WEBSITE_URL}guide/en/beats/filebeat/${DOC_LINK_VERSION}`,
Expand Down Expand Up @@ -82,72 +83,72 @@ export class DocLinksService {
base: `${OPENSEARCH_WEBSITE_URL}guide/en/beats/winlogbeat/${DOC_LINK_VERSION}`,
},
aggs: {
date_histogram: `${OPENSEARCH_DOCS}search-aggregations-bucket-datehistogram-aggregation.html`,
date_range: `${OPENSEARCH_DOCS}search-aggregations-bucket-daterange-aggregation.html`,
filter: `${OPENSEARCH_DOCS}search-aggregations-bucket-filter-aggregation.html`,
filters: `${OPENSEARCH_DOCS}search-aggregations-bucket-filters-aggregation.html`,
geohash_grid: `${OPENSEARCH_DOCS}search-aggregations-bucket-geohashgrid-aggregation.html`,
histogram: `${OPENSEARCH_DOCS}search-aggregations-bucket-histogram-aggregation.html`,
ip_range: `${OPENSEARCH_DOCS}search-aggregations-bucket-iprange-aggregation.html`,
range: `${OPENSEARCH_DOCS}search-aggregations-bucket-range-aggregation.html`,
significant_terms: `${OPENSEARCH_DOCS}search-aggregations-bucket-significantterms-aggregation.html`,
terms: `${OPENSEARCH_DOCS}search-aggregations-bucket-terms-aggregation.html`,
avg: `${OPENSEARCH_DOCS}search-aggregations-metrics-avg-aggregation.html`,
avg_bucket: `${OPENSEARCH_DOCS}search-aggregations-pipeline-avg-bucket-aggregation.html`,
max_bucket: `${OPENSEARCH_DOCS}search-aggregations-pipeline-max-bucket-aggregation.html`,
min_bucket: `${OPENSEARCH_DOCS}search-aggregations-pipeline-min-bucket-aggregation.html`,
sum_bucket: `${OPENSEARCH_DOCS}search-aggregations-pipeline-sum-bucket-aggregation.html`,
cardinality: `${OPENSEARCH_DOCS}search-aggregations-metrics-cardinality-aggregation.html`,
count: `${OPENSEARCH_DOCS}search-aggregations-metrics-valuecount-aggregation.html`,
cumulative_sum: `${OPENSEARCH_DOCS}search-aggregations-metrics-sum-aggregation.html`,
derivative: `${OPENSEARCH_DOCS}search-aggregations-pipeline-derivative-aggregation.html`,
geo_bounds: `${OPENSEARCH_DOCS}search-aggregations-metrics-geobounds-aggregation.html`,
geo_centroid: `${OPENSEARCH_DOCS}search-aggregations-metrics-geocentroid-aggregation.html`,
max: `${OPENSEARCH_DOCS}search-aggregations-metrics-max-aggregation.html`,
median: `${OPENSEARCH_DOCS}search-aggregations-metrics-percentile-aggregation.html`,
min: `${OPENSEARCH_DOCS}search-aggregations-metrics-min-aggregation.html`,
moving_avg: `${OPENSEARCH_DOCS}search-aggregations-pipeline-movavg-aggregation.html`,
percentile_ranks: `${OPENSEARCH_DOCS}search-aggregations-metrics-percentile-rank-aggregation.html`,
serial_diff: `${OPENSEARCH_DOCS}search-aggregations-pipeline-serialdiff-aggregation.html`,
std_dev: `${OPENSEARCH_DOCS}search-aggregations-metrics-extendedstats-aggregation.html`,
sum: `${OPENSEARCH_DOCS}search-aggregations-metrics-sum-aggregation.html`,
top_hits: `${OPENSEARCH_DOCS}search-aggregations-metrics-top-hits-aggregation.html`,
date_histogram: `${OPENSEARCH_DOCS}bucket-agg/#histogram-date_histogram`,
date_range: `${OPENSEARCH_DOCS}bucket-agg/#range-date_range-ip_range`,
filter: `${OPENSEARCH_DOCS}bucket-agg/#filter-filters`,
filters: `${OPENSEARCH_DOCS}bucket-agg/#filter-filters`,
geohash_grid: `${OPENSEARCH_DOCS}bucket-agg/#geo_distance-geohash_grid`,
histogram: `${OPENSEARCH_DOCS}bucket-agg/#histogram-date_histogram`,
ip_range: `${OPENSEARCH_DOCS}bucket-agg/#range-date_range-ip_range`,
range: `${OPENSEARCH_DOCS}bucket-agg/#range-date_range-ip_range`,
significant_terms: `${OPENSEARCH_DOCS}bucket-agg/#significant_terms-significant_text`,
terms: `${OPENSEARCH_DOCS}bucket-agg/#terms`,
avg: `${OPENSEARCH_DOCS}metric-agg/#sum-min-max-avg`,
avg_bucket: `${OPENSEARCH_DOCS}pipeline-agg/#avg_bucket-sum_bucket-min_bucket-max_bucket`,
max_bucket: `${OPENSEARCH_DOCS}pipeline-agg/#avg_bucket-sum_bucket-min_bucket-max_bucket`,
min_bucket: `${OPENSEARCH_DOCS}pipeline-agg/#avg_bucket-sum_bucket-min_bucket-max_bucket`,
sum_bucket: `${OPENSEARCH_DOCS}pipeline-agg/#avg_bucket-sum_bucket-min_bucket-max_bucket`,
cardinality: `${OPENSEARCH_DOCS}metric-agg/#cardinality`,
count: `${OPENSEARCH_DOCS}metric-agg/#value_count`,
cumulative_sum: `${OPENSEARCH_DOCS}pipeline-agg/#cumulative_sum`,
derivative: `${OPENSEARCH_DOCS}pipeline-agg/#derivative`,
geo_bounds: `${OPENSEARCH_DOCS}metric-agg/#geo_bound`,
geo_centroid: `${OPENSEARCH_DOCS}metric-agg/#geo_bound`,
max: `${OPENSEARCH_DOCS}metric-agg/#sum-min-max-avg`,
median: `${OPENSEARCH_DOCS}metric-agg/#sum-min-max-avg`,
min: `${OPENSEARCH_DOCS}metric-agg/#sum-min-max-avg`,
moving_avg: `${OPENSEARCH_DOCS}pipeline-agg/#moving_avg`,
percentile_ranks: `${OPENSEARCH_DOCS}metric-agg/#percentile-percentile_ranks`,
serial_diff: `${OPENSEARCH_DOCS}pipeline-agg/#serial_diff`,
std_dev: `${OPENSEARCH_DOCS}metric-agg/#stats-extended_stats-matrix_stats`,
sum: `${OPENSEARCH_DOCS}metric-agg/#sum-min-max-avg`,
top_hits: `${OPENSEARCH_DOCS}metric-agg/#top_hits`,
},
scriptedFields: {
scriptFields: `${OPENSEARCH_DOCS}search-request-script-fields.html`,
scriptAggs: `${OPENSEARCH_DOCS}search-aggregations.html#_values_source`,
scriptAggs: `${OPENSEARCH_DOCS}metric-agg/#scripted_metric`,
painless: `${OPENSEARCH_DOCS}modules-scripting-painless.html`,
painlessApi: `${OPENSEARCH_WEBSITE_URL}guide/en/elasticsearch/painless/${DOC_LINK_VERSION}/painless-api-reference.html`,
painlessSyntax: `${OPENSEARCH_DOCS}modules-scripting-painless-syntax.html`,
luceneExpressions: `${OPENSEARCH_DOCS}modules-scripting-expression.html`,
},
indexPatterns: {
loadingData: `${OPENSEARCH_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/tutorial-load-dataset.html`,
introduction: `${OPENSEARCH_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/index-patterns.html`,
loadingData: `${OPENSEARCH_WEBSITE_URL}guide/en/opensearch/${DOC_LINK_VERSION}/tutorial-load-dataset.html`,
introduction: `${OPENSEARCH_WEBSITE_URL}guide/en/opensearch/${DOC_LINK_VERSION}/index-patterns.html`,
},
addData: `${OPENSEARCH_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/connect-to-elasticsearch.html`,
opensearchDashboards: `${OPENSEARCH_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/index.html`,
addData: `${OPENSEARCH_WEBSITE_URL}guide/en/opensearch/${DOC_LINK_VERSION}/connect-to-elasticsearch.html`,
opensearchDashboards: `${OPENSEARCH_DASHBOARDS_DOCS}`,
siem: {
guide: `${OPENSEARCH_WEBSITE_URL}guide/en/security/${DOC_LINK_VERSION}/index.html`,
gettingStarted: `${OPENSEARCH_WEBSITE_URL}guide/en/security/${DOC_LINK_VERSION}/index.html`,
},
query: {
eql: `${OPENSEARCH_DOCS}eql.html`,
luceneQuerySyntax: `${OPENSEARCH_DOCS}query-dsl-query-string-query.html#query-string-syntax`,
queryDsl: `${OPENSEARCH_DOCS}query-dsl.html`,
kueryQuerySyntax: `${OPENSEARCH_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/kuery-query.html`,
queryDsl: `${OPENSEARCH_DOCS}query-dsl`,
kueryQuerySyntax: `${OPENSEARCH_DOCS}query-dsl`,
},
date: {
dateMath: `${OPENSEARCH_DOCS}common-options.html#date-math`,
},
management: {
opensearchDashboardsGeneralSettings: `${OPENSEARCH_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/advanced-options.html#kibana-general-settings`,
opensearchDashboardsSearchSettings: `${OPENSEARCH_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/advanced-options.html#kibana-search-settings`,
dashboardSettings: `${OPENSEARCH_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/advanced-options.html#kibana-dashboard-settings`,
opensearchDashboardsGeneralSettings: `${OPENSEARCH_WEBSITE_URL}guide/en/opensearch/${DOC_LINK_VERSION}/advanced-options.html#opensearch-general-settings`,
opensearchDashboardsSearchSettings: `${OPENSEARCH_WEBSITE_URL}guide/en/opensearch/${DOC_LINK_VERSION}/advanced-options.html#opensearch-search-settings`,
dashboardSettings: `${OPENSEARCH_WEBSITE_URL}guide/en/opensearch/${DOC_LINK_VERSION}/advanced-options.html#opensearch-dashboard-settings`,
},
visualize: {
guide: `${OPENSEARCH_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/dashboard.html`,
timelineDeprecation: `${OPENSEARCH_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/dashboard.html#timeline-deprecation`,
guide: `${OPENSEARCH_WEBSITE_URL}guide/en/opensearch/${DOC_LINK_VERSION}/dashboard.html`,
timelineDeprecation: `${OPENSEARCH_WEBSITE_URL}guide/en/opensearch/${DOC_LINK_VERSION}/dashboard.html#timeline-deprecation`,
},
},
});
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.