-
-
Notifications
You must be signed in to change notification settings - Fork 775
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
chore: cross-chain improvs #6472
Changes from 2 commits
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 |
---|---|---|
|
@@ -9,7 +9,6 @@ const loadingState = { | |
}; | ||
|
||
document.result = bounty; | ||
// listen_for_web3_changes(); | ||
|
||
Vue.mixin({ | ||
methods: { | ||
|
@@ -44,6 +43,52 @@ Vue.mixin({ | |
_alert('Error fetching bounties. Please contact [email protected]', 'error'); | ||
}); | ||
}, | ||
getTransactionURL: function(token_name, txn) { | ||
let url; | ||
|
||
switch (token_name) { | ||
case 'ETC': | ||
url = `https://blockscout.com/etc/mainnet/tx/${txn}`; | ||
break; | ||
|
||
case 'cUSD': | ||
case 'cGLD': | ||
url = `https://alfajores-blockscout.celo-testnet.org/tx/${txn}`; | ||
break; | ||
|
||
case 'ZIL': | ||
url = `https://viewblock.io/zilliqa/tx/${txn}`; | ||
break; | ||
|
||
default: | ||
url = `https://etherscan.io/tx/${txn}`; | ||
|
||
} | ||
return url; | ||
}, | ||
getAddressURL: function(token_name, address) { | ||
let url; | ||
|
||
switch (token_name) { | ||
case 'ETC': | ||
url = `https://blockscout.com/etc/mainnet/address/${address}`; | ||
break; | ||
|
||
case 'cUSD': | ||
case 'cGLD': | ||
url = `https://alfajores-blockscout.celo-testnet.org/address/${address}`; | ||
break; | ||
|
||
case 'ZIL': | ||
url = `https://viewblock.io/zilliqa/address/${address}`; | ||
break; | ||
|
||
default: | ||
url = `https://etherscan.io/address/${address}`; | ||
} | ||
return url; | ||
}, | ||
|
||
syncBounty: function() { | ||
let vm = this; | ||
|
||
|
@@ -272,15 +317,6 @@ Vue.mixin({ | |
} | ||
document.location.href = `${vm.bounty.url}?snooze=${text}`; | ||
}, | ||
overrideStatus: function() { | ||
let vm = this; | ||
let text = window.prompt('What new status (valid choices: "open", "started", "submitted", "done", "expired", "cancelled", "" to remove override )?', ''); | ||
|
||
if (text === null) { | ||
return; | ||
} | ||
document.location.href = `${vm.bounty.url}?admin_override_satatus=${text}`; | ||
}, | ||
hasAcceptedFulfillments: function() { | ||
let vm = this; | ||
|
||
|
@@ -370,13 +406,6 @@ Vue.mixin({ | |
activities.forEach(activity => { | ||
if (activity.metadata) { | ||
if (activity.metadata.new_bounty) { | ||
// ETH | ||
activity.metadata.new_bounty['token_value'] = activity.metadata.new_bounty.value_in_token / 10 ** decimals; | ||
if (activity.metadata.old_bounty) { | ||
activity.metadata.old_bounty['token_value'] = activity.metadata.old_bounty.value_in_token / 10 ** decimals; | ||
} | ||
} else { | ||
// cross-chain | ||
activity.metadata['token_value'] = activity.metadata.value_in_token / 10 ** decimals; | ||
} | ||
} | ||
|
@@ -502,7 +531,6 @@ var extend_expiration = function(bounty_pk, data) { | |
}; | ||
|
||
var show_interest_modal = function() { | ||
var self = this; | ||
var modals = $('#modalInterest'); | ||
let modalBody = $('#modalInterest .modal-content'); | ||
let modalUrl = `/interest/modal?redirect=${window.location.pathname}&pk=${document.result['pk']}`; | ||
|
@@ -529,9 +557,6 @@ var show_interest_modal = function() { | |
discord_username: $('#discord_username').length ? $('#discord_username').val() : null | ||
}).then(success => { | ||
if (success) { | ||
// $(self).attr('href', '/uninterested'); | ||
// $(self).find('span').text(gettext('Stop Work')); | ||
// $(self).parent().attr('title', '<div class="tooltip-info tooltip-sm">' + gettext('Notify the funder that you will not be working on this project') + '</div>'); | ||
appBounty.fetchBounty(); | ||
modals.bootstrapModal('hide'); | ||
|
||
|
@@ -579,17 +604,4 @@ const promisify = (inner) => | |
resolve(res); | ||
} | ||
}) | ||
); | ||
|
||
// async function waitBlock(txid) { | ||
// while (true) { | ||
// let receipt = web3.eth.getTransactionReceipt(txid); | ||
// if (receipt && receipt.contractAddress) { | ||
// console.log("Your contract has been deployed at http://testnet.etherscan.io/address/" + receipt.contractAddress); | ||
// console.log("Note that it might take 30 - 90 sceonds for the block to propagate befor it's visible in etherscan.io"); | ||
// break; | ||
// } | ||
// console.log("Waiting a mined block to include your contract... currently in block " + web3.eth.blockNumber); | ||
// await sleep(4000); | ||
// } | ||
// } | ||
); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,7 +38,6 @@ | |
<a v-for="link in quickLinks" class="btn btn-outline-gc-blue px-2 mx-2 font-smaller-4" :href="[[link.href]]" :title="[[ link.title ]]">[[ link.label ]]</a> | ||
<button class="btn btn-outline-gc-blue px-2 mx-2 font-smaller-4" @click="contactFunder()">Contact Funder</button> | ||
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. these removed are not part of quickLinks since are not links, are prompts and I fixed them to not send the actions if are empty (today that is broken in normal bounties if you click that prompts then the action is sent even without nothing 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. Added this back ! |
||
<button class="btn btn-outline-gc-blue px-2 mx-2 font-smaller-4" @click="overrideStatus()">Override Status</button> | ||
<button class="btn btn-outline-gc-blue px-2 mx-2 font-smaller-4" @click="snoozeeGitbot()">Snooze Gitcoinbot</button> | ||
</div> | ||
<div class="col-12" v-if="loadingState === 'resolved'"> | ||
{% if event_tag %} | ||
|
@@ -273,7 +272,7 @@ <h5 class="font-body font-weight-semibold">{% trans "SUBMISSIONS" %}</h5> | |
[[ fulfillment.profile.handle ]] | ||
</a> | ||
<div class="font-smaller-4" v-if="fulfillment.fulfiller_address"> | ||
<a :href="`${is_bounties_network ? `https://etherscan.io/address/${fulfillment.fulfiller_address}` : `https://classic.etccoopexplorer.com/address/${fulfillment.fulfiller_address}` }`" target="_blank">[[ fulfillment.fulfiller_address | truncateHash ]]</a> | ||
<a :href="getAddressURL(fulfillment.token_name, fulfillment.fulfiller_address)" target="_blank">[[ fulfillment.fulfiller_address | truncateHash ]]</a> | ||
<button class="btn btn-sm my-0 px-1" @click="copyTextToClipboard(fulfillment.fulfiller_address)"> | ||
<i class="far fa-clipboard-check"></i> | ||
</button> | ||
|
@@ -291,7 +290,7 @@ <h5 class="font-body font-weight-semibold">{% trans "SUBMISSIONS" %}</h5> | |
<i class="fas fa-check mr-2 font-caption"></i> Bounty Paid | ||
</span> | ||
<p class="font-smaller-4 my-0"> | ||
<a :href="`${is_bounties_network ? `https://etherscan.io/address/${fulfillment.payout_tx_id}` : `https://classic.etccoopexplorer.com/tx/${fulfillment.payout_tx_id}` }`" target="_blank">([[ fulfillment.payout_tx_id | truncateHash ]])</a> | ||
<a :href="getTransactionURL(fulfillment.token_name, fulfillment.payout_tx_id)" target="_blank">([[ fulfillment.payout_tx_id | truncateHash ]])</a> | ||
<button class="btn btn-sm my-0 px-1" @click="copyTextToClipboard(fulfillment.payout_tx_id)"> | ||
<i class="far fa-clipboard-check"></i> | ||
</button> | ||
|
@@ -303,16 +302,26 @@ <h5 class="font-body font-weight-semibold">{% trans "SUBMISSIONS" %}</h5> | |
<i class="fas fa-spinner fa-spin mr-2 font-caption"></i>Pending Verification | ||
</button> | ||
<p class="font-smaller-4 my-0"> | ||
<a :href="`${is_bounties_network ? `https://etherscan.io/address/${fulfillment.payout_tx_id}` : `https://classic.etccoopexplorer.com/tx/${fulfillment.payout_tx_id}` }`" target="_blank">([[ fulfillment.payout_tx_id | truncateHash ]])</a> | ||
<a :href="getTransactionURL(fulfillment.token_name, fulfillment.payout_tx_id)" target="_blank">([[ fulfillment.payout_tx_id | truncateHash ]])</a> | ||
<button class="btn btn-sm my-0 px-1" @click="copyTextToClipboard(fulfillment.payout_tx_id)"> | ||
<i class="far fa-clipboard-check"></i> | ||
</button> | ||
</p> | ||
</template> | ||
|
||
<button v-else data-toggle="modal" :data-target="`#payoutModal${fulfillment.pk}`" class="btn btn-sm btn-gc-blue my-auto px-3 font-smaller-2 font-weight-semibold"> | ||
<i class="fas fa-money-check-alt mr-2 font-caption"></i>Payout Bounty | ||
</button> | ||
<template v-else> | ||
<template v-if="fulfillment.payout_status == 'expired'"> | ||
<span class="font-smaller-1 position-relative" style="top: 2px" data-html="true" data-toggle="tooltip" | ||
title="<div class='tooltip-info text-left'><p class='font-smaller-1 font-weight-semibold mb-1'>We couldn't find the transaction on chain</p><p class='mb-0 font-smaller-2'>Please ensure the payment has been made and click on payout bounty </p></div>"> | ||
<i class="fas fa-exclamation-triangle text-danger mr-3"></i> | ||
</span> | ||
</template> | ||
|
||
<button data-toggle="modal" :data-target="`#payoutModal${fulfillment.pk}`" class="btn btn-sm btn-gc-blue my-auto px-3 font-smaller-2 font-weight-semibold"> | ||
<i class="fas fa-money-check-alt mr-2 font-caption"></i>Payout Bounty | ||
</button> | ||
</template> | ||
|
||
</template> | ||
|
||
<template v-else> | ||
|
@@ -321,7 +330,7 @@ <h5 class="font-body font-weight-semibold">{% trans "SUBMISSIONS" %}</h5> | |
<i class="fas fa-check mr-2 font-caption"></i> Bounty Paid | ||
</span> | ||
<p class="font-smaller-4 my-0"> | ||
<a :href="`${is_bounties_network ? `https://etherscan.io/address/${fulfillment.payout_tx_id}` : `https://classic.etccoopexplorer.com/tx/${fulfillment.payout_tx_id}` }`" target="_blank">([[ fulfillment.payout_tx_id | truncateHash ]])</a> | ||
<a :href="getTransactionURL(fulfillment.token_name, fulfillment.payout_tx_id)" target="_blank">([[ fulfillment.payout_tx_id | truncateHash ]])</a> | ||
<button class="btn btn-sm my-0 px-1" @click="copyTextToClipboard(fulfillment.payout_tx_id)"> | ||
<i class="far fa-clipboard-check"></i> | ||
</button> | ||
|
@@ -332,7 +341,7 @@ <h5 class="font-body font-weight-semibold">{% trans "SUBMISSIONS" %}</h5> | |
<i class="fas fa-spinner fa-spin mr-2 font-caption"></i>Pending Verification | ||
</button> | ||
<p class="font-smaller-4 my-0"> | ||
<a :href="`${is_bounties_network ? `https://etherscan.io/address/${fulfillment.payout_tx_id}` : `https://classic.etccoopexplorer.com/tx/${fulfillment.payout_tx_id}` }`" target="_blank">([[ fulfillment.payout_tx_id | truncateHash ]])</a> | ||
<a :href="getTransactionURL(fulfillment.token_name, fulfillment.payout_tx_id)" target="_blank">([[ fulfillment.payout_tx_id | truncateHash ]])</a> | ||
<button class="btn btn-sm my-0 px-1" @click="copyTextToClipboard(fulfillment.payout_tx_id)"> | ||
<i class="far fa-clipboard-check"></i> | ||
</button> | ||
|
@@ -371,7 +380,7 @@ <h5 class="font-body font-weight-semibold">{% trans "SUBMISSIONS" %}</h5> | |
|
||
<p v-if="bounty.bounty_owner_address"> | ||
<span class="d-block">Scan QR code using address</span> | ||
<span class="font-subheader font-weight-semibold">[[bounty.bounty_owner_address]]</span> | ||
<a :href="getAddressURL(bounty.token_name, bounty.bounty_owner_address)" target="_blank" class="font-subheader font-weight-semibold">[[bounty.bounty_owner_address]]</a> | ||
</p> | ||
|
||
<p class="payout-input-amount-container font-weight-semibold "> | ||
|
@@ -664,17 +673,14 @@ <h3>{{ noscript.keywords }}</h3> | |
<script> | ||
$('body').bootstrapTooltip({ | ||
selector: '[data-toggle="tooltip"]', | ||
template: '<div class="no-tooltip" role="tooltip"><div class="tooltip-inner"></div></div>' | ||
template: '<div class="no-tooltip" role="tooltip"><div class="tooltip-inner font-smaller-2"></div></div>' | ||
}); | ||
|
||
$('[data-toggle="popover"]').popover() | ||
$('body').on('mouseover', '[data-username]', function(e) { | ||
openContributorPopOver($(this).data('username'), $(this)); | ||
}); | ||
|
||
// $('body').on('mouseout', '[data-username]', function(e) { | ||
// $(this).popover('dispose'); | ||
// }); | ||
|
||
$('body').on('show.bs.popover', '[data-username]', function () { | ||
$('body [data-username]').not(this).popover('hide'); | ||
}) | ||
|
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.
are not going to jump and use this file in eth bounties in near future?
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'd want to do it via the backend where we streamline the response and then pass it to the frontend !
Activity will be in common format when it comes to frontend (irrespective of if it's ETH or cross-chain)