diff --git a/src/app/pages/submission/submission.page.ts b/src/app/pages/submission/submission.page.ts
index 9bab0be..fb058f0 100644
--- a/src/app/pages/submission/submission.page.ts
+++ b/src/app/pages/submission/submission.page.ts
@@ -5,6 +5,7 @@ import { FormBuilder, FormGroup, Validators, NgForm } from '@angular/forms';
import { COMMA, ENTER, SPACE } from '@angular/cdk/keycodes';
import { distinctUntilChanged, debounceTime } from 'rxjs/operators';
import { MatChipInputEvent } from '@angular/material/chips';
+import { SettingsService } from 'src/app/services/settings.service';
@Component({
selector: 'page-submission',
@@ -19,9 +20,11 @@ export class PageSubmission implements OnInit {
form: FormGroup;
readonly tagsSeparatorKeysCodes = [ ENTER, COMMA, SPACE ] as const;
tags: string[] = [];
+ settings: any;
@ViewChild('formDirective') private formDirective: NgForm;
constructor(private entriesService: EntriesService,
+ private settingsService: SettingsService,
private router: Router,
private formBuilder: FormBuilder) { }
@@ -33,6 +36,10 @@ export class PageSubmission implements OnInit {
text: [ '', Validators.nullValidator ],
});
+ this.settingsService.settings.subscribe((settings) => {
+ this.settings = settings;
+ });
+
this.form.get('entryType').setValue(this.entryType);
this.form.get('entryType').valueChanges.subscribe((value) => {
diff --git a/src/app/ui/entries/entries.ui.html b/src/app/ui/entries/entries.ui.html
index 0fa7041..f511598 100644
--- a/src/app/ui/entries/entries.ui.html
+++ b/src/app/ui/entries/entries.ui.html
@@ -25,7 +25,7 @@
filter_alt
-
+
;
boundTagspickerChange: Function;
- searchFormControl = new FormControl();
- readonly separatorKeysCodes = [ ENTER, COMMA, SPACE ] as const;
constructor(private tagsService: TagsService) { }
ngOnInit(): void {
this.checkFilterOpen();
this.boundTagspickerChange = this.tagspickerChange.bind(this);
- this.searchTags = this.searchFormControl
- .valueChanges
- .pipe(
- debounceTime(300),
- switchMap(value => this.tagsService.search(value))
- );
}
checkFilterOpen() {
@@ -54,7 +46,7 @@ export class UiEntries implements OnInit {
tagspickerChange(value: any) {
console.log("change", value);
- this.setFilter('tag', value);
+ this.setFilter('tag', value[0]);
}
setFilter(key: string, value) {
diff --git a/src/app/ui/tags/tagspicker.ui.html b/src/app/ui/tags/tagspicker.ui.html
index f8ddbcb..5970956 100644
--- a/src/app/ui/tags/tagspicker.ui.html
+++ b/src/app/ui/tags/tagspicker.ui.html
@@ -1,4 +1,4 @@
-
+
tag{{tag}}
@@ -6,9 +6,10 @@
cancel
-
+ 1" align="end">{{tags && tags.length || 0}}/{{max}}
diff --git a/src/app/ui/tags/tagspicker.ui.ts b/src/app/ui/tags/tagspicker.ui.ts
index 590e766..e5f27a9 100644
--- a/src/app/ui/tags/tagspicker.ui.ts
+++ b/src/app/ui/tags/tagspicker.ui.ts
@@ -18,7 +18,7 @@ export class UiTagsPicker implements OnInit {
@Input() change: Function;
@Input() model: any;
@Input() placeholder: string;
- @Input() singleton: boolean = false;
+ @Input() max: number = 0;
tags: string[] = [];
searchTags: Observable