Skip to content

Commit

Permalink
Merge branch 'release/3.8.18' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonella Sgarlatta committed Jul 22, 2021
2 parents de8be41 + 660a58e commit 6408941
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 17 deletions.
1 change: 1 addition & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion app/assets/javascripts/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ function reloadHiddenFirefoxTab(): boolean {
const startApplication: StartApplication = async function startApplication(
defaultSyncServerHost: string,
bridge: Bridge,
webSocketUrl: string,
) {
if (reloadHiddenFirefoxTab()) {
return;
Expand All @@ -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
Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions app/assets/javascripts/startApplication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ import { Bridge } from "./services/bridge";
export type StartApplication = (
defaultSyncServerHost: string,
bridge: Bridge,
webSocketUrl: string,
) => Promise<void>;
7 changes: 6 additions & 1 deletion app/assets/javascripts/ui_models/app_state/app_state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions app/assets/javascripts/ui_models/application_group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
14 changes: 10 additions & 4 deletions app/assets/javascripts/views/notes/notes_view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ class NotesViewCtrl extends PureViewCtrl<unknown, NotesCtrlState> {
if (selectedTag.isSmartTag && !selectedTag.isAllTag) {
return;
}
return this.createNewNote();
return this.createNewNote(false);
}

streamNotesAndTags() {
Expand All @@ -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);
Expand Down Expand Up @@ -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()) {
Expand All @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions app/views/application/app.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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? %>
Expand Down
2 changes: 2 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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"
Expand Down
18 changes: 9 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -2029,12 +2029,12 @@
"@standardnotes/sncrypto-common" "^1.2.7"
libsodium-wrappers "^0.7.8"

"@standardnotes/[email protected].18":
version "2.7.18"
resolved "https://registry.yarnpkg.com/@standardnotes/snjs/-/snjs-2.7.18.tgz#90dd33576176da53714438e0819eef180c221381"
integrity sha512-fXv91FhsxLRMK9KR1LLNzG/k9vdnMqrqMwQrfRECDqJRG2iZvlvVqzgWKBCYtCvLRHSRnFmt0xPKA2yuTkZqpA==
"@standardnotes/[email protected].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":
Expand Down

0 comments on commit 6408941

Please sign in to comment.