Move date dropdown component

This commit is contained in:
Michael Shamoon 2020-12-12 09:01:48 -08:00
parent 2a57f9d6e5
commit 8ce4434ba9
6 changed files with 5 additions and 6 deletions

View File

@ -29,7 +29,7 @@ import { AppFrameComponent } from './components/app-frame/app-frame.component';
import { ToastsComponent } from './components/common/toasts/toasts.component';
import { FilterEditorComponent } from './components/filter-editor/filter-editor.component';
import { FilterDropdownComponent } from './components/filter-editor/filter-dropdown/filter-dropdown.component';
import { FilterDropdownDateComponent } from './components/filter-editor/filter-dropdown/filter-dropdown-date/filter-dropdown-date.component';
import { FilterDropdownDateComponent } from './components/filter-editor/filter-dropdown-date/filter-dropdown-date.component';
import { DocumentCardLargeComponent } from './components/document-list/document-card-large/document-card-large.component';
import { DocumentCardSmallComponent } from './components/document-list/document-card-small/document-card-small.component';
import { NgxFileDropModule } from 'ngx-file-drop';

View File

@ -2,7 +2,6 @@ import { Component, EventEmitter, Input, OnInit, Output, ElementRef, ViewChild }
import { FilterRule } from 'src/app/data/filter-rule';
import { FilterRuleType, FILTER_RULE_TYPES } from 'src/app/data/filter-rule-type';
import { ObjectWithId } from 'src/app/data/object-with-id';
import { FilterDropdownComponent } from '../filter-dropdown.component'
import { NgbDate, NgbDateStruct } from '@ng-bootstrap/ng-bootstrap';
@Component({
@ -10,7 +9,7 @@ import { NgbDate, NgbDateStruct } from '@ng-bootstrap/ng-bootstrap';
templateUrl: './filter-dropdown-date.component.html',
styleUrls: ['./filter-dropdown-date.component.scss']
})
export class FilterDropdownDateComponent extends FilterDropdownComponent {
export class FilterDropdownDateComponent {
@Input()
filterRuleTypeIDs: number[] = []
@ -19,13 +18,13 @@ export class FilterDropdownDateComponent extends FilterDropdownComponent {
selected = new EventEmitter()
filterRuleTypes: FilterRuleType[] = []
title: string
dateAfter: NgbDateStruct
dateBefore: NgbDateStruct
ngOnInit(): void {
this.filterRuleTypes = this.filterRuleTypeIDs.map(id => FILTER_RULE_TYPES.find(rt => rt.id == id))
this.filterRuleTypeID = this.filterRuleTypeIDs[0]
super.ngOnInit()
this.title = this.filterRuleTypes[0].displayName
}
setDateQuickFilter(range: any) {

View File

@ -10,7 +10,7 @@ import { CorrespondentService } from 'src/app/services/rest/correspondent.servic
import { DocumentTypeService } from 'src/app/services/rest/document-type.service';
import { TagService } from 'src/app/services/rest/tag.service';
import { FilterDropdownComponent } from './filter-dropdown/filter-dropdown.component'
import { FilterDropdownDateComponent } from './filter-dropdown/filter-dropdown-date/filter-dropdown-date.component'
import { FilterDropdownDateComponent } from './filter-dropdown-date/filter-dropdown-date.component'
import { fromEvent } from 'rxjs';
import { debounceTime, distinctUntilChanged, tap } from 'rxjs/operators';
import { NgbDateStruct } from '@ng-bootstrap/ng-bootstrap';