diff --git a/Backend/app.js b/Backend/app.js index 8cdd264f4..ba4965fdf 100644 --- a/Backend/app.js +++ b/Backend/app.js @@ -7,6 +7,8 @@ var cors = require('cors'); var fs = require('fs'); var Raven = require('raven'); +var RS_VERSION = JSON.parse(fs.readFileSync('./package.json')).version; + var testMode = process.env.NODE_ENV === 'test'; var verboseMode = process.env.VERBOSE === 'true'; @@ -22,7 +24,7 @@ var devMode = appConfig.environment === 'dev'; Raven.config(appConfig.sentry.dsn, { environment: appConfig.environment, - release: '2.0.0' + release: RS_VERSION }).install(); // Routes diff --git a/Backend/fdxzimport.app.js b/Backend/fdxzimport.app.js index 7acbe93b4..eee8adf13 100644 --- a/Backend/fdxzimport.app.js +++ b/Backend/fdxzimport.app.js @@ -14,6 +14,8 @@ var Recipe_Label = require('./models').Recipe_Label; var UtilService = require('./services/util'); +var RS_VERSION = JSON.parse(fs.readFileSync('./package.json')).version; + let runConfig = { path: process.argv[2], userId: process.argv[3], @@ -34,7 +36,7 @@ var devMode = appConfig.environment === 'dev'; Raven.config(appConfig.sentry.dsn, { environment: appConfig.environment, - release: '2.0.0' + release: RS_VERSION }).install(); let logError = async err => { diff --git a/Backend/lcbimport.app.js b/Backend/lcbimport.app.js index b6414cea1..fbc22453d 100644 --- a/Backend/lcbimport.app.js +++ b/Backend/lcbimport.app.js @@ -16,6 +16,8 @@ var Recipe_Label = require('./models').Recipe_Label; var UtilService = require('./services/util'); +var RS_VERSION = JSON.parse(fs.readFileSync('./package.json')).version; + let runConfig = { path: process.argv[2], userId: process.argv[3], @@ -38,7 +40,7 @@ var devMode = appConfig.environment === 'dev'; Raven.config(appConfig.sentry.dsn, { environment: appConfig.environment, - release: '2.0.0' + release: RS_VERSION }).install(); let logError = async err => { diff --git a/Backend/package.json b/Backend/package.json index 41c917d37..35240c557 100644 --- a/Backend/package.json +++ b/Backend/package.json @@ -1,6 +1,6 @@ { "name": "chefbook-backend", - "version": "0.0.0", + "version": "2.0.2", "private": true, "scripts": { "start": "node ./bin/www", diff --git a/Backend/routes/index.js b/Backend/routes/index.js index d3d5020a4..3ab6b4ea3 100644 --- a/Backend/routes/index.js +++ b/Backend/routes/index.js @@ -110,7 +110,9 @@ function saveRecipes(userId, recipes) { return Promise.all(recipes.map(function (recipe) { return new Promise(function (resolve, reject) { if (recipe.imageURL) { - UtilService.sendURLToS3(recipe.imageURL).then(resolve).catch(reject) + UtilService.sendURLToS3(recipe.imageURL).then(resolve).catch(() => { + resolve(null); + }); } else resolve(null); }).then(function (image) { return Recipe.create({ diff --git a/Frontend/src/app/app-routing.module.ts b/Frontend/src/app/app-routing.module.ts index 369184f44..6e861770f 100644 --- a/Frontend/src/app/app-routing.module.ts +++ b/Frontend/src/app/app-routing.module.ts @@ -144,8 +144,9 @@ const routes: Routes = [ canDeactivate: [UnsavedChangesGuardService] }, // Legacy route redirects - { path: 'about-details', redirectTo: RouteMap.AboutDetailsPage.getPath(), pathMatch: 'full' }, - { path: 'login', redirectTo: RouteMap.AuthPage.getPath(AuthType.Login), pathMatch: 'full' } + { path: 'about-details', redirectTo: '/about/details', pathMatch: 'full' }, + { path: 'login', redirectTo: '/auth/login', pathMatch: 'full' }, + { path: 'edit-recipe', redirectTo: '/', pathMatch: 'full' } ]; @NgModule({ diff --git a/Frontend/src/app/pages/info-components/release-notes/release-notes.page.html b/Frontend/src/app/pages/info-components/release-notes/release-notes.page.html index 48b589d0d..31a2b1354 100644 --- a/Frontend/src/app/pages/info-components/release-notes/release-notes.page.html +++ b/Frontend/src/app/pages/info-components/release-notes/release-notes.page.html @@ -20,6 +20,21 @@
+ v2.0.2
+ - Pepperplate import will now still work even if Pepperplate image servers are down + (they are now almost always down, unfortunately)
+ +
+ + v2.0.1
+ - Fixed several cases where app would crash due to old cached versions
+ - Added warning when leaving the edit recipe page with unsaved changes
+ - Added handler for old urls to redirect to new url format
+ - Fix thumbnail sizing
+ - Fix push notifications
+ +
+ v2.0.0
- Performance & under-the-hood improvements
- New theme options available in settings (dark & black oled). Defaults to system theme on supported browsers
diff --git a/Frontend/src/app/pages/recipe-components/edit-recipe/edit-recipe.page.ts b/Frontend/src/app/pages/recipe-components/edit-recipe/edit-recipe.page.ts index 17551531b..42d11464a 100644 --- a/Frontend/src/app/pages/recipe-components/edit-recipe/edit-recipe.page.ts +++ b/Frontend/src/app/pages/recipe-components/edit-recipe/edit-recipe.page.ts @@ -176,6 +176,8 @@ export class EditRecipePage { if (this.recipe.id) { this.recipeService.update(this.recipe).then(response => { + this.markAsClean(); + this.navCtrl.navigateRoot(RouteMap.RecipePage.getPath(this.recipe.id)); loading.dismiss(); @@ -204,6 +206,8 @@ export class EditRecipePage { }); } else { this.recipeService.create(this.recipe).then(response => { + this.markAsClean(); + this.navCtrl.navigateRoot(RouteMap.RecipePage.getPath(response.id)); loading.dismiss(); @@ -256,4 +260,8 @@ export class EditRecipePage { markAsDirty() { this.unsavedChangesService.setPendingChanges(); } + + markAsClean() { + this.unsavedChangesService.clearPendingChanges(); + } } diff --git a/Frontend/src/app/services/unsaved-changes.service.ts b/Frontend/src/app/services/unsaved-changes.service.ts index 20679603d..f0b5bb8c3 100644 --- a/Frontend/src/app/services/unsaved-changes.service.ts +++ b/Frontend/src/app/services/unsaved-changes.service.ts @@ -19,7 +19,7 @@ export class UnsavedChangesService { // Reset pending changes after every navigation event this.router.events.subscribe((event) => { if (event instanceof NavigationEnd) { - this.pendingChanges = false; + this.clearPendingChanges(); } }); @@ -39,4 +39,8 @@ export class UnsavedChangesService { hasPendingChanges() { return this.pendingChanges; } + + clearPendingChanges() { + this.pendingChanges = false; + } } diff --git a/Frontend/src/index.html b/Frontend/src/index.html index 4c810bfc1..52422de20 100644 --- a/Frontend/src/index.html +++ b/Frontend/src/index.html @@ -122,7 +122,7 @@