1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 15:53:27 +00:00

implement notifications service

This commit is contained in:
Kyle Spearrin
2018-08-20 17:40:39 -04:00
parent ce61e62cf0
commit 50c94f587d
12 changed files with 61 additions and 18 deletions

View File

@@ -48,6 +48,11 @@
<input id="identityUrl" type="text" name="IdentityUrl" [(ngModel)]="identityUrl" inputmode="url"
appInputVerbatim>
</div>
<div class="box-content-row" appBoxRow>
<label for="notificationsUrl">{{'notificationsUrl' | i18n}}</label>
<input id="notificationsUrl" type="text" name="NotificationsUrl" inputmode="url"
[(ngModel)]="notificationsUrl" appInputVerbatim>
</div>
<div class="box-content-row" appBoxRow>
<label for="iconsUrl">{{'iconsUrl' | i18n}}</label>
<input id="iconsUrl" type="text" name="IconsUrl" [(ngModel)]="iconsUrl" inputmode="url"

View File

@@ -27,6 +27,7 @@ import { FolderService } from 'jslib/abstractions/folder.service';
import { I18nService } from 'jslib/abstractions/i18n.service';
import { LockService } from 'jslib/abstractions/lock.service';
import { MessagingService } from 'jslib/abstractions/messaging.service';
import { NotificationsService } from 'jslib/abstractions/notifications.service';
import { PasswordGenerationService } from 'jslib/abstractions/passwordGeneration.service';
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
import { SearchService as SearchServiceAbstraction } from 'jslib/abstractions/search.service';
@@ -146,6 +147,11 @@ export function initFactory(i18nService: I18nService, storageService: StorageSer
{ provide: AppIdService, useFactory: getBgService<AppIdService>('appIdService'), deps: [] },
{ provide: AutofillService, useFactory: getBgService<AutofillService>('autofillService'), deps: [] },
{ provide: ExportService, useFactory: getBgService<ExportService>('exportService'), deps: [] },
{
provide: NotificationsService,
useFactory: getBgService<NotificationsService>('notificationsService'),
deps: [],
},
{
provide: APP_INITIALIZER,
useFactory: initFactory,

View File

@@ -121,9 +121,11 @@ export class CiphersComponent extends BaseCiphersComponent implements OnInit, On
this.ngZone.run(async () => {
switch (message.command) {
case 'syncCompleted':
window.setTimeout(() => {
this.refresh();
}, 500);
if (message.successfully) {
window.setTimeout(() => {
this.refresh();
}, 500);
}
break;
default:
break;

View File

@@ -94,9 +94,11 @@ export class GroupingsComponent extends BaseGroupingsComponent implements OnInit
this.ngZone.run(async () => {
switch (message.command) {
case 'syncCompleted':
window.setTimeout(() => {
this.load();
}, 500);
if (message.successfully) {
window.setTimeout(() => {
this.load();
}, 500);
}
break;
default:
break;

View File

@@ -268,7 +268,7 @@
<div *ngIf="cipher.hasPasswordHistory">
<b class="font-weight-semibold">{{'passwordHistory' | i18n}}:</b>
<a routerLink="/cipher-password-history" [queryParams]="{cipherId: cipher.id}"
appStopClick title="{{'passwordHistory' | i18n}}" class="text-muted">
appStopClick title="{{'passwordHistory' | i18n}}">
{{cipher.passwordHistory.length}}
</a>
</div>

View File

@@ -1,7 +1,8 @@
import { Location } from '@angular/common';
import {
ChangeDetectorRef,
Component,
OnInit,
NgZone,
} from '@angular/core';
import {
ActivatedRoute,
@@ -11,8 +12,6 @@ import {
import { ToasterService } from 'angular2-toaster';
import { Angulartics2 } from 'angulartics2';
import { BrowserApi } from '../../browser/browserApi';
import { AuditService } from 'jslib/abstractions/audit.service';
import { CipherService } from 'jslib/abstractions/cipher.service';
import { CryptoService } from 'jslib/abstractions/crypto.service';
@@ -21,13 +20,15 @@ import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
import { TokenService } from 'jslib/abstractions/token.service';
import { TotpService } from 'jslib/abstractions/totp.service';
import { BroadcasterService } from 'jslib/angular/services/broadcaster.service';
import { ViewComponent as BaseViewComponent } from 'jslib/angular/components/view.component';
@Component({
selector: 'app-vault-view',
templateUrl: 'view.component.html',
})
export class ViewComponent extends BaseViewComponent implements OnInit {
export class ViewComponent extends BaseViewComponent {
showAttachments = true;
constructor(cipherService: CipherService, totpService: TotpService,
@@ -35,9 +36,11 @@ export class ViewComponent extends BaseViewComponent implements OnInit {
cryptoService: CryptoService, platformUtilsService: PlatformUtilsService,
i18nService: I18nService, analytics: Angulartics2,
auditService: AuditService, private route: ActivatedRoute,
private router: Router, private location: Location) {
private router: Router, private location: Location,
broadcasterService: BroadcasterService, ngZone: NgZone,
changeDetectorRef: ChangeDetectorRef) {
super(cipherService, totpService, tokenService, toasterService, cryptoService, platformUtilsService,
i18nService, analytics, auditService, window);
i18nService, analytics, auditService, window, broadcasterService, ngZone, changeDetectorRef);
}
ngOnInit() {
@@ -51,6 +54,7 @@ export class ViewComponent extends BaseViewComponent implements OnInit {
await this.load();
});
super.ngOnInit();
}
edit() {