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)); humanReadableMsg = this.i18nService.t('deletedAttachmentForItem', this.getShortId(ev.cipherId));
break; break;
case EventType.Cipher_Shared: case EventType.Cipher_Shared:
msg = this.i18nService.t('sharedItemId', this.formatCipherId(ev, options)); msg = this.i18nService.t('movedItemIdToOrg', this.formatCipherId(ev, options));
humanReadableMsg = this.i18nService.t('sharedItemId', this.getShortId(ev.cipherId)); humanReadableMsg = this.i18nService.t('movedItemIdToOrg', this.getShortId(ev.cipherId));
break; break;
case EventType.Cipher_ClientViewed: case EventType.Cipher_ClientViewed:
msg = this.i18nService.t('viewedItemId', this.formatCipherId(ev, options)); msg = this.i18nService.t('viewedItemId', this.formatCipherId(ev, options));

View File

@ -12,7 +12,7 @@
<td class="reduced-lh wrap"> <td class="reduced-lh wrap">
<a href="#" appStopClick (click)="selectCipher(c)" title="{{'editItem' | i18n}}">{{c.name}}</a> <a href="#" appStopClick (click)="selectCipher(c)" title="{{'editItem' | i18n}}">{{c.name}}</a>
<ng-container *ngIf="!organization && c.organizationId"> <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> <span class="sr-only">{{'shared' | i18n}}</span>
</ng-container> </ng-container>
<ng-container *ngIf="c.hasAttachments"> <ng-container *ngIf="c.hasAttachments">

View File

@ -28,7 +28,7 @@
<span>{{c.name}}</span> <span>{{c.name}}</span>
</ng-template> </ng-template>
<ng-container *ngIf="!organization && c.organizationId"> <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> <span class="sr-only">{{'shared' | i18n}}</span>
</ng-container> </ng-container>
<ng-container *ngIf="c.hasAttachments"> <ng-container *ngIf="c.hasAttachments">

View File

@ -29,7 +29,7 @@
<td class="reduced-lh wrap"> <td class="reduced-lh wrap">
<a href="#" appStopClick (click)="selectCipher(c)" title="{{'editItem' | i18n}}">{{c.name}}</a> <a href="#" appStopClick (click)="selectCipher(c)" title="{{'editItem' | i18n}}">{{c.name}}</a>
<ng-container *ngIf="!organization && c.organizationId"> <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> <span class="sr-only">{{'shared' | i18n}}</span>
</ng-container> </ng-container>
<ng-container *ngIf="c.hasAttachments"> <ng-container *ngIf="c.hasAttachments">

View File

@ -34,7 +34,7 @@
<span>{{c.name}}</span> <span>{{c.name}}</span>
</ng-template> </ng-template>
<ng-container *ngIf="!organization && c.organizationId"> <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> <span class="sr-only">{{'shared' | i18n}}</span>
</ng-container> </ng-container>
<ng-container *ngIf="c.hasAttachments"> <ng-container *ngIf="c.hasAttachments">

View File

@ -29,7 +29,7 @@
<td class="reduced-lh wrap"> <td class="reduced-lh wrap">
<a href="#" appStopClick (click)="selectCipher(c)" title="{{'editItem' | i18n}}">{{c.name}}</a> <a href="#" appStopClick (click)="selectCipher(c)" title="{{'editItem' | i18n}}">{{c.name}}</a>
<ng-container *ngIf="!organization && c.organizationId"> <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> <span class="sr-only">{{'shared' | i18n}}</span>
</ng-container> </ng-container>
<ng-container *ngIf="c.hasAttachments"> <ng-container *ngIf="c.hasAttachments">

View File

@ -34,7 +34,7 @@
<span>{{c.name}}</span> <span>{{c.name}}</span>
</ng-template> </ng-template>
<ng-container *ngIf="!organization && c.organizationId"> <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> <span class="sr-only">{{'shared' | i18n}}</span>
</ng-container> </ng-container>
<ng-container *ngIf="c.hasAttachments"> <ng-container *ngIf="c.hasAttachments">

View File

