feat(1824): update docs links to new URL structure (remove '/docs') (#2140)

* feat(1824): Update docs links to new URL structure (remove '/docs')

* feat(1824): Updated proposals doc links to use new helper

* feat(1824): ensuring custom url string added to link in proposal-form-terms.tsx
This commit is contained in:
Sam Keen 2022-11-18 10:32:34 +00:00 committed by GitHub
parent 5922994a26
commit ba4a5f104c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 70 additions and 26 deletions

View File

@ -6,15 +6,15 @@ const LINKS = {
testnet: [ testnet: [
{ {
label: 'Learn about liquidity fees', label: 'Learn about liquidity fees',
url: 'https://docs.vega.xyz/docs/testnet/tutorials/providing-liquidity#resources', url: 'https://docs.vega.xyz/testnet/tutorials/providing-liquidity#resources',
}, },
{ {
label: 'Provide liquidity', label: 'Provide liquidity',
url: 'https://docs.vega.xyz/docs/testnet/tutorials/providing-liquidity#overview', url: 'https://docs.vega.xyz/testnet/tutorials/providing-liquidity#overview',
}, },
{ {
label: 'View your liquidity provisions', label: 'View your liquidity provisions',
url: 'https://docs.vega.xyz/docs/testnet/tutorials/providing-liquidity#viewing-existing-liquidity-provisions', url: 'https://docs.vega.xyz/testnet/tutorials/providing-liquidity#viewing-existing-liquidity-provisions',
}, },
{ {
label: 'Amend or remove liquidity', label: 'Amend or remove liquidity',

View File

@ -7,4 +7,4 @@ NX_ETHEREUM_PROVIDER_URL=https://mainnet.infura.io/v3/4f846e79e13f44d1b51bbd7ed9
NX_ETHERSCAN_URL=https://etherscan.io NX_ETHERSCAN_URL=https://etherscan.io
NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions
NX_VEGA_EXPLORER_URL=https://explorer.vega.xyz NX_VEGA_EXPLORER_URL=https://explorer.vega.xyz
NX_VEGA_DOCS_URL=https://docs.vega.xyz/docs/mainnet NX_VEGA_DOCS_URL=https://docs.vega.xyz/mainnet

View File

@ -5,6 +5,7 @@ import {
ExternalLink, ExternalLink,
TextArea, TextArea,
} from '@vegaprotocol/ui-toolkit'; } from '@vegaprotocol/ui-toolkit';
import { createDocsLinks } from '@vegaprotocol/react-helpers';
import { useEnvironment } from '@vegaprotocol/environment'; import { useEnvironment } from '@vegaprotocol/environment';
import type { UseFormRegisterReturn } from 'react-hook-form'; import type { UseFormRegisterReturn } from 'react-hook-form';
@ -32,9 +33,13 @@ export const ProposalFormTerms = ({
<div className="mt-[-4px] mb-2 text-sm font-light"> <div className="mt-[-4px] mb-2 text-sm font-light">
<span className="mr-1">{t('ProposalTermsText')}</span> <span className="mr-1">{t('ProposalTermsText')}</span>
<ExternalLink <ExternalLink
href={`${VEGA_DOCS_URL}/tutorials/proposals${docsLink}`} href={`${
createDocsLinks(VEGA_DOCS_URL).PROPOSALS_GUIDE
}${docsLink}`}
target="_blank" target="_blank"
>{`${VEGA_DOCS_URL}/tutorials/proposals${docsLink}`}</ExternalLink> >
{`${createDocsLinks(VEGA_DOCS_URL).PROPOSALS_GUIDE}${docsLink}`}
</ExternalLink>
</div> </div>
)} )}

View File

@ -18,7 +18,11 @@ import { ProposalMinRequirements } from '../../components/shared';
import { AsyncRenderer, ExternalLink } from '@vegaprotocol/ui-toolkit'; import { AsyncRenderer, ExternalLink } from '@vegaprotocol/ui-toolkit';
import { Heading } from '../../../../components/heading'; import { Heading } from '../../../../components/heading';
import { VegaWalletContainer } from '../../../../components/vega-wallet-container'; import { VegaWalletContainer } from '../../../../components/vega-wallet-container';
import { NetworkParams, useNetworkParams } from '@vegaprotocol/react-helpers'; import {
createDocsLinks,
NetworkParams,
useNetworkParams,
} from '@vegaprotocol/react-helpers';
import { ProposalUserAction } from '../../components/shared'; import { ProposalUserAction } from '../../components/shared';
export interface FreeformProposalFormFields { export interface FreeformProposalFormFields {
@ -29,7 +33,7 @@ export interface FreeformProposalFormFields {
proposalReference: string; proposalReference: string;
} }
const DOCS_LINK = 'freeform-proposal'; const DOCS_LINK = '/freeform-proposal';
export const ProposeFreeform = () => { export const ProposeFreeform = () => {
const { params, loading, error } = useNetworkParams([ const { params, loading, error } = useNetworkParams([
@ -96,9 +100,13 @@ export const ProposeFreeform = () => {
<p className="text-sm" data-testid="proposal-docs-link"> <p className="text-sm" data-testid="proposal-docs-link">
<span className="mr-1">{t('ProposalTermsText')}</span> <span className="mr-1">{t('ProposalTermsText')}</span>
<ExternalLink <ExternalLink
href={`${VEGA_DOCS_URL}/tutorials/proposals/${DOCS_LINK}`} href={`${
createDocsLinks(VEGA_DOCS_URL).PROPOSALS_GUIDE
}${DOCS_LINK}`}
target="_blank" target="_blank"
>{`${VEGA_DOCS_URL}/tutorials/proposals/${DOCS_LINK}`}</ExternalLink> >{`${
createDocsLinks(VEGA_DOCS_URL).PROPOSALS_GUIDE
}${DOCS_LINK}`}</ExternalLink>
</p> </p>
)} )}

View File

@ -2,6 +2,7 @@ import { useState } from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { useForm } from 'react-hook-form'; import { useForm } from 'react-hook-form';
import { import {
createDocsLinks,
suitableForSyntaxHighlighter, suitableForSyntaxHighlighter,
useNetworkParams, useNetworkParams,
} from '@vegaprotocol/react-helpers'; } from '@vegaprotocol/react-helpers';
@ -168,9 +169,13 @@ export const ProposeNetworkParameter = () => {
<p className="text-sm" data-testid="proposal-docs-link"> <p className="text-sm" data-testid="proposal-docs-link">
<span className="mr-1">{t('ProposalTermsText')}</span> <span className="mr-1">{t('ProposalTermsText')}</span>
<ExternalLink <ExternalLink
href={`${VEGA_DOCS_URL}/tutorials/proposals${DOCS_LINK}`} href={`${
createDocsLinks(VEGA_DOCS_URL).PROPOSALS_GUIDE
}${DOCS_LINK}`}
target="_blank" target="_blank"
>{`${VEGA_DOCS_URL}/tutorials/proposals${DOCS_LINK}`}</ExternalLink> >{`${
createDocsLinks(VEGA_DOCS_URL).PROPOSALS_GUIDE
}${DOCS_LINK}`}</ExternalLink>
</p> </p>
)} )}

View File

@ -9,6 +9,7 @@ import {
} from '@vegaprotocol/governance'; } from '@vegaprotocol/governance';
import { useEnvironment } from '@vegaprotocol/environment'; import { useEnvironment } from '@vegaprotocol/environment';
import { import {
createDocsLinks,
NetworkParams, NetworkParams,
useNetworkParams, useNetworkParams,
validateJson, validateJson,
@ -135,9 +136,13 @@ export const ProposeNewAsset = () => {
<p className="text-sm" data-testid="proposal-docs-link"> <p className="text-sm" data-testid="proposal-docs-link">
<span className="mr-1">{t('ProposalTermsText')}</span> <span className="mr-1">{t('ProposalTermsText')}</span>
<ExternalLink <ExternalLink
href={`${VEGA_DOCS_URL}/tutorials/proposals${DOCS_LINK}`} href={`${
createDocsLinks(VEGA_DOCS_URL).PROPOSALS_GUIDE
}${DOCS_LINK}`}
target="_blank" target="_blank"
>{`${VEGA_DOCS_URL}/tutorials/proposals${DOCS_LINK}`}</ExternalLink> >{`${
createDocsLinks(VEGA_DOCS_URL).PROPOSALS_GUIDE
}${DOCS_LINK}`}</ExternalLink>
</p> </p>
)} )}

View File

@ -8,6 +8,7 @@ import {
} from '@vegaprotocol/governance'; } from '@vegaprotocol/governance';
import { useEnvironment } from '@vegaprotocol/environment'; import { useEnvironment } from '@vegaprotocol/environment';
import { import {
createDocsLinks,
NetworkParams, NetworkParams,
useNetworkParams, useNetworkParams,
validateJson, validateJson,
@ -125,9 +126,13 @@ export const ProposeNewMarket = () => {
<p className="text-sm" data-testid="proposal-docs-link"> <p className="text-sm" data-testid="proposal-docs-link">
<span className="mr-1">{t('ProposalTermsText')}</span> <span className="mr-1">{t('ProposalTermsText')}</span>
<ExternalLink <ExternalLink
href={`${VEGA_DOCS_URL}/tutorials/proposals${DOCS_LINK}`} href={`${
createDocsLinks(VEGA_DOCS_URL).PROPOSALS_GUIDE
}${DOCS_LINK}`}
target="_blank" target="_blank"
>{`${VEGA_DOCS_URL}/tutorials/proposals${DOCS_LINK}`}</ExternalLink> >{`${
createDocsLinks(VEGA_DOCS_URL).PROPOSALS_GUIDE
}${DOCS_LINK}`}</ExternalLink>
</p> </p>
)} )}

