-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add dialog to manage schema templates. #5303
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
Add dialog to manage schema templates. #5303
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some things I found:
Save new schema template
-
'Save new...' could just be 'Save...' since you can save new or save existing. (Also update header to 'Save schema template')
-
Manage schema templates should have ellipsis (…).
-
I would pull 'Manage schema templates' out of the 'Save' dialog.
-
Padding needs to be adjusted.
Manage schema templates
-
Change header from 'Schema templates' to 'Manage Wikibase schema templates'
-
A better presentation would be to have the actions (Rename | Export | Delete) to the right of each template name.
-
The list of templates needs to handle overflow (scrollbar).
-
If I delete a template, then close the manage schema dialog, the save new dialog still has the template in the 'Select template...' dropdown. (This is another reason to move Manage schema templates out of there).
extensions/wikidata/module/styles/dialogs/schema-template-dialog.less
Outdated
Show resolved
Hide resolved
extensions/wikidata/module/scripts/dialogs/schema-template-dialog.js
Outdated
Show resolved
Hide resolved
Thanks a lot for the thorough review!
That would also work, but I think @lozanaross had some precise thoughts about the naming of this button to distinguish it from the "Save schema" button.
I agree it feels weird to have to go through the Save dialog for that. Would you add it as a button in the schema editor (next to the button that currently says "Save new…")? Or in the extension menu perhaps? |
Thank you both for all the comments (note - still have not seen what this PR does UI-wise - screenshots would be handy). After running some more user testing sessions last week, I've noticed the following:
I will lay this all out in more detail in a report after all user testing is complete this week. But let's also discuss here if the above is unclear. |
Here is one (but I would really like to ensure you can try out a PR on your machine, so that you can have the full user experience - let me know if you need help to set this up):
Let's leave this for a separate issue since this can be changed independently from this PR.
I think calling those schemas would work. We can then distinguish from complete and incomplete schemas when needed (which is already something we do since #5131).
Yes I think it makes sense. Some users might find it a bit annoying (because applying a schema to a project will require extra steps, and same for the export), but it is probably worth it for the sake of simplifying the UI. That does require some changes to this PR because at the moment importing a schema exported from a previous version of OpenRefine as a schema template in 3.7 will not work (because of the missing name). But I can introduce a workaround for that.
I think it is fine to have a dialog accessible from multiple places. We already have that for the Wikibase upload dialog, accessible both from the global Export menu and the Wikibase extension dropdown, for instance. |
So I have renamed schema templates to just schemas and simplified the extension menu (removed import/export and replaced by the schema templates): I feel like it's a nice usability gain, thanks @lozanaross! |
OK, agreed, I'll try it w/ GH desktop app and see if I manage. Shall I then make a separate issue if I have small tweaks for this particular dialog window?
OK, I will make the issue (maybe after the user testing report is complete).
Sounds good.
To be honest all Wikimedia users I've spoken with didn't really understand the schema concept very well (including myself), so I doubt there will be many users who used this functionality extensively to be annoyed once we change it.
OK, great.
Great, good to know. I may have accidentally navigated users away from Export, because I thought you can only upload via the extension dropdown 🫣 |
This is getting stale, so merging it. Further tweaks can be suggested in follow-up issues. |
@wetneb @lozanaross @trnstlntk Curious, do you know where folks are saving schema templates for collaboration? Is it under individual WikiProjects? |
The feature is so new that I haven't seen adoption yet. Maybe good to start just doing it :) WikiProjects on Wikidata make sense. There's no equivalent of these on Commons so there I don't know yet. |
Closes #5280.
To validate the schema templates that are imported by the user, I considered using a JSON schema (like we do for Wikibase manifests). I tried generating the JSON schema automatically from the Java classes using jsonschema-generator but it does not quite work out of the box and has no guarantees to be completely faithful to Jackson deserialization. So I went for a simpler approach of introducing a new command which parses a schema template in the backend, and reports the status to the frontend.
The UI is not beautiful and style changes would be welcome. I did not add support for exporting multiple templates at a time because it would require bundling up in some archive, and that is not something I would want to do generate in the frontend directly.