diff --git a/db/migrations/0196__rename_bulk_actions.sql b/db/migrations/0196__rename_bulk_actions.sql
new file mode 100644
index 000000000..fd82ae344
--- /dev/null
+++ b/db/migrations/0196__rename_bulk_actions.sql
@@ -0,0 +1,2 @@
+UPDATE attributes SET name = 'updateLabelValue' WHERE name = 'setLabelValue' AND type = 'label';
+UPDATE attributes SET name = 'updateRelationTarget' WHERE name = 'setRelationTarget' AND type = 'label';
diff --git a/src/public/app/services/bulk_action.js b/src/public/app/services/bulk_action.js
index 81c11e72d..b2de0c130 100644
--- a/src/public/app/services/bulk_action.js
+++ b/src/public/app/services/bulk_action.js
@@ -1,15 +1,17 @@
import server from "./server.js";
import ws from "./ws.js";
-import MoveNoteBulkAction from "../widgets/bulk_actions/move_note.js";
-import DeleteNoteBulkAction from "../widgets/bulk_actions/delete_note.js";
-import DeleteNoteRevisionsBulkAction from "../widgets/bulk_actions/delete_note_revisions.js";
-import DeleteLabelBulkAction from "../widgets/bulk_actions/delete_label.js";
-import DeleteRelationBulkAction from "../widgets/bulk_actions/delete_relation.js";
-import RenameLabelBulkAction from "../widgets/bulk_actions/rename_label.js";
-import RenameRelationBulkAction from "../widgets/bulk_actions/rename_relation.js";
-import SetLabelValueBulkAction from "../widgets/bulk_actions/set_label_value.js";
-import SetRelationTargetSearchAction from "../widgets/bulk_actions/set_relation_target.js";
+import MoveNoteBulkAction from "../widgets/bulk_actions/note/move_note.js";
+import DeleteNoteBulkAction from "../widgets/bulk_actions/note/delete_note.js";
+import DeleteNoteRevisionsBulkAction from "../widgets/bulk_actions/note/delete_note_revisions.js";
+import DeleteLabelBulkAction from "../widgets/bulk_actions/label/delete_label.js";
+import DeleteRelationBulkAction from "../widgets/bulk_actions/relation/delete_relation.js";
+import RenameLabelBulkAction from "../widgets/bulk_actions/label/rename_label.js";
+import RenameRelationBulkAction from "../widgets/bulk_actions/relation/rename_relation.js";
+import UpdateLabelValueBulkAction from "../widgets/bulk_actions/label/update_label_value.js";
+import UpdateRelationTargetBulkAction from "../widgets/bulk_actions/relation/update_relation_target.js";
import ExecuteScriptBulkAction from "../widgets/bulk_actions/execute_script.js";
+import AddLabelBulkAction from "../widgets/bulk_actions/label/add_label.js";
+import AddRelationBulkAction from "../widgets/bulk_actions/relation/add_relation.js";
const ACTION_CLASSES = [
MoveNoteBulkAction,
@@ -19,8 +21,10 @@ const ACTION_CLASSES = [
DeleteRelationBulkAction,
RenameLabelBulkAction,
RenameRelationBulkAction,
- SetLabelValueBulkAction,
- SetRelationTargetSearchAction,
+ AddLabelBulkAction,
+ AddRelationBulkAction,
+ UpdateLabelValueBulkAction,
+ UpdateRelationTargetBulkAction,
ExecuteScriptBulkAction
];
diff --git a/src/public/app/widgets/bulk_actions/add_label.js b/src/public/app/widgets/bulk_actions/label/add_label.js
similarity index 90%
rename from src/public/app/widgets/bulk_actions/add_label.js
rename to src/public/app/widgets/bulk_actions/label/add_label.js
index 515a8ae36..e4267c88d 100644
--- a/src/public/app/widgets/bulk_actions/add_label.js
+++ b/src/public/app/widgets/bulk_actions/label/add_label.js
@@ -1,5 +1,5 @@
-import SpacedUpdate from "../../services/spaced_update.js";
-import AbstractBulkAction from "./abstract_bulk_action.js";
+import SpacedUpdate from "../../../services/spaced_update.js";
+import AbstractBulkAction from "../abstract_bulk_action.js";
const TPL = `
@@ -38,8 +38,8 @@ const TPL = `
`;
export default class AddLabelBulkAction extends AbstractBulkAction {
- static get actionName() { return "setLabelValue"; }
- static get actionTitle() { return "Set label value"; }
+ static get actionName() { return "addLabel"; }
+ static get actionTitle() { return "Add label"; }
doRender() {
const $action = $(TPL);
diff --git a/src/public/app/widgets/bulk_actions/delete_label.js b/src/public/app/widgets/bulk_actions/label/delete_label.js
similarity index 89%
rename from src/public/app/widgets/bulk_actions/delete_label.js
rename to src/public/app/widgets/bulk_actions/label/delete_label.js
index 6c81d5615..76490ca56 100644
--- a/src/public/app/widgets/bulk_actions/delete_label.js
+++ b/src/public/app/widgets/bulk_actions/label/delete_label.js
@@ -1,5 +1,5 @@
-import SpacedUpdate from "../../services/spaced_update.js";
-import AbstractBulkAction from "./abstract_bulk_action.js";
+import SpacedUpdate from "../../../services/spaced_update.js";
+import AbstractBulkAction from "../abstract_bulk_action.js";
const TPL = `
diff --git a/src/public/app/widgets/bulk_actions/rename_label.js b/src/public/app/widgets/bulk_actions/label/rename_label.js
similarity index 93%
rename from src/public/app/widgets/bulk_actions/rename_label.js
rename to src/public/app/widgets/bulk_actions/label/rename_label.js
index 99f458c24..a215846d7 100644
--- a/src/public/app/widgets/bulk_actions/rename_label.js
+++ b/src/public/app/widgets/bulk_actions/label/rename_label.js
@@ -1,5 +1,5 @@
-import SpacedUpdate from "../../services/spaced_update.js";
-import AbstractBulkAction from "./abstract_bulk_action.js";
+import SpacedUpdate from "../../../services/spaced_update.js";
+import AbstractBulkAction from "../abstract_bulk_action.js";
const TPL = `
diff --git a/src/public/app/widgets/bulk_actions/set_label_value.js b/src/public/app/widgets/bulk_actions/label/update_label_value.js
similarity index 76%
rename from src/public/app/widgets/bulk_actions/set_label_value.js
rename to src/public/app/widgets/bulk_actions/label/update_label_value.js
index 76063f693..3a0829fff 100644
--- a/src/public/app/widgets/bulk_actions/set_label_value.js
+++ b/src/public/app/widgets/bulk_actions/label/update_label_value.js
@@ -1,11 +1,11 @@
-import SpacedUpdate from "../../services/spaced_update.js";
-import AbstractBulkAction from "./abstract_bulk_action.js";
+import SpacedUpdate from "../../../services/spaced_update.js";
+import AbstractBulkAction from "../abstract_bulk_action.js";
const TPL = `
-
Set label
+
Update label value
-
On all matched notes:
-
-
-
create given label if note doesn't have one yet
-
or change value of the existing label
-
+
On all matched notes, change value of the existing label.
You can also call this method without value, in such case label will be assigned to the note without value.
@@ -37,9 +32,9 @@ const TPL = `
`;
-export default class SetLabelValueBulkAction extends AbstractBulkAction {
- static get actionName() { return "setLabelValue"; }
- static get actionTitle() { return "Set label value"; }
+export default class UpdateLabelValueBulkAction extends AbstractBulkAction {
+ static get actionName() { return "updateLabelValue"; }
+ static get actionTitle() { return "Update label value"; }
doRender() {
const $action = $(TPL);
diff --git a/src/public/app/widgets/bulk_actions/delete_note.js b/src/public/app/widgets/bulk_actions/note/delete_note.js
similarity index 88%
rename from src/public/app/widgets/bulk_actions/delete_note.js
rename to src/public/app/widgets/bulk_actions/note/delete_note.js
index 20bf83bc0..1580987f1 100644
--- a/src/public/app/widgets/bulk_actions/delete_note.js
+++ b/src/public/app/widgets/bulk_actions/note/delete_note.js
@@ -1,4 +1,4 @@
-import AbstractBulkAction from "./abstract_bulk_action.js";
+import AbstractBulkAction from "../abstract_bulk_action.js";
const TPL = `
diff --git a/src/public/app/widgets/bulk_actions/delete_note_revisions.js b/src/public/app/widgets/bulk_actions/note/delete_note_revisions.js
similarity index 93%
rename from src/public/app/widgets/bulk_actions/delete_note_revisions.js
rename to src/public/app/widgets/bulk_actions/note/delete_note_revisions.js
index 40ed8123b..6fa8ad823 100644
--- a/src/public/app/widgets/bulk_actions/delete_note_revisions.js
+++ b/src/public/app/widgets/bulk_actions/note/delete_note_revisions.js
@@ -1,4 +1,4 @@
-import AbstractBulkAction from "./abstract_bulk_action.js";
+import AbstractBulkAction from "../abstract_bulk_action.js";
const TPL = `
diff --git a/src/public/app/widgets/bulk_actions/move_note.js b/src/public/app/widgets/bulk_actions/note/move_note.js
similarity index 91%
rename from src/public/app/widgets/bulk_actions/move_note.js
rename to src/public/app/widgets/bulk_actions/note/move_note.js
index 03a49b8bb..ba11e9f70 100644
--- a/src/public/app/widgets/bulk_actions/move_note.js
+++ b/src/public/app/widgets/bulk_actions/note/move_note.js
@@ -1,6 +1,6 @@
-import SpacedUpdate from "../../services/spaced_update.js";
-import AbstractBulkAction from "./abstract_bulk_action.js";
-import noteAutocompleteService from "../../services/note_autocomplete.js";
+import SpacedUpdate from "../../../services/spaced_update.js";
+import AbstractBulkAction from "../abstract_bulk_action.js";
+import noteAutocompleteService from "../../../services/note_autocomplete.js";
const TPL = `
diff --git a/src/public/app/widgets/bulk_actions/relation/add_relation.js b/src/public/app/widgets/bulk_actions/relation/add_relation.js
new file mode 100644
index 000000000..40ba0ab08
--- /dev/null
+++ b/src/public/app/widgets/bulk_actions/relation/add_relation.js
@@ -0,0 +1,65 @@
+import SpacedUpdate from "../../../services/spaced_update.js";
+import AbstractBulkAction from "../abstract_bulk_action.js";
+import noteAutocompleteService from "../../../services/note_autocomplete.js";
+
+const TPL = `
+