View File

@ -4,6 +4,7 @@ import { Link } from 'react-router-dom';
import { ExternalLink } from '@vegaprotocol/ui-toolkit'; import { ExternalLink } from '@vegaprotocol/ui-toolkit';
import { useEnvironment } from '@vegaprotocol/environment'; import { useEnvironment } from '@vegaprotocol/environment';
import { Heading } from '../../../components/heading'; import { Heading } from '../../../components/heading';
import { createDocsLinks } from '@vegaprotocol/react-helpers';
export const Propose = () => { export const Propose = () => {
const { VEGA_DOCS_URL, VEGA_EXPLORER_URL } = useEnvironment(); const { VEGA_DOCS_URL, VEGA_EXPLORER_URL } = useEnvironment();
@ -18,9 +19,11 @@ export const Propose = () => {
<p> <p>
<span className="mr-1">{t('ProposalTermsText')}</span> <span className="mr-1">{t('ProposalTermsText')}</span>
<ExternalLink <ExternalLink
href={`${VEGA_DOCS_URL}/tutorials/proposals`} href={createDocsLinks(VEGA_DOCS_URL).PROPOSALS_GUIDE}
target="_blank" target="_blank"
>{`${VEGA_DOCS_URL}/tutorials/proposals`}</ExternalLink> >
{createDocsLinks(VEGA_DOCS_URL).PROPOSALS_GUIDE}
</ExternalLink>
</p> </p>
)} )}
{VEGA_EXPLORER_URL && ( {VEGA_EXPLORER_URL && (

View File

@ -11,6 +11,7 @@ import {
TextArea, TextArea,
} from '@vegaprotocol/ui-toolkit'; } from '@vegaprotocol/ui-toolkit';
import { import {
createDocsLinks,
NetworkParams, NetworkParams,
useNetworkParams, useNetworkParams,
validateJson, validateJson,
@ -88,9 +89,11 @@ export const ProposeRaw = () => {
<p className="text-sm" data-testid="proposal-docs-link"> <p className="text-sm" data-testid="proposal-docs-link">
<span className="mr-1">{t('ProposalTermsText')}</span> <span className="mr-1">{t('ProposalTermsText')}</span>
<ExternalLink <ExternalLink
href={`${VEGA_DOCS_URL}/tutorials/proposals`} href={createDocsLinks(VEGA_DOCS_URL).PROPOSALS_GUIDE}
target="_blank" target="_blank"
>{`${VEGA_DOCS_URL}/tutorials/proposals`}</ExternalLink> >
{createDocsLinks(VEGA_DOCS_URL).PROPOSALS_GUIDE}
</ExternalLink>
</p> </p>
)} )}

View File

@ -8,6 +8,7 @@ import {
} from '@vegaprotocol/governance'; } from '@vegaprotocol/governance';
import { useEnvironment } from '@vegaprotocol/environment'; import { useEnvironment } from '@vegaprotocol/environment';
import { import {
createDocsLinks,
NetworkParams, NetworkParams,
useNetworkParams, useNetworkParams,
validateJson, validateJson,
@ -125,9 +126,13 @@ export const ProposeUpdateAsset = () => {
<p className="text-sm" data-testid="proposal-docs-link"> <p className="text-sm" data-testid="proposal-docs-link">
<span className="mr-1">{t('ProposalTermsText')}</span> <span className="mr-1">{t('ProposalTermsText')}</span>
<ExternalLink <ExternalLink
href={`${VEGA_DOCS_URL}/tutorials/proposals${DOCS_LINK}`} href={`${
createDocsLinks(VEGA_DOCS_URL).PROPOSALS_GUIDE
}${DOCS_LINK}`}
target="_blank" target="_blank"
>{`${VEGA_DOCS_URL}/tutorials/proposals${DOCS_LINK}`}</ExternalLink> >{`${
createDocsLinks(VEGA_DOCS_URL).PROPOSALS_GUIDE
}${DOCS_LINK}`}</ExternalLink>
</p> </p>
)} )}

