@@ -12,31 +12,44 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
See the License for the specific language governing permissions and
13
13
limitations under the License.
14
14
==============================================================================*/
15
- import { ChangeDetectionStrategy , Component , Input } from '@angular/core' ;
15
+ import {
16
+ ChangeDetectionStrategy ,
17
+ Component ,
18
+ EventEmitter ,
19
+ Input ,
20
+ Output ,
21
+ } from '@angular/core' ;
16
22
import { CardObserver } from '../card_renderer/card_lazy_loader' ;
17
23
import { CardIdWithMetadata } from '../metrics_view_types' ;
18
24
19
25
@Component ( {
20
26
selector : 'metrics-pinned-view-component' ,
21
27
template : `
22
28
<div class="group-toolbar">
23
- <mat-icon svgIcon="keep_24px"></mat-icon>
24
- <span class="group-text">
25
- <span class="group-title" aria-role="heading" aria-level="3"
26
- >Pinned</span
27
- >
28
- <span *ngIf="cardIdsWithMetadata.length > 1" class="group-card-count"
29
- >{{ cardIdsWithMetadata.length }} cards</span
30
- >
31
- <span *ngIf="lastPinnedCardTime">
32
- <span
33
- *ngFor="let id of [lastPinnedCardTime]"
34
- [attr.data-id]="id"
35
- class="new-card-pinned"
36
- >New card pinned</span
29
+ <div class="left-items">
30
+ <mat-icon svgIcon="keep_24px"></mat-icon>
31
+ <span class="group-text">
32
+ <span class="group-title" aria-role="heading" aria-level="3"
33
+ >Pinned</span
37
34
>
35
+ <span *ngIf="cardIdsWithMetadata.length > 1" class="group-card-count"
36
+ >{{ cardIdsWithMetadata.length }} cards</span
37
+ >
38
+ <span *ngIf="lastPinnedCardTime">
39
+ <span
40
+ *ngFor="let id of [lastPinnedCardTime]"
41
+ [attr.data-id]="id"
42
+ class="new-card-pinned"
43
+ >New card pinned</span
44
+ >
45
+ </span>
38
46
</span>
39
- </span>
47
+ </div>
48
+ <div class="right-items" *ngIf="cardIdsWithMetadata.length > 0">
49
+ <button mat-stroked-button (click)="onClearAllPinsClicked.emit()">
50
+ Clear all pins
51
+ </button>
52
+ </div>
40
53
</div>
41
54
<metrics-card-grid
42
55
*ngIf="cardIdsWithMetadata.length; else emptyPinnedView"
@@ -54,4 +67,5 @@ export class PinnedViewComponent {
54
67
@Input ( ) cardObserver ! : CardObserver ;
55
68
@Input ( ) cardIdsWithMetadata ! : CardIdWithMetadata [ ] ;
56
69
@Input ( ) lastPinnedCardTime ! : number ;
70
+ @Output ( ) onClearAllPinsClicked = new EventEmitter < void > ( ) ;
57
71
}
0 commit comments