better format enum
This commit is contained in:
parent
497dab0dcd
commit
81dc41652f
@ -136,10 +136,11 @@ function metaItem(metadata: string | undefined): {
|
||||
item?.voterStatus !== VoteOption.VOTE_OPTION_NO_WITH_VETO
|
||||
"
|
||||
>{{
|
||||
voteOptionToJSON(item?.voterStatus).replace(
|
||||
'VOTE_OPTION_',
|
||||
''
|
||||
)
|
||||
voteOptionToJSON(item?.voterStatus)
|
||||
.toLowerCase()
|
||||
.replace(/^vote_option/, '')
|
||||
.replaceAll(/_(.)/g, (m, g) => ' ' + g.toUpperCase())
|
||||
.trim()
|
||||
}}</span
|
||||
>
|
||||
|
||||
@ -237,10 +238,11 @@ function metaItem(metadata: string | undefined): {
|
||||
<span
|
||||
v-if="item?.voterStatus !== VoteOption.VOTE_OPTION_NO_WITH_VETO"
|
||||
>{{
|
||||
voteOptionToJSON(item?.voterStatus).replace(
|
||||
'VOTE_OPTION_',
|
||||
''
|
||||
)
|
||||
voteOptionToJSON(item?.voterStatus)
|
||||
.toLowerCase()
|
||||
.replace(/^vote_option/, '')
|
||||
.replaceAll(/_(.)/g, (m, g) => ' ' + g.toUpperCase())
|
||||
.trim()
|
||||
}}</span
|
||||
>
|
||||
|
||||
|
||||
@ -71,7 +71,13 @@ function myContracts() {
|
||||
</td>
|
||||
<td>{{ v.creator }}</td>
|
||||
<td>
|
||||
{{ accessTypeToJSON(v.instantiatePermission?.permission) }}
|
||||
{{
|
||||
accessTypeToJSON(v.instantiatePermission?.permission)
|
||||
.toLowerCase()
|
||||
.replace(/^access_type/, '')
|
||||
.replaceAll(/_(.)/g, (m, g) => ' ' + g.toUpperCase())
|
||||
.trim()
|
||||
}}
|
||||
<span
|
||||
>{{ v.instantiatePermission?.address }}
|
||||
{{ v.instantiatePermission?.addresses.join(', ') }}</span
|
||||
|
||||
@ -103,10 +103,11 @@ const color = computed(() => {
|
||||
});
|
||||
const status = computed(() => {
|
||||
if (proposal.value.status) {
|
||||
return proposalStatusToJSON(proposal.value.status).replace(
|
||||
'PROPOSAL_STATUS_',
|
||||
''
|
||||
);
|
||||
return proposalStatusToJSON(proposal.value.status)
|
||||
.toLowerCase()
|
||||
.replace(/^proposal_status/, '')
|
||||
.replaceAll(/_(.)/g, (m, g) => ' ' + g.toUpperCase())
|
||||
.trim();
|
||||
}
|
||||
return '';
|
||||
});
|
||||
@ -440,10 +441,11 @@ function metaItem(metadata: string | undefined): {
|
||||
item.options
|
||||
.map(
|
||||
(x) =>
|
||||
`${voteOptionToJSON(x.option).replace(
|
||||
'VOTE_OPTION_',
|
||||
''
|
||||
)}:${format.percent(x.weight)}`
|
||||
`${voteOptionToJSON(x.option)
|
||||
.toLowerCase()
|
||||
.replace(/^vote_option/, '')
|
||||
.replaceAll(/_(.)/g, (m, g) => ' ' + g.toUpperCase())
|
||||
.trim()}:${format.percent(x.weight)}`
|
||||
)
|
||||
.join(', ')
|
||||
}}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user