diff --git a/src/app/accounts/set-password.component.html b/src/app/accounts/set-password.component.html index 42d3484c..27cc4283 100644 --- a/src/app/accounts/set-password.component.html +++ b/src/app/accounts/set-password.component.html @@ -1,81 +1,90 @@ -
-
-
-

{{'setMasterPassword' | i18n}}

-
-
- {{'ssoCompleteRegistration' | i18n}} -
- - {{'masterPasswordPolicyInEffect' | i18n}} -
    -
  • - {{'policyInEffectMinComplexity' | i18n : getPasswordScoreAlertDisplay()}} -
  • -
  • - {{'policyInEffectMinLength' | i18n : enforcedPolicyOptions?.minLength.toString()}} -
  • -
  • - {{'policyInEffectUppercase' | i18n}}
  • -
  • - {{'policyInEffectLowercase' | i18n}}
  • -
  • - {{'policyInEffectNumbers' | i18n}}
  • -
  • - {{'policyInEffectSpecial' | i18n : '!@#$%^&*'}}
  • -
-
- -
-
- - - +
+ +
+
+
+
{{'setMasterPassword' | i18n}}
+
+ {{'ssoCompleteRegistration' | i18n}} +
+ + {{'masterPasswordPolicyInEffect' | i18n}} +
    +
  • + {{'policyInEffectMinComplexity' | i18n : getPasswordScoreAlertDisplay()}} +
  • +
  • + {{'policyInEffectMinLength' | i18n : enforcedPolicyOptions?.minLength.toString()}} +
  • +
  • + {{'policyInEffectUppercase' | i18n}}
  • +
  • + {{'policyInEffectLowercase' | i18n}}
  • +
  • + {{'policyInEffectNumbers' | i18n}}
  • +
  • + {{'policyInEffectSpecial' | i18n : '!@#$%^&*'}}
  • +
