Skip to content

Commit 7f39d57

Browse files
authored
Switch bulk update data loading to use Vuex data store (#1351)
1 parent 70ec02e commit 7f39d57

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

static/js/admin/src/action/UpdatePatronAccessBatchAction.js

+11-12
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,23 @@ define('UpdatePatronAccessBatchAction', [ 'jquery', 'AbstractBatchAction'], func
1515
UpdatePatronAccessBatchAction.prototype.execute = function() {
1616
let targets = this.getTargets();
1717

18-
let perms_editor_data = perms_editor.$children[0].$children[0].$data;
19-
perms_editor_data.permissionType = 'Patron';
20-
perms_editor_data.alertHandler = this.context.view.$alertHandler;
21-
perms_editor_data.actionHandler = this.context.actionHandler;
18+
perms_editor_store.commit('setPermissionType', 'Patron');
19+
perms_editor_store.commit('setAlertHandler', this.context.view.$alertHandler);
20+
perms_editor_store.commit('setActionHandler', this.context.actionHandler);
2221
if (targets.length == 1) {
23-
perms_editor_data.resultObject = targets[0];
24-
perms_editor_data.resultObjects = null;
25-
perms_editor_data.metadata = targets[0].metadata;
22+
perms_editor_store.commit('setResultObject', targets[0]);
23+
perms_editor_store.commit('setResultObjects', null);
24+
perms_editor_store.commit('setMetadata', targets[0].metadata);
2625
} else {
27-
perms_editor_data.resultObject = null;
28-
perms_editor_data.resultObjects = targets;
29-
perms_editor_data.metadata = {
26+
perms_editor_store.commit('setResultObject', null);
27+
perms_editor_store.commit('setResultObjects', targets);
28+
perms_editor_store.commit('setMetadata', {
3029
title: targets.length + " objects",
3130
id: null,
3231
type: null
33-
};
32+
});
3433
}
35-
perms_editor_data.showModal = true;
34+
perms_editor_store.commit('setShowModal', true);
3635

3736
AbstractBatchAction.prototype.execute.call(this);
3837
}

0 commit comments

Comments
 (0)