Tangerine-Community / Tangerine-client-legacy

This repository has been moved to https://github.com/Tangerine-Community/Tangerine
Other
2 stars 4 forks source link

Feature: Process data that was downloaded offline and sent via email or dropbox #248

Closed chrisekelley closed 8 years ago

chrisekelley commented 8 years ago

My proposed solution is the past test in test/spec/process.coffee.

Next step is to upload this to a test couch and see how it is syncing. Proposed steps:

From Utils.uploadCompressed() -

docs = {"docs":response.rows.map((el)->el.doc)}
 compressedData = LZString.compressToBase64(JSON.stringify(docs))

In my current code, I'm not compressing it to Base64 - probably need to add that; not sure.

Then change the destination to this:

      bulkDocsUrl = "#{a.protocol}//#{a.host}/_cors_bulk_docs/upload/#{Tangerine.settings.groupDB-KLONE}"

      $.ajax
        type : "POST"
        url : bulkDocsUrl
        data : compressedData
        error: =>
          alert "Server bulk docs error"
        success: =>
          Utils.sticky "Results uploaded"
          return

I am assuming that _cors_bulk_docs or couch bulkDocs ignores duplicate id's, or at least ones with duplicate _rev's. I'm wondering if we should filter out the non-Assessment data, such as the Assessment forms?

More stuff to do:

Any backups made moving forward will be placed in the other dropbox, RTI-DataVision PILOT backup files.

chrisekelley commented 8 years ago

RJ has created the Tangerine-CLI which closes this issue and creates a very useful way to handle Tangerine administrative tasks.