From e9c9ce2f13fb0b2ad4e3ab5db03530e85f215249 Mon Sep 17 00:00:00 2001 From: flo Date: Tue, 29 May 2018 13:23:57 +0200 Subject: [PATCH] Bump version to 0.4.0 --- README.md | 1 + web/src/Background.elm | 11 ++++++-- web/src/Data/Settings.elm | 24 ++++++----------- web/src/Data/TaskList.elm | 1 - web/src/Views/ReleaseLog.elm | 31 +++++++++++++++++++++- web_extension/content_scripts/pageUtils.js | 1 - web_extension/manifest.json | 4 +-- 7 files changed, 50 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index d820f9c..890ee0c 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,7 @@ More specific instructions can be found in the corresponding folders. * Grep for `TODO!`s: `rg TODO!` and resolve them * Find stray log statements: `rg "^([^/\n]*(console.log|Log\.[de])|[^-]*Debug.log)"` and possibly remove them * Increment versions in `build.gradle`, `web/src/Data/Settings.elm` and `web_extension/manifest.json` + + Only increment Android if the Android shell code changed, otherwise, don't do anything about Android. * Go through the readmes of `web, android, web_extension` * Push changes to github * Upload the generated builds on github releases diff --git a/web/src/Background.elm b/web/src/Background.elm index adc0ff8..fa1c70f 100644 --- a/web/src/Background.elm +++ b/web/src/Background.elm @@ -320,12 +320,19 @@ update msg model = let newSiteEntry = if model.newSiteEntry.siteName == "" || Just model.newSiteEntry.siteName == model.currentSite then + -- Pre fill the site name in the add new account dialogue if it was previously empty + -- or if it contained the previous site Data.PasswordMeta.setSiteName site model.newSiteEntry else model.newSiteEntry + + newModel = + { model | currentSite = Just site, newSiteEntry = newSiteEntry } in - { model | currentSite = Just site, newSiteEntry = newSiteEntry } - |> withCmds [ Ports.accountsForSite (Data.Sync.getAccountsForSite site model.syncData) ] + if Data.Settings.isDeactivatedFor site model.syncData.shared.settings then + newModel |> noCmd + else + newModel |> withCmds [ Ports.accountsForSite (Data.Sync.getAccountsForSite site model.syncData) ] AddSiteEntry { isSignUp, entry } -> -- TODO: type can be either SignUp | LogIn | UpdateCredentials diff --git a/web/src/Data/Settings.elm b/web/src/Data/Settings.elm index d9483d9..293259b 100644 --- a/web/src/Data/Settings.elm +++ b/web/src/Data/Settings.elm @@ -16,6 +16,7 @@ module Data.Settings , get , set , deactivateForSite + , isDeactivatedFor , setDoneWithTutorial ) @@ -32,20 +33,6 @@ import Crdt.TimestampedVersionRegister as TimestampedVersionRegister exposing (T import Crdt.ORSet as ORSet exposing (ORSet) -{- TODO: update news + sync if read tutorial - - save last seen update news for version number: - start at v 0.0.0. - If the current version number is bigger than our last seen, - show all news with v >= currentV - - save news in a Dict Version Content - - save read news and sync, so we only have to read once - --} - - type alias SharedSettings = { allowLevel1 : Maybe (TimestampedVersionRegister Bool) , timeUntilAutoLock : Maybe (TimestampedVersionRegister Time) @@ -66,12 +53,12 @@ type alias Settings = currentVersion = -- TODO!: change if a new version is released - "0.3.0" + "0.4.0" allVersions = -- TODO!: update this on big releases, e.g. if you want to include some text - Set.fromList [ "0.3" ] + Set.fromList [ "0.3.0", "0.4.0" ] get : SharedSettings -> Settings @@ -99,6 +86,11 @@ deactivateForSite site opt = { opt | deactivateForSite = ORSet.add site opt.deactivateForSite } +isDeactivatedFor : String -> SharedSettings -> Bool +isDeactivatedFor site settings = + Set.member site (ORSet.get settings.deactivateForSite) + + removeFromIgnored : String -> SharedSettings -> SharedSettings removeFromIgnored site opt = { opt | deactivateForSite = ORSet.remove site opt.deactivateForSite } diff --git a/web/src/Data/TaskList.elm b/web/src/Data/TaskList.elm index d2a9db3..1f3b48d 100644 --- a/web/src/Data/TaskList.elm +++ b/web/src/Data/TaskList.elm @@ -219,7 +219,6 @@ getProgress groupId sharesInBoxes dict = getTasks : (GroupId -> List Share) -> (GroupId -> Int) -> List ( Box, Set GroupId ) -> Request.State -> Dict GroupId (List Device) -> Dict GroupId (Set String) -> Dict GroupId String -> TaskList -> List Task getTasks getShares getSharesInBoxes boxesNeedingShares request groupsNotFullyDistributed progress postFixDict tasks = - -- TODO!: Create new task for "create new keys for box -> open box + unlock group" let getGroup groupId = ( groupId, Helper.dictGetWithDefault "" groupId postFixDict ) diff --git a/web/src/Views/ReleaseLog.elm b/web/src/Views/ReleaseLog.elm index d1bda3b..4b3c219 100644 --- a/web/src/Views/ReleaseLog.elm +++ b/web/src/Views/ReleaseLog.elm @@ -13,7 +13,8 @@ allNews : Dict String ( Element Msg, Element Msg ) allNews = -- TODO!: on new big release, write log Dict.fromList - [ ( "0.3", ( s0_3, n0_3 ) ) + [ ( "0.3.0", ( s0_3, n0_3 ) ) + , ( "0.4.0", ( s0_4, n0_4 ) ) ] @@ -47,6 +48,34 @@ n0_3 = ] +s0_4 = + Elements.p "New feature: Key boxes" + + +n0_4 = + column [ spacing (Styles.paddingScale 3), height shrink ] + [ Elements.h3 "Note" + , Elements.p """The last upgrade notes didn't show up correctly, that's why it showed up this time. + If you haven't read and followed the instructions of the 0.3.0 release yet, you should do so now. + If you already did so, you don't have to do anything.""" + , Elements.button (Just <| NavigateTo (ReleaseLog "0.3.0")) "Read 0.3.0 notes" + , Elements.p "" + , Elements.h3 "New Feature" + , Elements.h4 "Key Boxes" + , Elements.paragraph [] + [ Elements.text """A key box is a password protected box that holds keys. It allows you to unlock + a password group even if you don't carry enough devices with you. + A key box can be created from the 'Devices' tab.""" + ] + , Elements.p "" + , Elements.h3 "Improvements" + , Elements.list + [ Elements.p "You can now move passwords to a group that doesn't exist yet." + , Elements.p "Various improvements to the browser extension" + ] + ] + + sortedLog : List String sortedLog = Dict.keys allNews diff --git a/web_extension/content_scripts/pageUtils.js b/web_extension/content_scripts/pageUtils.js index 51104c1..9df0538 100644 --- a/web_extension/content_scripts/pageUtils.js +++ b/web_extension/content_scripts/pageUtils.js @@ -165,7 +165,6 @@ const closePopup = () => { }; const closePopupFor = (time) => { - // TODO! closePopup(); disablePopup(); setTimeout(() => { enablePopup(); }, time); diff --git a/web_extension/manifest.json b/web_extension/manifest.json index a54778b..27b0e81 100644 --- a/web_extension/manifest.json +++ b/web_extension/manifest.json @@ -3,7 +3,7 @@ "name": "NoKey", "description": "A distributed password manager without a master passwords", - "version": "0.3", + "version": "0.4.0", "author": "Florian Zinggeler", "applications": { @@ -54,7 +54,7 @@ } ], - "content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self';", + "content_security_policy": "script-src 'self'; object-src 'self';", "content_security_policy_RELEASE": "script-src 'self'; object-src 'self';", "content_security_policy_DEBUG": "script-src 'self' 'unsafe-eval'; object-src 'self';" }