Display tags with color pills

This commit is contained in:
Michael Shamoon 2020-12-10 15:49:00 -08:00
parent 364df5c050
commit 57504b7ee6
2 changed files with 7 additions and 2 deletions

View File

@ -10,7 +10,10 @@
<path fill-rule="evenodd" d="M10.97 4.97a.75.75 0 0 1 1.071 1.05l-3.992 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425a.236.236 0 0 1 .02-.022z"/>
</svg>
</div>
<div class="mr-1">{{item.name}}</div>
<div class="mr-1">
<app-tag *ngIf="display == 'tag'; else displayName" [tag]="item" [clickable]="true" linkTitle="Filter by tag"></app-tag>
<ng-template #displayName>{{item.name}}</ng-template>
</div>
<div class="badge bg-primary text-light rounded-pill ml-auto">{{item.document_count}}</div>
</button>
</ng-container>

View File

@ -1,5 +1,5 @@
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { FilterRuleType, FILTER_CORRESPONDENT, FILTER_DOCUMENT_TYPE, FILTER_HAS_TAG, FILTER_TITLE, FILTER_RULE_TYPES } from 'src/app/data/filter-rule-type';
import { FilterRuleType, FILTER_HAS_TAG, FILTER_RULE_TYPES } from 'src/app/data/filter-rule-type';
import { ObjectWithId } from 'src/app/data/object-with-id';
@Component({
@ -21,10 +21,12 @@ export class FilterDropdownComponent implements OnInit {
itemsActive: ObjectWithId[] = []
title: string
filterText: string
display: string
ngOnInit(): void {
let filterRuleType: FilterRuleType = FILTER_RULE_TYPES.find(t => t.id == this.filterRuleTypeID)
this.title = filterRuleType.name
this.display = filterRuleType.datatype
}
toggleItem(item: ObjectWithId) {