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

Renaming issue #168

Merged
merged 7 commits into from
Sep 17, 2018
Merged

Renaming issue #168

merged 7 commits into from
Sep 17, 2018

Conversation

bashlund
Copy link
Contributor

@bashlund bashlund commented Sep 16, 2018

This should sort out the contract renaming issue we've been having.
Contract names are only 16 characters max length in this version since that's the current format, which we likely will extend later on.

@bashlund bashlund added the bug Something isn't working label Sep 16, 2018
@bashlund bashlund self-assigned this Sep 16, 2018
filippsen
filippsen previously approved these changes Sep 16, 2018
Copy link
Contributor

@filippsen filippsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This request resolves issue #99:

  • Project tabs gets automatically closed when saving. The Please close any [...] window alert has been removed;
  • If open, the contract file to be renamed gets automatically closed instead of requiring explicit action by the user;
  • Failed to reproduce the problem as initially described in Add ability to rename a contract file #99 [1]. OK!
  • Reference tests Test 1, Test 2, Test 3 and Test 4 [2] are working, without the need to manually close HelloWorld.sol before saving. OK!

OK!

This request also solves issue #110:

  • The relevant project tabs get automatically closed when deleting a file.

OK!

This request also solves issue #157:

  • Error checking added to contractinteraction.js

OK!

Other/code review:

  • Unused code has been removed (projectname);
  • Maximum length when renaming has been set to 16 characters;

OK!


[1]

  1. Create a New project from Hello World template.
  2. Now, proceed with the following actions, always accessing it from the left side menu:
  3. Expand HelloWorld.sol in the Files hierarchy;
  4. Click Configure: rename HelloWorld to b. Save;
  5. Expand b.sol;
  6. Click Configure. Do nothing. Leave the tab open.
  7. Click Compile. Leave the tab open. (Could also be triggered from the editor menu)
  8. Click Deploy. Leave the tab open. (Could also be triggered from the editor menu)
  9. Click Configure. Rename back to HelloWorld

[2] Please refer to section Current state in issue #99

@@ -145,8 +149,8 @@ export default class ContractEditor extends Component {
alert('Error: Missing fields.');
return;
}
if(!this.contract.obj.name.match(/^([a-zA-Z0-9-_]+)$/)) {
alert('Illegal contract name. Only A-Za-z0-9, dash (-) and underscore (_) allowed.');
if(!this.contract.obj.name.match(/^([a-zA-Z0-9-_]+)$/) || this.contract.obj.name.length > 16) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bashlund I still believe we shouldn't make the decision for the user, restricting how long SC name can it be.

@javier-tarazaga javier-tarazaga added the Plan Item Feature, task or bug which has has already being planned for developemt label Sep 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Plan Item Feature, task or bug which has has already being planned for developemt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants