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

Redefine cipher "share" to "move to organization" (#1039)

* Redefine cipher "share" to "move to organization"

* Bump jslib

Co-authored-by: = <=>
This commit is contained in:
Matt Gibson 2021-06-21 19:27:27 -04:00 committed by GitHub
parent d6d71c94f5
commit f8a7439675
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 58 additions and 38 deletions

2
jslib

@ -1 +1 @@
Subproject commit 1f83c3c1ba14d2cdbc319ac060a08cc7c0911b5c
Subproject commit f568c872898c86b3cf8b5a99f8b5b377cb5b49e7

View File

@ -101,8 +101,8 @@ export class EventService {
humanReadableMsg = this.i18nService.t('deletedAttachmentForItem', this.getShortId(ev.cipherId));
break;
case EventType.Cipher_Shared:
msg = this.i18nService.t('sharedItemId', this.formatCipherId(ev, options));
humanReadableMsg = this.i18nService.t('sharedItemId', this.getShortId(ev.cipherId));
msg = this.i18nService.t('movedItemIdToOrg', this.formatCipherId(ev, options));
humanReadableMsg = this.i18nService.t('movedItemIdToOrg', this.getShortId(ev.cipherId));
break;
case EventType.Cipher_ClientViewed:
msg = this.i18nService.t('viewedItemId', this.formatCipherId(ev, options));

View File

@ -12,7 +12,7 @@
<td class="reduced-lh wrap">
<a href="#" appStopClick (click)="selectCipher(c)" title="{{'editItem' | i18n}}">{{c.name}}</a>
<ng-container *ngIf="!organization && c.organizationId">
<i class="fa fa-share-alt" appStopProp title="{{'shared' | i18n}}" aria-hidden="true"></i>
<i class="fa fa-cube" appStopProp title="{{'shared' | i18n}}" aria-hidden="true"></i>
<span class="sr-only">{{'shared' | i18n}}</span>
</ng-container>
<ng-container *ngIf="c.hasAttachments">

View File

@ -28,7 +28,7 @@
<span>{{c.name}}</span>
</ng-template>
<ng-container *ngIf="!organization && c.organizationId">
<i class="fa fa-share-alt" appStopProp title="{{'shared' | i18n}}" aria-hidden="true"></i>
<i class="fa fa-cube" appStopProp title="{{'shared' | i18n}}" aria-hidden="true"></i>
<span class="sr-only">{{'shared' | i18n}}</span>
</ng-container>
<ng-container *ngIf="c.hasAttachments">

View File

@ -29,7 +29,7 @@
<td class="reduced-lh wrap">
<a href="#" appStopClick (click)="selectCipher(c)" title="{{'editItem' | i18n}}">{{c.name}}</a>
<ng-container *ngIf="!organization && c.organizationId">
<i class="fa fa-share-alt" appStopProp title="{{'shared' | i18n}}" aria-hidden="true"></i>
<i class="fa fa-cube" appStopProp title="{{'shared' | i18n}}" aria-hidden="true"></i>
<span class="sr-only">{{'shared' | i18n}}</span>
</ng-container>
<ng-container *ngIf="c.hasAttachments">

View File

@ -34,7 +34,7 @@
<span>{{c.name}}</span>
</ng-template>
<ng-container *ngIf="!organization && c.organizationId">
<i class="fa fa-share-alt" appStopProp title="{{'shared' | i18n}}" aria-hidden="true"></i>
<i class="fa fa-cube" appStopProp title="{{'shared' | i18n}}" aria-hidden="true"></i>
<span class="sr-only">{{'shared' | i18n}}</span>
</ng-container>
<ng-container *ngIf="c.hasAttachments">

View File

@ -29,7 +29,7 @@
<td class="reduced-lh wrap">
<a href="#" appStopClick (click)="selectCipher(c)" title="{{'editItem' | i18n}}">{{c.name}}</a>
<ng-container *ngIf="!organization && c.organizationId">
<i class="fa fa-share-alt" appStopProp title="{{'shared' | i18n}}" aria-hidden="true"></i>
<i class="fa fa-cube" appStopProp title="{{'shared' | i18n}}" aria-hidden="true"></i>
<span class="sr-only">{{'shared' | i18n}}</span>
</ng-container>
<ng-container *ngIf="c.hasAttachments">

View File

@ -34,7 +34,7 @@
<span>{{c.name}}</span>
</ng-template>
<ng-container *ngIf="!organization && c.organizationId">
<i class="fa fa-share-alt" appStopProp title="{{'shared' | i18n}}" aria-hidden="true"></i>
<i class="fa fa-cube" appStopProp title="{{'shared' | i18n}}" aria-hidden="true"></i>
<span class="sr-only">{{'shared' | i18n}}</span>
</ng-container>
<ng-container *ngIf="c.hasAttachments">

View File

@ -9,8 +9,8 @@
{{'moveSelected' | i18n}}
</button>
<button class="dropdown-item" appStopClick (click)="bulkShare()" *ngIf="!deleted && !organization">
<i class="fa fa-fw fa-share-alt" aria-hidden="true"></i>
{{'shareSelected' | i18n}}
<i class="fa fa-fw fa-arrow-circle-o-right" aria-hidden="true"></i>
{{'moveSelectedToOrg' | i18n}}
</button>
<button class="dropdown-item" (click)="bulkRestore()" *ngIf="deleted && !organization">
<i class="fa fa-fw fa-undo" aria-hidden="true"></i>

View File

@ -1,17 +1,17 @@
<div class="modal fade" tabindex="-1" role="dialog" aria-modal="true" aria-labelledby="shareSelectedTitle">
<div class="modal fade" tabindex="-1" role="dialog" aria-modal="true" aria-labelledby="moveSelectedToOrgTitle">
<div class="modal-dialog modal-dialog-scrollable" role="document">
<form class="modal-content" #form (ngSubmit)="submit()" [appApiAction]="formPromise">
<div class="modal-header">
<h2 class="modal-title" id="shareSelectedTitle">
{{'shareSelected' | i18n}}
<h2 class="modal-title" id="moveSelectedToOrgTitle">
{{'moveSelectedToOrg' | i18n}}
</h2>
<button type="button" class="close" data-dismiss="modal" appA11yTitle="{{'close' | i18n}}">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<p>{{'shareManyDesc' | i18n}}</p>
<p>{{'shareSelectedItemsCountDesc' | i18n: this.ciphers.length : shareableCiphers.length : nonShareableCount}}
<p>{{'moveManyToOrgDesc' | i18n}}</p>
<p>{{'moveSelectedItemsCountDesc' | i18n: this.ciphers.length : shareableCiphers.length : nonShareableCount}}
</p>
<div class="form-group">
<label for="organization">{{'organization' | i18n}}</label>

View File

@ -71,7 +71,8 @@ export class BulkShareComponent implements OnInit {
checkedCollectionIds);
await this.formPromise;
this.onShared.emit();
this.toasterService.popAsync('success', null, this.i18nService.t('sharedItems'));
const orgName = this.organizations.find(o => o.id === this.organizationId)?.name ?? this.i18nService.t('organization');
this.toasterService.popAsync('success', null, this.i18nService.t('movedItemsToOrg', orgName));
} catch { }
}

