1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-11 10:10:25 +01:00

add send link copy (#11160)

This commit is contained in:
Jordan Aasen 2024-09-19 12:59:25 -07:00 committed by GitHub
parent ca1dce4625
commit 01f668e648
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 25 additions and 0 deletions

View File

@ -21,6 +21,19 @@
[originalSendView]="originalSendView" [originalSendView]="originalSendView"
></tools-send-file-details> ></tools-send-file-details>
<bit-form-field *ngIf="sendLink">
<bit-label>{{ "sendLink" | i18n }}</bit-label>
<input bitInput type="text" [value]="sendLink" readonly />
<button
type="button"
bitSuffix
showToast
bitIconButton="bwi-clone"
[appCopyClick]="sendLink"
[appA11yTitle]="'copySendLink' | i18n"
></button>
</bit-form-field>
<bit-form-field> <bit-form-field>
<bit-label>{{ "deletionDate" | i18n }}</bit-label> <bit-label>{{ "deletionDate" | i18n }}</bit-label>
<bit-select <bit-select

View File

@ -1,8 +1,10 @@
import { CommonModule, DatePipe } from "@angular/common"; import { CommonModule, DatePipe } from "@angular/common";
import { Component, OnInit } from "@angular/core"; import { Component, OnInit } from "@angular/core";
import { FormBuilder, ReactiveFormsModule } from "@angular/forms"; import { FormBuilder, ReactiveFormsModule } from "@angular/forms";
import { firstValueFrom } from "rxjs";
import { JslibModule } from "@bitwarden/angular/jslib.module"; import { JslibModule } from "@bitwarden/angular/jslib.module";
import { EnvironmentService } from "@bitwarden/common/platform/abstractions/environment.service";
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
import { SendType } from "@bitwarden/common/tools/send/enums/send-type"; import { SendType } from "@bitwarden/common/tools/send/enums/send-type";
import { import {
@ -47,17 +49,27 @@ import { SendTextDetailsComponent } from "./send-text-details.component";
export class SendDetailsComponent extends BaseSendDetailsComponent implements OnInit { export class SendDetailsComponent extends BaseSendDetailsComponent implements OnInit {
FileSendType = SendType.File; FileSendType = SendType.File;
TextSendType = SendType.Text; TextSendType = SendType.Text;
sendLink: string | null = null;
constructor( constructor(
protected sendFormContainer: SendFormContainer, protected sendFormContainer: SendFormContainer,
protected formBuilder: FormBuilder, protected formBuilder: FormBuilder,
protected i18nService: I18nService, protected i18nService: I18nService,
protected datePipe: DatePipe, protected datePipe: DatePipe,
protected environmentService: EnvironmentService,
) { ) {
super(sendFormContainer, formBuilder, i18nService, datePipe); super(sendFormContainer, formBuilder, i18nService, datePipe);
} }
async getSendLink() {}
async ngOnInit() { async ngOnInit() {
await super.ngOnInit(); await super.ngOnInit();
if (!this.originalSendView) {
return;
}
const env = await firstValueFrom(this.environmentService.environment$);
this.sendLink =
env.getSendUrl() + this.originalSendView.accessId + "/" + this.originalSendView.urlB64Key;
} }
} }