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

[Widget Params] Updated help url and tooltip #3428

Merged
merged 1 commit into from
Feb 13, 2019
Merged
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
11 changes: 7 additions & 4 deletions client/app/components/ParameterMappingInput.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable react/no-multi-comp */

import { isString, extend, each, map, includes, findIndex, find, fromPairs, clone, isEmpty, replace } from 'lodash';
import { isString, extend, each, map, includes, findIndex, find, fromPairs, clone, isEmpty } from 'lodash';
import React, { Fragment } from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
Expand All @@ -23,7 +23,10 @@ import './ParameterMappingInput.less';

const { Option } = Select;

const HELP_URL = 'https://redash.io/help/user-guide/querying/query-parameters?source={0}';
const HELP_URL = [
'https://redash.io/help/user-guide/querying/query-parameters?source=dialog#Value-Source-Options',
'Guide: Value Source Options',
];

export const MappingType = {
DashboardAddNew: 'dashboard-add-new',
Expand Down Expand Up @@ -336,15 +339,15 @@ class MappingEditor extends React.Component {

renderContent() {
const { mapping, inputError } = this.state;
const helpUrl = replace(HELP_URL, '{0}', 'edit_mapping');
const [helpUrl, tooltip] = HELP_URL;

return (
<div className="parameter-mapping-editor">
<header>
Edit Source and Value
{/* eslint-disable-next-line react/jsx-no-target-blank */}
<a href={helpUrl} target="_blank" rel="noopener">
<Tooltip title="Learn more about editing query paramaters (opens in a new window)">
<Tooltip title={tooltip}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a thought: maybe we should have a <HelpTrigger> component, that currently will: render circle icon with a tooltip. We will use it in all the places we add help content to. But later on allow us in one single swoop change the implementation to open a drawer with the help content inside the app?

(not a blocker of course, I'm waiting for the relevant docs PR to merge)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the drawer idea. Will the content be retrieved with github api by help url?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I thought we will update the Gatsby configuration to create a "drawer friendly" view of the help content alongside the regular one. The drawer pages will have the same URL structure, so we can deduce the new URL based on the regular one (so Cmd/Shift+Click will still work).

<Icon type="question-circle" />
</Tooltip>
</a>
Expand Down