Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PS-1341] Add folder to item view #3347

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
72de5f9
Initial - add folder id to popup item view
patrickhlauke Aug 20, 2022
e456c5c
Merge branch 'master' into patrickhlauke-feature-folder-in-item-view
patrickhlauke Aug 28, 2022
78434e4
Add folder service to view component
patrickhlauke Aug 29, 2022
e82b09c
Merge branch 'master' into patrickhlauke-feature-folder-in-item-view
patrickhlauke Aug 30, 2022
666f1a5
Merge branch 'master' into patrickhlauke-feature-folder-in-item-view
patrickhlauke Sep 4, 2022
0e0e422
Merge branch 'master' into patrickhlauke-feature-folder-in-item-view
patrickhlauke Sep 8, 2022
cc712bf
Merge branch 'master' into patrickhlauke-feature-folder-in-item-view
patrickhlauke Sep 8, 2022
f0a4cd1
Move folder info higher in the item view as proper box
patrickhlauke Sep 9, 2022
eeeedb7
Merge branch 'master' into patrickhlauke-feature-folder-in-item-view
patrickhlauke Sep 9, 2022
d39fb07
Add folder name handling to component
patrickhlauke Sep 9, 2022
b8803fc
Add folder field to browser view
patrickhlauke Sep 9, 2022
3deee37
Add folder field to desktop view
patrickhlauke Sep 9, 2022
21ef6da
Merge branch 'master' into patrickhlauke-feature-folder-in-item-view
patrickhlauke Sep 13, 2022
98a8250
Make folder field draggable
patrickhlauke Sep 13, 2022
4187fed
Use `<label>` and readonly `<input>`
patrickhlauke Sep 13, 2022
ecdca91
Merge branch 'master' into patrickhlauke-feature-folder-in-item-view
patrickhlauke Sep 13, 2022
d6325a4
Merge branch 'master' into patrickhlauke-feature-folder-in-item-view
patrickhlauke Sep 25, 2022
5d19758
Changes from review
patrickhlauke Sep 25, 2022
e3becd5
Match `name` to `id`
patrickhlauke Sep 25, 2022
7cd155b
Merge branch 'master' into patrickhlauke-feature-folder-in-item-view
patrickhlauke Sep 29, 2022
d8e7161
Merge branch 'master' into patrickhlauke-feature-folder-in-item-view
patrickhlauke Oct 4, 2022
6b6f28f
Merge branch 'master' into patrickhlauke-feature-folder-in-item-view
patrickhlauke Oct 12, 2022
4ac1828
Merge branch 'master' into patrickhlauke-feature-folder-in-item-view
patrickhlauke Oct 14, 2022
1f2054a
Merge branch 'master' into patrickhlauke-feature-folder-in-item-view
patrickhlauke Oct 19, 2022
ead0b69
Merge branch 'master' into patrickhlauke-feature-folder-in-item-view
djsmith85 Oct 19, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions apps/browser/src/popup/vault/view.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,20 @@ <h2 class="box-header">
</div>
</div>
</div>
<div class="box" *ngIf="cipher.folderId">
<div class="box-content">
<div class="box-content-row">
<label
for="folderName"
class="draggable"
draggable="true"
(dragstart)="setTextDataOnDrag($event, folder.name)"
>{{ "folder" | i18n }}</label
>
<input id="folderName" type="text" name="folderName" [value]="folder.name" readonly />
</div>
</div>
</div>
<div class="box" *ngIf="cipher.notes">
<h2 class="box-header">
<label
Expand Down
3 changes: 3 additions & 0 deletions apps/browser/src/popup/vault/view.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { CipherService } from "@bitwarden/common/abstractions/cipher.service";
import { CryptoService } from "@bitwarden/common/abstractions/crypto.service";
import { EventService } from "@bitwarden/common/abstractions/event.service";
import { FileDownloadService } from "@bitwarden/common/abstractions/fileDownload/fileDownload.service";
import { FolderService } from "@bitwarden/common/abstractions/folder/folder.service.abstraction";
import { I18nService } from "@bitwarden/common/abstractions/i18n.service";
import { LogService } from "@bitwarden/common/abstractions/log.service";
import { MessagingService } from "@bitwarden/common/abstractions/messaging.service";
Expand Down Expand Up @@ -43,6 +44,7 @@ export class ViewComponent extends BaseViewComponent {

constructor(
cipherService: CipherService,
folderService: FolderService,
totpService: TotpService,
tokenService: TokenService,
i18nService: I18nService,
Expand All @@ -67,6 +69,7 @@ export class ViewComponent extends BaseViewComponent {
) {
super(
cipherService,
folderService,
totpService,
tokenService,
i18nService,
Expand Down
14 changes: 14 additions & 0 deletions apps/desktop/src/app/vault/view.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,20 @@ <h2 class="box-header">
</div>
</div>
</div>
<div class="box" *ngIf="cipher.folderId">
<div class="box-content">
<div class="box-content-row">
<label
for="folderName"
class="draggable"
draggable="true"
(dragstart)="setTextDataOnDrag($event, folder.name)"
>{{ "folder" | i18n }}</label
>
<input id="folderName" type="text" name="folderName" [value]="folder.name" readonly />
</div>
</div>
</div>
<div class="box" *ngIf="cipher.notes">
<h2 class="box-header">
<span
Expand Down
3 changes: 3 additions & 0 deletions apps/desktop/src/app/vault/view.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { CipherService } from "@bitwarden/common/abstractions/cipher.service";
import { CryptoService } from "@bitwarden/common/abstractions/crypto.service";
import { EventService } from "@bitwarden/common/abstractions/event.service";
import { FileDownloadService } from "@bitwarden/common/abstractions/fileDownload/fileDownload.service";
import { FolderService } from "@bitwarden/common/abstractions/folder/folder.service.abstraction";
import { I18nService } from "@bitwarden/common/abstractions/i18n.service";
import { LogService } from "@bitwarden/common/abstractions/log.service";
import { MessagingService } from "@bitwarden/common/abstractions/messaging.service";
Expand All @@ -36,6 +37,7 @@ export class ViewComponent extends BaseViewComponent implements OnChanges {

constructor(
cipherService: CipherService,
folderService: FolderService,
totpService: TotpService,
tokenService: TokenService,
i18nService: I18nService,
Expand All @@ -55,6 +57,7 @@ export class ViewComponent extends BaseViewComponent implements OnChanges {
) {
super(
cipherService,
folderService,
totpService,
tokenService,
i18nService,
Expand Down
11 changes: 11 additions & 0 deletions libs/angular/src/components/view.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
OnInit,
Output,
} from "@angular/core";
import { firstValueFrom } from "rxjs";

import { ApiService } from "@bitwarden/common/abstractions/api.service";
import { AuditService } from "@bitwarden/common/abstractions/audit.service";
Expand All @@ -16,6 +17,7 @@ import { CipherService } from "@bitwarden/common/abstractions/cipher.service";
import { CryptoService } from "@bitwarden/common/abstractions/crypto.service";
import { EventService } from "@bitwarden/common/abstractions/event.service";
import { FileDownloadService } from "@bitwarden/common/abstractions/fileDownload/fileDownload.service";
import { FolderService } from "@bitwarden/common/abstractions/folder/folder.service.abstraction";
import { I18nService } from "@bitwarden/common/abstractions/i18n.service";
import { LogService } from "@bitwarden/common/abstractions/log.service";
import { PasswordRepromptService } from "@bitwarden/common/abstractions/passwordReprompt.service";
Expand All @@ -31,6 +33,7 @@ import { EncArrayBuffer } from "@bitwarden/common/models/domain/enc-array-buffer
import { ErrorResponse } from "@bitwarden/common/models/response/error.response";
import { AttachmentView } from "@bitwarden/common/models/view/attachment.view";
import { CipherView } from "@bitwarden/common/models/view/cipher.view";
import { FolderView } from "@bitwarden/common/models/view/folder.view";
import { LoginUriView } from "@bitwarden/common/models/view/login-uri.view";

const BroadcasterSubscriptionId = "ViewComponent";
Expand Down Expand Up @@ -58,13 +61,15 @@ export class ViewComponent implements OnDestroy, OnInit {
totpLow: boolean;
fieldType = FieldType;
checkPasswordPromise: Promise<number>;
folder: FolderView;

private totpInterval: any;
private previousCipherId: string;
private passwordReprompted = false;

constructor(
protected cipherService: CipherService,
protected folderService: FolderService,
protected totpService: TotpService,
protected tokenService: TokenService,
protected i18nService: I18nService,
Expand Down Expand Up @@ -112,6 +117,12 @@ export class ViewComponent implements OnDestroy, OnInit {
this.showPremiumRequiredTotp =
this.cipher.login.totp && !this.canAccessPremium && !this.cipher.organizationUseTotp;

if (this.cipher.folderId) {
this.folder = await (
await firstValueFrom(this.folderService.folderViews$)
).find((f) => f.id == this.cipher.folderId);
}

if (
this.cipher.type === CipherType.Login &&
this.cipher.login.totp &&
Expand Down