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

[SM-605] Remove access from create service account (#4946)

This commit is contained in:
Oscar Hinton 2023-03-07 14:27:50 +01:00 committed by GitHub
parent f2276227aa
commit 4f64ac87de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 50 deletions

View File

@ -1,42 +1,11 @@
<form [formGroup]="formGroup" [bitSubmit]="submit">
<bit-dialog dialogSize="default">
<bit-dialog dialogSize="small">
<ng-container bitDialogTitle>{{ "newServiceAccount" | i18n }}</ng-container>
<div bitDialogContent>
<bit-form-field>
<bit-label>{{ "serviceAccountName" | i18n }}</bit-label>
<input formControlName="name" bitInput />
</bit-form-field>
<h3 class="tw-uppercase">{{ "smAccess" | i18n }}</h3>
<bit-form-field>
<bit-label>{{ "newSaSelectAccess" | i18n }}</bit-label>
<select bitInput>
<!-- TODO need to look into creating a bit autocomplete component? -->
<option selected disabled hidden>-- {{ "newSaTypeToFilter" | i18n }} --</option>
<option *ngFor="let project of projects">
{{ project.name }}
</option>
<option *ngFor="let secret of secrets">
{{ secret.name }}
</option>
</select>
</bit-form-field>
<bit-table>
<ng-container header>
<tr>
<th bitCell>{{ "projectCommaSecret" | i18n }}</th>
<th bitCell>{{ "permissions" | i18n }}</th>
</tr>
</ng-container>
<ng-template body>
<tr>
<!-- TODO once access is implement display selected access -->
<td bitCell>example</td>
<td bitCell>example</td>
</tr>
</ng-template>
</bit-table>
</div>
<div bitDialogFooter class="tw-flex tw-gap-2">
<button type="submit" bitButton buttonType="primary" bitFormButton>

View File

@ -1,15 +1,11 @@
import { DialogRef, DIALOG_DATA } from "@angular/cdk/dialog";
import { Component, Inject, OnInit } from "@angular/core";
import { Component, Inject } from "@angular/core";
import { FormControl, FormGroup, Validators } from "@angular/forms";
import { I18nService } from "@bitwarden/common/abstractions/i18n.service";
import { PlatformUtilsService } from "@bitwarden/common/abstractions/platformUtils.service";
import { ProjectListView } from "../../models/view/project-list.view";
import { SecretListView } from "../../models/view/secret-list.view";
import { ServiceAccountView } from "../../models/view/service-account.view";
import { ProjectService } from "../../projects/project.service";
import { SecretService } from "../../secrets/secret.service";
import { ServiceAccountService } from "../service-account.service";
export interface ServiceAccountOperation {
@ -20,11 +16,8 @@ export interface ServiceAccountOperation {
selector: "sm-service-account-dialog",
templateUrl: "./service-account-dialog.component.html",
})
export class ServiceAccountDialogComponent implements OnInit {
projects: ProjectListView[];
secrets: SecretListView[];
formGroup = new FormGroup({
export class ServiceAccountDialogComponent {
protected formGroup = new FormGroup({
name: new FormControl("", [Validators.required]),
});
@ -33,16 +26,9 @@ export class ServiceAccountDialogComponent implements OnInit {
@Inject(DIALOG_DATA) private data: ServiceAccountOperation,
private serviceAccountService: ServiceAccountService,
private i18nService: I18nService,
private platformUtilsService: PlatformUtilsService,
private projectService: ProjectService,
private secretService: SecretService
private platformUtilsService: PlatformUtilsService
) {}
async ngOnInit() {
this.projects = await this.projectService.getProjects(this.data.organizationId);
this.secrets = await this.secretService.getSecrets(this.data.organizationId);
}
submit = async () => {
this.formGroup.markAllAsTouched();