View File

@ -13,7 +13,7 @@
<a href="#" appStopClick appStopProp (click)="selectCipher(c)"
title="{{'editItem' | i18n}}">{{c.name}}</a>
<ng-container *ngIf="!organization && c.organizationId">
<i class="fa fa-share-alt" appStopProp title="{{'shared' | i18n}}" aria-hidden="true"></i>
<i class="fa fa-cube" appStopProp title="{{'shared' | i18n}}" aria-hidden="true"></i>
<span class="sr-only">{{'shared' | i18n}}</span>
</ng-container>
<ng-container *ngIf="c.hasAttachments">
@ -70,8 +70,8 @@
</a>
<a class="dropdown-item" href="#" appStopClick
*ngIf="!organization && !c.organizationId && !c.isDeleted" (click)="share(c)">
<i class="fa fa-fw fa-share-alt" aria-hidden="true"></i>
{{'share' | i18n}}
<i class="fa fa-fw fa-arrow-circle-o-right" aria-hidden="true"></i>
{{'moveToOrganization' | i18n}}
</a>
<a class="dropdown-item" href="#" appStopClick *ngIf="c.organizationId && !c.isDeleted"
(click)="collections(c)">

View File

@ -3,7 +3,7 @@
<form class="modal-content" #form (ngSubmit)="submit()" [appApiAction]="formPromise">
<div class="modal-header">
<h2 class="modal-title" id="shareTitle">
{{'share' | i18n}}
{{'moveToOrganization' | i18n}}
<small *ngIf="cipher">{{cipher.name}}</small>
</h2>
<button type="button" class="close" data-dismiss="modal" appA11yTitle="{{'close' | i18n}}">
@ -14,7 +14,7 @@
{{'noOrganizationsList' | i18n}}
</div>
<div class="modal-body" *ngIf="organizations && organizations.length">
<p>{{'shareDesc' | i18n}}</p>
<p>{{'moveToOrgDesc' | i18n}}</p>
<div class="form-group">
<label for="organization">{{'organization' | i18n}}</label>
<select id="organization" name="OrganizationId" [(ngModel)]="organizationId" class="form-control"

