Merge branch 'release/3.3.6'

This commit is contained in:
Baptiste Grob
2020-07-23 10:53:28 +02:00
14 changed files with 54 additions and 33 deletions

2
.gitignore vendored
View File

@@ -28,6 +28,8 @@
dump.rdb
index.html
# Ignore compiled assets
/public/assets

View File

@@ -6,7 +6,7 @@ Standard Notes is a simple and private notes app available on most platforms, in
![](https://standardnotes.org/assets/homepage-hero.png)
<div align="center">
[![latest release version](https://img.shields.io/github/v/release/standardnotes/desktop)](https://github.com/standardnotes/desktop/releases)
[![License](https://img.shields.io/github/license/standardnotes/web?color=blue)](https://github.com/standardnotes/web/blob/master/LICENSE)
[![Slack](https://img.shields.io/badge/slack-standardnotes-CC2B5E.svg?style=flat&logo=slack)](https://standardnotes.org/slack)
@@ -70,7 +70,8 @@ This repo contains the core code used in the web app, as well as the Electron-ba
1. Clone the repo
2. `npm install`
3. `npm start`
3. `cp index.html.sample index.html`
4. `npm start`
Then open your browser to `http://localhost:3000`.

View File

@@ -445,6 +445,7 @@ class AccountMenuCtrl extends PureCtrl {
async downloadDataArchive() {
this.archiveManager.downloadBackup(this.state.mutable.backupEncrypted);
this.close();
}
notesAndTagsCount() {

View File

@@ -29,16 +29,12 @@ export class ArchiveManager {
keys = await this.authManager.keys();
authParams = await this.authManager.getAuthParams();
}
const data = await this.__itemsData(items, keys, authParams);
this.__downloadData(data,
`Standard Notes Encrypted Backup and Import File - ${this.__formattedDate()}.txt`);
} else {
this.__downloadZippedItems(items);
}
this.__itemsData(items, keys, authParams).then((data) => {
const modifier = encrypted ? "Encrypted" : "Decrypted";
this.__downloadData(data, `Standard Notes ${modifier} Backup - ${this.__formattedDate()}.txt`);
// download as zipped plain text files
if(!keys) {
this.__downloadZippedItems(items);
}
});
};
if(await this.privilegesManager.actionRequiresPrivilege(PrivilegesManager.ActionManageBackups)) {
@@ -89,9 +85,19 @@ export class ArchiveManager {
__downloadZippedItems(items) {
this.__loadZip(() => {
zip.createWriter(new zip.BlobWriter("application/zip"), (zipWriter) => {
zip.createWriter(new zip.BlobWriter("application/zip"), async (zipWriter) => {
var index = 0;
const data = await this.modelManager.getJSONDataForItems(items);
await new Promise((resolve) => {
const blob = new Blob([data], {type: 'text/plain'});
zipWriter.add(
'Standard Notes Backup and Import File.txt',
new zip.BlobReader(blob),
resolve
);
});
const nextFile = () => {
var item = items[index];
var name, contents;
@@ -113,7 +119,7 @@ export class ArchiveManager {
const fileSuffix = `-${item.uuid.split("-")[0]}.txt`;
// Standard max filename length is 255. Slice the note name down to allow filenameEnd
filePrefix = filePrefix.slice(0, (255 - fileSuffix.length));
const fileName = `${item.content_type}/${filePrefix}${fileSuffix}`;
const fileName = `Items/${item.content_type}/${filePrefix}${fileSuffix}`;
zipWriter.add(fileName, new zip.BlobReader(blob), () => {
index++;
if(index < items.length) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,4 +1,7 @@
<!-- <!DOCTYPE html> -->
<!--
This file is strictly used for local development using the webpack-dev-server.
-->
<!DOCTYPE html>
<html ng-app="app">
<head>
@@ -22,7 +25,7 @@
<meta ng-bind="title" content="Standard Notes" name="apple-mobile-web-app-title" />
<meta ng-bind="title" content="Standard Notes" name="application-name" />
<title>Notes · Standard Notes</title>
<title>Dev · Notes · Standard Notes</title>
<script>
window._default_sf_server = "https://sync.standardnotes.org";
@@ -30,8 +33,8 @@
window._batch_manager_location = "public/extensions/batch-manager/dist/index.min.html";
</script>
<script src="dist/javascripts/app.js"></script>
<link rel="stylesheet" media="all" href="dist/stylesheets/app.css" debug="false" />
<script src="javascripts/app.js"></script>
<link rel="stylesheet" media="all" href="stylesheets/app.css" debug="false" />
</head>

8
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "standard-notes-web",
"version": "3.3.5",
"version": "3.3.6",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -7481,9 +7481,9 @@
}
},
"lodash": {
"version": "4.17.15",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A=="
"version": "4.17.19",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz",
"integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ=="
},
"log-symbols": {
"version": "2.2.0",

View File

@@ -1,6 +1,6 @@
{
"name": "standard-notes-web",
"version": "3.3.5",
"version": "3.3.6",
"license": "AGPL-3.0-or-later",
"repository": {
"type": "git",
@@ -9,7 +9,9 @@
"scripts": {
"start": "webpack-dev-server --progress",
"bundle": "webpack --mode production",
"build": "bundle install && npm ci && bundle exec rails assets:precompile && npm run bundle",
"precompile:assets": "bundle exec rails assets:precompile",
"postinstall": "npm run precompile:assets",
"build": "bundle install && npm ci && npm run precompile:assets && npm run bundle",
"submodules": "git submodule update --init --force --remote",
"test": "karma start karma.conf.js --single-run",
"lint": "eslint --fix app/assets/javascripts/**/*.js"
@@ -53,6 +55,6 @@
"webpack-dev-server": "^3.10.3"
},
"dependencies": {
"lodash": "^4.17.15"
"lodash": "^4.17.19"
}
}

View File

@@ -2,6 +2,8 @@ const path = require('path');
const webpack = require('webpack');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const port = 3000;
module.exports = {
entry: './app/assets/javascripts/index.js',
output: {
@@ -10,11 +12,15 @@ module.exports = {
devServer: {
proxy: {
'/extensions': {
target: 'http://localhost:3000',
target: `http://localhost:${port}`,
pathRewrite: { '^/extensions': '/public/extensions' }
},
'/assets': {
target: `http://localhost:${port}`,
pathRewrite: { '^/assets': '/public/assets' }
}
},
port: 3000
port
},
plugins: [
new webpack.DefinePlugin({