1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-28 17:27:50 +01:00

collection externalId

This commit is contained in:
Kyle Spearrin 2019-03-07 15:18:05 -05:00
parent aabb1bc264
commit fefe4edda1
5 changed files with 12 additions and 4 deletions

2
jslib

@ -1 +1 @@
Subproject commit 3b3b71d84192cc195f4626d6294b34d788641215 Subproject commit 79fea92b8152c70ed59188d6acd4948dd81ed235

View File

@ -15,6 +15,11 @@
<label for="name">{{'name' | i18n}}</label> <label for="name">{{'name' | i18n}}</label>
<input id="name" class="form-control" type="text" name="Name" [(ngModel)]="name" required> <input id="name" class="form-control" type="text" name="Name" [(ngModel)]="name" required>
</div> </div>
<div class="form-group">
<label for="externalId">{{'externalId' | i18n}}</label>
<input id="externalId" class="form-control" type="text" name="ExternalId" [(ngModel)]="externalId">
<small class="form-text text-muted">{{'externalIdDesc' | i18n}}</small>
</div>
<ng-container *ngIf="accessGroups"> <ng-container *ngIf="accessGroups">
<h3 class="mt-4 d-flex mb-0"> <h3 class="mt-4 d-flex mb-0">
{{'groupAccess' | i18n}} {{'groupAccess' | i18n}}

View File

@ -38,6 +38,7 @@ export class CollectionAddEditComponent implements OnInit {
accessGroups: boolean = false; accessGroups: boolean = false;
title: string; title: string;
name: string; name: string;
externalId: string;
groups: GroupResponse[] = []; groups: GroupResponse[] = [];
formPromise: Promise<any>; formPromise: Promise<any>;
deletePromise: Promise<any>; deletePromise: Promise<any>;
@ -65,6 +66,7 @@ export class CollectionAddEditComponent implements OnInit {
try { try {
const collection = await this.apiService.getCollectionDetails(this.organizationId, this.collectionId); const collection = await this.apiService.getCollectionDetails(this.organizationId, this.collectionId);
this.name = await this.cryptoService.decryptToUtf8(new CipherString(collection.name), this.orgKey); this.name = await this.cryptoService.decryptToUtf8(new CipherString(collection.name), this.orgKey);
this.externalId = collection.externalId;
if (collection.groups != null && this.groups.length > 0) { if (collection.groups != null && this.groups.length > 0) {
collection.groups.forEach((s) => { collection.groups.forEach((s) => {
const group = this.groups.filter((g) => !g.accessAll && g.id === s.id); const group = this.groups.filter((g) => !g.accessAll && g.id === s.id);
@ -109,6 +111,7 @@ export class CollectionAddEditComponent implements OnInit {
const request = new CollectionRequest(); const request = new CollectionRequest();
request.name = (await this.cryptoService.encrypt(this.name, this.orgKey)).encryptedString; request.name = (await this.cryptoService.encrypt(this.name, this.orgKey)).encryptedString;
request.externalId = this.externalId;
request.groups = this.groups.filter((g) => (g as any).checked && !g.accessAll) request.groups = this.groups.filter((g) => (g as any).checked && !g.accessAll)
.map((g) => new SelectionReadOnlyRequest(g.id, !!(g as any).readOnly)); .map((g) => new SelectionReadOnlyRequest(g.id, !!(g as any).readOnly));

View File

@ -18,7 +18,7 @@
<div class="form-group"> <div class="form-group">
<label for="externalId">{{'externalId' | i18n}}</label> <label for="externalId">{{'externalId' | i18n}}</label>
<input id="externalId" class="form-control" type="text" name="ExternalId" [(ngModel)]="externalId"> <input id="externalId" class="form-control" type="text" name="ExternalId" [(ngModel)]="externalId">
<small class="form-text text-muted">{{'externalIdGroupDesc' | i18n}}</small> <small class="form-text text-muted">{{'externalIdDesc' | i18n}}</small>
</div> </div>
<h3 class="mt-4 d-flex"> <h3 class="mt-4 d-flex">
<div class="mb-2"> <div class="mb-2">

View File

@ -2044,8 +2044,8 @@
"externalId": { "externalId": {
"message": "External Id" "message": "External Id"
}, },
"externalIdGroupDesc": { "externalIdDesc": {
"message": "The external id is used to link this group to an external system such as a user directory." "message": "The external id can be used as a reference or to link this resource to an external system such as a user directory."
}, },
"accessControl": { "accessControl": {
"message": "Access Control" "message": "Access Control"