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

Fix Dice widget and add automatic update #1022

Merged
merged 2 commits into from
Aug 13, 2024

Conversation

letsfindaway
Copy link
Collaborator

@letsfindaway letsfindaway commented Jun 20, 2024

When updating the interactivity widgets to the new OpenBoard API, the Dice widget was forgotten. This PR fixes this in two commits:

  • The first commit extends the UBWidgetUpgradeAdaptor. It was initially written to upgrade widgets which have been using the old API to updated versions using the new API. The extension added now can also update a widget already using the new API to a new version.
  • The second commit applies all the changes necessary for uwb-main based widgets.

The automatic version update makes sure that widgets on already existing documents get automatically updated. The update is performed if

  • The widget existing in the document has a valid ID and version number.
  • The widget existing in the document does not use the old API. Using the old API takes us to the already implemented "upgrade" path where an widget is upgraded without version number comparison.
  • The library contains a widget with the same id as the document widget.
  • The library widget and the document widget have the same major version number. Different major version numbers might indicate incompatible widgets, where an automatic update could break things.
  • The library widget has however a newer version number taking into account minor or micro version.

This PR fixes #1020.

- when a newer version of a widget is available in the library
  then update a widget in a document to that version
- only update if major version number does not change, as
  this might indicate an incompatible change
- Dice widget was missed when updating uwb-main based widgets
- apply the changes also used for other similar widgets
- update version number to 2.1
@kaamui kaamui merged commit 78ca58a into OpenBoard-org:dev Aug 13, 2024
@letsfindaway letsfindaway deleted the feat-update-widget branch August 13, 2024 12:29
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

Successfully merging this pull request may close these issues.

2 participants