update label

pull/2461/head
yann300 3 years ago
parent 02fcb5770b
commit 04b099986f
  1. 6
      apps/remix-ide-e2e/src/tests/publishContract.test.ts
  2. 8
      libs/remix-ui/publish-to-storage/src/lib/publish-to-storage.tsx

@ -25,7 +25,7 @@ module.exports = {
const value = <string>(result.value) const value = <string>(result.value)
browser.perform((done) => { browser.perform((done) => {
if (value.indexOf('Metadata of "ballot" was published successfully.') === -1) browser.assert.fail('ipfs deploy failed') if (value.indexOf('Metadata and sources of "ballot" were published successfully.') === -1) browser.assert.fail('ipfs deploy failed')
done() done()
}) })
}) })
@ -43,7 +43,7 @@ module.exports = {
const value = <string>(result.value) const value = <string>(result.value)
browser.perform((done) => { browser.perform((done) => {
if (value.indexOf('Metadata of "ballot" was published successfully.') === -1) browser.assert.fail('swarm deploy failed') if (value.indexOf('Metadata and sources of "ballot" were published successfully.') === -1) browser.assert.fail('swarm deploy failed')
if (value.indexOf('bzz') === -1) browser.assert.fail('swarm deploy failed') if (value.indexOf('bzz') === -1) browser.assert.fail('swarm deploy failed')
done() done()
}) })
@ -67,7 +67,7 @@ module.exports = {
.getText('[data-id="udappModalDialogModalBody-react"]', (result) => { .getText('[data-id="udappModalDialogModalBody-react"]', (result) => {
const value = typeof result.value === 'string' ? result.value : null const value = typeof result.value === 'string' ? result.value : null
if (value.indexOf('Metadata of "storage" was published successfully.') === -1) browser.assert.fail('ipfs deploy failed') if (value.indexOf('Metadata and sources of "storage" were published successfully.') === -1) browser.assert.fail('ipfs deploy failed')
}) })
.modalFooterOKClick('udapp') .modalFooterOKClick('udapp')
}, },

@ -28,7 +28,7 @@ export const PublishToStorage = (props: RemixUiPublishToStorageProps) => {
try { try {
const result = await publishToSwarm(contract, api) const result = await publishToSwarm(contract, api)
modal(`Published ${contract.name}'s Metadata`, publishMessage(result.uploaded)) modal(`Published ${contract.name}'s Metadata and Sources`, publishMessage(result.uploaded))
} catch (err) { } catch (err) {
let parseError = err let parseError = err
try { try {
@ -41,7 +41,7 @@ export const PublishToStorage = (props: RemixUiPublishToStorageProps) => {
try { try {
const result = await publishToIPFS(contract, api) const result = await publishToIPFS(contract, api)
modal(`Published ${contract.name}'s Metadata`, publishMessage(result.uploaded)) modal(`Published ${contract.name}'s Metadata and Sources`, publishMessage(result.uploaded))
} catch (err) { } catch (err) {
modal('IPFS Publish Failed', publishMessageFailed(storage, err)) modal('IPFS Publish Failed', publishMessageFailed(storage, err))
} }
@ -55,7 +55,7 @@ export const PublishToStorage = (props: RemixUiPublishToStorageProps) => {
}, [storage]) }, [storage])
const publishMessage = (uploaded) => ( const publishMessage = (uploaded) => (
<span> Metadata of "{contract.name.toLowerCase()}" was published successfully. <br /> <span> Metadata and sources of "{contract.name.toLowerCase()}" were published successfully. <br />
<pre> <pre>
<div> <div>
{ uploaded.map((value, index) => <div key={index}><b>{ value.filename }</b> : <pre>{ value.output.url }</pre></div>) } { uploaded.map((value, index) => <div key={index}><b>{ value.filename }</b> : <pre>{ value.output.url }</pre></div>) }
@ -65,7 +65,7 @@ export const PublishToStorage = (props: RemixUiPublishToStorageProps) => {
) )
const publishMessageFailed = (storage, err) => ( const publishMessageFailed = (storage, err) => (
<span>Failed to publish metadata file to { storage }, please check the { storage } gateways is available. <br /> <span>Failed to publish metadata file and sources to { storage }, please check the { storage } gateways is available. <br />
{err} {err}
</span> </span>
) )

Loading…
Cancel
Save