From 8c94aa90e7c1a1fcf52d720ace54ee36abe28943 Mon Sep 17 00:00:00 2001 From: Guillaume Vincent Date: Sun, 28 Mar 2021 20:41:10 +0200 Subject: [PATCH] lesspass-pure 9.3.1 --- .github/workflows/build-lesspass-pure-package.yml | 3 +- packages/lesspass-pure/package.json | 2 +- packages/lesspass-pure/src/components/Avatar.vue | 4 +- .../lesspass-pure/src/components/InputSite.vue | 2 +- packages/lesspass-pure/src/components/Menu.vue | 117 +++++++++++++-------- packages/lesspass-pure/src/components/Message.vue | 8 +- .../src/components/PasswordProfile.vue | 4 +- .../src/components/RemoveAutoComplete.vue | 14 ++- .../lesspass-pure/src/services/url-parser.test.js | 56 +++++++--- packages/lesspass-pure/src/store/mutations.test.js | 10 +- packages/lesspass-pure/src/views/MyAccount.vue | 2 +- packages/lesspass-pure/src/views/Passwords.vue | 4 +- 12 files changed, 152 insertions(+), 74 deletions(-) diff --git a/.github/workflows/build-lesspass-pure-package.yml b/.github/workflows/build-lesspass-pure-package.yml index 4f11fbb..53d2406 100644 --- a/.github/workflows/build-lesspass-pure-package.yml +++ b/.github/workflows/build-lesspass-pure-package.yml @@ -42,5 +42,6 @@ jobs: run: | git config --global user.name 'botsito' git config --global user.email 'botsito@lesspass.com' - git commit -am "Auto build for lesspass-pure" + git add . + git commit -m "Auto build for lesspass-pure" git push diff --git a/packages/lesspass-pure/package.json b/packages/lesspass-pure/package.json index b6ee6d9..addcdd1 100644 --- a/packages/lesspass-pure/package.json +++ b/packages/lesspass-pure/package.json @@ -1,6 +1,6 @@ { "name": "lesspass-pure", - "version": "9.2.0", + "version": "9.3.1", "description": "LessPass web component", "license": "GPL-3.0", "author": "Guillaume Vincent ", diff --git a/packages/lesspass-pure/src/components/Avatar.vue b/packages/lesspass-pure/src/components/Avatar.vue index 79b68b4..c7b6884 100644 --- a/packages/lesspass-pure/src/components/Avatar.vue +++ b/packages/lesspass-pure/src/components/Avatar.vue @@ -12,7 +12,9 @@ } diff --git a/packages/lesspass-pure/src/components/Message.vue b/packages/lesspass-pure/src/components/Message.vue index ee941d7..78cbe8d 100644 --- a/packages/lesspass-pure/src/components/Message.vue +++ b/packages/lesspass-pure/src/components/Message.vue @@ -34,11 +34,15 @@
- {{message.text}} + {{ message.text }} diff --git a/packages/lesspass-pure/src/components/PasswordProfile.vue b/packages/lesspass-pure/src/components/PasswordProfile.vue index 8ba7c89..fb2811f 100644 --- a/packages/lesspass-pure/src/components/PasswordProfile.vue +++ b/packages/lesspass-pure/src/components/PasswordProfile.vue @@ -24,9 +24,9 @@
- {{password.site}} + {{ password.site }}
- {{password.login}} + {{ password.login }}
diff --git a/packages/lesspass-pure/src/components/RemoveAutoComplete.vue b/packages/lesspass-pure/src/components/RemoveAutoComplete.vue index 808722f..4af17b4 100644 --- a/packages/lesspass-pure/src/components/RemoveAutoComplete.vue +++ b/packages/lesspass-pure/src/components/RemoveAutoComplete.vue @@ -1,10 +1,20 @@ diff --git a/packages/lesspass-pure/src/services/url-parser.test.js b/packages/lesspass-pure/src/services/url-parser.test.js index d75fc0a..a21de26 100644 --- a/packages/lesspass-pure/src/services/url-parser.test.js +++ b/packages/lesspass-pure/src/services/url-parser.test.js @@ -3,36 +3,60 @@ import * as urlParser from "./url-parser"; test("cleanUrl", () => { expect("lesspass.com").toBe(urlParser.cleanUrl("https://lesspass.com/#!/")); expect("lesspass.com").toBe(urlParser.cleanUrl("https://lesspass.com/api/")); - expect("api.lesspass.com").toBe(urlParser.cleanUrl("https://api.lesspass.com/")); + expect("api.lesspass.com").toBe( + urlParser.cleanUrl("https://api.lesspass.com/") + ); expect("lesspass.com").toBe(urlParser.cleanUrl("http://lesspass.com")); - expect("stackoverflow.com").toBe(urlParser.cleanUrl( - "http://stackoverflow.com/questions/3689423/google-chrome-plugin-how-to-get-domain-from-url-tab-url" - )); - expect("v4-alpha.getbootstrap.com").toBe(urlParser.cleanUrl("http://v4-alpha.getbootstrap.com/components/buttons/")); - expect("accounts.google.com").toBe(urlParser.cleanUrl( - "https://accounts.google.com/ServiceLogin?service=mail&passive=true&rm=false&continue=https://mail.google.com/mail/&ss=1&scc=1<mpl=default<mplcache=2&emr=1&osid=1#identifier" - )); - expect("www.netflix.com").toBe(urlParser.cleanUrl("https://www.netflix.com/browse")); + expect("stackoverflow.com").toBe( + urlParser.cleanUrl( + "http://stackoverflow.com/questions/3689423/google-chrome-plugin-how-to-get-domain-from-url-tab-url" + ) + ); + expect("v4-alpha.getbootstrap.com").toBe( + urlParser.cleanUrl("http://v4-alpha.getbootstrap.com/components/buttons/") + ); + expect("accounts.google.com").toBe( + urlParser.cleanUrl( + "https://accounts.google.com/ServiceLogin?service=mail&passive=true&rm=false&continue=https://mail.google.com/mail/&ss=1&scc=1<mpl=default<mplcache=2&emr=1&osid=1#identifier" + ) + ); + expect("www.netflix.com").toBe( + urlParser.cleanUrl("https://www.netflix.com/browse") + ); expect("www.bbc.co.uk").toBe(urlParser.cleanUrl("https://www.bbc.co.uk")); - expect("192.168.1.1:10443").toBe(urlParser.cleanUrl("https://192.168.1.1:10443/webapp/")); + expect("192.168.1.1:10443").toBe( + urlParser.cleanUrl("https://192.168.1.1:10443/webapp/") + ); expect("").toBe(urlParser.cleanUrl(undefined)); expect("").toBe(urlParser.cleanUrl(undefined)); expect("").toBe(urlParser.cleanUrl("chrome://extensions/")); }); test("getSuggestions", () => { - expect(["bbc", "bbc.com", "www.bbc.com"]).toEqual(urlParser.getSuggestions("https://www.bbc.com")); + expect(["bbc", "bbc.com", "www.bbc.com"]).toEqual( + urlParser.getSuggestions("https://www.bbc.com") + ); expect(["example", "example.org", "www.example.org"]).toEqual( urlParser.getSuggestions("https://www.example.org/api/?offset=100&limit=10") ); - expect(["example", "example.org"]).toEqual(urlParser.getSuggestions("https://example.org")); - expect(["example", "example.org"]).toEqual(urlParser.getSuggestions("example.org")); - expect([]).toEqual(urlParser.getSuggestions("https://192.168.1.1:10443/webapp/")); + expect(["example", "example.org"]).toEqual( + urlParser.getSuggestions("https://example.org") + ); + expect(["example", "example.org"]).toEqual( + urlParser.getSuggestions("example.org") + ); + expect([]).toEqual( + urlParser.getSuggestions("https://192.168.1.1:10443/webapp/") + ); expect([]).toEqual(urlParser.getSuggestions("example")); expect([]).toEqual(urlParser.getSuggestions("example.")); expect([]).toEqual(urlParser.getSuggestions("example.o")); - expect(urlParser.getSuggestions("http://example.org")).toEqual(urlParser.getSuggestions("https://example.org")); - expect(["example", "example.org"]).toEqual(urlParser.getSuggestions("EXAMPLE.org")); + expect(urlParser.getSuggestions("http://example.org")).toEqual( + urlParser.getSuggestions("https://example.org") + ); + expect(["example", "example.org"]).toEqual( + urlParser.getSuggestions("EXAMPLE.org") + ); }); test("getSite", () => { diff --git a/packages/lesspass-pure/src/store/mutations.test.js b/packages/lesspass-pure/src/store/mutations.test.js index 229b0fe..67f4fa9 100644 --- a/packages/lesspass-pure/src/store/mutations.test.js +++ b/packages/lesspass-pure/src/store/mutations.test.js @@ -90,7 +90,10 @@ test("SET_PASSWORDS", () => { test("DELETE_PASSWORD", () => { const DELETE_PASSWORD = mutations[types.DELETE_PASSWORD]; const state = { - passwords: [{ id: "1", site: "site1" }, { id: "2", site: "site2" }] + passwords: [ + { id: "1", site: "site1" }, + { id: "2", site: "site2" } + ] }; expect(state.passwords.length).toBe(2); DELETE_PASSWORD(state, { id: "1" }); @@ -100,7 +103,10 @@ test("DELETE_PASSWORD", () => { test("DELETE_PASSWORD replace state.password with state.defaultPassword", () => { const DELETE_PASSWORD = mutations[types.DELETE_PASSWORD]; const state = { - passwords: [{ id: "1", length: 30 }, { id: "2", length: 16 }], + passwords: [ + { id: "1", length: 30 }, + { id: "2", length: 16 } + ], password: { id: "1", length: 30 }, defaultPassword: { length: 16 } }; diff --git a/packages/lesspass-pure/src/views/MyAccount.vue b/packages/lesspass-pure/src/views/MyAccount.vue index 243a64a..1d7d933 100644 --- a/packages/lesspass-pure/src/views/MyAccount.vue +++ b/packages/lesspass-pure/src/views/MyAccount.vue @@ -75,7 +75,7 @@ export default { this.$router.push({ name: "home" }).catch(() => {}); }, changePassword: async function() { - if (!this.email) { + if (!this.email) { message.error(this.$t("EmailRequiredError", "Email is required")); return; } diff --git a/packages/lesspass-pure/src/views/Passwords.vue b/packages/lesspass-pure/src/views/Passwords.vue index ac0f385..59a1103 100644 --- a/packages/lesspass-pure/src/views/Passwords.vue +++ b/packages/lesspass-pure/src/views/Passwords.vue @@ -112,7 +112,9 @@ export default { var siteMatch = password.site.match(new RegExp(this.searchQuery, "i")); return loginMatch || siteMatch; }); - this.pagination.pageCount = Math.ceil(passwords.length / this.pagination.perPage); + this.pagination.pageCount = Math.ceil( + passwords.length / this.pagination.perPage + ); return passwords.slice( this.pagination.currentPage * this.pagination.perPage - this.pagination.perPage,