mirror of
https://github.com/bitwarden/browser.git
synced 2025-01-08 19:18:02 +01:00
[EC-1003] Make External ID in group modal to read-only (#4492)
* [EC-1003] chore: refactor form builder * [EC-1003] feat: disable externalId * [EC-1003] feat: disable `externalId` editing * [EC-1003] feat: remove `externalId` from request classes
This commit is contained in:
parent
8675219162
commit
ff8f19aa2f
@ -64,7 +64,6 @@ export class GroupService {
|
|||||||
async save(group: GroupView): Promise<GroupView> {
|
async save(group: GroupView): Promise<GroupView> {
|
||||||
const request = new GroupRequest();
|
const request = new GroupRequest();
|
||||||
request.name = group.name;
|
request.name = group.name;
|
||||||
request.externalId = group.externalId;
|
|
||||||
request.accessAll = group.accessAll;
|
request.accessAll = group.accessAll;
|
||||||
request.users = group.members;
|
request.users = group.members;
|
||||||
request.collections = group.collections.map(
|
request.collections = group.collections.map(
|
||||||
|
@ -3,7 +3,6 @@ import { SelectionReadOnlyRequest } from "@bitwarden/common/models/request/selec
|
|||||||
export class GroupRequest {
|
export class GroupRequest {
|
||||||
name: string;
|
name: string;
|
||||||
accessAll: boolean;
|
accessAll: boolean;
|
||||||
externalId: string;
|
|
||||||
collections: SelectionReadOnlyRequest[] = [];
|
collections: SelectionReadOnlyRequest[] = [];
|
||||||
users: string[] = [];
|
users: string[] = [];
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { DIALOG_DATA, DialogConfig, DialogRef } from "@angular/cdk/dialog";
|
import { DIALOG_DATA, DialogConfig, DialogRef } from "@angular/cdk/dialog";
|
||||||
import { ChangeDetectorRef, Component, Inject, OnDestroy, OnInit } from "@angular/core";
|
import { ChangeDetectorRef, Component, Inject, OnDestroy, OnInit } from "@angular/core";
|
||||||
import { FormBuilder, FormControl, Validators } from "@angular/forms";
|
import { FormBuilder, Validators } from "@angular/forms";
|
||||||
import { catchError, combineLatest, from, map, of, Subject, switchMap, takeUntil } from "rxjs";
|
import { catchError, combineLatest, from, map, of, Subject, switchMap, takeUntil } from "rxjs";
|
||||||
|
|
||||||
import { ApiService } from "@bitwarden/common/abstractions/api.service";
|
import { ApiService } from "@bitwarden/common/abstractions/api.service";
|
||||||
@ -90,11 +90,11 @@ export class GroupAddEditComponent implements OnInit, OnDestroy {
|
|||||||
group: GroupView;
|
group: GroupView;
|
||||||
|
|
||||||
groupForm = this.formBuilder.group({
|
groupForm = this.formBuilder.group({
|
||||||
accessAll: new FormControl(false),
|
accessAll: [false],
|
||||||
name: new FormControl("", [Validators.required, Validators.maxLength(100)]),
|
name: ["", [Validators.required, Validators.maxLength(100)]],
|
||||||
externalId: new FormControl("", Validators.maxLength(300)),
|
externalId: this.formBuilder.control({ value: "", disabled: true }),
|
||||||
members: new FormControl<AccessItemValue[]>([]),
|
members: [[] as AccessItemValue[]],
|
||||||
collections: new FormControl<AccessItemValue[]>([]),
|
collections: [[] as AccessItemValue[]],
|
||||||
});
|
});
|
||||||
|
|
||||||
get groupId(): string | undefined {
|
get groupId(): string | undefined {
|
||||||
@ -246,7 +246,6 @@ export class GroupAddEditComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
const formValue = this.groupForm.value;
|
const formValue = this.groupForm.value;
|
||||||
groupView.name = formValue.name;
|
groupView.name = formValue.name;
|
||||||
groupView.externalId = formValue.externalId;
|
|
||||||
groupView.accessAll = formValue.accessAll;
|
groupView.accessAll = formValue.accessAll;
|
||||||
groupView.members = formValue.members?.map((m) => m.id) ?? [];
|
groupView.members = formValue.members?.map((m) => m.id) ?? [];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user