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

Overhaul save & export options #1134

Merged
merged 19 commits into from
Jan 10, 2021
Merged

Overhaul save & export options #1134

merged 19 commits into from
Jan 10, 2021

Conversation

JPSchellenberg
Copy link
Member

No description provided.

@JPSchellenberg JPSchellenberg added the [type] feature Changes that introduce a new feature (resulting in minor-version-bump) label Jan 6, 2021
@sr258
Copy link
Member

sr258 commented Jan 6, 2021

It would be good to give the user a choice how the html exporter should export resources: inline in the html bundle or as separate files. h5p-server's HtmlExporter supports both variants, but they need to be exposed in the UI somehow.

An option would be to have two seperate menu entries in the "File" menu and a choice when you click on the <> button in the editor window.

Alternatively we could display a modal that gives you the choice (might be something we need anyway in the future to configure the reporting component of the package)

@JPSchellenberg
Copy link
Member Author

I agree. We should offer both options, but I would like to keep the process as simple as possible as a lot of people do not understand what the difference between inline resources or external resources.
I am afraid that two entries in the menu might confuse a lot of users. (Keep in mind the average technical knowledge of a teacher ;D)

A Modal might also be a bit cumbersome as the system "save as" dialog pops up right after that.

My idea would be to have a default way of exporting, which is configurable through a settingspage in the app-config.

@sr258
Copy link
Member

sr258 commented Jan 6, 2021

I think putting the option into global settings is not very discoverable. No-one is going to know that you can change modes, except if they stumble over it by chance.

Not sure if this is possible in Electron, but one way might be to allow the user to select the filetype in the save file picker. We could offer a selection like this:
'.html (all-in-one HTML bundle)'
'.html (all-in-one HTML bundle with report generator)'
'.zip (HTML file with separate images, videos und audio files)'
'.zip (HTML file with separate images, videos und audio files and report generator)'

This way of changing file formats is quite common (the MS Office products do it that way), so it might be intuitive enough for people to find it. And we don't have to implement weird modals.

@sr258
Copy link
Member

sr258 commented Jan 6, 2021

One thing: if we don't have the HTML buttons we need some kind of saving / loading indicator. My favourite would be to fully block the UI (gray it out) and display a spinner in the centre.

@JPSchellenberg
Copy link
Member Author

The loadingIndicator should show (blue progress bar). I will try to grey the ui out.

@JPSchellenberg
Copy link
Member Author

JPSchellenberg commented Jan 6, 2021

It looks good that we can handle the different exports via the system dialog: 😄
Screenshot 2021-01-06 at 14 53 49

I just need to find out how to retrieve the chosen format...

@JPSchellenberg
Copy link
Member Author

It looks like this option is only for defining which file types can be overwritten..

Or do you see a solution?
https://www.electronjs.org/docs/api/dialog#dialogshowsavedialogbrowserwindow-options

@JPSchellenberg
Copy link
Member Author

Ok, changing the format changes the extension in the name field:
Screenshot 2021-01-06 at 15 10 46

We could use that to determine from the filename how it should be exported, but we would have to come up with extension-names for every case.

like .html-inline for html with inline resources. We would then now inside electron to export a html with inline resources and then we would have to change the extension back to a normal .html

It is a bit hacky.. could you confirm that this would work on windows too?

@sr258
Copy link
Member

sr258 commented Jan 6, 2021

It's indeed a bit hacky to append something that is removed later...

But:
html-external should be zip anyway, as we need to put the resources files into a package somehow.
html-internal can then become html
and h5p can stay h5p

This way the extensions in the list are exactly the ones you'd expect. The question remains how we can put in further options (report generator). A modal after the user has selected the file would be acceptable I think.

I can test this on Windows later, but I don't think it will be a problem.

@sr258
Copy link
Member

sr258 commented Jan 6, 2021

The file saver dialog works in Windows as expected:
image

@JPSchellenberg
Copy link
Member Author

How do we want to differentiate between saving & exporting?
Should the .h5p option only be available in the saving dialog while .html and .zip are in the export dialog or should everything be in the save-dialog?

@sr258
Copy link
Member

sr258 commented Jan 7, 2021

I think there are arguments for both ways. I'd prefer having an "export" menu entry, as it makes it clearer that the file can't be reused then.

@JPSchellenberg JPSchellenberg marked this pull request as ready for review January 7, 2021 21:20
@JPSchellenberg
Copy link
Member Author

JPSchellenberg commented Jan 7, 2021

The export as zip is not implemented yet as the html-exporter does not support it yet, but we can add that later.

