Skip to content

A community-supported supercharged document management system: scan, index and archive all your documents

Move date dropdown component

Michael Shamoon8ce4434ba91a
diff --git a/src-ui/src/app/app.module.ts b/src-ui/src/app/app.module.ts
index 4c24123e6..3021e417b 100644
--- a/src-ui/src/app/app.module.ts
+++ b/src-ui/src/app/app.module.ts
@@ -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';
diff --git a/src-ui/src/app/components/filter-editor/filter-dropdown/filter-dropdown-date/filter-dropdown-date.component.html b/src-ui/src/app/components/filter-editor/filter-dropdown-date/filter-dropdown-date.component.html
similarity index 100%
rename from src-ui/src/app/components/filter-editor/filter-dropdown/filter-dropdown-date/filter-dropdown-date.component.html
rename to src-ui/src/app/components/filter-editor/filter-dropdown-date/filter-dropdown-date.component.html
diff --git a/src-ui/src/app/components/filter-editor/filter-dropdown/filter-dropdown-date/filter-dropdown-date.component.scss b/src-ui/src/app/components/filter-editor/filter-dropdown-date/filter-dropdown-date.component.scss
similarity index 100%
rename from src-ui/src/app/components/filter-editor/filter-dropdown/filter-dropdown-date/filter-dropdown-date.component.scss
rename to src-ui/src/app/components/filter-editor/filter-dropdown-date/filter-dropdown-date.component.scss
diff --git a/src-ui/src/app/components/filter-editor/filter-dropdown/filter-dropdown-date/filter-dropdown-date.component.spec.ts b/src-ui/src/app/components/filter-editor/filter-dropdown-date/filter-dropdown-date.component.spec.ts
similarity index 100%
rename from src-ui/src/app/components/filter-editor/filter-dropdown/filter-dropdown-date/filter-dropdown-date.component.spec.ts
rename to src-ui/src/app/components/filter-editor/filter-dropdown-date/filter-dropdown-date.component.spec.ts
diff --git a/src-ui/src/app/components/filter-editor/filter-dropdown/filter-dropdown-date/filter-dropdown-date.component.ts b/src-ui/src/app/components/filter-editor/filter-dropdown-date/filter-dropdown-date.component.ts
similarity index 89%
rename from src-ui/src/app/components/filter-editor/filter-dropdown/filter-dropdown-date/filter-dropdown-date.component.ts
rename to src-ui/src/app/components/filter-editor/filter-dropdown-date/filter-dropdown-date.component.ts
index 2973a25eb..9acfb44f8 100644
--- a/src-ui/src/app/components/filter-editor/filter-dropdown/filter-dropdown-date/filter-dropdown-date.component.ts
+++ b/src-ui/src/app/components/filter-editor/filter-dropdown-date/filter-dropdown-date.component.ts
@@ -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) {
diff --git a/src-ui/src/app/components/filter-editor/filter-editor.component.ts b/src-ui/src/app/components/filter-editor/filter-editor.component.ts
index 05dd3a92a..3d006a76e 100644
--- a/src-ui/src/app/components/filter-editor/filter-editor.component.ts
+++ b/src-ui/src/app/components/filter-editor/filter-editor.component.ts
@@ -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';