Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2019/kw15/change password strength #551

Closed
wants to merge 20 commits into from
Closed

2019/kw15/change password strength #551

wants to merge 20 commits into from

Conversation

Tirokk
Copy link
Member

@Tirokk Tirokk commented Oct 4, 2020

ulfgebhardt Authored by ulfgebhardt
May 6, 2019
Merged May 10, 2019


Pullrequest

image

image

image

image

image

Issues

Todo

  • There is console errors since i updated the styleguide on unrelated components (avatar) - those components are also displayed in a strange way. Please someone find out whats the Problem there
  • Is this the fault of this PR? Please confirm on current staging

image

image

image

ulfgebhardt and others added 20 commits April 11, 2019 17:24
… settings labels, bind to user input validation function which is not working currently
- moved passwordStrength to watch since there was a "unexpected side effect in computed property vue" in lint
- found this SO post https://stackoverflow.com/questions/53757107/handling-unexpected-side-effect-in-computed-properties-vuejs
…-Connection/Human-Connection into 2019/kw15/change_password_strength
- when will this be automated!!!
@Tirokk
Copy link
Member Author

Tirokk commented Oct 6, 2020

ulfgebhardt Authored by ulfgebhardt
May 8, 2019


The strange error messages occur on master aswell - therefor not the fault of this pr / styleguide-update

const strength = !isEmpty(this.pass) ? zxcvbn(this.pass).score : null
if (strength !== this.strength) {
this.strength = strength
this.isSecure = Boolean(strength >= 3)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mattwr18 Authored by mattwr18
May 9, 2019


Outdated (history rewrite) - original diff


@@ -0,0 +1,139 @@
+<template>
+  <div class="field">
+    <div class="password-strength-meter">
+      <div
+        class="password-strength-meter-inner"
+        :class="strengthClass"
+      />
+    </div>
+    <p class="help">
+      <span
+        v-if="pass"
+        :class="{ insecure: (passwordStrength < 3) }"
+      >
+        {{ $t('settings.security.change-password.passwordSecurity') }}:
+        <strong>{{ $t(`settings.security.change-password.passwordStrength${passwordStrength}`) }}</strong>
+      </span>
+      <span v-else>&nbsp;</span>
+    </p>
+  </div>
+</template>
+
+<script>
+import zxcvbn from 'zxcvbn'
+import { isEmpty } from 'lodash'
+
+export default {
+  name: 'PasswordMeter',
+  props: {
+    password: {
+      type: String,
+      required: true
+    }
+  },
+  data() {
+    return {
+      lastScore: 0,
+      pass: this.password || null
+    }
+  },
+  computed: {
+    strengthClass() {
+      return `strength-${this.passwordStrength}`
+    }
+  },
+  watch: {
+    /**
+     * passwordStrength is the score calculated by zxcvbn
+     * @return {Number} Password Strength Score
+     */
+    passwordStrength() {

I moved this @ulfgebhardt because it was failing the linting
please see my commit message with a link to the SO post where I found the suggestion to move it to watch

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ulfgebhardt Authored by ulfgebhardt
May 9, 2019


I Agree 100% - thanks for fixing this. As you can see i am still new to vue <3

@Tirokk
Copy link
Member Author

Tirokk commented Oct 6, 2020

ulfgebhardt Authored by ulfgebhardt
May 9, 2019


this is great @ulfgebhardt
do you think there is any place for cypress tests?
I'm unsure how I feel about it

thanks @mattwr18 for doing this - much appreciated!
If you remove the same-password-test and its still green feel free to merge it. Else I will make sure to have more coverage.

@Tirokk
Copy link
Member Author

Tirokk commented Oct 6, 2020

ulfgebhardt Authored by ulfgebhardt
May 9, 2019


@mattwr18 I removed the test case - but there is still problems with the UI. visible as console errors in the tests
image
It might be due to my updating the styleguide library - but i did not change anything regarding the component ds-avatar

@Tirokk
Copy link
Member Author

Tirokk commented Oct 6, 2020

mattwr18 Authored by mattwr18
May 9, 2019


@ulfgebhardt, I have added an issue for this, as it is not part of the scope of this PR
and have found(?) the source of the issue and put in a PR
Human-Connection/Human-Connection#587

@Tirokk
Copy link
Member Author

Tirokk commented Oct 6, 2020

codecov[bot] Authored by codecov[bot]
May 10, 2019


Codecov Report

Merging #551 into master will increase coverage by 1.2%.
The diff coverage is 89.66%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #551     +/-   ##
=========================================
+ Coverage   17.57%   18.77%   +1.2%     
=========================================
  Files         154      156      +2     
  Lines        2157     2200     +43     
  Branches       98      107      +9     
=========================================
+ Hits          379      413     +34     
- Misses       1756     1764      +8     
- Partials       22       23      +1
Impacted Files Coverage Δ
webapp/pages/settings/security.vue 0% <0%> (ø) ⬆️
webapp/components/Password/Strength.vue 90% <90%> (ø)
webapp/components/Password/Change.vue 94.44% <94.44%> (ø)
webapp/components/Empty.vue 100% <0%> (ø) ⬆️
webapp/components/Badges.vue 100% <0%> (ø) ⬆️
webapp/pages/logout.vue 0% <0%> (ø) ⬆️
webapp/components/Image/index.vue 100% <0%> (ø)
webapp/pages/settings/my-social-media.vue 67.65% <0%> (+7.65%) ⬆️

Copy link
Contributor

@Mogge Mogge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great job @ulfgebhardt!!
really excited about this feature!!! I love it when I see that someone has implemented a password strength feature!!

And awesome you were able to learn more about vue, I too learned having put in a commit!

@ulfgebhardt ulfgebhardt deleted the pr551head branch January 7, 2021 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants