Misc fixes (#101)

* fix env var bug

* fix #99

* fix #97

* fix #96

* fix #95, #94

* restrict commenting to live proposals
This commit is contained in:
Danny Skubak 2019-12-05 19:06:03 -05:00 committed by Daniel Ternyak
parent 98dce6c5ea
commit 95102842a7
8 changed files with 34 additions and 16 deletions

View File

@ -78,11 +78,19 @@ class ProposalDetailNaked extends React.Component<Props, State> {
return (
<Popconfirm
title={
<p>
Are you sure you want to cancel proposal and begin
<br />
the refund process? This cannot be undone.
</p>
isVersionTwo ? (
<p>
Are you sure you want to cancel proposal?
<br />
This cannot be undone.
</p>
) : (
<p>
Are you sure you want to cancel proposal and begin
<br />
the refund process? This cannot be undone.
</p>
)
}
placement="left"
cancelText="cancel"

View File

@ -110,6 +110,9 @@ def post_proposal_comments(proposal_id, comment, parent_comment_id):
if not proposal:
return {"message": "No proposal matching id"}, 404
if proposal.status != ProposalStatus.LIVE:
return {"message": "Proposal must be live to comment"}, 400
# Make sure the parent comment exists
parent = None
if parent_comment_id:

View File

@ -60,7 +60,7 @@ LINKEDIN_CLIENT_SECRET = env.str("LINKEDIN_CLIENT_SECRET")
BLOCKCHAIN_REST_API_URL = env.str("BLOCKCHAIN_REST_API_URL")
BLOCKCHAIN_API_SECRET = env.str("BLOCKCHAIN_API_SECRET")
STAGING_PASSWORD = env.str("STAGING_PASSWORD")
STAGING_PASSWORD = env.str("STAGING_PASSWORD", default=None)
EXPLORER_URL = env.str("EXPLORER_URL", default="https://chain.so/tx/ZECTEST/<txid>")

View File

@ -127,7 +127,8 @@ class SignUp extends React.Component<Props> {
ev.preventDefault();
const { createUser } = this.props;
this.props.form.validateFieldsAndScroll((err: any, values: any) => {
if (!err) {
const hasAgreed = this.props.form.getFieldValue('hasAgreed')
if (!err && hasAgreed) {
delete values.passwordConfirm;
createUser(values);
}

View File

@ -11,7 +11,11 @@ interface Props {
export default class CancelModal extends React.Component<Props> {
render() {
const { isVisible, handleClose } = this.props;
const {
isVisible,
handleClose,
proposal: { isVersionTwo },
} = this.props;
return (
<Modal
@ -23,13 +27,15 @@ export default class CancelModal extends React.Component<Props> {
onCancel={handleClose}
>
<p>
Are you sure you would like to cancel this proposal, and refund any
contributors? <strong>This cannot be undone</strong>.
Are you sure you would like to cancel this proposal
{isVersionTwo ? '' : ', and refund any contributors'}?{' '}
<strong>This cannot be undone</strong>.
</p>
<p>
Canceled proposals cannot be deleted and will still be viewable by contributors
or anyone with a direct link. However, they will be de-listed everywhere else on
ZF Grants.
Canceled proposals cannot be deleted and will still be viewable by{' '}
{isVersionTwo ? '' : 'contributors or '}
anyone with a direct link. However, they will be de-listed everywhere else on ZF
Grants.
</p>
<p>
If you're sure you'd like to cancel, please{' '}

View File

@ -110,7 +110,7 @@ export class ProposalDetail extends React.Component<Props, State> {
const milestonesDisabled = proposal.isVersionTwo
? !proposal.acceptedWithFunding
: false;
const defaultTab = milestonesDisabled ? 'discussions' : 'milestones';
const defaultTab = !milestonesDisabled || !isLive ? 'milestones' : 'discussions';
const adminMenu = (
<Menu>

View File

@ -77,7 +77,7 @@ export default class TipJarAddress extends React.Component<Props, State> {
<Form.Item label="Tip jar address" validateStatus={status} help={help}>
<Input
value={tipJarAddress || ''}
placeholder="Z or T address"
placeholder="Z address"
onChange={this.handleChange}
disabled={isFetching || isSaving || errorFetching}
/>

View File

@ -106,7 +106,7 @@ class TipJarProposalSettingsModalBase extends React.Component<Props, State> {
>
<Input
value={address || ''}
placeholder="Z or T address"
placeholder="Z address"
onChange={this.handleTipJarAddressChange}
disabled={addressInputDisabled}
/>