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

Update static_list.esm.js #945

Open
wants to merge 1 commit into
base: 17.0
Choose a base branch
from
Open
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
24 changes: 14 additions & 10 deletions server_action_mass_edit/static/src/js/static_list.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,29 @@ patch(StaticList.prototype, {
this._onUpdate = options.onUpdate;

this._cache = markRaw({});
this._commands = [];
this._initialCommands = [];
this._commands = this._commands || [];
console.log("Initial Commands:", this._commands);

this._savePoint = undefined;
this._unknownRecordCommands = {};
this._currentIds = [...this.resIds];
this._initialCurrentIds = [...this.currentIds];
this._needsReordering = false;
this._tmpIncreaseLimit = 0;
this._extendedRecords = new Set();
// To prevent the TypeError: data.slice is not a function" while set/remove/add
// value in wizard
this.records = Array.isArray(data)
? data
.slice(this.offset, this.limit)
.map((r) => this._createRecordDatapoint(r))
: [];

const safeData = Array.isArray(data) ? data : [];
this.records = safeData.slice(this.offset, this.limit).map((r) => this._createRecordDatapoint(r));

this.count = this.resIds.length;
this.handleField = Object.keys(this.activeFields).find(
(fieldName) => this.activeFields[fieldName].isHandle
);
},

_applyCommands() {
console.log("Applying Commands:", this._commands);
// Add logic here to ensure commands is iterable
this._commands = this._commands || [];
// Further code...
}
});
Loading