mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 00:03:56 +00:00
[SM-249] Adding detailed description of which secrets are unable to be deleted (#4849)
* Adding detailed description of which secrets are unable to be deleted * removing accidental change * removing Can write from Service Account options * suggested PR changes * thomas's suggested changes * fixing merge conflicts after merging in master
This commit is contained in:
@@ -8,6 +8,8 @@ import { PlatformUtilsService } from "@bitwarden/common/abstractions/platformUti
|
||||
import { DialogService } from "@bitwarden/components";
|
||||
|
||||
import { ProjectListView } from "../../models/view/project-list.view";
|
||||
import { SecretListView } from "../../models/view/secret-list.view";
|
||||
import { SecretProjectView } from "../../models/view/secret-project.view";
|
||||
import { SecretView } from "../../models/view/secret.view";
|
||||
import { ProjectService } from "../../projects/project.service";
|
||||
import { SecretService } from "../secret.service";
|
||||
@@ -112,11 +114,13 @@ export class SecretDialogComponent implements OnInit {
|
||||
}
|
||||
|
||||
protected openDeleteSecretDialog() {
|
||||
const secretListView: SecretListView[] = this.getSecretListView();
|
||||
|
||||
const dialogRef = this.dialogService.open<unknown, SecretDeleteOperation>(
|
||||
SecretDeleteDialogComponent,
|
||||
{
|
||||
data: {
|
||||
secretIds: [this.data.secretId],
|
||||
secrets: secretListView,
|
||||
},
|
||||
}
|
||||
);
|
||||
@@ -146,4 +150,17 @@ export class SecretDialogComponent implements OnInit {
|
||||
secretView.projects = [this.projects.find((p) => p.id == this.formGroup.value.project)];
|
||||
return secretView;
|
||||
}
|
||||
|
||||
private getSecretListView() {
|
||||
const secretListViews: SecretListView[] = [];
|
||||
const emptyProjects: SecretProjectView[] = [];
|
||||
const selectedProject = [this.projects.find((p) => p.id == this.formGroup.value.project)];
|
||||
|
||||
const secretListView = new SecretListView();
|
||||
secretListView.organizationId = this.data.organizationId;
|
||||
secretListView.name = this.formGroup.value.name;
|
||||
secretListView.projects = selectedProject ? selectedProject : emptyProjects;
|
||||
secretListViews.push(secretListView);
|
||||
return secretListViews;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user