-
Notifications
You must be signed in to change notification settings - Fork 37
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
Renaming issue #168
Conversation
+ Closes all open windows associated with contract
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.
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]
- Create a New project from Hello World template.
- Now, proceed with the following actions, always accessing it from the left side menu:
- Expand
HelloWorld.sol
in the Files hierarchy; - Click Configure: rename
HelloWorld
tob
. Save; - Expand
b.sol
; - Click Configure. Do nothing. Leave the tab open.
- Click Compile. Leave the tab open. (Could also be triggered from the editor menu)
- Click Deploy. Leave the tab open. (Could also be triggered from the editor menu)
- 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) { |
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.
@bashlund I still believe we shouldn't make the decision for the user, restricting how long SC name can it be.
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.