fix(governance,environment,proposals): network upgrade proposal urls include block height (#4704)
This commit is contained in:
parent
2a0811863f
commit
e9173796f5
@ -183,7 +183,7 @@ context(
|
||||
.first()
|
||||
.find('[data-testid="view-proposal-btn"]')
|
||||
.click();
|
||||
cy.url().should('contain', '/protocol-upgrades/v1');
|
||||
cy.url().should('contain', '/protocol-upgrades/v1/2015942');
|
||||
cy.getByTestId('protocol-upgrade-proposal').within(() => {
|
||||
cy.get('h1').should('have.text', 'Vega Release v1');
|
||||
cy.getByTestId('protocol-upgrade-block-height').should(
|
||||
@ -243,7 +243,7 @@ context(
|
||||
);
|
||||
cy.getByTestId('external-link')
|
||||
.should('have.attr', 'href')
|
||||
.and('contain', '/proposals/protocol-upgrade/v1');
|
||||
.and('contain', '/proposals/protocol-upgrade/v1/2015942');
|
||||
});
|
||||
|
||||
// estimate does not display possibly due to mocks or Cypress unless the proposal is clicked on several times
|
||||
|
@ -67,7 +67,7 @@ export const ProtocolUpgradeProposalsListItem = ({
|
||||
<Link
|
||||
to={`${Routes.PROTOCOL_UPGRADES}/${stripFullStops(
|
||||
proposal.vegaReleaseTag
|
||||
)}`}
|
||||
)}/${proposal.upgradeBlockHeight}`}
|
||||
>
|
||||
<Button data-testid="view-proposal-btn">{t('viewDetails')}</Button>
|
||||
</Link>
|
||||
|
@ -279,7 +279,7 @@ const routerConfig = [
|
||||
],
|
||||
},
|
||||
{
|
||||
path: `${Routes.PROTOCOL_UPGRADES}/:proposalReleaseTag`,
|
||||
path: `${Routes.PROTOCOL_UPGRADES}/:proposalReleaseTag/:proposalBlockHeight`,
|
||||
element: <LazyProtocolUpgradeProposal />,
|
||||
},
|
||||
{
|
||||
|
@ -127,7 +127,7 @@ export const TOKEN_GOVERNANCE = '/proposals';
|
||||
export const TOKEN_PROPOSALS = '/proposals';
|
||||
export const TOKEN_PROPOSAL = '/proposals/:id';
|
||||
export const TOKEN_PROTOCOL_UPGRADE_PROPOSAL =
|
||||
'/proposals/protocol-upgrade/:tag';
|
||||
'/proposals/protocol-upgrade/:tag/:blockHeight';
|
||||
export const TOKEN_VALIDATOR = '/validators/:id';
|
||||
|
||||
/**
|
||||
@ -135,12 +135,12 @@ export const TOKEN_VALIDATOR = '/validators/:id';
|
||||
*/
|
||||
export const useProtocolUpgradeProposalLink = () => {
|
||||
const governance = useLinks(DApp.Token);
|
||||
return (releaseTag: string) =>
|
||||
return (releaseTag: string, blockHeight: string) =>
|
||||
governance(
|
||||
TOKEN_PROTOCOL_UPGRADE_PROPOSAL.replace(
|
||||
':tag',
|
||||
stripFullStops(releaseTag)
|
||||
)
|
||||
).replace(':blockHeight', blockHeight)
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -73,7 +73,7 @@ export const ProtocolUpgradeCountdown = ({
|
||||
|
||||
return (
|
||||
<a
|
||||
href={detailsLink(data.vegaReleaseTag)}
|
||||
href={detailsLink(data.vegaReleaseTag, data.upgradeBlockHeight)}
|
||||
target="_blank"
|
||||
rel="noreferrer nofollow noopener"
|
||||
>
|
||||
|
@ -77,8 +77,8 @@ export const ProtocolUpgradeInProgressNotification = () => {
|
||||
{t(
|
||||
'Trading and other network activity has stopped until the upgrade is complete.'
|
||||
)}{' '}
|
||||
{vegaReleaseTag && (
|
||||
<ExternalLink href={detailsLink(vegaReleaseTag)}>
|
||||
{vegaReleaseTag && upgradeBlockHeight && (
|
||||
<ExternalLink href={detailsLink(vegaReleaseTag, upgradeBlockHeight)}>
|
||||
{t('View details')}
|
||||
</ExternalLink>
|
||||
)}
|
||||
|
@ -79,7 +79,7 @@ export const ProtocolUpgradeProposalNotification = ({
|
||||
{t(
|
||||
'Trading activity will be interrupted, manage your risk appropriately.'
|
||||
)}{' '}
|
||||
<ExternalLink href={detailsLink(vegaReleaseTag)}>
|
||||
<ExternalLink href={detailsLink(vegaReleaseTag, upgradeBlockHeight)}>
|
||||
{t('View details')}
|
||||
</ExternalLink>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user