substance / texture

A visual editor for research.
MIT License
1k stars 85 forks source link

Importing CSL/JSON the app is not getting the file.type #942

Closed sbirAECA closed 6 years ago

sbirAECA commented 6 years ago

I'm trying to import references via CSL/JSON. I ensure the file is well formatted (I see it in the properties as well).

If I run the app (npm run app) then ReferenceUploadComponent is not getting the file.type, so is not uploading anything

npm run app

... but if I start the dar server (npm start), and I check with the same JSON file, now I can see the file.type

npm start

Well, I would use the dar server option but every time I'm trying to save I obtain the same error

err

michael commented 6 years ago

Thank you for reporting. @integral can u confirm that problem, and if yes work on a fix?

sbirAECA commented 6 years ago

I have checked it with all sort of computers: Ubuntu 64 and Win 32 and 64, and in all cases I can't save when using dar-server

Integral commented 6 years ago

@sbirAECA can you please post here your CSL/JSON?

sbirAECA commented 6 years ago

I have to includle dummy DOIs because it is mandatory

[{
        "author": [{
                "family": "Acosta",
                "given": "Y.A."
            }, {
                "family": "Nabi",
                "given": "M.N."
            }, {
                "family": "Dornberger",
                "given": "U."
            }
        ],
        "title": "Technological capability improvement as result of the entrepreneur's search for innovation in the SMEs in Colombia",
        "container-title": "Journal of Marketing Development \u0026 Competitiveness",
        "volume": "6",
        "page": "1–15",
        "URL": "https://search.proquest.com/docview/1315304098",
        "issue": "4",
        "language": "en",
        "urldate": "from",
        "issued": {
            "date-parts": [[2012]]
        },
        "id": "acosta2012a",
        "DOI": "doi_FICTICIO_010",
        "type": "article-journal"
    }, {
        "author": [{
                "family": "Cuero",
                "given": "Y."
            }, {
                "family": "Un Nabi",
                "given": "M."
            }, {
                "family": "Dornberger",
                "given": "U."
            }
        ],
        "title": "Technological Capability Improvement as Result of the Entrepreneur's Search for innovation in the SMEs in Colombia",
        "container-title": "Journal of Marketing Development \u0026 Competitiveness",
        "volume": "6",
        "page": "1–16",
        "URL": "https://search.proquest.com/openview/4f5dfb4b55223e54bcaa85ec1ac19d30/1",
        "issue": "4",
        "language": "en",
        "urldate": "from",
        "issued": {
            "date-parts": [[2012]]
        },
        "id": "cuero2012a",
        "DOI": "doi_FICTICIO_010",
        "type": "article-journal"
    }, {
        "author": [{
                "family": "Kwon",
                "given": "M."
            }, {
                "family": "Cho",
                "given": "Y.C."
            }
        ],
        "title": "Investigating effects of entrepreneurial orientation and management on performance: public vs. private sector",
        "container-title": "Journal of Marketing Thought",
        "volume": "4",
        "page": "12–24",
        "URL": "http://www.ejmt.org/download/201708/JMT2017_8_2.pdf",
        "issue": "2",
        "language": "fr",
        "urldate": "from",
        "issued": {
            "date-parts": [[2017]]
        },
        "id": "kwon2017a",
        "DOI": "doi_FICTICIO_010",
        "type": "article-journal"
    }, {
        "author": [{
                "family": "López",
                "given": "S.A."
            }, {
                "family": "López",
                "given": "M.C."
            }, {
                "family": "Ríos",
                "given": "M.M."
            }
        ],
        "title": "Las capacidades tecnológicas y la experiencia empresarial",
        "container-title": "Revista TECSISTECATL",
        "volume": "19",
        "URL": "http://www.eumed.net/rev/TECSISTECATL/n19/capacidades.html",
        "language": "es",
        "urldate": "from",
        "issued": {
            "date-parts": [[2016]]
        },
        "id": "l2016a",
        "DOI": "doi_FICTICIO_010",
        "type": "article-journal"
    }, {
        "author": [{
                "family": "Poudel",
                "given": "K.P."
            }, {
                "family": "Carter",
                "given": "R."
            }, {
                "family": "Lonial",
                "given": "S."
            }
        ],
        "title": "The process aspect of Entrepreneurial Orientation-Performance Relationship: Uncovering the mediating roles of technological capabilities, innovation, and firm growth",
        "container-title": "Frontiers of Entrepreneurship Research",
        "volume": "32",
        "page": "483–497",
        "URL": "https://digitalknowledge.babson.edu/fer/vol32/iss12/3",
        "issue": "12",
        "language": "en",
        "urldate": "from",
        "issued": {
            "date-parts": [[2012]]
        },
        "id": "poudel2012a",
        "DOI": "doi_FICTICIO_010",
        "type": "article-journal"
    }, {
        "author": [{
                "family": "Welter",
                "given": "C."
            }, {
                "family": "Bosse",
                "given": "D.A."
            }, {
                "family": "Alvarez",
                "given": "A.S."
            }
        ],
        "title": "The interaction between managerial and technological capabilities as a determinant of company performance: an empirical study of biotech firms",
        "container-title": "International Journal of Management",
        "volume": "30",
        "page": "272–284",
        "URL": "https://search.proquest.com/docview/1315212905",
        "issue": "1",
        "language": "en",
        "urldate": "from",
        "issued": {
            "date-parts": [[2013]]
        },
        "id": "welter2013a",
        "DOI": "doi_FICTICIO_010",
        "type": "article-journal"
    }
]
sbirAECA commented 6 years ago