View File

@ -10,6 +10,7 @@ import {
} from '@vegaprotocol/governance'; } from '@vegaprotocol/governance';
import { useEnvironment } from '@vegaprotocol/environment'; import { useEnvironment } from '@vegaprotocol/environment';
import { import {
createDocsLinks,
NetworkParams, NetworkParams,
useNetworkParams, useNetworkParams,
validateJson, validateJson,
@ -188,9 +189,13 @@ export const ProposeUpdateMarket = () => {
<p className="text-sm" data-testid="proposal-docs-link"> <p className="text-sm" data-testid="proposal-docs-link">
<span className="mr-1">{t('ProposalTermsText')}</span> <span className="mr-1">{t('ProposalTermsText')}</span>
<ExternalLink <ExternalLink
href={`${VEGA_DOCS_URL}/tutorials/proposals${DOCS_LINK}`} href={`${
createDocsLinks(VEGA_DOCS_URL).PROPOSALS_GUIDE
}${DOCS_LINK}`}
target="_blank" target="_blank"
>{`${VEGA_DOCS_URL}/tutorials/proposals${DOCS_LINK}`}</ExternalLink> >{`${
createDocsLinks(VEGA_DOCS_URL).PROPOSALS_GUIDE
}${DOCS_LINK}`}</ExternalLink>
</p> </p>
)} )}

