1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-10-04 05:08:06 +02:00

react to jslib #77 changes (#474)

This commit is contained in:
Kyle Spearrin 2020-02-28 16:57:54 -05:00 committed by GitHub
parent e2108ff85b
commit aac011d3b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 3 additions and 63 deletions

2
jslib

@ -1 +1 @@
Subproject commit 6c529422048c95645304ceb14250c8efce938f34
Subproject commit e93c534ec4f724eaa8b494f516b187bea67b132c

View File

@ -19,7 +19,6 @@ import { AppComponent } from './app.component';
import { ModalComponent } from './modal.component';
import { AvatarComponent } from './components/avatar.component';
import { CalloutComponent } from './components/callout.component';
import { PasswordStrengthComponent } from './components/password-strength.component';
import { FooterComponent } from './layouts/footer.component';
@ -154,6 +153,7 @@ import { GroupingsComponent } from './vault/groupings.component';
import { ShareComponent } from './vault/share.component';
import { VaultComponent } from './vault/vault.component';
import { CalloutComponent } from 'jslib/angular/components/callout.component';
import { IconComponent } from 'jslib/angular/components/icon.component';
import { A11yTitleDirective } from 'jslib/angular/directives/a11y-title.directive';

View File

@ -1,7 +0,0 @@
<div class="callout callout-{{calloutStyle}}" role="alert">
<h3 class="callout-heading" *ngIf="title">
<i class="fa {{icon}}" *ngIf="icon" aria-hidden="true"></i>
{{title}}
</h3>
<ng-content></ng-content>
</div>

View File

@ -1,53 +0,0 @@
import {
Component,
Input,
OnInit,
} from '@angular/core';
import { I18nService } from 'jslib/abstractions/i18n.service';
@Component({
selector: 'app-callout',
templateUrl: 'callout.component.html',
})
export class CalloutComponent implements OnInit {
@Input() type = 'info';
@Input() icon: string;
@Input() title: string;
calloutStyle: string;
constructor(private i18nService: I18nService) { }
ngOnInit() {
this.calloutStyle = this.type;
if (this.type === 'warning' || this.type === 'danger') {
if (this.type === 'danger') {
this.calloutStyle = 'danger';
}
if (this.title === undefined) {
this.title = this.i18nService.t('warning');
}
if (this.icon === undefined) {
this.icon = 'fa-warning';
}
} else if (this.type === 'error') {
this.calloutStyle = 'danger';
if (this.title === undefined) {
this.title = this.i18nService.t('error');
}
if (this.icon === undefined) {
this.icon = 'fa-bolt';
}
} else if (this.type === 'tip') {
this.calloutStyle = 'success';
if (this.title === undefined) {
this.title = this.i18nService.t('tip');
}
if (this.icon === undefined) {
this.icon = 'fa-lightbulb-o';
}
}
}
}

View File

@ -1,7 +1,7 @@
<div class="page-header">
<h1>{{'passwordGenerator' | i18n}}</h1>
</div>
<app-callout type="info" *ngIf="hasPolicyInEffect()">
<app-callout type="info" *ngIf="policyInEffect">
{{'passwordGeneratorPolicyInEffect' | i18n}}
</app-callout>
<div class="card card-password bg-light my-4">