diff --git a/web-console/src/dialogs/retention-dialog/retention-dialog.tsx b/web-console/src/dialogs/retention-dialog/retention-dialog.tsx
index a9b695b2e4c..a563939fe86 100644
--- a/web-console/src/dialogs/retention-dialog/retention-dialog.tsx
+++ b/web-console/src/dialogs/retention-dialog/retention-dialog.tsx
@@ -21,10 +21,10 @@ import { IconNames } from '@blueprintjs/icons';
import axios from 'axios';
import React from 'react';
+import { SnitchDialog } from '..';
import { ExternalLink, RuleEditor } from '../../components';
+import { getLink } from '../../links';
import { QueryManager } from '../../utils';
-import { DRUID_DOCS_VERSION } from '../../variables';
-import { SnitchDialog } from '../snitch-dialog/snitch-dialog';
import './retention-dialog.scss';
@@ -183,9 +183,7 @@ export class RetentionDialog extends React.PureComponent<
Druid uses rules to determine what data should be retained in the cluster. The rules are
evaluated in order from top to bottom. For more information please refer to the{' '}
-
+
documentation
.
diff --git a/web-console/src/entry.ts b/web-console/src/entry.ts
index 5ea04d4e860..bebb5ff71bd 100644
--- a/web-console/src/entry.ts
+++ b/web-console/src/entry.ts
@@ -29,6 +29,7 @@ import './ace-modes/dsql';
import './ace-modes/hjson';
import './bootstrap/react-table-defaults';
import { ConsoleApplication } from './console-application';
+import { Links, setLinkOverrides } from './links';
import { UrlBaser } from './singletons/url-baser';
import './entry.scss';
@@ -58,6 +59,9 @@ interface ConsoleConfig {
// Extra context properties that will be added to all query requests
mandatoryQueryContext?: Record;
+
+ // Allow for link overriding to different docs
+ linkOverrides?: Links;
}
const consoleConfig: ConsoleConfig = (window as any).consoleConfig;
@@ -75,6 +79,9 @@ if (consoleConfig.customHeaderName && consoleConfig.customHeaderValue) {
if (consoleConfig.customHeaders) {
Object.assign(axios.defaults.headers, consoleConfig.customHeaders);
}
+if (consoleConfig.linkOverrides) {
+ setLinkOverrides(consoleConfig.linkOverrides);
+}
ReactDOM.render(
React.createElement(ConsoleApplication, {
diff --git a/web-console/src/links.ts b/web-console/src/links.ts
new file mode 100644
index 00000000000..4e45fb77ffb
--- /dev/null
+++ b/web-console/src/links.ts
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// This is set to the latest available version and should be updated to the next version before release
+import hasOwnProp from 'has-own-prop';
+
+const DRUID_DOCS_VERSION = '0.19.0';
+
+function fillVersion(str: string): string {
+ return str.replace(/\{\{VERSION}}/g, DRUID_DOCS_VERSION);
+}
+
+export interface Links {
+ websiteHref: string;
+ githubHref: string;
+ docsHref: string;
+ communityHref: string;
+ slackHref: string;
+ userGroup: string;
+ developerGroup: string;
+}
+
+const DEFAULT_LINKS: Links = {
+ websiteHref: 'https://druid.apache.org',
+ githubHref: 'https://github.com/apache/druid',
+ docsHref: fillVersion('https://druid.apache.org/docs/{{VERSION}}'),
+ communityHref: 'https://druid.apache.org/community/',
+ slackHref: 'https://druid.apache.org/community/join-slack',
+ userGroup: 'https://groups.google.com/forum/#!forum/druid-user',
+ developerGroup: 'https://lists.apache.org/list.html?dev@druid.apache.org',
+};
+
+const links = DEFAULT_LINKS;
+
+export function setLinkOverrides(linkOverrides: Links) {
+ const keys = Object.keys(DEFAULT_LINKS) as (keyof Links)[];
+ for (const k of keys) {
+ if (hasOwnProp(linkOverrides, k)) {
+ links[k] = fillVersion(String(linkOverrides[k]));
+ }
+ }
+}
+
+export type LinkNames =
+ | 'WEBSITE'
+ | 'GITHUB'
+ | 'DOCS'
+ | 'DOCS_SQL'
+ | 'DOCS_RUNE'
+ | 'DOCS_API'
+ | 'COMMUNITY'
+ | 'SLACK'
+ | 'USER_GROUP'
+ | 'DEVELOPER_GROUP';
+
+export function getLink(linkName: LinkNames): string {
+ switch (linkName) {
+ case 'WEBSITE':
+ return links.websiteHref;
+ case 'GITHUB':
+ return links.githubHref;
+ case 'DOCS':
+ return links.docsHref;
+ case 'DOCS_SQL':
+ return `${links.docsHref}/querying/sql.html`;
+ case 'DOCS_RUNE':
+ return `${links.docsHref}/querying/querying.html`;
+ case 'DOCS_API':
+ return `${links.docsHref}/operations/api-reference.html`;
+ case 'COMMUNITY':
+ return links.communityHref;
+ case 'SLACK':
+ return links.slackHref;
+ case 'USER_GROUP':
+ return links.userGroup;
+ case 'DEVELOPER_GROUP':
+ return links.developerGroup;
+ }
+}
diff --git a/web-console/src/utils/ingestion-spec.tsx b/web-console/src/utils/ingestion-spec.tsx
index 9a2d70058c2..25022bd8586 100644
--- a/web-console/src/utils/ingestion-spec.tsx
+++ b/web-console/src/utils/ingestion-spec.tsx
@@ -21,7 +21,7 @@ import React from 'react';
import { Field } from '../components/auto-form/auto-form';
import { ExternalLink } from '../components/external-link/external-link';
-import { DRUID_DOCS_VERSION } from '../variables';
+import { getLink } from '../links';
import {
BASIC_TIME_FORMATS,
@@ -175,13 +175,13 @@ export function getIngestionDocLink(spec: IngestionSpec): string {
switch (type) {
case 'kafka':
- return `https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/development/extensions-core/kafka-ingestion.html`;
+ return `${getLink('DOCS')}/development/extensions-core/kafka-ingestion.html`;
case 'kinesis':
- return `https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/development/extensions-core/kinesis-ingestion.html`;
+ return `${getLink('DOCS')}/development/extensions-core/kinesis-ingestion.html`;
default:
- return `https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/ingestion/native-batch.html#firehoses`;
+ return `${getLink('DOCS')}/ingestion/native-batch.html#firehoses`;
}
}
@@ -317,9 +317,7 @@ const INPUT_FORMAT_FORM_FIELDS: Field[] = [
The parser used to parse the data.
For more information see{' '}
-
+
the documentation
.
@@ -609,12 +607,7 @@ const FLATTEN_FIELD_FORM_FIELDS: Field[] = [
info: (
<>
Specify a flatten{' '}
-
- expression
-
- .
+ expression.
>
),
},
@@ -656,12 +649,7 @@ const TRANSFORM_FORM_FIELDS: Field[] = [
info: (
<>
A valid Druid{' '}
-
- expression
-
- .
+ expression.
>
),
},
@@ -931,7 +919,9 @@ const METRIC_SPEC_FORM_FIELDS: Field[] = [
Supported modes are ignore
, overflow
, and clip
. See
outlier handling modes
{' '}
@@ -1024,9 +1014,7 @@ export function getIoConfigFormFields(ingestionComboType: IngestionComboType): F
info: (
Druid connects to raw data through{' '}
-
+
inputSources
. You can change your selected inputSource here.
@@ -1079,9 +1067,7 @@ export function getIoConfigFormFields(ingestionComboType: IngestionComboType): F
required: true,
info: (
<>
-
+
inputSource.baseDir
Specifies the directory to search recursively for files to be ingested.
@@ -1105,9 +1091,7 @@ export function getIoConfigFormFields(ingestionComboType: IngestionComboType): F
],
info: (
<>
-
+
inputSource.filter
@@ -1177,11 +1161,7 @@ export function getIoConfigFormFields(ingestionComboType: IngestionComboType): F
info: (
The{' '}
-
- filter
- {' '}
+ filter{' '}
to apply to the data as part of querying.
),
@@ -1241,9 +1221,7 @@ export function getIoConfigFormFields(ingestionComboType: IngestionComboType): F
<>
JSON array of{' '}
-
+
S3 Objects
.
@@ -1405,9 +1383,7 @@ export function getIoConfigFormFields(ingestionComboType: IngestionComboType): F
<>
JSON array of{' '}
-
+
S3 Objects
.
@@ -1465,9 +1441,7 @@ export function getIoConfigFormFields(ingestionComboType: IngestionComboType): F
<>
JSON array of{' '}
-
+
Google Cloud Storage Objects
.
@@ -1500,7 +1474,9 @@ export function getIoConfigFormFields(ingestionComboType: IngestionComboType): F
info: (
<>
consumerProperties
@@ -1524,7 +1500,9 @@ export function getIoConfigFormFields(ingestionComboType: IngestionComboType): F
info: (
<>
consumerProperties
@@ -1575,9 +1553,7 @@ export function getIoConfigFormFields(ingestionComboType: IngestionComboType): F
info: (
<>
The Amazon Kinesis stream endpoint for a region. You can find a list of endpoints{' '}
-
+
here
.
diff --git a/web-console/src/variables.ts b/web-console/src/variables.ts
deleted file mode 100644
index f018073a6a2..00000000000
--- a/web-console/src/variables.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// This is set to the latest available version and should be updated to the next version before release
-export const DRUID_DOCS_VERSION = '0.17.0';
-
-export const DRUID_WEBSITE = 'https://druid.apache.org';
-export const DRUID_GITHUB = 'https://github.com/apache/druid';
-export const DRUID_DOCS = `https://druid.apache.org/docs/${DRUID_DOCS_VERSION}`;
-export const DRUID_DOCS_SQL = `https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/querying/sql.html`;
-export const DRUID_DOCS_RUNE = `https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/querying/querying.html`;
-export const DRUID_COMMUNITY = 'https://druid.apache.org/community/';
-export const DRUID_USER_GROUP = 'https://groups.google.com/forum/#!forum/druid-user';
-export const DRUID_ASF_SLACK = 'https://druid.apache.org/community/join-slack';
-export const DRUID_DEVELOPER_GROUP = 'https://lists.apache.org/list.html?dev@druid.apache.org';
-export const DRUID_DOCS_API = `https://druid.apache.org/docs/${DRUID_DOCS_VERSION}/operations/api-reference.html`;
diff --git a/web-console/src/views/load-data-view/load-data-view.tsx b/web-console/src/views/load-data-view/load-data-view.tsx
index 49d322d3746..be13c22dfbf 100644
--- a/web-console/src/views/load-data-view/load-data-view.tsx
+++ b/web-console/src/views/load-data-view/load-data-view.tsx
@@ -54,6 +54,7 @@ import {
} from '../../components';
import { FormGroupWithInfo } from '../../components/form-group-with-info/form-group-with-info';
import { AsyncActionDialog } from '../../dialogs';
+import { getLink } from '../../links';
import { AppToaster } from '../../singletons/toaster';
import { UrlBaser } from '../../singletons/url-baser';
import {
@@ -146,7 +147,6 @@ import {
SampleStrategy,
} from '../../utils/sampler';
import { computeFlattenPathsForData } from '../../utils/spec-utils';
-import { DRUID_DOCS_VERSION } from '../../variables';
import { ExamplePicker } from './example-picker/example-picker';
import { FilterTable, filterTableSelectedColumnName } from './filter-table/filter-table';
@@ -811,9 +811,7 @@ export class LoadDataView extends React.PureComponent
If you do not see your source of raw data here, you can try to ingest it by submitting a{' '}
-
+
JSON task or supervisor spec
.
@@ -916,9 +914,7 @@ export class LoadDataView extends React.PureComponent
For more information please refer to the{' '}
-
+
documentation on loading extensions
.
@@ -1060,9 +1056,7 @@ export class LoadDataView extends React.PureComponent
Druid ingests raw data and converts it into a custom,{' '}
-
+
indexed format
{' '}
that is optimized for analytic queries.
@@ -1311,9 +1305,7 @@ export class LoadDataView extends React.PureComponent
If you have nested data, you can{' '}
-
+
flatten
{' '}
it here. If the provided flattening capabilities are not sufficient, please
@@ -1321,9 +1313,7 @@ export class LoadDataView extends React.PureComponent
)}
Ensure that your data appears correctly in a row/column orientation.
-
+
{!selectedFlattenField && (
<>
@@ -1462,7 +1452,7 @@ export class LoadDataView extends React.PureComponent
@@ -1574,9 +1564,7 @@ export class LoadDataView extends React.PureComponent
-
+
@@ -1724,16 +1712,12 @@ export class LoadDataView extends React.PureComponentOptional
Druid can perform per-row{' '}
-
+
transforms
{' '}
of column values allowing you to create new derived columns or alter existing column.
-
+
{Boolean(transformQueryState.error && transforms.length) && (
@@ -1964,16 +1948,10 @@ export class LoadDataView extends React.PureComponentOptional
Druid can{' '}
-
- filter
- {' '}
+ filter{' '}
out unwanted data by applying per-row filters.
-
+
{!showGlobalFilter && this.renderColumnFilterControls()}
{!selectedFilter && this.renderGlobalFilterControls()}
@@ -2239,9 +2217,7 @@ export class LoadDataView extends React.PureComponent
)}
-
+
{!somethingSelected && (
<>
@@ -2252,14 +2228,12 @@ export class LoadDataView extends React.PureComponent
Select whether or not you want to set an explicit list of{' '}
dimensions
{' '}
and{' '}
-
+
metrics
. Explicitly setting dimensions and metrics can lead to better compression and
@@ -2304,9 +2278,7 @@ export class LoadDataView extends React.PureComponent
If you enable{' '}
-
+
roll-up
, Druid will try to pre-aggregate data before indexing it to conserve storage.
@@ -2315,18 +2287,12 @@ export class LoadDataView extends React.PureComponent
If you enable rollup, you must specify which columns are{' '}
-
+
dimensions
{' '}
(fields you want to group and filter on), and which are{' '}
-
- metrics
- {' '}
- (fields you want to aggregate on).
+ metrics (fields
+ you want to aggregate on).
}
@@ -2779,9 +2745,7 @@ export class LoadDataView extends React.PureComponent
Optional
Configure how Druid will partition data.
-
+