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/set saved loading issue #199

Merged
merged 7 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ All notable changes to this project will be documented here.

Nothing yet.

## [0.15.3] - Oct 4th, 2024
- Fix issue where legacy submit button functionality would break loading

## [0.15.2] - Oct 4th, 2024
- Change `set_saved` on submit buttons to be a true boolean,
rather than an optional boolean that could needlessly force a reload prompt
Expand Down
2 changes: 1 addition & 1 deletion dist/ulabel.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/ulabel.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ulabel",
"description": "An image annotation tool.",
"version": "0.15.2",
"version": "0.15.3",
"main": "dist/ulabel.js",
"module": "dist/ulabel.js",
"scripts": {
Expand All @@ -10,6 +10,7 @@
"build": "tsc && webpack --mode production",
"build-dev": "tsc && webpack --mode development",
"build-and-demo": "npm run build && npm run demo",
"build-dev-and-demo": "npm run build-dev && npm run demo",
"prepare": "husky"
},
"lint-staged": {
Expand Down
18 changes: 9 additions & 9 deletions src/toolbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2417,15 +2417,6 @@ export class SubmitButtons extends ToolboxItem {
// Grab the submit buttons from ulabel
this.submit_buttons = ulabel.config.submit_buttons;

// Set `set_saved` to false if not provided
for (const button of this.submit_buttons) {
button.set_saved = button.set_saved ?? false;
}

this.add_styles();

this.add_event_listeners();

// For legacy reasons submit_buttons may be a function, in that case convert it to the right format
if (typeof this.submit_buttons == "function") {
this.submit_buttons = [{
Expand All @@ -2436,6 +2427,15 @@ export class SubmitButtons extends ToolboxItem {
}];
}

// Set `set_saved` to false if not provided
for (const button of this.submit_buttons) {
button.set_saved = button.set_saved ?? false;
}

this.add_styles();

this.add_event_listeners();

this.submit_buttons_by_row = this.sort_buttons_by_row_number();

for (const idx in this.submit_buttons) {
Expand Down
2 changes: 1 addition & 1 deletion src/version.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const ULABEL_VERSION = "0.15.2";
export const ULABEL_VERSION = "0.15.3";