Import/Export Templates #11

Closed
neocotic opened this Issue Jul 26, 2011 · 2 comments

Comments

Projects
None yet
1 participant
@neocotic
Member

neocotic commented Jul 26, 2011

Allow users to import/export both official and user-generated templates. JSON is probably the safest option but investigation is required as to whether or not Chrome allows file uploads or if copy-paste system should be used. Regardless, the system must allow multiple templates to be imported/exported at one time. Also, it is vital that the system is future-proof and is probably wise to include the extension version from the beginning should it be required further down the line.

When importing care should be taken to ensure name conflicts are resolved if/when they occur, always favoring the existing template. This could be done by attempting to append a number (starting from 1) to the name until an available alternative is found. The availability check should include any templates added previously in the import job in case the JSON includes duplicate templates.

Full validation should be carried out on the imported templates once completed. Imports should not be persisted automatically and should only be if/when the user clicks the "Save & Close" button.

@ghost ghost assigned neocotic Jul 26, 2011

@neocotic

This comment has been minimized.

Show comment
Hide comment
@neocotic

neocotic Aug 1, 2011

Member

This has been implemented in my last commit but still requires intensive testing and the code needs cleaned up (as does a lot of code in options.js).

Important Points

  • Any imports that change existing templates only change the existing template's values if they are valid
  • Any imports that could override predefined templates only have their non-protected values changed
  • A Save As... exists on the Export popup but handles differently depending on whether or not the user is in offline mode
    • Online: Sends the export string to my server API and forces a download of the text file (suggesting the file name export.json)
    • Offline: Attempts to force a download of the export string as a text file but cannot suggest a file name or type (may be confusing)
  • User can always select which template(s) they wish to import/export

Over time I will determine whether or not the Save As... setup is workable and safe.

Member

neocotic commented Aug 1, 2011

This has been implemented in my last commit but still requires intensive testing and the code needs cleaned up (as does a lot of code in options.js).

Important Points

  • Any imports that change existing templates only change the existing template's values if they are valid
  • Any imports that could override predefined templates only have their non-protected values changed
  • A Save As... exists on the Export popup but handles differently depending on whether or not the user is in offline mode
    • Online: Sends the export string to my server API and forces a download of the text file (suggesting the file name export.json)
    • Offline: Attempts to force a download of the export string as a text file but cannot suggest a file name or type (may be confusing)
  • User can always select which template(s) they wish to import/export

Over time I will determine whether or not the Save As... setup is workable and safe.

@neocotic

This comment has been minimized.

Show comment
Hide comment
@neocotic

neocotic Aug 2, 2011

Member

This has now been implemented and I'm happy with it so far. I'm sure any/all bugs will be picked up by users with normal use. May test offline Save As... functionality is triggered as expected (when there's no internet connection) so really just need to test window.navigator.onLine === false when offline.

Member

neocotic commented Aug 2, 2011

This has now been implemented and I'm happy with it so far. I'm sure any/all bugs will be picked up by users with normal use. May test offline Save As... functionality is triggered as expected (when there's no internet connection) so really just need to test window.navigator.onLine === false when offline.

@neocotic neocotic closed this Aug 2, 2011

@neocotic neocotic referenced this issue in neocotic/iOrder Mar 20, 2012

Closed

Import/export functionality #20

@neocotic neocotic added the accepted label Nov 15, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment