Saving status improvements

This commit is contained in:
Mo Bitar
2019-06-03 11:09:38 -05:00
parent 39549503ce
commit e9b57a25f2
7 changed files with 31 additions and 12 deletions

View File

@@ -276,6 +276,11 @@ angular.module('app')
let note = this.note; let note = this.note;
note.dummy = false; note.dummy = false;
if(note.deleted) {
alert("The note you are attempting to edit has been deleted, and is awaiting sync. Changes you make will be disregarded.");
return;
}
if(!modelManager.findItem(note.uuid)) { if(!modelManager.findItem(note.uuid)) {
alert("The note you are attempting to save can not be found or has been deleted. Changes you make will not be synced. Please copy this note's text and start a new note."); alert("The note you are attempting to save can not be found or has been deleted. Changes you make will not be synced. Please copy this note's text and start a new note.");
return; return;
@@ -330,7 +335,7 @@ angular.module('app')
if(!error) { if(!error) {
error = { error = {
message: "Sync Unreachable", message: "Sync Unreachable",
desc: "All changes saved offline" desc: "Changes saved offline"
} }
} }
this.saveError = true; this.saveError = true;

View File

@@ -296,6 +296,13 @@ angular.module('app')
}) })
} }
if(note.deleted) {
flags.push({
text: "Deletion Pending Sync",
class: "danger"
})
}
note.flags = flags; note.flags = flags;
return flags; return flags;

View File

@@ -75,6 +75,7 @@ class RevisionPreviewModal {
var uuid = $scope.uuid; var uuid = $scope.uuid;
item = modelManager.findItem(uuid); item = modelManager.findItem(uuid);
item.content = Object.assign({}, $scope.content); item.content = Object.assign({}, $scope.content);
// mapResponseItemsToLocalModels is async, but we don't need to wait here.
modelManager.mapResponseItemsToLocalModels([item], SFModelManager.MappingSourceRemoteActionRetrieved); modelManager.mapResponseItemsToLocalModels([item], SFModelManager.MappingSourceRemoteActionRetrieved);
} }

View File

@@ -5,6 +5,8 @@ class SyncManager extends SFSyncManager {
this.$rootScope = $rootScope; this.$rootScope = $rootScope;
this.$compile = $compile; this.$compile = $compile;
// this.loggingEnabled = true;
// Content types appearing first are always mapped first // Content types appearing first are always mapped first
this.contentTypeLoadPriority = [ this.contentTypeLoadPriority = [
"SN|UserPreferences", "SN|Privileges", "SN|UserPreferences", "SN|Privileges",

View File

@@ -29,12 +29,15 @@ $heading-height: 75px;
height: auto; height: auto;
overflow: visible; overflow: visible;
$title-width: 70%;
$save-status-width: 30%;
> .title { > .title {
font-size: var(--sn-stylekit-font-size-h1); font-size: var(--sn-stylekit-font-size-h1);
font-weight: bold; font-weight: bold;
padding-top: 0px; padding-top: 0px;
width: 100%; width: $title-width;
padding-right: 120px; /* make room for save status */ padding-right: 20px; /* make room for save status */
> .input { > .input {
float: left; float: left;
@@ -54,7 +57,7 @@ $heading-height: 75px;
} }
#save-status { #save-status {
width: 20%; width: $save-status-width;
float: right; float: right;
position: absolute; position: absolute;
@@ -64,6 +67,7 @@ $heading-height: 75px;
font-weight: normal; font-weight: normal;
margin-top: 4px; margin-top: 4px;
text-align: right; text-align: right;
white-space: nowrap;
.desc, .message:not(.warning):not(.danger) { .desc, .message:not(.warning):not(.danger) {
// color: var(--sn-stylekit-editor-foreground-color); // color: var(--sn-stylekit-editor-foreground-color);

12
package-lock.json generated
View File

@@ -5724,9 +5724,9 @@
} }
}, },
"snjs": { "snjs": {
"version": "0.2.4", "version": "0.2.5",
"resolved": "https://registry.npmjs.org/snjs/-/snjs-0.2.4.tgz", "resolved": "https://registry.npmjs.org/snjs/-/snjs-0.2.5.tgz",
"integrity": "sha512-WYrDWZpLnJ9PnE5d93ONGgCaN+D3y/kBdtI8orDkmbYsfSL0v5OX/Fbj96z6xMEskOFvXTH6vYO//LmlPrk4WQ==", "integrity": "sha512-HFjUD9tvVp5VN6ACmKxTlvpvhBTrLj5t8TSR6tPMOHtCU/ozpmuRgD0RFYfOhUYE5bY1woXC/YFR/Nl77oib3Q==",
"dev": true "dev": true
}, },
"source-map": { "source-map": {
@@ -5817,9 +5817,9 @@
"dev": true "dev": true
}, },
"standard-file-js": { "standard-file-js": {
"version": "0.3.61", "version": "0.3.62",
"resolved": "https://registry.npmjs.org/standard-file-js/-/standard-file-js-0.3.61.tgz", "resolved": "https://registry.npmjs.org/standard-file-js/-/standard-file-js-0.3.62.tgz",
"integrity": "sha512-KxjtvYmZQIY9HIIDpW9Ss2cdMBID805Hjilz4xu7Ea2lZkTY4gk7/mx9x8/usNWeBEdfWvywQGFJ69iW6LZo1w==", "integrity": "sha512-zvUYxgz7UlW9tOfl7gqgV9NjdTa/x8Cxp0RftB9008i/Mm4AHKBdvu3rTFcms7Hj+Sw+pHhLGbNm8H4c5rHY0A==",
"dev": true "dev": true
}, },
"static-extend": { "static-extend": {

View File

@@ -39,7 +39,7 @@
"mocha": "^5.2.0", "mocha": "^5.2.0",
"serve-static": "^1.13.2", "serve-static": "^1.13.2",
"sn-stylekit": "2.0.15", "sn-stylekit": "2.0.15",
"snjs": "0.2.4", "snjs": "0.2.5",
"standard-file-js": "0.3.61" "standard-file-js": "0.3.62"
} }
} }