Copy link
Member

@sr258 sr258 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you don't add an extension to the exported filename, the file will have none. The exporter should append the .html extension if the user has specified none.

If you abort the file picker dialog, you get an error notification, which is not really useful, as there was not real error.

Except for these two small things, the PR is ready to be merged.

@JPSchellenberg
Copy link
Member Author

If you abort the file picker dialog, you get an error notification, which is not really useful, as there was not real error.

That should not happen. I fixed that a few commits ago. Did you have the latest commit?

@sr258 sr258 merged commit e01192e into master Jan 10, 2021
@JPSchellenberg JPSchellenberg mentioned this pull request Jan 10, 2021
github-actions bot pushed a commit that referenced this pull request Jan 11, 2021
# [0.4.0](v0.3.1...v0.4.0) (2021-01-11)

### Bug Fixes

* **config:** broken/missing configs dealt with gracefully ([#1137](#1137)) ([0ddff46](0ddff46))
* **configuration:** config allows larger file sizes ([#1127](#1127)) ([9f19067](9f19067))
* **deps:** pin dependencies ([1128831](1128831))
* **deps:** update dependency @sentry/browser to v5.29.2 ([8369da7](8369da7))
* **deps:** update dependency @testing-library/jest-dom to v5.11.8 ([60f415d](60f415d))
* **deps:** update dependency @testing-library/react to v11.2.2 ([bc7ab16](bc7ab16))
* **deps:** update dependency @testing-library/react to v11.2.3 ([#1144](#1144)) ([b593f0a](b593f0a))
* **deps:** update dependency @testing-library/user-event to v12.6.0 ([b230e2e](b230e2e))
* **deps:** update dependency @types/jest to v26.0.19 ([7c8a9f7](7c8a9f7))
* **deps:** update dependency @types/jest to v26.0.20 ([#1140](#1140)) ([18f84fd](18f84fd))
* **deps:** update dependency @types/node to v12.19.11 ([da10f45](da10f45))
* **deps:** update dependency @types/node to v12.19.12 ([0c59694](0c59694))
* **deps:** update dependency @types/react to v16.14.2 ([295fb13](295fb13))
* **deps:** update dependency @types/react to v17 ([#1108](#1108)) ([4ea1e6e](4ea1e6e))
* **deps:** update dependency @types/react-dom to v16.9.10 ([446d443](446d443))
* **deps:** update dependency @types/react-dom to v17 ([#1109](#1109)) ([c5f952e](c5f952e))
* **deps:** update dependency electron-log to v4.3.1 ([daa2a7e](daa2a7e))
* **deps:** update dependency h5p-nodejs-library to v6.1.3 ([846ffe3](846ffe3))
* **deps:** update dependency h5p-nodejs-library to v6.2.0 ([fa53968](fa53968))
* **deps:** update dependency react-scripts to v4.0.1 ([0b22dd1](0b22dd1))
* **deps:** update dependency socket.io to v2.4.1 ([#1141](#1141)) ([70dcaf5](70dcaf5))
* **deps:** update dependency typescript to v4.1.3 ([edc37a6](edc37a6))
* **deps:** update dependency web-vitals to v1 ([#1110](#1110)) ([efe22d5](efe22d5))
* **deps:** update h5p-react to v0.1.2 ([#1146](#1146)) ([2d4bfec](2d4bfec))
* **deps:** update mui monorepo to v4.11.2 ([a660f4e](a660f4e))
* **deps:** update socket.io packages to v2.4.0 ([b391b6a](b391b6a))
* **dev tools:** corrected dev tool setup ([#1126](#1126)) ([10a46c5](10a46c5))
* **devtools-start:** fix missing path on npm start ([#1133](#1133)) ([700ebb3](700ebb3))
* **multi instances:** old content isn't deleted on startup ([#1145](#1145)) ([5179b2e](5179b2e))
* **player:** content resizes with window ([#1142](#1142)) ([eb4e201](eb4e201))
* **sentry:** deactivate sentry ([#1147](#1147)) ([6637f2d](6637f2d))
* **windows:** config file created correctly on windows ([#1115](#1115)) ([4eb3d9b](4eb3d9b))

### Features

* **gui:** overhaul save & export options ([#1134](#1134)) ([57b8353](57b8353))
* **htmlexport:** add HTML Export ([#1094](#1094)) ([37272f4](37272f4)), closes [#1091](#1091)
* **notifications:** reenable notifications ([#1135](#1135)) ([fddf795](fddf795))
* **server:** in-memory cache speeds up editor load times ([#1125](#1125)) ([ec5082f](ec5082f))
* **ui:** re-added custom h5p styles ([#1138](#1138)) ([45ded91](45ded91))
@JPSchellenberg JPSchellenberg deleted the feature/1122 branch February 1, 2021 12:04
github-actions bot pushed a commit that referenced this pull request Feb 1, 2021
# [0.5.0](v0.4.0...v0.5.0) (2021-02-01)

### Bug Fixes

* **analytics-import:** folder with dots in their name can be imported ([#1205](#1205)) ([7f4b999](7f4b999))
* **config:** broken/missing configs dealt with gracefully ([#1137](#1137)) ([729f997](729f997))
* **configuration:** config allows larger file sizes ([#1127](#1127)) ([5ef7523](5ef7523))
* **deps:** pin dependencies ([e87d68c](e87d68c))
* **deps:** update dependency @material-ui/core to v4.11.3 ([6875f02](6875f02))
* **deps:** update dependency @sentry/browser to v5.29.2 ([475c48a](475c48a))
* **deps:** update dependency @sentry/electron to v2.1.0 ([#1154](#1154)) ([260087c](260087c))
* **deps:** update dependency @sentry/electron to v2.2.0 ([1ab4ac1](1ab4ac1))
* **deps:** update dependency @testing-library/jest-dom to v5.11.8 ([eaa0cd8](eaa0cd8))
* **deps:** update dependency @testing-library/jest-dom to v5.11.9 ([#1155](#1155)) ([6510d76](6510d76))
* **deps:** update dependency @testing-library/react to v11.2.2 ([5a717cf](5a717cf))
* **deps:** update dependency @testing-library/react to v11.2.3 ([#1144](#1144)) ([227519b](227519b))
* **deps:** update dependency @testing-library/user-event to v12.6.0 ([0cf08f2](0cf08f2))
* **deps:** update dependency @testing-library/user-event to v12.6.1 ([982b227](982b227))
* **deps:** update dependency @testing-library/user-event to v12.6.2 ([d47d60a](d47d60a))
* **deps:** update dependency @types/jest to v26.0.19 ([54198bc](54198bc))
* **deps:** update dependency @types/jest to v26.0.20 ([#1140](#1140)) ([72b8776](72b8776))
* **deps:** update dependency @types/node to v12.19.11 ([8986fdb](8986fdb))
* **deps:** update dependency @types/node to v12.19.12 ([4b9f75c](4b9f75c))
* **deps:** update dependency @types/node to v12.19.13 ([#1156](#1156)) ([f155ddc](f155ddc))
* **deps:** update dependency @types/node to v12.19.14 ([#1175](#1175)) ([3a13e7e](3a13e7e))
* **deps:** update dependency @types/node to v12.19.15 ([dd999b5](dd999b5))
* **deps:** update dependency @types/react to v16.14.2 ([de82c3d](de82c3d))
* **deps:** update dependency @types/react to v17 ([#1108](#1108)) ([7151f05](7151f05))
* **deps:** update dependency @types/react-dom to v16.9.10 ([3943396](3943396))
* **deps:** update dependency @types/react-dom to v17 ([#1109](#1109)) ([eb583b9](eb583b9))
* **deps:** update dependency electron-log to v4.3.1 ([95edbe3](95edbe3))
* **deps:** update dependency express-fileupload to v1.2.1 ([#1153](#1153)) ([f37d962](f37d962))
* **deps:** update dependency fs-extra to v9.1.0 ([8c08202](8c08202))
* **deps:** update dependency h5p-nodejs-library to v6.1.3 ([f554fe9](f554fe9))
* **deps:** update dependency h5p-nodejs-library to v6.2.0 ([a15a7dc](a15a7dc))
* **deps:** update dependency i18next to v19.8.5 ([49a03ae](49a03ae))
* **deps:** update dependency i18next-fs-backend to v1.0.8 ([7111875](7111875))
* **deps:** update dependency nucleus-nodejs to v3.0.8 ([1866bd8](1866bd8))
* **deps:** update dependency react-scripts to v4.0.1 ([3f673fd](3f673fd))
* **deps:** update dependency socket.io to v2.4.1 ([#1141](#1141)) ([c3e7b8c](c3e7b8c))
* **deps:** update dependency typescript to v4.1.3 ([ed43a7d](ed43a7d))
* **deps:** update dependency web-vitals to v1 ([#1110](#1110)) ([94c154b](94c154b))
* **deps:** update dependency web-vitals to v1.1.0 ([ecbb6a0](ecbb6a0))
* **deps:** update h5p-react to v0.1.2 ([#1146](#1146)) ([5a0d450](5a0d450))
* **deps:** update h5p-server to v7.0.0-alpha.1 ([#1208](#1208)) ([2882b9e](2882b9e))
* **deps:** update mui monorepo to v4.11.2 ([e55078d](e55078d))
* **deps:** update sentry monorepo to v5.30.0 ([#1160](#1160)) ([654dcaa](654dcaa))
* **deps:** update socket.io packages to v2.4.0 ([0da5e88](0da5e88))
* **dev tools:** corrected dev tool setup ([#1126](#1126)) ([99c6695](99c6695))
* **devtools-start:** fix missing path on npm start ([#1133](#1133)) ([417c9b1](417c9b1))
* **editor:** localization files are found correctly ([#1171](#1171)) ([9480c2d](9480c2d))
* **error handling:** server deals more gracefully with invalid content ([#1174](#1174)) ([10010e1](10010e1))
* **multi instances:** old content isn't deleted on startup ([#1145](#1145)) ([8605612](8605612))
* **player:** content resizes with window ([#1142](#1142)) ([b50cd04](b50cd04))
* **saving:** last change is always saved now ([#1170](#1170)) ([9c2eb34](9c2eb34))
* **sentry:** deactivate sentry ([#1147](#1147)) ([866453c](866453c))
* **ui:** display a backbutton if not in launchpad ([#1209](#1209)) ([72c6bc1](72c6bc1))
* **windows:** config file created correctly on windows ([#1115](#1115)) ([f3113e0](f3113e0))

### Features

* **analytics:** add analytics and xapi-reporter ([#1196](#1196)) ([daa02d2](daa02d2))
* **gui:** overhaul save & export options ([#1134](#1134)) ([e01192e](e01192e))
* **htmlexport:** add HTML Export ([#1094](#1094)) ([a58b899](a58b899)), closes [#1091](#1091)
* **notifications:** reenable notifications ([#1135](#1135)) ([1e95e3c](1e95e3c))
* **server:** in-memory cache speeds up editor load times ([#1125](#1125)) ([7e2a35b](7e2a35b))
* **ui:** re-added custom h5p styles ([#1138](#1138)) ([d4e8f34](d4e8f34))
github-actions bot pushed a commit that referenced this pull request Feb 1, 2021
# [0.5.0](v0.4.0...v0.5.0) (2021-02-01)

### Bug Fixes

* **analytics-import:** folder with dots in their name can be imported ([#1205](#1205)) ([7f4b999](7f4b999))
* **config:** broken/missing configs dealt with gracefully ([#1137](#1137)) ([729f997](729f997))
* **configuration:** config allows larger file sizes ([#1127](#1127)) ([5ef7523](5ef7523))
* **deps:** pin dependencies ([e87d68c](e87d68c))
* **deps:** update dependency @material-ui/core to v4.11.3 ([6875f02](6875f02))
* **deps:** update dependency @sentry/browser to v5.29.2 ([475c48a](475c48a))
* **deps:** update dependency @sentry/electron to v2.1.0 ([#1154](#1154)) ([260087c](260087c))
* **deps:** update dependency @sentry/electron to v2.2.0 ([1ab4ac1](1ab4ac1))
* **deps:** update dependency @testing-library/jest-dom to v5.11.8 ([eaa0cd8](eaa0cd8))
* **deps:** update dependency @testing-library/jest-dom to v5.11.9 ([#1155](#1155)) ([6510d76](6510d76))
* **deps:** update dependency @testing-library/react to v11.2.2 ([5a717cf](5a717cf))
* **deps:** update dependency @testing-library/react to v11.2.3 ([#1144](#1144)) ([227519b](227519b))
* **deps:** update dependency @testing-library/user-event to v12.6.0 ([0cf08f2](0cf08f2))
* **deps:** update dependency @testing-library/user-event to v12.6.1 ([982b227](982b227))
* **deps:** update dependency @testing-library/user-event to v12.6.2 ([d47d60a](d47d60a))
* **deps:** update dependency @types/jest to v26.0.19 ([54198bc](54198bc))
* **deps:** update dependency @types/jest to v26.0.20 ([#1140](#1140)) ([72b8776](72b8776))
* **deps:** update dependency @types/node to v12.19.11 ([8986fdb](8986fdb))
* **deps:** update dependency @types/node to v12.19.12 ([4b9f75c](4b9f75c))
* **deps:** update dependency @types/node to v12.19.13 ([#1156](#1156)) ([f155ddc](f155ddc))
* **deps:** update dependency @types/node to v12.19.14 ([#1175](#1175)) ([3a13e7e](3a13e7e))
* **deps:** update dependency @types/node to v12.19.15 ([dd999b5](dd999b5))
* **deps:** update dependency @types/react to v16.14.2 ([de82c3d](de82c3d))
* **deps:** update dependency @types/react to v17 ([#1108](#1108)) ([7151f05](7151f05))
* **deps:** update dependency @types/react-dom to v16.9.10 ([3943396](3943396))
* **deps:** update dependency @types/react-dom to v17 ([#1109](#1109)) ([eb583b9](eb583b9))
* **deps:** update dependency electron-log to v4.3.1 ([95edbe3](95edbe3))
* **deps:** update dependency express-fileupload to v1.2.1 ([#1153](#1153)) ([f37d962](f37d962))
* **deps:** update dependency fs-extra to v9.1.0 ([8c08202](8c08202))
* **deps:** update dependency h5p-nodejs-library to v6.1.3 ([f554fe9](f554fe9))
* **deps:** update dependency h5p-nodejs-library to v6.2.0 ([a15a7dc](a15a7dc))
* **deps:** update dependency i18next to v19.8.5 ([49a03ae](49a03ae))
* **deps:** update dependency i18next-fs-backend to v1.0.8 ([7111875](7111875))
* **deps:** update dependency nucleus-nodejs to v3.0.8 ([1866bd8](1866bd8))
* **deps:** update dependency react-scripts to v4.0.1 ([3f673fd](3f673fd))
* **deps:** update dependency socket.io to v2.4.1 ([#1141](#1141)) ([c3e7b8c](c3e7b8c))
* **deps:** update dependency typescript to v4.1.3 ([ed43a7d](ed43a7d))
* **deps:** update dependency web-vitals to v1 ([#1110](#1110)) ([94c154b](94c154b))
* **deps:** update dependency web-vitals to v1.1.0 ([ecbb6a0](ecbb6a0))
* **deps:** update h5p-react to v0.1.2 ([#1146](#1146)) ([5a0d450](5a0d450))
* **deps:** update h5p-server to v7.0.0-alpha.1 ([#1208](#1208)) ([2882b9e](2882b9e))
* **deps:** update mui monorepo to v4.11.2 ([e55078d](e55078d))
* **deps:** update sentry monorepo to v5.30.0 ([#1160](#1160)) ([654dcaa](654dcaa))
* **deps:** update socket.io packages to v2.4.0 ([0da5e88](0da5e88))
* **dev tools:** corrected dev tool setup ([#1126](#1126)) ([99c6695](99c6695))
* **devtools-start:** fix missing path on npm start ([#1133](#1133)) ([417c9b1](417c9b1))
* **editor:** localization files are found correctly ([#1171](#1171)) ([9480c2d](9480c2d))
* **error handling:** server deals more gracefully with invalid content ([#1174](#1174)) ([10010e1](10010e1))
* **multi instances:** old content isn't deleted on startup ([#1145](#1145)) ([8605612](8605612))
* **player:** content resizes with window ([#1142](#1142)) ([b50cd04](b50cd04))
* **saving:** last change is always saved now ([#1170](#1170)) ([9c2eb34](9c2eb34))
* **sentry:** deactivate sentry ([#1147](#1147)) ([866453c](866453c))
* **ui:** display a backbutton if not in launchpad ([#1209](#1209)) ([72c6bc1](72c6bc1))
* **windows:** config file created correctly on windows ([#1115](#1115)) ([f3113e0](f3113e0))

### Features

* **analytics:** add analytics and xapi-reporter ([#1196](#1196)) ([daa02d2](daa02d2))
* **gui:** overhaul save & export options ([#1134](#1134)) ([e01192e](e01192e))
* **htmlexport:** add HTML Export ([#1094](#1094)) ([a58b899](a58b899)), closes [#1091](#1091)
* **notifications:** reenable notifications ([#1135](#1135)) ([1e95e3c](1e95e3c))
* **server:** in-memory cache speeds up editor load times ([#1125](#1125)) ([7e2a35b](7e2a35b))
* **ui:** re-added custom h5p styles ([#1138](#1138)) ([d4e8f34](d4e8f34))
@github-actions
Copy link

github-actions bot commented Feb 1, 2021

🎉 This PR is included in version 0.5.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released [type] feature Changes that introduce a new feature (resulting in minor-version-bump)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants