fix(governance): market name component not showing correct instrument code (#5830)

This commit is contained in:
Matthew Russell 2024-02-20 13:00:51 -05:00 committed by GitHub
parent 7b06c05853
commit e532f88daa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 24 deletions

View File

@ -62,6 +62,9 @@ const cache: InMemoryCacheConfig = {
Account: { Account: {
keyFields: false, keyFields: false,
}, },
Instrument: {
keyFields: ['code'],
},
Delegation: { Delegation: {
keyFields: false, keyFields: false,
// Only get full updates // Only get full updates

View File

@ -140,6 +140,9 @@ const ProposalDetails = ({
); );
} }
case 'UpdateMarketState': { case 'UpdateMarketState': {
const marketPageLink = consoleLink(
CONSOLE_MARKET_PAGE.replace(':marketId', terms.change.market.id)
);
return ( return (
<span> <span>
{featureFlags.UPDATE_MARKET_STATE && {featureFlags.UPDATE_MARKET_STATE &&
@ -161,24 +164,16 @@ const ProposalDetails = ({
</button> </button>
</CopyWithTooltip> </CopyWithTooltip>
<Tooltip description={t('OpenInConsole')} align="center"> <Tooltip description={t('OpenInConsole')} align="center">
<button <Link
className="inline-block px-1" className="inline-block px-1"
onClick={() => { to={marketPageLink}
const marketPageLink = consoleLink( target="_blank"
CONSOLE_MARKET_PAGE.replace(
':marketId',
// @ts-ignore ts doesn't like this field even though its already a string above???
terms.change.market.id
)
);
window.open(marketPageLink, '_blank');
}}
> >
<VegaIcon <VegaIcon
size={20} size={20}
name={VegaIconNames.OPEN_EXTERNAL} name={VegaIconNames.OPEN_EXTERNAL}
/> />
</button> </Link>
</Tooltip> </Tooltip>
</span> </span>
</span> </span>
@ -188,6 +183,10 @@ const ProposalDetails = ({
); );
} }
case 'UpdateMarket': { case 'UpdateMarket': {
const marketPageLink = consoleLink(
CONSOLE_MARKET_PAGE.replace(':marketId', terms.change.marketId)
);
return ( return (
<> <>
<span>{t('UpdateToMarket')}: </span> <span>{t('UpdateToMarket')}: </span>
@ -205,21 +204,13 @@ const ProposalDetails = ({
</button> </button>
</CopyWithTooltip> </CopyWithTooltip>
<Tooltip description={t('OpenInConsole')} align="center"> <Tooltip description={t('OpenInConsole')} align="center">
<button <Link
className="inline-block px-1" className="inline-block px-1"
onClick={() => { target="_blank"
const marketPageLink = consoleLink( to={marketPageLink}
CONSOLE_MARKET_PAGE.replace(
':marketId',
// @ts-ignore ts doesn't like this field even though its already a string above???
terms.change.marketId
)
);
window.open(marketPageLink, '_blank');
}}
> >
<VegaIcon size={20} name={VegaIconNames.OPEN_EXTERNAL} /> <VegaIcon size={20} name={VegaIconNames.OPEN_EXTERNAL} />
</button> </Link>
</Tooltip> </Tooltip>
</span> </span>
</span> </span>