Commit 385d2192 authored by LAVENIER's avatar LAVENIER
Browse files

Release v0.12.1

[fix] Table: keep row editing, when saving
parent 4ee6d46f
{
"name": "@sumaris-net/ngx-components",
"description": "SUMARiS Angular components",
"version": "0.12.0",
"version": "0.12.1",
"author": "contact@e-is.pro",
"license": "AGPL-3.0",
"readmeFilename": "README.md",
......
......@@ -775,6 +775,10 @@ export abstract class AppTable<
}
async save(opts?: {keepEditing: boolean; }): Promise<boolean> {
opts = {
keepEditing: this.keepEditedRowOnSave,
...opts
};
if (this.readOnly) {
throw {code: ErrorCodes.TABLE_READ_ONLY, message: 'ERROR.TABLE_READ_ONLY'};
}
......@@ -782,7 +786,7 @@ export abstract class AppTable<
this.resetError();
// Keep edited row id (should be done BEFORE confirmEditCreate() )
const editedRowId = toBoolean(opts?.keepEditing, this.keepEditedRowOnSave) && this.editedRow?.editing && this.editedRow.id;
const editedRowId = opts.keepEditing && this.editedRow && this.editedRow.editing && this.editedRow.id;
if (!this.confirmEditCreate()) {
throw {code: ErrorCodes.TABLE_INVALID_ROW_ERROR, message: 'ERROR.TABLE_INVALID_ROW_ERROR'};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment