angular-klingon / klingon

Angular Klingon: The UI companion for the @angular/cli
https://angular.run
MIT License
189 stars 19 forks source link

fix(feature): drag and drop angular project #62

Closed sumitparakh closed 5 years ago

sumitparakh commented 5 years ago

drap and drop angular project will set the klingon ui accordingly

restore mode, issue #50

sumitparakh commented 5 years ago

Closes #50

manekinekko commented 5 years ago

When testing this PR on a pixel book. I got the following error:

core.js:1673 ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'isDirectory' of null
TypeError: Cannot read property 'isDirectory' of null
    at import.service.ts:40
    at new ZoneAwarePromise (zone.js:891)
    at ImportService.push../src/app/_shared/utilities/import.service.ts.ImportService.validate (import.service.ts:37)
    at import.service.ts:27
    at new ZoneAwarePromise (zone.js:891)
    at ImportService.<anonymous> (import.service.ts:27)
    at step (terminal.component.ts:37)
    at (link: http://Object.next) Object.next (terminal.component.ts:37)
    at terminal.component.ts:37
    at new ZoneAwarePromise (zone.js:891)
    at resolvePromise (zone.js:814)
    at new ZoneAwarePromise (zone.js:894)
    at ImportService.push../src/app/_shared/utilities/import.service.ts.ImportService.validate (import.service.ts:37)
    at import.service.ts:27
    at new ZoneAwarePromise (zone.js:891)
    at ImportService.<anonymous> (import.service.ts:27)
    at step (terminal.component.ts:37)
    at (link: http://Object.next) Object.next (terminal.component.ts:37)
    at terminal.component.ts:37
    at new ZoneAwarePromise (zone.js:891)

Here is the content of the dataTransfer:

image

sumitparakh commented 5 years ago

When testing this PR on a pixel book. I got the following error:

core.js:1673 ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'isDirectory' of null
TypeError: Cannot read property 'isDirectory' of null
    at import.service.ts:40
    at new ZoneAwarePromise (zone.js:891)
    at ImportService.push../src/app/_shared/utilities/import.service.ts.ImportService.validate (import.service.ts:37)
    at import.service.ts:27
    at new ZoneAwarePromise (zone.js:891)
    at ImportService.<anonymous> (import.service.ts:27)
    at step (terminal.component.ts:37)
    at (link: http://Object.next) Object.next (terminal.component.ts:37)
    at terminal.component.ts:37
    at new ZoneAwarePromise (zone.js:891)
    at resolvePromise (zone.js:814)
    at new ZoneAwarePromise (zone.js:894)
    at ImportService.push../src/app/_shared/utilities/import.service.ts.ImportService.validate (import.service.ts:37)
    at import.service.ts:27
    at new ZoneAwarePromise (zone.js:891)
    at ImportService.<anonymous> (import.service.ts:27)
    at step (terminal.component.ts:37)
    at (link: http://Object.next) Object.next (terminal.component.ts:37)
    at terminal.component.ts:37
    at new ZoneAwarePromise (zone.js:891)

Here is the content of the dataTransfer:

image

I just added some logs to check userAgent and get available methods for dropped object, can you pull and share following console logs(userAgent, available @methods)?

issue62

manekinekko commented 5 years ago

This seems to be known error. Check this thread: https://github.com/froala/wysiwyg-editor/issues/1457#issuecomment-241891846

manekinekko commented 5 years ago

On the pixelbook (Version 71.0.3578.21 (Official Build) dev (64-bit)), the available methods are ["getAsString", "getAsFile", "webkitGetAsEntry"].

sumitparakh commented 5 years ago

I'll try solution suggested in https://github.com/froala/wysiwyg-editor/issues/1457#issuecomment-241891846 tomorrow.

manekinekko commented 5 years ago

Another related issue: https://github.com/electron/electron/issues/9840

sumitparakh commented 5 years ago

Made some changes based on above issues. Can you pull and try now @manekinekko ?

If it doesn't work even after that, then plz tell which log was generated in console:- 1) directory entry getAsEntry, \<value>, OR 2) directory entry webkitGetAsEntry, \<value>

As specified in spec:-

The webkitGetAsEntry() method must run the following steps when invoked:

  1. If the DataTransferItem object is not in the read/write mode or the read-only mode, return null and abort these steps.

    Can you check permission of your folder? (It seems , drop operation is failing at this step in your case)

  2. If the drag data item kind is not File, then return null and abort these steps.
  3. Return a new FileSystemEntry object representing the entry.

Also let me know if your folder name contains non-ascii characters. There is a bug which mentions this case https://bugs.chromium.org/p/chromium/issues/detail?id=149735

manekinekko commented 5 years ago

@sumitparakh I made this issue a low priority. Is that fine by you?

sumitparakh commented 5 years ago

@sumitparakh I made this issue a low priority. Is that fine by you?

That is fine because i'm not able to test pixel book issue. Otherwise it is working fine. @manekinekko

manekinekko commented 5 years ago

Alright. Let's merge it then. We'll open an issue later.

sumitparakh commented 5 years ago

Alright. Let's merge it then. We'll open an issue later.

I've tried to run chrome OS in virtual box to test this feature but it is failing.