@ -9,8 +9,8 @@
{{'moveSelected' | i18n}} {{'moveSelected' | i18n}}
</button> </button>
<button class="dropdown-item" appStopClick (click)="bulkShare()" *ngIf="!deleted && !organization"> <button class="dropdown-item" appStopClick (click)="bulkShare()" *ngIf="!deleted && !organization">
<i class="fa fa-fw fa-share-alt" aria-hidden="true"></i> <i class="fa fa-fw fa-arrow-circle-o-right" aria-hidden="true"></i>
{{'shareSelected' | i18n}} {{'moveSelectedToOrg' | i18n}}
</button> </button>
<button class="dropdown-item" (click)="bulkRestore()" *ngIf="deleted && !organization"> <button class="dropdown-item" (click)="bulkRestore()" *ngIf="deleted && !organization">
<i class="fa fa-fw fa-undo" aria-hidden="true"></i> <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"> <div class="modal-dialog modal-dialog-scrollable" role="document">
<form class="modal-content" #form (ngSubmit)="submit()" [appApiAction]="formPromise"> <form class="modal-content" #form (ngSubmit)="submit()" [appApiAction]="formPromise">
<div class="modal-header"> <div class="modal-header">
<h2 class="modal-title" id="shareSelectedTitle"> <h2 class="modal-title" id="moveSelectedToOrgTitle">
{{'shareSelected' | i18n}} {{'moveSelectedToOrg' | i18n}}
</h2> </h2>
<button type="button" class="close" data-dismiss="modal" appA11yTitle="{{'close' | i18n}}"> <button type="button" class="close" data-dismiss="modal" appA11yTitle="{{'close' | i18n}}">
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
</button> </button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<p>{{'shareManyDesc' | i18n}}</p> <p>{{'moveManyToOrgDesc' | i18n}}</p>
<p>{{'shareSelectedItemsCountDesc' | i18n: this.ciphers.length : shareableCiphers.length : nonShareableCount}} <p>{{'moveSelectedItemsCountDesc' | i18n: this.ciphers.length : shareableCiphers.length : nonShareableCount}}
</p> </p>
<div class="form-group"> <div class="form-group">
<label for="organization">{{'organization' | i18n}}</label> <label for="organization">{{'organization' | i18n}}</label>

View File

@ -71,7 +71,8 @@ export class BulkShareComponent implements OnInit {
checkedCollectionIds); checkedCollectionIds);
await this.formPromise; await this.formPromise;
this.onShared.emit(); 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 { } } catch { }
} }

View File

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

View File

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

View File

@ -360,6 +360,9 @@
"share": { "share": {
"message": "Share" "message": "Share"
}, },
"moveToOrganization": {
"message": "Move to Organization"
},
"valueCopied": { "valueCopied": {
"message": "$VALUE$ copied", "message": "$VALUE$ copied",
"description": "Value has been copied to the clipboard.", "description": "Value has been copied to the clipboard.",
@ -400,8 +403,8 @@
"vault": { "vault": {
"message": "Vault" "message": "Vault"
}, },
"shareSelected": { "moveSelectedToOrg": {
"message": "Share Selected" "message": "Move Selected to Organization"
}, },
"deleteSelected": { "deleteSelected": {
"message": "Delete Selected" "message": "Delete Selected"
@ -448,11 +451,27 @@
"editedItem": { "editedItem": {
"message": "Edited item" "message": "Edited item"
}, },
"sharedItem": { "movedItemToOrg": {
"message": "Shared item" "message": "$ITEMNAME$ moved to $ORGNAME$",
"placeholders": {
"itemname": {
"content": "$1",
"example": "Secret Item"
},
"orgname": {
"content": "$2",
"example": "Company Name"
}
}
}, },
"sharedItems": { "movedItemsToOrg": {
"message": "Shared items" "message": "Selected items moved to $ORGNAME$",
"placeholders": {
"orgname": {
"content": "$1",
"example": "Company Name"
}
}
}, },
"deleteItem": { "deleteItem": {
"message": "Delete Item" "message": "Delete Item"
@ -749,11 +768,11 @@
"organizations": { "organizations": {
"message": "Organizations" "message": "Organizations"
}, },
"shareDesc": { "moveToOrgDesc": {
"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." "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": { "moveManyToOrgDesc": {
"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." "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": { "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." "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": { "moveSelectedItemsCountDesc": {
"message": "You have selected $COUNT$ item(s). $SHAREABLE_COUNT$ items are sharable, $NONSHAREABLE_COUNT$ are not.", "message": "You have selected $COUNT$ item(s). $MOVEABLE_COUNT$ item(s) can be moved to an organization, $NONMOVEABLE_COUNT$ cannot.",
"placeholders": { "placeholders": {
"count": { "count": {
"content": "$1", "content": "$1",
"example": "10" "example": "10"
}, },
"shareable_count": { "moveable_count": {
"content": "$2", "content": "$2",
"example": "8" "example": "8"
}, },
"nonshareable_count": { "nonmoveable_count": {
"content": "$3", "content": "$3",
"example": "2" "example": "2"
} }
@ -2333,8 +2352,8 @@
} }
} }
}, },
"sharedItemId": { "movedItemIdToOrg": {
"message": "Shared item $ID$.", "message": "Moved item $ID$ to an organization.",
"placeholders": { "placeholders": {
"id": { "id": {
"content": "$1", "content": "$1",