Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Directory creation error #4244

Merged
merged 10 commits into from
Jul 11, 2013
Merged

Directory creation error #4244

merged 10 commits into from
Jul 11, 2013

Conversation

thefirstofthe300
Copy link
Contributor

I have two commits in this pull request because GitHub was being stupid and wouldn't let me make a pull request with my other branch.

This should fix issue #3985. I have checked it out on the Linux build so I am not a hundred percent sure but it appears to work just fine.

StringUtils.breakableUrl(data.rslt.name)
)
);
if (selectionEntry.isFile) {
Copy link
Member

Choose a reason for hiding this comment

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

Remove this if statement new if statement and just use suggestions above.

@ghost ghost assigned jasonsanjose Jun 17, 2013
@jasonsanjose
Copy link
Member

Initial review complete

StringUtils.breakableUrl(data.rslt.name)
)
);
}
} else {
Copy link
Contributor

Choose a reason for hiding this comment

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

At this else branch there is another error dialog that always display "File" in the strings as the code fixed. Maybe this could be fixed here too.

@thefirstofthe300
Copy link
Contributor Author

I implemented all code suggestions and everything should work like a charm. :)

"ERROR_CREATING_FILE_TITLE" : "Error creating file",
"ERROR_CREATING_FILE" : "An error occurred when trying to create the file <span class='dialog-filename'>{0}</span>. {1}",
"FILE_ALREADY_EXISTS" : "The {0} <span class='dialog-filename'>{1}</span> already exists.",
"DIRECTORY_ALREADY_EXISTS" : "The directory <span class='dialog-filename'>{0}</span> already exists.",
Copy link
Member

Choose a reason for hiding this comment

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

You probably intended to remove DIRECTORY_ALREADY_EXISTS right?

@jasonsanjose
Copy link
Member

@DaBungalow 3 more comments and we should be ready to merge.

@thefirstofthe300
Copy link
Contributor Author

How does this look?

Strings.FILE_ALREADY_EXISTS,
StringUtils.breakableUrl(data.rslt.name)
)
StringUtils.format(Strings.FILE_ALREADY_EXISTS_TILE, errorString),
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be Strings.INVALID_FILENAME_TITLE instead of Strings.FILE_ALREADY_EXISTS_TILE (typo)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops. You are right.

Copy link
Contributor

Choose a reason for hiding this comment

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

One other small Nit: errorString doesn't sound great as a variable name for this, specially since there is an errString variable. Maybe something like entryType or fileType would be better.

@jasonsanjose
Copy link
Member

@DaBungalow 1 more comment. Please re-test.

@thefirstofthe300
Copy link
Contributor Author

@jasonsanjose I would do the testing myself but I am currently running Linux only and am not sure how to get the test suite running on Linux. Can you point me in the right direction?

Currently, all I see when I open SpecRunner.html is the title bar and nothing else.

Edit: Looking at the SpecRunner.js, it would appear that I need to have Node installed, but I know for a fact that I don't. How to integrate?

@jasonsanjose
Copy link
Member

You could test manually to catch that last issue I caught. It's not ideal, but if you also have access to a mac or win machine that would help too. As you know, there's still plenty of work to do on linux. You can help by implementing node integration :)

@thefirstofthe300
Copy link
Contributor Author

Not sure where to start to integrate Node. I don't have any experience
with it. But I will try. :)

On Wed, Jul 10, 2013 at 4:51 PM, Jason San Jose notifications@github.comwrote:

You could test manually to catch that last issue I caught. It's not ideal,
but if you also have access to a mac or win machine that would help too. As
you know, there's still plenty of work to do on linux. You can help by
implementing node integration :)


Reply to this email directly or view it on GitHubhttps://github.com//pull/4244#issuecomment-20781743
.

Danny Seymour
dannyseeless@gmail.com

@thefirstofthe300
Copy link
Contributor Author

OK. I implemented all of the comments and tested this. On my Linux build, this works perfectly, so it should be good to merge.

@@ -1227,15 +1227,14 @@ define(function (require, exports, module) {
};

var errorCallback = function (error) {
var entryType = isFolder ? Strings.DIRECTORY : Strings.FILE;
if ((error.name === NativeFileError.PATH_EXISTS_ERR) ||
(error.name === NativeFileError.TYPE_MISMATCH_ERR)) {
Copy link
Member

Choose a reason for hiding this comment

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

Almost. I went back to the original bug to test and found some more issues not mentioned.

If you create a file with a name foo, the try to create a directory of the same name, you get "The directory foo already exists" instead of "The file foo already exists"...and vice versa.

You can split the if here with an else if branch to handle TYPE_MISMATCH_ERR separate from PATH_EXISTS_ERROR, that should fix it.

@jasonsanjose
Copy link
Member

One more comment @DaBungalow. Sorry I didn't catch that sooner.

@thefirstofthe300
Copy link
Contributor Author

Is this what you are wanting?

@jasonsanjose
Copy link
Member

Looks good. Thanks for your patience. Merging.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants