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

Adding UUID under the secret name on secrets list (#5773)

* adding UUID under the secret name on secrets list

* thomas' suggested changes

* Adding small attribute to bitbutton

* Copying a secret will work on all pages now that show secrets
This commit is contained in:
cd-bitwarden 2023-08-04 16:18:17 -04:00 committed by GitHub
parent b7fbab84f5
commit c0810c96cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 59 additions and 3 deletions

View File

@ -717,6 +717,9 @@
"yourVaultIsLocked": { "yourVaultIsLocked": {
"message": "Your vault is locked. Verify your master password to continue." "message": "Your vault is locked. Verify your master password to continue."
}, },
"uuid":{
"message" : "UUID"
},
"unlock": { "unlock": {
"message": "Unlock" "message": "Unlock"
}, },
@ -948,6 +951,9 @@
"copyVerificationCode": { "copyVerificationCode": {
"message": "Copy verification code" "message": "Copy verification code"
}, },
"copyUuid": {
"message": "Copy UUID"
},
"warning": { "warning": {
"message": "Warning" "message": "Warning"
}, },

View File

@ -63,6 +63,7 @@
(editSecretEvent)="openEditSecret($event)" (editSecretEvent)="openEditSecret($event)"
(copySecretNameEvent)="copySecretName($event)" (copySecretNameEvent)="copySecretName($event)"
(copySecretValueEvent)="copySecretValue($event)" (copySecretValueEvent)="copySecretValue($event)"
(copySecretUuidEvent)="copySecretUuid($event)"
[secrets]="view.latestSecrets" [secrets]="view.latestSecrets"
></sm-secrets-list> ></sm-secrets-list>
<div *ngIf="view.allSecrets.length > 0" class="tw-ml-auto tw-mt-4 tw-max-w-max"> <div *ngIf="view.allSecrets.length > 0" class="tw-ml-auto tw-mt-4 tw-max-w-max">

View File

@ -290,6 +290,10 @@ export class OverviewComponent implements OnInit, OnDestroy {
); );
} }
copySecretUuid(id: string) {
SecretsListComponent.copySecretUuid(id, this.platformUtilsService, this.i18nService);
}
protected hideOnboarding() { protected hideOnboarding() {
this.showOnboarding = false; this.showOnboarding = false;
this.saveCompletedTasks(this.organizationId, { this.saveCompletedTasks(this.organizationId, {

View File

@ -16,6 +16,7 @@
(editSecretEvent)="openEditSecret($event)" (editSecretEvent)="openEditSecret($event)"
(copySecretNameEvent)="copySecretName($event)" (copySecretNameEvent)="copySecretName($event)"
(copySecretValueEvent)="copySecretValue($event)" (copySecretValueEvent)="copySecretValue($event)"
(copySecretUuidEvent)="copySecretUuid($event)"
[secrets]="projectSecrets.secrets" [secrets]="projectSecrets.secrets"
></sm-secrets-list> ></sm-secrets-list>
</ng-container> </ng-container>

View File

@ -109,4 +109,8 @@ export class ProjectSecretsComponent {
this.secretService this.secretService
); );
} }
copySecretUuid(id: string) {
SecretsListComponent.copySecretUuid(id, this.platformUtilsService, this.i18nService);
}
} }

View File

@ -12,6 +12,7 @@
(editSecretEvent)="openEditSecret($event)" (editSecretEvent)="openEditSecret($event)"
(copySecretNameEvent)="copySecretName($event)" (copySecretNameEvent)="copySecretName($event)"
(copySecretValueEvent)="copySecretValue($event)" (copySecretValueEvent)="copySecretValue($event)"
(copySecretUuidEvent)="copySecretUuid($event)"
[secrets]="secrets$ | async" [secrets]="secrets$ | async"
[search]="search" [search]="search"
></sm-secrets-list> ></sm-secrets-list>

View File

@ -96,4 +96,8 @@ export class SecretsComponent implements OnInit {
this.secretService this.secretService
); );
} }
copySecretUuid(id: string) {
SecretsListComponent.copySecretUuid(id, this.platformUtilsService, this.i18nService);
}
} }

View File

@ -64,9 +64,30 @@
<td bitCell> <td bitCell>
<div class="tw-flex tw-items-center tw-gap-4 tw-break-all"> <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> <i class="bwi bwi-key tw-text-muted" aria-hidden="true"></i>
<button type="button" bitLink (click)="editSecretEvent.emit(secret.id)" *ngIf="!trash"> <div>
{{ secret.name }} <div>
</button> <button
type="button"
bitLink
(click)="editSecretEvent.emit(secret.id)"
*ngIf="!trash"
>
{{ secret.name }}
</button>
</div>
<div class="tw-text-sm tw-text-muted">
{{ secret.id }}
<button
type="button"
bitIconButton="bwi-clone"
buttonType="main"
size="small"
[title]="'copyUuid' | i18n"
[attr.aria-label]="'copyUuid' | i18n"
(click)="copySecretUuidEvent.emit(secret.id)"
></button>
</div>
</div>
<div *ngIf="trash">{{ secret.name }}</div> <div *ngIf="trash">{{ secret.name }}</div>
</div> </div>
</td> </td>

View File

@ -38,6 +38,7 @@ export class SecretsListComponent implements OnDestroy {
@Output() editSecretEvent = new EventEmitter<string>(); @Output() editSecretEvent = new EventEmitter<string>();
@Output() copySecretNameEvent = new EventEmitter<string>(); @Output() copySecretNameEvent = new EventEmitter<string>();
@Output() copySecretValueEvent = new EventEmitter<string>(); @Output() copySecretValueEvent = new EventEmitter<string>();
@Output() copySecretUuidEvent = new EventEmitter<string>();
@Output() onSecretCheckedEvent = new EventEmitter<string[]>(); @Output() onSecretCheckedEvent = new EventEmitter<string[]>();
@Output() deleteSecretsEvent = new EventEmitter<SecretListView[]>(); @Output() deleteSecretsEvent = new EventEmitter<SecretListView[]>();
@Output() newSecretEvent = new EventEmitter(); @Output() newSecretEvent = new EventEmitter();
@ -149,6 +150,19 @@ export class SecretsListComponent implements OnDestroy {
}); });
} }
static copySecretUuid(
id: string,
platformUtilsService: PlatformUtilsService,
i18nService: I18nService
) {
platformUtilsService.copyToClipboard(id);
platformUtilsService.showToast(
"success",
null,
i18nService.t("valueCopied", i18nService.t("uuid"))
);
}
/** /**
* TODO: Remove in favor of updating `PlatformUtilsService.copyToClipboard` * TODO: Remove in favor of updating `PlatformUtilsService.copyToClipboard`
*/ */