Skip to content
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

FIX #740, Disable 'Autoplay' on videos recorded into Milestones #757

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
765cec3
Transform description from iframe to video element
nadirlaskar May 6, 2019
063cec9
Repalced use of jquery with regex to extract url
nadirlaskar May 6, 2019
dea7101
Transform a copy of description to video tag
nadirlaskar May 6, 2019
7e0d2a5
Add check for undefined description value
nadirlaskar May 6, 2019
94153d3
Merge branch 'develop' into patch-1
nadirlaskar May 17, 2019
6e5b16a
eslint-fix
nadirlaskar May 18, 2019
7bc885d
fixed incorrect import
nadirlaskar May 19, 2019
a148647
eslint use of label without htmlFor, replaced with span
nadirlaskar May 19, 2019
7b42e24
eslint space and tab fixes
nadirlaskar May 19, 2019
19d1de2
removed quotes from eslint npm script
nadirlaskar May 19, 2019
224d534
updated import to css from scss
nadirlaskar May 19, 2019
707b272
Merge branch 'develop' into eslint-fix
nadirlaskar May 19, 2019
b7f00be
use destructor instead, eslint-fix
nadirlaskar May 19, 2019
8cf1480
added mock localstorage to setupTests required by localforage
nadirlaskar May 19, 2019
1bc8b9a
updated commitTime test data to be timestamp from date string
nadirlaskar May 19, 2019
05d82e2
added relative path to imports
nadirlaskar May 19, 2019
4f08c8f
use amount as amountRemaining in donation model when absent
nadirlaskar May 19, 2019
a137a0b
added check for amount attribute to convert to wei from bigNumber eth
nadirlaskar May 19, 2019
5349f00
Merge branch 'eslint-fix' into patch-1
nadirlaskar May 19, 2019
6fa2d8b
use destructor and added spaces for lint issue fixes
nadirlaskar May 19, 2019
a697336
Merge branch 'patch-1' of https://github.com/nadirlaskar/giveth-dapp …
nadirlaskar May 29, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@
"build": "npm run build-css && react-scripts build",
"serve": "npm run build && pm2 serve -s build",
"test": "react-scripts test --env=jsdom",
"eslint": "eslint 'src/**/*.js*'",
"eslint:fix": "npm run eslint --fix",
"eslint": "eslint src/**/*.js*",
"eslint:fix": "eslint --fix src/**/*.js*",
"eject": "react-scripts eject",
"prettify": "prettier --write 'src/**/*.js*'",
"doc": "jsdoc src -r -d docs"
Expand Down
30 changes: 14 additions & 16 deletions src/components/BackupWalletButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,20 @@ const BackupWalletButton = ({ wallet, onBackup }) => (
// No wallet found
) */}

{wallet &&
Array.isArray(wallet.keystores) &&
wallet.keystores.length > 0 && (
<a
className="btn btn-success"
onClick={onBackup}
href={URL.createObjectURL(
new Blob([JSON.stringify(wallet.keystores)], {
type: 'application/json',
}),
)}
download={`UTC--${new Date().toISOString()}-${wallet.keystores[0].address}.json`}
>
Download Backup File
</a>
)}
{wallet && Array.isArray(wallet.keystores) && wallet.keystores.length > 0 && (
<a
className="btn btn-success"
onClick={onBackup}
href={URL.createObjectURL(
new Blob([JSON.stringify(wallet.keystores)], {
type: 'application/json',
}),
)}
download={`UTC--${new Date().toISOString()}-${wallet.keystores[0].address}.json`}
>
Download Backup File
</a>
)}
</span>
);

Expand Down
73 changes: 35 additions & 38 deletions src/components/Balances.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,45 +9,42 @@ import DAC from 'models/DAC';
*/
const Balances = ({ entity }) => (
<div className="dashboard-table-view">
{entity.donationCounters &&
entity.donationCounters.length > 0 && (
<Fragment>
<h4>Current balance</h4>
<div className="table-container">
<table
className="table table-responsive table-hover"
style={{ marginTop: 0, marginBottom: '50px' }}
>
<thead>
<tr>
<th className="td-donations-amount">Current balance</th>
<th className="td-donations-number">Number of donations</th>
<th className="td-donations-amount">Total donated</th>
{entity.donationCounters && entity.donationCounters.length > 0 && (
<Fragment>
<h4>Current balance</h4>
<div className="table-container">
<table
className="table table-responsive table-hover"
style={{ marginTop: 0, marginBottom: '50px' }}
>
<thead>
<tr>
<th className="td-donations-amount">Current balance</th>
<th className="td-donations-number">Number of donations</th>
<th className="td-donations-amount">Total donated</th>
</tr>
</thead>
<tbody>
{entity.donationCounters.map(dc => (
<tr key={dc._id}>
<td className="td-donations-amount">
{dc.currentBalance && dc.currentBalance !== 'null'
? dc.currentBalance.toNumber()
: 0}{' '}
{dc.symbol}
</td>
<td className="td-donations-number">{dc.donationCount || 0}</td>
<td className="td-donations-amount">
{dc.totalDonated && dc.totalDonated !== 'null' ? dc.totalDonated.toNumber() : 0}{' '}
{dc.symbol}
</td>
</tr>
</thead>
<tbody>
{entity.donationCounters.map(dc => (
<tr key={dc._id}>
<td className="td-donations-amount">
{dc.currentBalance && dc.currentBalance !== 'null'
? dc.currentBalance.toNumber()
: 0}{' '}
{dc.symbol}
</td>
<td className="td-donations-number">{dc.donationCount || 0}</td>
<td className="td-donations-amount">
{dc.totalDonated && dc.totalDonated !== 'null'
? dc.totalDonated.toNumber()
: 0}{' '}
{dc.symbol}
</td>
</tr>
))}
</tbody>
</table>
</div>
</Fragment>
)}
))}
</tbody>
</table>
</div>
</Fragment>
)}
</div>
);

