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:
51
src/popup/components/send-list.component.html
Normal file
51
src/popup/components/send-list.component.html
Normal 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>
|
||||
41
src/popup/components/send-list.component.ts
Normal file
41
src/popup/components/send-list.component.ts
Normal 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user