small fixes

This commit is contained in:
zadam 2021-10-03 10:42:46 +02:00
parent a1c1c7c830
commit 75fc9e2048
4 changed files with 13 additions and 2 deletions

View File

@ -166,12 +166,14 @@ class NoteRevision extends AbstractEntity {
utcDateLastEdited: this.utcDateLastEdited,
utcDateCreated: this.utcDateCreated,
utcDateModified: this.utcDateModified,
content: this.content,
contentLength: this.contentLength
};
}
getPojoToSave() {
const pojo = this.getPojo();
delete pojo.content; // not getting persisted
delete pojo.contentLength; // not getting persisted
if (pojo.isProtected) {

View File

@ -141,7 +141,7 @@ export default class DesktopLayout {
.ribbon(new NoteInfoWidget())
.button(new EditButton())
.button(new ButtonWidget()
.icon('bx bx-history')
.icon('bx-history')
.title("Note Revisions")
.command("showNoteRevisions")
.titlePlacement("bottom"))

View File

@ -310,7 +310,7 @@ export default class RibbonContainer extends NoteContextAwareWidget {
// won't trigger .refresh();
await super.handleEventInChildren('setNoteContext', data);
}
else if (this.isEnabled()) {
else if (this.isEnabled() || name === 'initialRenderComplete') {
const activeRibbonWidget = this.getActiveRibbonWidget();
// forward events only to active ribbon tab, inactive ones don't need to be updated

View File

@ -40,6 +40,15 @@ export default class SqlResultWidget extends NoteContextAwareWidget {
this.$resultContainer.empty();
for (const rows of results) {
if (typeof rows === 'object' && !Array.isArray(rows)) {
// inserts, updates
this.$resultContainer.empty().show().append(
$("<pre>").text(JSON.stringify(rows, null, '\t'))
);
continue;
}
if (!rows.length) {
continue;
}