View File

@ -1,7 +1,7 @@
import { t } from '@vegaprotocol/react-helpers'; import { t } from '@vegaprotocol/react-helpers';
import { Schema } from '@vegaprotocol/types'; import { Schema } from '@vegaprotocol/types';
// More detail in https://docs.vega.xyz/docs/mainnet/graphql/enums/order-time-in-force // More detail in https://docs.vega.xyz/mainnet/graphql/enums/order-time-in-force
export const timeInForceLabel = (tif: string) => { export const timeInForceLabel = (tif: string) => {
switch (tif) { switch (tif) {
case Schema.OrderTimeInForce.TIME_IN_FORCE_GTC: case Schema.OrderTimeInForce.TIME_IN_FORCE_GTC:

View File

@ -9,6 +9,7 @@ export const createDocsLinks = (docsUrl: string) => ({
AUCTION_TYPE_CLOSING: `${docsUrl}/concepts/trading-on-vega/trading-modes#auction-type-closing`, AUCTION_TYPE_CLOSING: `${docsUrl}/concepts/trading-on-vega/trading-modes#auction-type-closing`,
STAKING_GUIDE: `${docsUrl}/concepts/vega-chain/#staking-on-vega`, STAKING_GUIDE: `${docsUrl}/concepts/vega-chain/#staking-on-vega`,
VEGA_WALLET_CONCEPTS_URL: `${docsUrl}/concepts/vega-wallet`, VEGA_WALLET_CONCEPTS_URL: `${docsUrl}/concepts/vega-wallet`,
PROPOSALS_GUIDE: `${docsUrl}/tutorials/proposals`,
}); });
export const ExternalLinks = { export const ExternalLinks = {
@ -16,7 +17,6 @@ export const ExternalLinks = {
GITHUB: 'https://github.com/vegaprotocol/token-frontend', GITHUB: 'https://github.com/vegaprotocol/token-frontend',
DISCORD: 'https://vega.xyz/discord', DISCORD: 'https://vega.xyz/discord',
GOVERNANCE_PAGE: 'https://vega.xyz/governance', GOVERNANCE_PAGE: 'https://vega.xyz/governance',
PROPOSALS_GUIDE: 'https://docs.vega.xyz/docs/mainnet/tutorials/proposals',
VALIDATOR_FORUM: 'https://community.vega.xyz/c/mainnet-validator-candidates', VALIDATOR_FORUM: 'https://community.vega.xyz/c/mainnet-validator-candidates',
MARGIN_CREDIT_RISK: MARGIN_CREDIT_RISK:
'https://vega.xyz/papers/margins-and-credit-risk.pdf#page=7', 'https://vega.xyz/papers/margins-and-credit-risk.pdf#page=7',