Merge branch 'release/3.8.18' into main

This commit is contained in:
Antonella Sgarlatta
2021-07-22 11:08:17 -03:00
10 changed files with 37 additions and 17 deletions

View File

@@ -15,6 +15,7 @@ SF_DEFAULT_SERVER=http://localhost:3000
DEV_DEFAULT_SYNC_SERVER=https://api.standardnotes.com
DEV_EXTENSIONS_MANAGER_LOCATION=public/extensions/extensions-manager/dist/index.html
ENABLE_UNFINISHED_FEATURES=false
DEV_WEBSOCKET_URL=wss://sockets-dev.standardnotes.com
# NewRelic (Optional)
NEW_RELIC_ENABLED=false

View File

@@ -91,6 +91,7 @@ function reloadHiddenFirefoxTab(): boolean {
const startApplication: StartApplication = async function startApplication(
defaultSyncServerHost: string,
bridge: Bridge,
webSocketUrl: string,
) {
if (reloadHiddenFirefoxTab()) {
return;
@@ -107,7 +108,8 @@ const startApplication: StartApplication = async function startApplication(
.config(configRoutes)
.constant('bridge', bridge)
.constant('defaultSyncServerHost', defaultSyncServerHost)
.constant('appVersion', bridge.appVersion);
.constant('appVersion', bridge.appVersion)
.constant('webSocketUrl', webSocketUrl);
// Controllers
angular
@@ -193,6 +195,7 @@ if (__WEB__) {
startApplication(
(window as any)._default_sync_server,
new BrowserBridge(__VERSION__),
(window as any)._websocket_url,
);
} else {
(window as any).startApplication = startApplication;

View File

@@ -3,4 +3,5 @@ import { Bridge } from "./services/bridge";
export type StartApplication = (
defaultSyncServerHost: string,
bridge: Bridge,
webSocketUrl: string,
) => Promise<void>;

View File

@@ -246,11 +246,16 @@ export class AppState {
}
if (note.deleted) {
this.closeEditor(editor);
} else if (note.trashed && !this.selectedTag?.isTrashTag) {
} else if (
note.trashed &&
!this.selectedTag?.isTrashTag &&
!this.searchOptions.includeTrashed
) {
this.closeEditor(editor);
} else if (
note.archived &&
!this.selectedTag?.isArchiveTag &&
!this.searchOptions.includeArchived &&
!this.application.getPreference(PrefKey.NotesShowArchived, false)
) {
this.closeEditor(editor);

View File

@@ -29,6 +29,7 @@ export class ApplicationGroup extends SNApplicationGroup {
$timeout: ng.ITimeoutService,
private defaultSyncServerHost: string,
private bridge: Bridge,
private webSocketUrl: string
) {
super(new WebDeviceInterface($timeout, bridge));
this.$compile = $compile;

View File

@@ -255,7 +255,7 @@ class NotesViewCtrl extends PureViewCtrl<unknown, NotesCtrlState> {
if (selectedTag.isSmartTag && !selectedTag.isAllTag) {
return;
}
return this.createNewNote();
return this.createNewNote(false);
}
streamNotesAndTags() {
@@ -277,7 +277,11 @@ class NotesViewCtrl extends PureViewCtrl<unknown, NotesCtrlState> {
if (this.application.getAppState().notes.selectedNotesCount < 2) {
if (activeNote) {
const discarded = activeNote.deleted || activeNote.trashed;
if (discarded && !this.appState?.selectedTag?.isTrashTag) {
if (
discarded &&
!this.appState?.selectedTag?.isTrashTag &&
!this.appState?.searchOptions.includeTrashed
) {
this.selectNextOrCreateNew();
} else if (!this.state.selectedNotes[activeNote.uuid]) {
this.selectNote(activeNote);
@@ -354,7 +358,7 @@ class NotesViewCtrl extends PureViewCtrl<unknown, NotesCtrlState> {
await this.appState.notes.selectNote(note.uuid, userTriggered);
}
async createNewNote() {
async createNewNote(focusNewNote = true) {
this.appState.notes.unselectNotes();
let title = `Note ${this.state.notes.length + 1}`;
if (this.isFiltering()) {
@@ -365,7 +369,9 @@ class NotesViewCtrl extends PureViewCtrl<unknown, NotesCtrlState> {
await this.reloadNotes();
await this.appState.noteTags.reloadTags();
const noteTitleEditorElement = document.getElementById('note-title-editor');
noteTitleEditorElement?.focus();
if (focusNewNote) {
noteTitleEditorElement?.focus();
}
}
async handleTagChange(tag: SNTag) {

View File

@@ -34,6 +34,7 @@
window._batch_manager_location = "<%= ENV['BATCH_MANAGER_LOCATION'] %>";
window._bugsnag_api_key = "<%= ENV['BUGSNAG_API_KEY'] %>";
window._enable_unfinished_features = "<%= ENV['ENABLE_UNFINISHED_FEATURES'] %>" === 'true';
window._websocket_url = "<%= ENV['WEBSOCKET_URL'] %>";
</script>
<% if Rails.env.development? %>

View File

@@ -33,12 +33,14 @@
data-extensions-manager-location="<%= env.DEV_EXTENSIONS_MANAGER_LOCATION %>"
data-bugsnag-api-key="<%= env.DEV_BUGSNAG_API_KEY %>"
data-enable-unfinished-features="<%= env.ENABLE_UNFINISHED_FEATURES %>"
data-web-socket-url="<%= env.DEV_WEBSOCKET_URL %>"
>
<script>
window._default_sync_server = document.body.dataset.defaultSyncServer || "https://api.standardnotes.com";
window._extensions_manager_location = document.body.dataset.extensionsManagerLocation || "public/extensions/extensions-manager/dist/index.html";
window._bugsnag_api_key = document.body.dataset.bugsnagApiKey;
window._enable_unfinished_features = document.body.dataset.enableUnfinishedFeatures === 'true';
window._websocket_url = document.body.dataset.webSocketUrl;
</script>
<application-group-view />
</body>

View File

@@ -1,6 +1,6 @@
{
"name": "standard-notes-web",
"version": "3.8.17",
"version": "3.8.18",
"license": "AGPL-3.0-or-later",
"repository": {
"type": "git",
@@ -71,7 +71,7 @@
"@reach/checkbox": "^0.13.2",
"@reach/dialog": "^0.13.0",
"@standardnotes/sncrypto-web": "1.2.10",
"@standardnotes/snjs": "2.7.18",
"@standardnotes/snjs": "2.7.21",
"mobx": "^6.1.6",
"mobx-react-lite": "^3.2.0",
"preact": "^10.5.12"

View File

@@ -2011,10 +2011,10 @@
prop-types "^15.7.2"
tslib "^2.1.0"
"@standardnotes/auth@^2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@standardnotes/auth/-/auth-2.0.0.tgz#93f633fd40855f87843f911109e92b29dcbc5a04"
integrity sha512-B2NznCm3pzwBvBU/YQfuDrtlEbLO3hNH3QrqSwK2dFwUGAnl5UQPC9FKFWYgly05rWevwMY3IUmiZRzUEVlKsQ==
"@standardnotes/auth@3.1.1":
version "3.1.1"
resolved "https://registry.yarnpkg.com/@standardnotes/auth/-/auth-3.1.1.tgz#834701c2e14d31eb204bff90457fa05e9183464a"
integrity sha512-E9zDYZ1gJkVZBEzd7a1L2haQ4GYeH1lUrY87UmDH1AMYUHW+c0SqZ71af1fBNqGzrx3EZSXk+Qzr7RyOa6N1Mw==
"@standardnotes/sncrypto-common@^1.2.7", "@standardnotes/sncrypto-common@^1.2.9":
version "1.2.9"
@@ -2029,12 +2029,12 @@
"@standardnotes/sncrypto-common" "^1.2.7"
libsodium-wrappers "^0.7.8"
"@standardnotes/snjs@2.7.18":
version "2.7.18"
resolved "https://registry.yarnpkg.com/@standardnotes/snjs/-/snjs-2.7.18.tgz#90dd33576176da53714438e0819eef180c221381"
integrity sha512-fXv91FhsxLRMK9KR1LLNzG/k9vdnMqrqMwQrfRECDqJRG2iZvlvVqzgWKBCYtCvLRHSRnFmt0xPKA2yuTkZqpA==
"@standardnotes/snjs@2.7.21":
version "2.7.21"
resolved "https://registry.yarnpkg.com/@standardnotes/snjs/-/snjs-2.7.21.tgz#db451e5facaf5fa41fa509eb1f304723929c3541"
integrity sha512-GhkGk1LJmD494COZkSOgyHaUnGnLWNLlSuCZMTwbw3dgkN5PjobbRhfDvEZaLqjwok+h9nkiQt3hugQ3h6Cy5w==
dependencies:
"@standardnotes/auth" "^2.0.0"
"@standardnotes/auth" "3.1.1"
"@standardnotes/sncrypto-common" "^1.2.9"
"@svgr/babel-plugin-add-jsx-attribute@^5.4.0":