From 0904607eda64a781d1edc45ea53a8a3f5d01f440 Mon Sep 17 00:00:00 2001 From: Tobias Skarhed Date: Tue, 25 Jun 2019 13:56:35 +0200 Subject: [PATCH] Password: Remove PasswordStrength (#17750) * Closes #17748 * Remove remaining occurences * And the last one --- public/app/core/angular_wrappers.ts | 2 - .../app/core/components/PasswordStrength.tsx | 37 ------------------- .../app/core/specs/PasswordStrength.test.tsx | 21 ----------- public/app/partials/signup_invited.html | 4 -- public/app/partials/signup_step2.html | 4 -- public/sass/pages/_login.scss | 20 ---------- public/sass/pages/_signup.scss | 6 --- 7 files changed, 94 deletions(-) delete mode 100644 public/app/core/components/PasswordStrength.tsx delete mode 100644 public/app/core/specs/PasswordStrength.test.tsx diff --git a/public/app/core/angular_wrappers.ts b/public/app/core/angular_wrappers.ts index fc4a63f5e83..6544aaeab17 100644 --- a/public/app/core/angular_wrappers.ts +++ b/public/app/core/angular_wrappers.ts @@ -1,7 +1,6 @@ import { react2AngularDirective } from 'app/core/utils/react2angular'; import { QueryEditor as StackdriverQueryEditor } from 'app/plugins/datasource/stackdriver/components/QueryEditor'; import { AnnotationQueryEditor as StackdriverAnnotationQueryEditor } from 'app/plugins/datasource/stackdriver/components/AnnotationQueryEditor'; -import { PasswordStrength } from './components/PasswordStrength'; import PageHeader from './components/PageHeader/PageHeader'; import EmptyListCTA from './components/EmptyListCTA/EmptyListCTA'; import { TagFilter } from './components/TagFilter/TagFilter'; @@ -14,7 +13,6 @@ import { SearchField } from './components/search/SearchField'; import { GraphContextMenu } from 'app/plugins/panel/graph/GraphContextMenu'; export function registerAngularDirectives() { - react2AngularDirective('passwordStrength', PasswordStrength, ['password']); react2AngularDirective('sidemenu', SideMenu, []); react2AngularDirective('functionEditor', FunctionEditor, ['func', 'onRemove', 'onMoveLeft', 'onMoveRight']); react2AngularDirective('appNotificationsList', AppNotificationList, []); diff --git a/public/app/core/components/PasswordStrength.tsx b/public/app/core/components/PasswordStrength.tsx deleted file mode 100644 index 6c6bb697f65..00000000000 --- a/public/app/core/components/PasswordStrength.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import React from 'react'; - -export interface Props { - password: string; -} - -export class PasswordStrength extends React.Component { - constructor(props: Props) { - super(props); - } - - render() { - const { password } = this.props; - let strengthText = 'strength: strong like a bull.'; - let strengthClass = 'password-strength-good'; - - if (!password) { - return null; - } - - if (password.length <= 8) { - strengthText = 'strength: you can do better.'; - strengthClass = 'password-strength-ok'; - } - - if (password.length < 4) { - strengthText = 'strength: weak sauce.'; - strengthClass = 'password-strength-bad'; - } - - return ( -
- {strengthText} -
- ); - } -} diff --git a/public/app/core/specs/PasswordStrength.test.tsx b/public/app/core/specs/PasswordStrength.test.tsx deleted file mode 100644 index 1bd52ee6d50..00000000000 --- a/public/app/core/specs/PasswordStrength.test.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import React from 'react'; -import { shallow } from 'enzyme'; - -import { PasswordStrength } from '../components/PasswordStrength'; - -describe('PasswordStrength', () => { - it('should have class bad if length below 4', () => { - const wrapper = shallow(); - expect(wrapper.find('.password-strength-bad')).toHaveLength(1); - }); - - it('should have class ok if length below 8', () => { - const wrapper = shallow(); - expect(wrapper.find('.password-strength-ok')).toHaveLength(1); - }); - - it('should have class good if length above 8', () => { - const wrapper = shallow(); - expect(wrapper.find('.password-strength-good')).toHaveLength(1); - }); -}); diff --git a/public/app/partials/signup_invited.html b/public/app/partials/signup_invited.html index 966dba2d352..746f3f0b434 100644 --- a/public/app/partials/signup_invited.html +++ b/public/app/partials/signup_invited.html @@ -25,10 +25,6 @@ -
- -
-
- -