Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to open files from and save them to Filesystem #1

Open
bkmeneguello opened this issue Mar 5, 2018 · 1 comment
Open

Allow to open files from and save them to Filesystem #1

bkmeneguello opened this issue Mar 5, 2018 · 1 comment

Comments

@bkmeneguello
Copy link

I think it's possible to hack into "swagger-editor" to import a file (and its dependencies) from FileSystem API, them save it to the same API.
If you look at topbar.jsx#L64 'll notice that it only calls this.props.specActions.updateSpec(YAML.safeDump(YAML.safeLoad(textFromFileLoaded))) with textFromFileLoaded from the (obviously) loaded file.
If you add a menu bar and implement an Electron's load file dialog and feed the editor with this data, it should be nicely integrated with local FS, then a simple "Save" action could overwrite the file and (maybe) some fsnotifier could sync the editor when some external editor changes the same content.

@XuluWarrior
Copy link
Owner

It's been a long time coming. (A very long time). But I've finally come back to this project and added the file actions to the Electron menu bar.

https://github.com/XuluWarrior/swagger-editor-offline/releases/tag/v0.2.0

So far these (mostly) mimic the ones available in the browser window. The exception being I rolled up the "convert to" logic into a choice of format in the Save As dialog.

So no "Save" option yet. And no monitoring the filesystem.
I'll work on "Save" next

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants