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

Task: add description to documentation link #1203

Merged
merged 4 commits into from
Nov 12, 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
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
import { Link, Separator, Text } from '@fluentui/react';
import { DefaultButton, Separator, Stack, Text } from '@fluentui/react';
import React from 'react';

import { IHint } from './suffix-util';
import { styles } from './suffix.styles';

export const HintList = ({ hints }: any) => {
const listItems = hints.map((hint: IHint, index: any) => <div key={index}>
{hint.description && <Text block variant='small' id={'description' + index}>
{hint.description && <Text block variant='medium' id={'description' + index}>
{hint.description}
</Text>}
{hint.link && <Link href={hint.link.url} target='_blank' className={styles.link}>
{hint.link.name}
</Link>}
{hint.link &&
<Stack className={styles.buttons} tokens={{ childrenGap: 8 }} horizontal>
<DefaultButton href={hint.link.url} target='_blank' className={styles.link}>
{hint.link.name}
</DefaultButton>
</Stack>
}
<Separator />
</div>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {
DefaultButton, FocusTrapCallout, FocusZone, getId, Icon, ITooltipHostStyles, Spinner, Stack, Text, TooltipHost
Callout, getId, Icon, ITooltipHostStyles,
Spinner, Text, TooltipHost
} from '@fluentui/react';
import React, { useState } from 'react';
import { FormattedMessage } from 'react-intl';
import { useSelector } from 'react-redux';

import { ISampleQuery } from '../../../../../../types/query-runner';
Expand All @@ -14,7 +14,6 @@ import { HintList } from './HintList';
import { getMatchingSamples, IHint } from './suffix-util';
import { styles } from './suffix.styles';


const SuffixRenderer = () => {
const { autoComplete, sampleQuery, samples, queryRunnerStatus } = useSelector(
(state: IRootState) => state
Expand All @@ -37,7 +36,7 @@ const SuffixRenderer = () => {
url: querySamples[0].docLink || '',
name: translateMessage('Learn more')
},
description: ''
description: translateMessage('A documentation link for this URL exists. Click learn more to access it')
};
}
}
Expand Down Expand Up @@ -96,7 +95,7 @@ const SuffixRenderer = () => {
id={buttonId}
/>
{isCalloutVisible && (
<FocusTrapCallout
<Callout
className={styles.callout}
ariaLabelledBy={labelId}
ariaDescribedBy={descriptionId}
Expand All @@ -110,12 +109,7 @@ const SuffixRenderer = () => {
/{requestUrl}
</Text>
<HintList hints={hints} />
<FocusZone>
<Stack className={styles.buttons} tokens={{ childrenGap: 8 }} horizontal>
<DefaultButton onClick={toggleCallout}><FormattedMessage id='Close' /></DefaultButton>
</Stack>
</FocusZone>
</FocusTrapCallout>
</Callout>
)}
</>);
}
Expand Down
3 changes: 2 additions & 1 deletion src/messages/GE.json
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@
"documentation": "documentation",
"Missing response headers for query workaround": "Some headers, typically returned for this request, may be missing due to the limitations of the workaround.",
"Learn more": "Learn more",
"A documentation link for this URL exists. Click learn more to access it": "A documentation link for this URL exists. Click learn more to access it",
"Feedback": "Got feedback?",
"Comment question": "Tell us more about your experience",
"Prompt question": "We'd love your Feedback",
Expand All @@ -398,7 +399,7 @@
"Slightly difficult": "Slightly difficult",
"Neither easy nor difficult": "Neither easy nor difficult",
"Slightly easy": "Slightly easy",
"Ratiing": "Rating",
"Rating": "Rating",
"Extremely easy": "Extremely easy",
"Email (optional)": "Email (optional)",
"You can contact me about this feedback": "You can contact me about this feedback",
Expand Down