I'm sending you the file export.citeproc01_preparadoTexture.zip

Integral commented 6 years ago

Thank you, I need some time for the investigation as it is working for MAC OS build.

sbirAECA commented 6 years ago

Sorry I don't have a MAC. This is what I have to do to work


> @@ -68,15 +68,17 @@ export default class ReferenceUploadComponent extends Component {
>    }
>  
>    _handleUploadedFiles (files) {
>      Object.values(files).forEach(file => {
>        const isJSON = file.type.indexOf('application/json') === 0
> -      if (isJSON) {
> +   // si comentamos estos hay que asegurarse que se están subiendo 
> +   // archivos CSL/JSON
> +      //if (isJSON) {
>          const reader = new window.FileReader()
>          reader.onload = this._onFileLoad.bind(this)
>          reader.readAsText(file)
> -      }
> +      //}
>      })
>    }
>  
>    _onFileLoad (e) {
>      const res = e.target.result

Always ensuring I'm uploading json files

Integral commented 6 years ago

@sbirAECA I just installed latest version from master branch on Ubuntu, did npm run app and imported file from your archive. I can't see any problems.

Integral commented 6 years ago

I used this dialog... and you?

screen shot 2018-11-08 at 19 15 16
sbirAECA commented 6 years ago

Yes, pressing 'select'

Integral commented 6 years ago

Please give a try with fresh git clone

On Thu, 8 Nov 2018, 19:29 Carlos Martinez <notifications@github.com wrote:

Yes, pressing 'select'

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/substance/texture/issues/942#issuecomment-437060187, or mute the thread https://github.com/notifications/unsubscribe-auth/AALG-jJNxyPQ9wle6C9ZKEyEIGWoF6TKks5utFv-gaJpZM4XTo1M .

Integral commented 6 years ago

There are might be some other problems with building in Linux systems, see #1024

sbirAECA commented 6 years ago

Give me a moment

sbirAECA commented 6 years ago

Again, it is empty fileType (WIN 32) filetype

sbirAECA commented 6 years ago

Here is the screen when I run the command 'npm run app'

npmrunapp

Integral commented 6 years ago

I will check Windows version, thanks

On Fri, 9 Nov 2018, 11:12 Carlos Martinez <notifications@github.com wrote:

Here is the screen when I run the command 'npm run app'

[image: npmrunapp] https://user-images.githubusercontent.com/37865559/48250735-9291e280-e3ff-11e8-858f-9b3262c44c63.jpg

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/substance/texture/issues/942#issuecomment-437282827, or mute the thread https://github.com/notifications/unsubscribe-auth/AALG-gNvLqmhHQSDUOAlwUJ3lr6BsSRzks5utTjzgaJpZM4XTo1M .

Integral commented 6 years ago

@sbirAECA, just to have a better understanding, what Windows are you using, what is your browser? You could see a report here: https://www.whatsmybrowser.org

sbirAECA commented 6 years ago

I'm not at work at this very moment. I'm at home. But I can try to test it. Here is the rport of my home computer. I can tell you it is different from work ordenador

sbirAECA commented 6 years ago

Now, give me a moment to install texture

sbirAECA commented 6 years ago

git clone https://github.com/substance/texture.git ... npm install ...

npminstall

sbirAECA commented 6 years ago

and npm run app ... npmrunapp

sbirAECA commented 6 years ago

It doesn't recognize file.type

jsonfile

Integral commented 6 years ago

@sbirAECA thanks again, I will continue my investigation!

Integral commented 6 years ago

At last, I can see these problems on windows.

On Fri, 9 Nov 2018, 22:02 Carlos Martinez <notifications@github.com wrote:

It doesn't recognize file.type

[image: jsonfile] https://user-images.githubusercontent.com/37865559/48282584-66577f80-e45a-11e8-862a-fc0a43eb4ac1.jpg

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/substance/texture/issues/942#issuecomment-437461620, or mute the thread https://github.com/notifications/unsubscribe-auth/AALG-tfSU3JW2PnYQHeVPPIJSMyI60oHks5utdFegaJpZM4XTo1M .

Integral commented 6 years ago

I will close this issue now since there is fix in master. @sbirAECA, thank you very much! And please file a new issue about saving problems if you have it.