View File

@ -360,6 +360,9 @@
"share": {
"message": "Share"
},
"moveToOrganization": {
"message": "Move to Organization"
},
"valueCopied": {
"message": "$VALUE$ copied",
"description": "Value has been copied to the clipboard.",
@ -400,8 +403,8 @@
"vault": {
"message": "Vault"
},
"shareSelected": {
"message": "Share Selected"
"moveSelectedToOrg": {
"message": "Move Selected to Organization"
},
"deleteSelected": {
"message": "Delete Selected"
@ -448,11 +451,27 @@
"editedItem": {
"message": "Edited item"
},
"sharedItem": {
"message": "Shared item"
"movedItemToOrg": {
"message": "$ITEMNAME$ moved to $ORGNAME$",
"placeholders": {
"itemname": {
"content": "$1",
"example": "Secret Item"
},
"orgname": {
"content": "$2",
"example": "Company Name"
}
}
},
"sharedItems": {
"message": "Shared items"
"movedItemsToOrg": {
"message": "Selected items moved to $ORGNAME$",
"placeholders": {
"orgname": {
"content": "$1",
"example": "Company Name"
}
}
},
"deleteItem": {
"message": "Delete Item"
@ -749,11 +768,11 @@
"organizations": {
"message": "Organizations"
},
"shareDesc": {
"message": "Choose an organization that you wish to share this item with. Sharing transfers ownership of the item to the organization. You will no longer be the direct owner of this item once it has been shared."
"moveToOrgDesc": {
"message": "Choose an organization that you wish to move this item to. Moving to an organization transfers ownership of the item to that organization. You will no longer be the direct owner of this item once it has been moved."
},
"shareManyDesc": {
"message": "Choose an organization that you wish to share these items with. Sharing transfers ownership of the items to the organization. You will no longer be the direct owner of these items once they have been shared."
"moveManyToOrgDesc": {
"message": "Choose an organization that you wish to move these items to. Moving to an organization transfers ownership of the items to that organization. You will no longer be the direct owner of these items once they have been moved."
},
"collectionsDesc": {
"message": "Edit the collections that this item is being shared with. Only organization users with access to these collections will be able to see this item."
@ -776,18 +795,18 @@
}
}
},
"shareSelectedItemsCountDesc": {
"message": "You have selected $COUNT$ item(s). $SHAREABLE_COUNT$ items are sharable, $NONSHAREABLE_COUNT$ are not.",
"moveSelectedItemsCountDesc": {
"message": "You have selected $COUNT$ item(s). $MOVEABLE_COUNT$ item(s) can be moved to an organization, $NONMOVEABLE_COUNT$ cannot.",
"placeholders": {
"count": {
"content": "$1",
"example": "10"
},
"shareable_count": {
"moveable_count": {
"content": "$2",
"example": "8"
},
"nonshareable_count": {
"nonmoveable_count": {
"content": "$3",
"example": "2"
}
@ -2333,8 +2352,8 @@
}
}
},
"sharedItemId": {
"message": "Shared item $ID$.",
"movedItemIdToOrg": {
"message": "Moved item $ID$ to an organization.",
"placeholders": {
"id": {
"content": "$1",