Skip to content

allow saving/loading schemas from localstorage #49

@eviltester

Description

@eviltester

Currently schemas are 'transient' but people might want to store them, also if the browser crashes people would lose them

Save the 'current' schema in local storage as 'ldraft', do this by default when schemas change to allow recovery if something goes wrong - never save "" as draft. (even if invalid, save to draft)

On "Generate" or "Generate Combination" save as 'last used - date time' - save 10 last used and rotate positions - this should be unique list based on schema content so we don't save the same schema multiple times as a last used. If it is regenerated then amend the name to 'last used - new date time'

Above saving to Local Storage (not session storage)

In the Test Data Schema edit control have a new MVC control with supporting story book coverage

A Details/Summary with title "Managed Stored Schemas (x)" where x is the number of saved schemas

Not expanded by default.

Expanded has:

[Save Schema As] button which prompts for a name then saves it to local storage under that name

[Recover Draft] (?) the (?) tippy shows a truncated preview of the schema.

Last Used: {drop down of last used dates} [Load] (?) the tippy preview shows a truncated preview of te item selected in the list, Load loads it into the schema editor

[Clear Last Used]

we would also need a

[Load Saved Schema]

button which shows a Dialog with the saved schemas shows a list of the saved schemas.

Allow a max of 50 saved schemas - show "Too many existing saved schemas" if try to save when 50 are already saved.

Hae these numbers as constants to start with:

MAX_SAVED_SCHEMAS:50
MAX_LAST_USED_SCHEMAS:10


Saved Schemas:

schema name [Load] [Rename] [Delete] (?)

[Close]

Where (?) is a truncated preview of the schema.

Load loads the schema and closes te dialogs

Rename shows an input with Apply Cancel

Delete shows a "Delete Stored Schema named X?" Yes/No

The [Close] in the Dialog with Saved Schema closes the dialog.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions