mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 16:23:44 +00:00
folder listing, add/edit components, cleanup
This commit is contained in:
38
src/popup/settings/folders.component.ts
Normal file
38
src/popup/settings/folders.component.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import { Location } from '@angular/common';
|
||||
import {
|
||||
Component,
|
||||
OnInit,
|
||||
} from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
|
||||
import { FolderView } from 'jslib/models/view/folderView';
|
||||
|
||||
import { FolderService } from 'jslib/abstractions/folder.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-folders',
|
||||
templateUrl: 'folders.component.html',
|
||||
})
|
||||
export class FoldersComponent implements OnInit {
|
||||
folders: FolderView[];
|
||||
|
||||
constructor(private folderService: FolderService, private location: Location,
|
||||
private router: Router) {
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
this.folders = await this.folderService.getAllDecrypted();
|
||||
}
|
||||
|
||||
folderSelected(folder: FolderView) {
|
||||
this.router.navigate(['/edit-folder'], { queryParams: { folderId: folder.id } });
|
||||
}
|
||||
|
||||
addFolder() {
|
||||
this.router.navigate(['/add-folder']);
|
||||
}
|
||||
|
||||
close() {
|
||||
this.location.back();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user