From 1eac82f2d0a0091482d747d5030db400f0fd36bc Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Wed, 25 Mar 2020 14:39:03 +0000 Subject: [PATCH 1/7] Added contract name to success modal --- src/app/tabs/compile-tab.js | 5 +++-- src/app/ui/modal-dialog-custom.js | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index 2918f50772c..799ac71e484 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -316,6 +316,7 @@ class CompileTab extends ViewPlugin { publish (storage) { if (this.selectedContract) { var contract = this.data.contractsDetails[this.selectedContract] + if (contract.metadata === undefined || contract.metadata.length === 0) { modalDialogCustom.alert('This contract may be abstract, may not implement an abstract parent\'s methods completely or not invoke an inherited contract\'s constructor correctly.') } else { @@ -331,7 +332,7 @@ class CompileTab extends ViewPlugin { var result = yo`
${uploaded.map((value) => { return yo`
${value.filename} :
${value.output.url}
` })}
` - modalDialogCustom.alert(yo`Metadata published successfully.
${result}
`) + modalDialogCustom.alert(`Published ${contract.name} Metadata`, yo`Metadata of ${contract.name.toLowerCase()} contract was published successfully.
${result}
`) } }, (item) => { // triggered each time there's a new verified publish (means hash correspond) this.fileProvider.addExternal('swarm/' + item.hash, item.content) @@ -348,7 +349,7 @@ class CompileTab extends ViewPlugin { var result = yo`
${uploaded.map((value) => { return yo`
${value.filename} :
${value.output.url}
` })}
` - modalDialogCustom.alert(yo`Metadata published successfully.
${result}
`) + modalDialogCustom.alert(`Published ${contract.name} Metadata`, yo`Metadata of ${contract.name.toLowerCase()} contract was published successfully.
${result}
`) } }, (item) => { // triggered each time there's a new verified publish (means hash correspond) this.fileProvider.addExternal('ipfs/' + item.hash, item.content) diff --git a/src/app/ui/modal-dialog-custom.js b/src/app/ui/modal-dialog-custom.js index 93b139e88a4..a02b5ee099c 100644 --- a/src/app/ui/modal-dialog-custom.js +++ b/src/app/ui/modal-dialog-custom.js @@ -3,8 +3,9 @@ var yo = require('yo-yo') var css = require('./styles/modal-dialog-custom-styles') module.exports = { - alert: function (text) { - return modal('', yo`
${text}
`, null, { label: null }) + alert: function (title, text) { + if(text) return modal(title, yo`
${text}
`, null, { label: null }) + return modal('', yo`
${title}
`, null, { label: null }) }, prompt: function (title, text, inputValue, ok, cancel, focus) { return prompt(title, text, false, inputValue, ok, cancel, focus) From 0b607a52a1423d0e0acf3874b51071f947ec2c4e Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Wed, 25 Mar 2020 14:44:12 +0000 Subject: [PATCH 2/7] Fixed linting error --- src/app/ui/modal-dialog-custom.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/ui/modal-dialog-custom.js b/src/app/ui/modal-dialog-custom.js index a02b5ee099c..d1e4bca67a6 100644 --- a/src/app/ui/modal-dialog-custom.js +++ b/src/app/ui/modal-dialog-custom.js @@ -4,7 +4,7 @@ var css = require('./styles/modal-dialog-custom-styles') module.exports = { alert: function (title, text) { - if(text) return modal(title, yo`
${text}
`, null, { label: null }) + if (text) return modal(title, yo`
${text}
`, null, { label: null }) return modal('', yo`
${title}
`, null, { label: null }) }, prompt: function (title, text, inputValue, ok, cancel, focus) { From ac3bbdd9849376cdfba5fc87a42112cc75c35b79 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Thu, 26 Mar 2020 10:47:17 +0000 Subject: [PATCH 3/7] Update metadata assertion --- test-browser/tests/publishContract.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-browser/tests/publishContract.js b/test-browser/tests/publishContract.js index 8ed0ad72e7c..36fe03e6509 100644 --- a/test-browser/tests/publishContract.js +++ b/test-browser/tests/publishContract.js @@ -17,7 +17,7 @@ module.exports = { .verifyContracts(['Ballot']) .click('#publishOnIpfs') .getModalBody((value, done) => { - if (value.indexOf('Metadata published successfully.') === -1) browser.assert.fail('ipfs deploy failed', '', '') + if (value.indexOf('Metadata of ballot contract was published successfully.') === -1) browser.assert.fail('ipfs deploy failed', '', '') if (value.indexOf('dweb:/ipfs') === -1) browser.assert.fail('ipfs deploy failed', '', '') done() }) From fdadb949ba3911eba33ae6926bb11a72068e85fe Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Fri, 27 Mar 2020 15:36:50 +0000 Subject: [PATCH 4/7] Added quotes to contract name --- src/app/tabs/compile-tab.js | 4 ++-- test-browser/tests/publishContract.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index 799ac71e484..9ade0a943e9 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -332,7 +332,7 @@ class CompileTab extends ViewPlugin { var result = yo`
${uploaded.map((value) => { return yo`
${value.filename} :
${value.output.url}
` })}
` - modalDialogCustom.alert(`Published ${contract.name} Metadata`, yo`Metadata of ${contract.name.toLowerCase()} contract was published successfully.
${result}
`) + modalDialogCustom.alert(`Published "${contract.name}" Metadata`, yo`Metadata of ${contract.name.toLowerCase()} was published successfully.
${result}
`) } }, (item) => { // triggered each time there's a new verified publish (means hash correspond) this.fileProvider.addExternal('swarm/' + item.hash, item.content) @@ -349,7 +349,7 @@ class CompileTab extends ViewPlugin { var result = yo`
${uploaded.map((value) => { return yo`
${value.filename} :
${value.output.url}
` })}
` - modalDialogCustom.alert(`Published ${contract.name} Metadata`, yo`Metadata of ${contract.name.toLowerCase()} contract was published successfully.
${result}
`) + modalDialogCustom.alert(`Published "${contract.name}" Metadata`, yo`Metadata of ${contract.name.toLowerCase()} was published successfully.
${result}
`) } }, (item) => { // triggered each time there's a new verified publish (means hash correspond) this.fileProvider.addExternal('ipfs/' + item.hash, item.content) diff --git a/test-browser/tests/publishContract.js b/test-browser/tests/publishContract.js index 36fe03e6509..dd8b14dfa7b 100644 --- a/test-browser/tests/publishContract.js +++ b/test-browser/tests/publishContract.js @@ -17,7 +17,7 @@ module.exports = { .verifyContracts(['Ballot']) .click('#publishOnIpfs') .getModalBody((value, done) => { - if (value.indexOf('Metadata of ballot contract was published successfully.') === -1) browser.assert.fail('ipfs deploy failed', '', '') + if (value.indexOf('Metadata of ballot was published successfully.') === -1) browser.assert.fail('ipfs deploy failed', '', '') if (value.indexOf('dweb:/ipfs') === -1) browser.assert.fail('ipfs deploy failed', '', '') done() }) @@ -28,7 +28,7 @@ module.exports = { browser .click('#publishOnSwarm') .getModalBody((value, done) => { - if (value.indexOf('Metadata published successfully.') === -1) browser.assert.fail('swarm deploy failed', '', '') + if (value.indexOf('Metadata of ballot was successfully.') === -1) browser.assert.fail('swarm deploy failed', '', '') if (value.indexOf('bzz') === -1) browser.assert.fail('swarm deploy failed', '', '') done() }) From 5a4cb644244ed8936feea272a9bcf42fac218bc4 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Tue, 31 Mar 2020 07:51:22 +0000 Subject: [PATCH 5/7] Added apostrophe to contracts name --- src/app/tabs/compile-tab.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index 9ade0a943e9..23cb1ad342a 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -332,7 +332,7 @@ class CompileTab extends ViewPlugin { var result = yo`
${uploaded.map((value) => { return yo`
${value.filename} :
${value.output.url}
` })}
` - modalDialogCustom.alert(`Published "${contract.name}" Metadata`, yo`Metadata of ${contract.name.toLowerCase()} was published successfully.
${result}
`) + modalDialogCustom.alert(`Published "${contract.name}'s" Metadata`, yo`Metadata of ${contract.name.toLowerCase()} was published successfully.
${result}
`) } }, (item) => { // triggered each time there's a new verified publish (means hash correspond) this.fileProvider.addExternal('swarm/' + item.hash, item.content) @@ -349,7 +349,7 @@ class CompileTab extends ViewPlugin { var result = yo`
${uploaded.map((value) => { return yo`
${value.filename} :
${value.output.url}
` })}
` - modalDialogCustom.alert(`Published "${contract.name}" Metadata`, yo`Metadata of ${contract.name.toLowerCase()} was published successfully.
${result}
`) + modalDialogCustom.alert(`Published "${contract.name}'s" Metadata`, yo`Metadata of ${contract.name.toLowerCase()} was published successfully.
${result}
`) } }, (item) => { // triggered each time there's a new verified publish (means hash correspond) this.fileProvider.addExternal('ipfs/' + item.hash, item.content) From 393695f506a942b9f4f55d2ddeb39c4952733951 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Tue, 31 Mar 2020 09:11:57 +0000 Subject: [PATCH 6/7] removed double quotes --- src/app/tabs/compile-tab.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index 23cb1ad342a..0752529d6de 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -332,7 +332,7 @@ class CompileTab extends ViewPlugin { var result = yo`
${uploaded.map((value) => { return yo`
${value.filename} :
${value.output.url}
` })}
` - modalDialogCustom.alert(`Published "${contract.name}'s" Metadata`, yo`Metadata of ${contract.name.toLowerCase()} was published successfully.
${result}
`) + modalDialogCustom.alert(`Published ${contract.name}\'s Metadata`, yo`Metadata of ${contract.name.toLowerCase()} was published successfully.
${result}
`) } }, (item) => { // triggered each time there's a new verified publish (means hash correspond) this.fileProvider.addExternal('swarm/' + item.hash, item.content) @@ -349,7 +349,7 @@ class CompileTab extends ViewPlugin { var result = yo`
${uploaded.map((value) => { return yo`
${value.filename} :
${value.output.url}
` })}
` - modalDialogCustom.alert(`Published "${contract.name}'s" Metadata`, yo`Metadata of ${contract.name.toLowerCase()} was published successfully.
${result}
`) + modalDialogCustom.alert(`Published ${contract.name}\'s Metadata`, yo`Metadata of ${contract.name.toLowerCase()} was published successfully.
${result}
`) } }, (item) => { // triggered each time there's a new verified publish (means hash correspond) this.fileProvider.addExternal('ipfs/' + item.hash, item.content) From 4fd44cc68e02e08de0aec4ceaac239ae66f6e8eb Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Tue, 31 Mar 2020 09:39:29 +0000 Subject: [PATCH 7/7] Fixed linting error --- src/app/tabs/compile-tab.js | 4 ++-- test-browser/tests/publishContract.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index 0752529d6de..31e431c530e 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -332,7 +332,7 @@ class CompileTab extends ViewPlugin { var result = yo`
${uploaded.map((value) => { return yo`
${value.filename} :
${value.output.url}
` })}
` - modalDialogCustom.alert(`Published ${contract.name}\'s Metadata`, yo`Metadata of ${contract.name.toLowerCase()} was published successfully.
${result}
`) + modalDialogCustom.alert(`Published ${contract.name}'s Metadata`, yo`Metadata of "${contract.name.toLowerCase()}" was published successfully.
${result}
`) } }, (item) => { // triggered each time there's a new verified publish (means hash correspond) this.fileProvider.addExternal('swarm/' + item.hash, item.content) @@ -349,7 +349,7 @@ class CompileTab extends ViewPlugin { var result = yo`
${uploaded.map((value) => { return yo`
${value.filename} :
${value.output.url}
` })}
` - modalDialogCustom.alert(`Published ${contract.name}\'s Metadata`, yo`Metadata of ${contract.name.toLowerCase()} was published successfully.
${result}
`) + modalDialogCustom.alert(`Published ${contract.name}'s Metadata`, yo`Metadata of "${contract.name.toLowerCase()}" was published successfully.
${result}
`) } }, (item) => { // triggered each time there's a new verified publish (means hash correspond) this.fileProvider.addExternal('ipfs/' + item.hash, item.content) diff --git a/test-browser/tests/publishContract.js b/test-browser/tests/publishContract.js index dd8b14dfa7b..82b32acc648 100644 --- a/test-browser/tests/publishContract.js +++ b/test-browser/tests/publishContract.js @@ -17,7 +17,7 @@ module.exports = { .verifyContracts(['Ballot']) .click('#publishOnIpfs') .getModalBody((value, done) => { - if (value.indexOf('Metadata of ballot was published successfully.') === -1) browser.assert.fail('ipfs deploy failed', '', '') + if (value.indexOf('Metadata of "ballot" was published successfully.') === -1) browser.assert.fail('ipfs deploy failed', '', '') if (value.indexOf('dweb:/ipfs') === -1) browser.assert.fail('ipfs deploy failed', '', '') done() }) @@ -28,7 +28,7 @@ module.exports = { browser .click('#publishOnSwarm') .getModalBody((value, done) => { - if (value.indexOf('Metadata of ballot was successfully.') === -1) browser.assert.fail('swarm deploy failed', '', '') + if (value.indexOf('Metadata of "ballot" was successfully.') === -1) browser.assert.fail('swarm deploy failed', '', '') if (value.indexOf('bzz') === -1) browser.assert.fail('swarm deploy failed', '', '') done() })