1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-20 18:23:31 +00:00

[Send] Groupings component (#1605)

* Initial commit of groupings component

* Update jslib ee164be

* Updated send-list item icons

* Requested changes

* Removed obsolete safari hacks
This commit is contained in:
Vincent Salucci
2021-02-10 10:16:34 -06:00
committed by GitHub
parent 1868b99d17
commit 0d6e212463
10 changed files with 395 additions and 48 deletions

View File

@@ -0,0 +1,51 @@
<a *ngFor="let s of sends" (click)="selectSend(s)" href="#" appStopClick title="{{title}} - {{s.name}}"
class="box-content-row box-content-row-flex">
<div class="row-main">
<div class="app-vault-icon">
<div class="icon" aria-hidden="true">
<i class="fa fa-fw fa-lg fa-file-text-o" *ngIf="s.type === sendType.Text"></i>
<i class="fa fa-fw fa-lg fa-file-o" *ngIf="s.type === sendType.File"></i>
</div>
</div>
<div class="row-main-content">
<span class="text">
{{s.name}}
<ng-container *ngIf="s.disabled">
<i class="fa fa-ban text-muted" title="{{'disabled' | i18n}}" aria-hidden="true"></i>
<span class="sr-only">{{'disabled' | i18n}}</span>
</ng-container>
<ng-container *ngIf="s.password">
<i class="fa fa-key text-muted" title="{{'passwordProtected' | i18n}}" aria-hidden="true"></i>
<span class="sr-only">{{'passwordProtected' | i18n}}</span>
</ng-container>
<ng-container *ngIf="s.maxAccessCountReached">
<i class="fa fa-warning text-muted" title="{{'maxAccessCountReached' | i18n}}"
aria-hidden="true"></i>
<span class="sr-only">{{'maxAccessCountReached' | i18n}}</span>
</ng-container>
<ng-container *ngIf="s.expired">
<i class="fa fa-clock-o text-muted" title="{{'expired' | i18n}}" aria-hidden="true"></i>
<span class="sr-only">{{'expired' | i18n}}</span>
</ng-container>
<ng-container *ngIf="s.pendingDelete">
<i class="fa fa-trash text-muted" title="{{'pendingDeletion' | i18n}}" aria-hidden="true"></i>
<span class="sr-only">{{'pendingDeletion' | i18n}}</span>
</ng-container>
</span>
<span class="detail">{{s.deletionDate | date:'medium'}}</span>
</div>
</div>
<div class="action-buttons">
<span class="row-btn" appStopClick appStopProp appA11yTitle="{{'copySendLink' | i18n}}"
(click)="copySendLink(s)">
<i class="fa fa-lg fa-copy" aria-hidden="true"></i>
</span>
<span class="row-btn" appStopClick appStopProp appA11yTitle="{{'removePassword' | i18n}}"
(click)="removePassword(s)" *ngIf="s.password">
<i class="fa fa-lg fa-undo" aria-hidden="true"></i>
</span>
<span class="row-btn" appStopClick appStopProp appA11yTitle="{{'delete' | i18n}}" (click)="delete(s)">
<i class="fa fa-lg fa-trash-o" aria-hidden="true"></i>
</span>
</div>
</a>

View File

@@ -0,0 +1,41 @@
import {
Component,
EventEmitter,
Input,
Output,
} from '@angular/core';
import { SendView } from 'jslib/models/view/sendView';
import { SendType } from 'jslib/enums/sendType';
@Component({
selector: 'app-send-list',
templateUrl: 'send-list.component.html',
})
export class SendListComponent {
@Input() sends: SendView[];
@Input() title: string;
@Output() onSelected = new EventEmitter<SendView>();
@Output() onCopySendLink = new EventEmitter<SendView>();
@Output() onRemovePassword = new EventEmitter<SendView>();
@Output() onDeleteSend = new EventEmitter<SendView>();
sendType = SendType;
selectSend(s: SendView) {
this.onSelected.emit(s);
}
copySendLink(s: SendView) {
this.onCopySendLink.emit(s);
}
removePassword(s: SendView) {
this.onRemovePassword.emit(s);
}
delete(s: SendView) {
this.onDeleteSend.emit(s);
}
}