Skip to content

Commit

Permalink
Merge pull request #1515 from daostack/dev
Browse files Browse the repository at this point in the history
release_0.10.1
  • Loading branch information
dkent600 authored Mar 15, 2020
2 parents 48f0c6f + b0afc90 commit 1c79554
Show file tree
Hide file tree
Showing 15 changed files with 148 additions and 117 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@
- Features Added
- Bugs Fixed

## Next release
## 0.10.1

- Features Added
- improved some display of staking/preboosting amounts feedback
- Unknown schemes now link to Scheme page and show permissions

- Bugs Fixed
- hide trailing slash in PreTransaction modal header
- validate all required fields in CreateUnknownGenericSchemeProposal modal
- workaround crash in Proposal History page

## 0.10.0

Expand Down
4 changes: 3 additions & 1 deletion src/components/Dao/DaoHistoryPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ class DaoHistoryPage extends React.Component<IProps, null> {
const proposals = data;

const proposalsHTML = proposals.map((proposal: Proposal) => {
return (<ProposalHistoryRow key={"proposal_" + proposal.id} history={this.props.history} proposal={proposal} daoState={daoState} currentAccountAddress={currentAccountAddress} />);
if (proposal.staticState.scheme) {
return (<ProposalHistoryRow key={"proposal_" + proposal.id} history={this.props.history} proposal={proposal} daoState={daoState} currentAccountAddress={currentAccountAddress} />);
}
});

return(
Expand Down
20 changes: 8 additions & 12 deletions src/components/Dao/UnknownSchemeCard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
margin: 25px;
margin-bottom: 0;
}

table {
width: 100%;
border-spacing: 0;
Expand All @@ -35,37 +35,33 @@
color: rgba(80, 97, 118, 1.000);
}

td img.attention {
td img.attention {
padding-right:4px;
width: 16px;
height: 16px;
position: relative;
bottom: -1px;
}


td a.address {
display:inline-block;
}

td.left {
width: 8px;
max-width: 8px;
min-width: 8px;
}

a {
.schemeLink {
display:inline-block;
color: rgba(154, 169, 181, 1.000);
position: relative;
bottom: 3px;
}

a:hover {
.schemeLink:hover {
text-decoration: underline;
}

@media only screen and (max-width: 975px) {
td a.address {
.schemeLink {
width:11rem;
overflow-x: hidden;
text-overflow: ellipsis;
Expand All @@ -74,13 +70,13 @@
}

@media only screen and (max-width: 815px) {
td a.address {
.schemeLink {
width:7rem;
}
}

@media only screen and (max-width: 715px) {
td a.address {
.schemeLink {
width:6rem;
}
}
Expand Down
14 changes: 9 additions & 5 deletions src/components/Dao/UnknownSchemeCard.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { Scheme, ISchemeState } from "@daostack/client";
import withSubscription, { ISubscriptionProps } from "components/Shared/withSubscription";
import { linkToEtherScan, splitByCamelCase } from "lib/util";
import { splitByCamelCase } from "lib/util";
import * as React from "react";
import { Link } from "react-router-dom";

import * as css from "./UnknownSchemeCard.scss";

interface IExternalProps {
Expand Down Expand Up @@ -34,10 +36,12 @@ const UnknownSchemeRow = (props: IRowProps) => {
<td className={css.left}>&nbsp;</td>
<td>
<img className={css.attention} src="/assets/images/Icon/Alert-red.svg" />
{schemeState.name ?
<a href={linkToEtherScan(schemeState.address)} target="_blank" rel="noopener noreferrer">{splitByCamelCase(schemeState.name)}</a> :
<a className={css.address} target="_blank" rel="noopener noreferrer" href={linkToEtherScan(schemeState.address)}>{schemeState.address}</a>
}
<Link className={css.schemeLink} to={`/dao/${schemeState.dao}/scheme/${schemeState.id}`}>
{schemeState.name ?
splitByCamelCase(schemeState.name) :
schemeState.address
}
</Link>
</td>
</tr>;
};
Expand Down
4 changes: 2 additions & 2 deletions src/components/Proposal/ActionButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -230,13 +230,13 @@ class ActionButton extends React.Component<IProps, IState> {
/> : ""
}

{ proposalState.stage === IProposalStage.Queued && proposalState.upstakeNeededToPreBoost.lt(new BN(0)) ?
{ proposalState.stage === IProposalStage.Queued && proposalState.upstakeNeededToPreBoost.ltn(0) ?
<button className={css.preboostButton} onClick={this.handleClickExecute("Pre-Boost")} data-test-id="buttonBoost">
<img src="/assets/images/Icon/boost.svg"/>
{ /* space after <span> is there on purpose */ }
<span> Pre-Boost</span>
</button> :
proposalState.stage === IProposalStage.PreBoosted && expired && proposalState.downStakeNeededToQueue.lte(new BN(0)) ?
proposalState.stage === IProposalStage.PreBoosted && expired && proposalState.downStakeNeededToQueue.lten(0) ?
<button className={css.unboostButton} onClick={this.handleClickExecute("Un-boost")} data-test-id="buttonBoost">
<img src="/assets/images/Icon/boost.svg"/>
<span> Un-Boost</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ class CreateGenericScheme extends React.Component<IProps, IStateProps> {
}

require("callData");
require("title");
require("description");
require("value");
nonEmpty("value");
nonNegative("value");

Expand Down
20 changes: 10 additions & 10 deletions src/components/Proposal/Staking/BoostAmount.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { formatTokens } from "lib/util";
import { IProposalStage, IProposalState } from "@daostack/client";

import BN = require("bn.js");
import classNames from "classnames";
import { formatTokens } from "lib/util";
import * as React from "react";

import * as css from "./BoostAmount.scss";


interface IProps {
detailView?: boolean;
expired?: boolean;
Expand All @@ -26,32 +25,33 @@ export default class BoostAmount extends React.Component<IProps, null> {
[css.wrapper]: true,
[css.detailView]: detailView,
});
const nothing = <span className={css.boostedAmount}><b>&nbsp;</b></span>;

return (
<div className={wrapperClass}>
{
proposal.stage === IProposalStage.Queued && !expired && proposal.upstakeNeededToPreBoost.gte(new BN(0)) ?
proposal.stage === IProposalStage.Queued && !expired && proposal.upstakeNeededToPreBoost.gten(0) ?
<span className={css.boostedAmount}>
<b>
{detailView ? <img src="/assets/images/Icon/Boost-slate.svg" /> : ""}
&gt; {formatTokens(proposal.upstakeNeededToPreBoost, "GEN")} to boost
&gt; {formatTokens(proposal.upstakeNeededToPreBoost, "GEN")} on Pass to boost
</b>
</span>
: proposal.stage === IProposalStage.PreBoosted && proposal.downStakeNeededToQueue.lte(new BN(0)) ?
: proposal.stage === IProposalStage.PreBoosted && proposal.downStakeNeededToQueue.lten(0) ?
<span className={css.boostedAmount}>
<b>
{detailView ? <img src="/assets/images/Icon/Boost-slate.svg" /> : ""}
&gt; {formatTokens(proposal.downStakeNeededToQueue.abs(), "GEN")} Pass to stay boosted
&gt; {formatTokens(proposal.downStakeNeededToQueue.abs(), "GEN")} on Pass to stay boosted
</b>
</span>
: proposal.stage === IProposalStage.PreBoosted && proposal.downStakeNeededToQueue.gt(new BN(0)) ?
: proposal.stage === IProposalStage.PreBoosted && proposal.downStakeNeededToQueue.gtn(0) ?
<span className={css.boostedAmount + " " + css.unboostAmount}>
<b>
{detailView ? <img src="/assets/images/Icon/Boost-slate.svg" /> : ""}
{formatTokens(proposal.downStakeNeededToQueue, "GEN")} on Fail to un-boost
&gt;= {formatTokens(proposal.downStakeNeededToQueue, "GEN")} on Fail to un-boost
</b>
</span>
: <span className={css.boostedAmount}><b>&nbsp;</b></span>
: nothing
}
</div>
);
Expand Down
Loading

0 comments on commit 1c79554

Please sign in to comment.