Rewrites checkVersion and checkVersionNewer in utils-service.js, refines upgradeToVersion

- Adds unit tests that cover all cases.
- Adds call to parseVersionString() so we can pass it version string e.g. '1.0.1'
- persistence-service.js now also manages JamstashVersion. It is set in localStorage from app.js's constant, and not from the changelog so we don't have to add a version to the changelog to actually do stuff.
- persistence-service.js's upgradeToVersion() now only applies newer changesets. This ensures we won't erase users' settings with changesets at every new version, e.g. resetting songSearchType to song every time.
- upgradeToVersion() will also notify the user of the upgrade, which was formerly done in settings.js
This commit is contained in:
Hyzual 2015-03-23 22:51:43 +01:00
parent ae703c1542
commit fe6c10bc4a
6 changed files with 274 additions and 92 deletions

View file

@ -50,5 +50,5 @@ angular.module('JamStash', ['ngCookies', 'ngRoute', 'ngSanitize', 'ui.keypress',
}]);
}])
//TODO: store as version object
//TODO: Hyz: Fill with grunt task
.constant('jamstashVersion', '4.4.5');