Feat/1478 better proposal title (#1544)

* chore: generate types

* feat: add asset id to title

* test: add test for new functionality
This commit is contained in:
Dexter Edwards 2022-10-03 09:01:45 +01:00 committed by GitHub
parent eb7b261ec4
commit 0a5a87f432
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 21 additions and 1 deletions

View File

@ -153,6 +153,10 @@ export interface ProposalFields_terms_change_UpdateAsset {
* The minimum economically meaningful amount of this specific asset
*/
quantum: string;
/**
* The asset to update
*/
assetId: string;
/**
* The source of the updated asset
*/

View File

@ -241,6 +241,7 @@ describe('Proposal header', () => {
terms: {
change: {
__typename: 'UpdateAsset',
assetId: 'foo',
},
},
})
@ -249,6 +250,7 @@ describe('Proposal header', () => {
expect(screen.getByTestId('proposal-details')).toHaveTextContent(
'Update asset'
);
expect(screen.getByText('foo')).toBeInTheDocument();
});
it("Renders unknown proposal if it's a different proposal type", () => {

View File

@ -77,7 +77,12 @@ export const ProposalHeader = ({ proposal }: { proposal: ProposalFields }) => {
break;
}
case 'UpdateAsset': {
details = `${t('Update asset')}`;
details = (
<>
`${t('Update asset')}`;
<Lozenge>{change.assetId}</Lozenge>
</>
);
break;
}
}

View File

@ -54,6 +54,7 @@ export const PROPOSAL_FRAGMENT = gql`
}
... on UpdateAsset {
quantum
assetId
source {
... on UpdateERC20 {
lifetimeLimit

View File

@ -153,6 +153,10 @@ export interface Proposal_proposal_terms_change_UpdateAsset {
* The minimum economically meaningful amount of this specific asset
*/
quantum: string;
/**
* The asset to update
*/
assetId: string;
/**
* The source of the updated asset
*/

View File

@ -153,6 +153,10 @@ export interface Proposals_proposalsConnection_edges_node_terms_change_UpdateAss
* The minimum economically meaningful amount of this specific asset
*/
quantum: string;
/**
* The asset to update
*/
assetId: string;
/**
* The source of the updated asset
*/