image notes can't be updated + minor visual tweaks

This commit is contained in:
azivner 2018-11-15 14:33:02 +01:00
parent 6749cbed1b
commit 39b3c91abf
6 changed files with 22 additions and 8 deletions

View File

@ -0,0 +1,14 @@
create index IDX_links_noteId_index
on links (noteId);
create index IDX_links_targetNoteId_index
on links (targetNoteId);
create index IDX_attributes_name_index
on attributes (name);
create index IDX_attributes_noteId_index
on attributes (noteId);
create index IDX_attributes_value_index
on attributes (value);

View File

@ -19,8 +19,8 @@ async function show() {
$component.show();
$fileName.text(attributeMap.originalFileName);
$fileSize.text(attributeMap.fileSize + " bytes");
$fileName.text(attributeMap.originalFileName || "?");
$fileSize.text((attributeMap.fileSize || "?") + " bytes");
$fileType.text(currentNote.mime);
}

View File

@ -21,8 +21,8 @@ async function show() {
$component.show();
$fileName.text(attributeMap.originalFileName);
$fileSize.text(attributeMap.fileSize + " bytes");
$fileName.text(attributeMap.originalFileName || "?");
$fileSize.text((attributeMap.fileSize || "?") + " bytes");
$fileType.text(currentNote.mime);
$imageView.prop("src", `/api/images/${currentNote.noteId}/${currentNote.title}`);

View File

@ -275,8 +275,8 @@ async function updateNote(noteId, noteUpdates) {
throw new Error(`Note ${noteId} is not available for change!`);
}
if (note.type === 'file') {
// for update file, newNote doesn't contain file payloads
if (note.type === 'file' || note.type === 'image') {
// files and images are immutable, they can't be updated
noteUpdates.content = note.content;
}

View File

@ -1,7 +1,7 @@
<div id="note-detail-file" class="note-detail-component">
<table id="file-table">
<tr>
<th>File name:</th>
<th>Original file name:</th>
<td id="file-filename"></td>
</tr>
<tr>

View File

@ -1,5 +1,5 @@
<div id="note-detail-image" class="note-detail-component">
<strong>File name:</strong>
<strong>Original file name:</strong>
<span id="image-filename"></span>
&nbsp; &nbsp;