+
+ +
+
+ +
+
+
+
+
+
+ + +
-
+ {{'masterPassDesc' | i18n}} +
+
+ +
+ -
- {{'masterPassDesc' | i18n}} -
-
- +
+ + + {{'masterPassHintDesc' | i18n}} +
+
- - +
-
- - - {{'masterPassHintDesc' | i18n}} -
-
-
- - -
-
- + +
diff --git a/src/app/accounts/set-password.component.ts b/src/app/accounts/set-password.component.ts index cd3e9e85..a36e7d04 100644 --- a/src/app/accounts/set-password.component.ts +++ b/src/app/accounts/set-password.component.ts @@ -1,20 +1,14 @@ import { Component } from '@angular/core'; -import { - ActivatedRoute, - Router, -} from '@angular/router'; +import { Router } from '@angular/router'; import { ApiService } from 'jslib/abstractions/api.service'; -import { CipherService } from 'jslib/abstractions/cipher.service'; import { CryptoService } from 'jslib/abstractions/crypto.service'; -import { FolderService } from 'jslib/abstractions/folder.service'; import { I18nService } from 'jslib/abstractions/i18n.service'; import { MessagingService } from 'jslib/abstractions/messaging.service'; import { PasswordGenerationService } from 'jslib/abstractions/passwordGeneration.service'; import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service'; import { PolicyService } from 'jslib/abstractions/policy.service'; -import { SyncService } from 'jslib/abstractions/sync.service'; import { UserService } from 'jslib/abstractions/user.service'; import { @@ -29,11 +23,9 @@ export class SetPasswordComponent extends BaseSetPasswordComponent { constructor(apiService: ApiService, i18nService: I18nService, cryptoService: CryptoService, messagingService: MessagingService, userService: UserService, passwordGenerationService: PasswordGenerationService, - platformUtilsService: PlatformUtilsService, folderService: FolderService, - cipherService: CipherService, syncService: SyncService, - policyService: PolicyService, router: Router, route: ActivatedRoute) { - super(apiService, i18nService, cryptoService, messagingService, userService, passwordGenerationService, - platformUtilsService, folderService, cipherService, syncService, policyService, router, route); + platformUtilsService: PlatformUtilsService, policyService: PolicyService, router: Router) { + super(i18nService, cryptoService, messagingService, userService, passwordGenerationService, + platformUtilsService, policyService, router, apiService); } get masterPasswordScoreWidth() { diff --git a/src/app/services/services.module.ts b/src/app/services/services.module.ts index 4cb71e28..478818f4 100644 --- a/src/app/services/services.module.ts +++ b/src/app/services/services.module.ts @@ -34,6 +34,7 @@ import { CryptoService } from 'jslib/services/crypto.service'; import { EnvironmentService } from 'jslib/services/environment.service'; import { NodeCryptoFunctionService } from 'jslib/services/nodeCryptoFunction.service'; import { PasswordGenerationService } from 'jslib/services/passwordGeneration.service'; +import { PolicyService } from 'jslib/services/policy.service'; import { StateService } from 'jslib/services/state.service'; import { TokenService } from 'jslib/services/token.service'; import { UserService } from 'jslib/services/user.service'; @@ -51,6 +52,7 @@ import { PasswordGenerationService as PasswordGenerationServiceAbstraction, } from 'jslib/abstractions/passwordGeneration.service'; import { PlatformUtilsService as PlatformUtilsServiceAbstraction } from 'jslib/abstractions/platformUtils.service'; +import { PolicyService as PolicyServiceAbstraction } from 'jslib/abstractions/policy.service'; import { StateService as StateServiceAbstraction } from 'jslib/abstractions/state.service'; import { StorageService as StorageServiceAbstraction } from 'jslib/abstractions/storage.service'; import { TokenService as TokenServiceAbstraction } from 'jslib/abstractions/token.service'; @@ -79,6 +81,7 @@ const configurationService = new ConfigurationService(storageService, secureStor const syncService = new SyncService(configurationService, logService, cryptoFunctionService, apiService, messagingService, i18nService); const passwordGenerationService = new PasswordGenerationService(cryptoService, storageService, null); +const policyService = new PolicyService(userService, storageService); const analytics = new Analytics(window, () => true, platformUtilsService, storageService, appIdService); containerService.attachToWindow(window); @@ -140,7 +143,8 @@ export function initFactory(): Function { { provide: ConfigurationService, useValue: configurationService }, { provide: SyncService, useValue: syncService }, { provide: PasswordGenerationServiceAbstraction, useValue: passwordGenerationService }, - { provide: CryptoFunctionServiceAbstraction, useValue: cryptoFunctionService }, + { provide: CryptoFunctionServiceAbstraction, useValue: cryptoFunctionService }, , + { provide: PolicyServiceAbstraction, useValue: policyService }, { provide: APP_INITIALIZER, useFactory: initFactory, diff --git a/src/locales/en/messages.json b/src/locales/en/messages.json index e4134a76..584110f0 100644 --- a/src/locales/en/messages.json +++ b/src/locales/en/messages.json @@ -617,5 +617,68 @@ }, "enterpriseSingleSignOn": { "message": "Enterprise Single Sign-On" + }, + "setMasterPassword": { + "message": "Set Master Password" + }, + "ssoCompleteRegistration": { + "message": "In order to complete logging in with SSO, please set a master password to access and protect your vault." + }, + "newMasterPass": { + "message": "New Master Password" + }, + "confirmNewMasterPass": { + "message": "Confirm New Master Password" + }, + "masterPasswordPolicyInEffect": { + "message": "One or more organization policies require your master password to meet the following requirements:" + }, + "policyInEffectMinComplexity": { + "message": "Minimum complexity score of $SCORE$", + "placeholders": { + "score": { + "content": "$1", + "example": "4" + } + } + }, + "policyInEffectMinLength": { + "message": "Minimum length of $LENGTH$", + "placeholders": { + "length": { + "content": "$1", + "example": "14" + } + } + }, + "policyInEffectUppercase": { + "message": "Contain one or more uppercase characters" + }, + "policyInEffectLowercase": { + "message": "Contain one or more lowercase characters" + }, + "policyInEffectNumbers": { + "message": "Contain one or more numbers" + }, + "policyInEffectSpecial": { + "message": "Contain one or more of the following special characters $CHARS$", + "placeholders": { + "chars": { + "content": "$1", + "example": "!@#$%^&*" + } + } + }, + "masterPassDesc": { + "message": "The master password is the password you use to access your vault. It is very important that you do not forget your master password. There is no way to recover the password in the event that you forget it." + }, + "reTypeMasterPass": { + "message": "Re-type Master Password" + }, + "masterPassHint": { + "message": "Master Password Hint (optional)" + }, + "masterPassHintDesc": { + "message": "A master password hint can help you remember your password if you forget it." } } diff --git a/src/scss/misc.scss b/src/scss/misc.scss index ab58ca2f..b093fe97 100644 --- a/src/scss/misc.scss +++ b/src/scss/misc.scss @@ -53,3 +53,68 @@ ul.testing-list { text-decoration: line-through; } } + +.callout { + padding: 10px; + margin-bottom: 10px; + border: 1px solid #000000; + border-left-width: 5px; + border-radius: 3px; + border-color: #ddd; + background-color: white; + + .callout-heading { + margin-top: 0; + } + + h3.callout-heading { + font-weight: bold; + text-transform: uppercase; + } + + &.callout-primary { + border-left-color: $primary; + + .callout-heading { + color: $primary; + } + } + + &.callout-info { + border-left-color: $info; + + .callout-heading { + color: $info; + } + } + + &.callout-danger { + border-left-color: $danger; + + .callout-heading { + color: $danger; + } + } + + &.callout-success { + border-left-color: $success; + + .callout-heading { + color: $success; + } + } + + &.callout-warning { + border-left-color: $warning; + + .callout-heading { + color: $warning; + } + } + + ul { + padding-left: 40px; + margin: 0; + } +} +