-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ana/add no proposal history #3198
Changes from 8 commits
404773e
b0547a9
4d03b1d
c01e6b5
99b2c90
e508391
bc56f16
c3a3d81
ae1e5f2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[Fixed] Now the proposals page behaves properly, displaying a banner in case there are no proposals in the network saying "No Governance Proposals". Also removed PageContainer from PageProposals @Bitcoinera |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,56 +1,45 @@ | ||||||
<template> | ||||||
<PageContainer | ||||||
<TmPage | ||||||
data-title="Proposals" | ||||||
:managed="true" | ||||||
:loading=" | ||||||
$apollo.queries.proposals.loading && $apollo.queries.parameters.loading | ||||||
" | ||||||
:error="$apollo.queries.proposals.error || $apollo.queries.parameters.error" | ||||||
hide-header | ||||||
> | ||||||
<template slot="no-data"> | ||||||
<!-- duplicated, I have no proper way of refactoring this --> | ||||||
<div class="button-container"> | ||||||
<TmBtn | ||||||
id="propose-btn" | ||||||
value="Create Proposal" | ||||||
type="secondary" | ||||||
@click.native="onPropose" | ||||||
/> | ||||||
</div> | ||||||
<TmDataMsg | ||||||
title="No Governance Proposals" | ||||||
subtitle="There are currently no governance proposals to display. | ||||||
Click the 'Create Proposal' button to submit a proposal." | ||||||
icon="gavel" | ||||||
:managed="false"> | ||||||
<div class="button-container"> | ||||||
<TmBtn | ||||||
id="propose-btn" | ||||||
value="Create Proposal" | ||||||
type="secondary" | ||||||
@click.native="onPropose" | ||||||
/> | ||||||
</template> | ||||||
<template slot="managed-body"> | ||||||
<!-- duplicated, I have no proper way of refactoring this --> | ||||||
<div class="button-container"> | ||||||
<TmBtn | ||||||
id="propose-btn" | ||||||
value="Create Proposal" | ||||||
type="secondary" | ||||||
@click.native="onPropose" | ||||||
/> | ||||||
</div> | ||||||
<ModalPropose | ||||||
ref="modalPropose" | ||||||
:denom="parameters.depositDenom" | ||||||
@success="() => afterPropose()" | ||||||
/> | ||||||
<div v-if="!$apollo.loading && proposals.length === 0"> | ||||||
<div> | ||||||
<TmDataMsg icon="gavel"> | ||||||
<div slot="title"> | ||||||
No Governance Proposals | ||||||
</div> | ||||||
<div slot="subtitle"> | ||||||
There are currently no governance proposals to display. | ||||||
Click the 'Create Proposal' button to submit the first network proposal! | ||||||
</div> | ||||||
</TmDataMsg> | ||||||
</div> | ||||||
</div> | ||||||
<div v-else-if="!$apollo.loading && proposals.length > 0"> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
<TmDataLoading v-if="$apollo.loading" /> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this contradicts line 31 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you can move it up and use a |
||||||
<TableProposals v-else :proposals="proposals" /> | ||||||
<ModalPropose | ||||||
ref="modalPropose" | ||||||
:denom="parameters.depositDenom" | ||||||
@success="() => afterPropose()" | ||||||
/> | ||||||
</template> | ||||||
</PageContainer> | ||||||
</div> | ||||||
</TmPage> | ||||||
</template> | ||||||
|
||||||
<script> | ||||||
import ModalPropose from "src/ActionModal/components/ModalPropose" | ||||||
import TableProposals from "governance/TableProposals" | ||||||
import TmPage from "common/TmPage" | ||||||
import TmBtn from "common/TmBtn" | ||||||
import PageContainer from "common/PageContainer" | ||||||
import TmDataMsg from "common/TmDataMsg" | ||||||
import TmDataLoading from "common/TmDataLoading" | ||||||
import { mapGetters } from "vuex" | ||||||
|
@@ -65,7 +54,7 @@ export default { | |||||
TmDataMsg, | ||||||
TmDataLoading, | ||||||
TmBtn, | ||||||
PageContainer | ||||||
TmPage | ||||||
}, | ||||||
data: () => ({ | ||||||
proposals: [], | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,148 +1,115 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`PageProposals shows a message if still loading 1`] = ` | ||
<pagecontainer-stub | ||
<tmpage-stub | ||
data-title="Proposals" | ||
hideheader="true" | ||
managed="true" | ||
subtitle="" | ||
title="" | ||
> | ||
<template> | ||
<div | ||
class="button-container" | ||
> | ||
<tmbtn-stub | ||
id="propose-btn" | ||
type="secondary" | ||
value="Create Proposal" | ||
/> | ||
</div> | ||
|
||
<tmdatamsg-stub | ||
icon="gavel" | ||
subtitle="There are currently no governance proposals to display. | ||
Click the 'Create Proposal' button to submit a proposal." | ||
title="No Governance Proposals" | ||
<div | ||
class="button-container" | ||
> | ||
<tmbtn-stub | ||
id="propose-btn" | ||
type="secondary" | ||
value="Create Proposal" | ||
/> | ||
</template> | ||
</div> | ||
|
||
<modalpropose-stub | ||
denom="xxx" | ||
/> | ||
|
||
<template> | ||
<div | ||
class="button-container" | ||
> | ||
<tmbtn-stub | ||
id="propose-btn" | ||
type="secondary" | ||
value="Create Proposal" | ||
/> | ||
<div> | ||
<div> | ||
<tmdatamsg-stub | ||
icon="gavel" | ||
> | ||
<div> | ||
|
||
No Governance Proposals | ||
|
||
</div> | ||
|
||
<div> | ||
|
||
There are currently no governance proposals to display. | ||
Click the 'Create Proposal' button to submit the first network proposal! | ||
|
||
</div> | ||
</tmdatamsg-stub> | ||
</div> | ||
|
||
<tableproposals-stub | ||
proposals="" | ||
/> | ||
|
||
<modalpropose-stub | ||
denom="xxx" | ||
/> | ||
</template> | ||
</pagecontainer-stub> | ||
</div> | ||
</tmpage-stub> | ||
`; | ||
|
||
exports[`PageProposals shows a message if there is nothing to display 1`] = ` | ||
<pagecontainer-stub | ||
<tmpage-stub | ||
data-title="Proposals" | ||
hideheader="true" | ||
managed="true" | ||
subtitle="" | ||
title="" | ||
> | ||
<template> | ||
<div | ||
class="button-container" | ||
> | ||
<tmbtn-stub | ||
id="propose-btn" | ||
type="secondary" | ||
value="Create Proposal" | ||
/> | ||
</div> | ||
|
||
<tmdatamsg-stub | ||
icon="gavel" | ||
subtitle="There are currently no governance proposals to display. | ||
Click the 'Create Proposal' button to submit a proposal." | ||
title="No Governance Proposals" | ||
<div | ||
class="button-container" | ||
> | ||
<tmbtn-stub | ||
id="propose-btn" | ||
type="secondary" | ||
value="Create Proposal" | ||
/> | ||
</template> | ||
</div> | ||
|
||
<modalpropose-stub | ||
denom="xxx" | ||
/> | ||
|
||
<template> | ||
<div | ||
class="button-container" | ||
> | ||
<tmbtn-stub | ||
id="propose-btn" | ||
type="secondary" | ||
value="Create Proposal" | ||
/> | ||
<div> | ||
<div> | ||
<tmdatamsg-stub | ||
icon="gavel" | ||
> | ||
<div> | ||
|
||
No Governance Proposals | ||
|
||
</div> | ||
|
||
<div> | ||
|
||
There are currently no governance proposals to display. | ||
Click the 'Create Proposal' button to submit the first network proposal! | ||
|
||
</div> | ||
</tmdatamsg-stub> | ||
</div> | ||
|
||
<tableproposals-stub | ||
proposals="" | ||
/> | ||
|
||
<modalpropose-stub | ||
denom="xxx" | ||
/> | ||
</template> | ||
</pagecontainer-stub> | ||
</div> | ||
</tmpage-stub> | ||
`; | ||
|
||
exports[`PageProposals shows a proposals table 1`] = ` | ||
<pagecontainer-stub | ||
<tmpage-stub | ||
data-title="Proposals" | ||
hideheader="true" | ||
managed="true" | ||
subtitle="" | ||
title="" | ||
> | ||
<template> | ||
<div | ||
class="button-container" | ||
> | ||
<tmbtn-stub | ||
id="propose-btn" | ||
type="secondary" | ||
value="Create Proposal" | ||
/> | ||
</div> | ||
|
||
<tmdatamsg-stub | ||
icon="gavel" | ||
subtitle="There are currently no governance proposals to display. | ||
Click the 'Create Proposal' button to submit a proposal." | ||
title="No Governance Proposals" | ||
<div | ||
class="button-container" | ||
> | ||
<tmbtn-stub | ||
id="propose-btn" | ||
type="secondary" | ||
value="Create Proposal" | ||
/> | ||
</template> | ||
</div> | ||
|
||
<template> | ||
<div | ||
class="button-container" | ||
> | ||
<tmbtn-stub | ||
id="propose-btn" | ||
type="secondary" | ||
value="Create Proposal" | ||
/> | ||
</div> | ||
|
||
<modalpropose-stub | ||
denom="lunies" | ||
/> | ||
|
||
<div> | ||
<tableproposals-stub | ||
proposals="[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]" | ||
/> | ||
|
||
<modalpropose-stub | ||
denom="lunies" | ||
/> | ||
</template> | ||
</pagecontainer-stub> | ||
</div> | ||
</tmpage-stub> | ||
`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what was
PageContainer
doing?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was intended to replace TmPage and some of the internals we don't need there anymore.
I assume we will still need TmPage to be present?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so true. I think it should be like:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I am going to change it