[SM-877] Updating trash to have ability to copy UUID (#5986)

* [SM-877] Updating trash to have ability to copy UUID

* Fixing the ordering of Div's for trash secret UUID copying

* moving ngif to div

* merge fixs
This commit is contained in:
cd-bitwarden 2023-08-28 11:03:01 -04:00 committed by GitHub
parent 76888d6fd7
commit c6972f3e1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 8 deletions

View File

@ -65,16 +65,12 @@
<div class="tw-flex tw-items-center tw-gap-4 tw-break-all">
<i class="bwi bwi-key tw-text-muted" aria-hidden="true"></i>
<div>
<div>
<button
type="button"
bitLink
(click)="editSecretEvent.emit(secret.id)"
*ngIf="!trash"
>
<div *ngIf="!trash">
<button type="button" bitLink (click)="editSecretEvent.emit(secret.id)">
{{ secret.name }}
</button>
</div>
<div *ngIf="trash">{{ secret.name }}</div>
<div class="tw-text-sm tw-text-muted">
{{ secret.id }}
<button
@ -88,7 +84,6 @@
></button>
</div>
</div>
<div *ngIf="trash">{{ secret.name }}</div>
</div>
</td>
<td bitCell>

View File

@ -9,4 +9,5 @@
(restoreSecretsEvent)="openRestoreSecret($event)"
[secrets]="secrets$ | async"
[trash]="true"
(copySecretUuidEvent)="copySecretUuid($event)"
></sm-secrets-list>

View File

@ -2,10 +2,13 @@ import { Component, OnInit } from "@angular/core";
import { ActivatedRoute } from "@angular/router";
import { combineLatestWith, Observable, startWith, switchMap } from "rxjs";
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
import { DialogService } from "@bitwarden/components";
import { SecretListView } from "../models/view/secret-list.view";
import { SecretService } from "../secrets/secret.service";
import { SecretsListComponent } from "../shared/secrets-list.component";
import {
SecretHardDeleteDialogComponent,
@ -28,6 +31,8 @@ export class TrashComponent implements OnInit {
constructor(
private route: ActivatedRoute,
private secretService: SecretService,
private platformUtilsService: PlatformUtilsService,
private i18nService: I18nService,
private dialogService: DialogService
) {}
@ -65,4 +70,8 @@ export class TrashComponent implements OnInit {
},
});
}
copySecretUuid(id: string) {
SecretsListComponent.copySecretUuid(id, this.platformUtilsService, this.i18nService);
}
}