Expand Down
2 changes: 1 addition & 1 deletion src/components/ConversationModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ class ConversationModal extends Component {

{enableAttachProof && (
<div className="col-md-6">
<label>Attachments</label>
<span className="label">Attachments</span>
<MilestoneProof
isEditMode
items={items}
Expand Down
2 changes: 1 addition & 1 deletion src/components/DatePickerFormsy.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class DatePickerFormsy extends React.Component {

return (
<div className={`form-group ${className}`}>
<label>
<label htmlFor="datePicker">
{this.props.label}
<DatePicker
id="datePicker"
Expand Down
166 changes: 83 additions & 83 deletions src/components/DelegateMultipleButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -344,91 +344,91 @@ class DelegateMultipleButton extends Component {
{milestone ? milestone.title : campaign.title}{' '}
</p>
)}
{this.state.objectToDelegateFrom.length === 1 &&
isLoadingDonations && <Loader className="small btn-loader" />}
{this.state.objectToDelegateFrom.length === 1 &&
!isLoadingDonations && (
<div>
{(!this.props.milestone || !this.props.milestone.acceptsSingleToken) && (
<SelectFormsy
name="token"
id="token-select"
label={`Select token or ${config.nativeTokenName} to delegate`}
helpText=""
value={selectedToken && selectedToken.address}
cta="--- Select ---"
options={tokenWhitelistOptions}
onChange={address => this.setToken(address)}
/>
)}

{delegations.length === 0 && (
<p>
The amount available to delegate is {maxAmount.toFixed()}{' '}
{selectedToken.symbol}. Please select a different currency or different
source DAC/Campaign.
</p>
)}
{delegations.length > 0 && (
<div>
<span className="label">Amount {selectedToken.symbol} to delegate:</span>

<div className="form-group">
<Slider
type="range"
name="amount2"
min={0}
max={maxAmount.toNumber()}
step={maxAmount.toNumber() / 10}
value={Number(amount)}
labels={{ 0: '0', [maxAmount.toNumber()]: maxAmount.toFixed() }}
tooltip={false}
onChange={newAmount =>
this.setState(prevState => ({
amount: prevState.maxAmount.gte(newAmount)
? newAmount.toFixed(2)
: prevState.maxAmount.toFixed(2),
}))
}
/>
</div>

<div className="form-group">
<Input
type="number"
validations={`greaterThan:0,isNumeric,lessOrEqualTo:${maxAmount.toNumber()}`}
validationErrors={{
greaterThan: 'Enter value greater than 0',
lessOrEqualTo: `The donations you are delegating have combined value of ${maxAmount.toNumber()}. Do not input higher amount than that.`,
isNumeric: 'Provide correct number',
}}
name="amount"
value={amount}
onChange={(name, newAmount) => this.setState({ amount: newAmount })}
/>
</div>

<button
className="btn btn-success"
formNoValidate
type="submit"
disabled={isSaving || !isCorrectNetwork}
>
{isSaving ? 'Delegating...' : 'Delegate here'}
</button>
<button
className="btn btn-light float-right"
type="button"
onClick={() => {
this.setState({ modalVisible: false });
{this.state.objectToDelegateFrom.length === 1 && isLoadingDonations && (
<Loader className="small btn-loader" />
)}
{this.state.objectToDelegateFrom.length === 1 && !isLoadingDonations && (
<div>
{(!this.props.milestone || !this.props.milestone.acceptsSingleToken) && (
<SelectFormsy
name="token"
id="token-select"
label={`Select token or ${config.nativeTokenName} to delegate`}
helpText=""
value={selectedToken && selectedToken.address}
cta="--- Select ---"
options={tokenWhitelistOptions}
onChange={address => this.setToken(address)}
/>
)}

{delegations.length === 0 && (
<p>
The amount available to delegate is {maxAmount.toFixed()}{' '}
{selectedToken.symbol}. Please select a different currency or different source
DAC/Campaign.
</p>
)}
{delegations.length > 0 && (
<div>
<span className="label">Amount {selectedToken.symbol} to delegate:</span>

<div className="form-group">
<Slider
type="range"
name="amount2"
min={0}
max={maxAmount.toNumber()}
step={maxAmount.toNumber() / 10}
value={Number(amount)}
labels={{ 0: '0', [maxAmount.toNumber()]: maxAmount.toFixed() }}
tooltip={false}
onChange={newAmount =>
this.setState(prevState => ({
amount: prevState.maxAmount.gte(newAmount)
? newAmount.toFixed(2)
: prevState.maxAmount.toFixed(2),
}))
}
/>
</div>

<div className="form-group">
<Input
type="number"
validations={`greaterThan:0,isNumeric,lessOrEqualTo:${maxAmount.toNumber()}`}
validationErrors={{
greaterThan: 'Enter value greater than 0',
lessOrEqualTo: `The donations you are delegating have combined value of ${maxAmount.toNumber()}. Do not input higher amount than that.`,
isNumeric: 'Provide correct number',
}}
>
Close
</button>
name="amount"
value={amount}
onChange={(name, newAmount) => this.setState({ amount: newAmount })}
/>
</div>
)}
</div>
)}

<button
className="btn btn-success"
formNoValidate
type="submit"
disabled={isSaving || !isCorrectNetwork}
>
{isSaving ? 'Delegating...' : 'Delegate here'}
</button>
<button
className="btn btn-light float-right"
type="button"
onClick={() => {
this.setState({ modalVisible: false });
}}
>
Close
</button>
</div>
)}
</div>
)}
</Form>
)}
</Modal>
Expand Down
Loading