From 6b95589bc2c90ab9bffe893ff88f171e97bef736 Mon Sep 17 00:00:00 2001 From: Avd6977 Date: Wed, 26 Sep 2018 10:33:33 -0500 Subject: [PATCH 1/3] Fixing call into local store to use category name --- .../app/shared/components/schema-category.component.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Squidex/app/shared/components/schema-category.component.ts b/src/Squidex/app/shared/components/schema-category.component.ts index 8ab0803e4..4dff7c540 100644 --- a/src/Squidex/app/shared/components/schema-category.component.ts +++ b/src/Squidex/app/shared/components/schema-category.component.ts @@ -60,13 +60,13 @@ export class SchemaCategoryComponent implements OnInit, OnChanges { } public ngOnInit() { - this.isOpen = this.localStore.get(`schema-category.${name}`) !== 'false'; + this.isOpen = this.localStore.get(`schema-category.${this.name}`) !== 'false'; } public toggle() { this.isOpen = !this.isOpen; - this.localStore.set(`schema-category.${name}`, this.isOpen + ''); + this.localStore.set(`schema-category.${this.name}`, this.isOpen + ''); } public ngOnChanges(changes: SimpleChanges): void { @@ -97,4 +97,4 @@ export class SchemaCategoryComponent implements OnInit, OnChanges { public trackBySchema(index: number, schema: SchemaDto) { return schema.id; } -} \ No newline at end of file +} From fed23af89909efaef3c679a894bfe49a697788ca Mon Sep 17 00:00:00 2001 From: Avd6977 Date: Wed, 26 Sep 2018 10:42:19 -0500 Subject: [PATCH 2/3] Hide categories that return no results Hide categories that return no results and update the count of schemas found. --- .../app/shared/components/schema-category.component.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Squidex/app/shared/components/schema-category.component.html b/src/Squidex/app/shared/components/schema-category.component.html index 19faa1ec9..353ea9d0a 100644 --- a/src/Squidex/app/shared/components/schema-category.component.html +++ b/src/Squidex/app/shared/components/schema-category.component.html @@ -1,4 +1,4 @@ -
+
@@ -6,7 +6,7 @@ -

{{displayName}} ({{schemasForCategory.length}})

+

{{displayName}} ({{schemasFiltered.length}})

@@ -37,4 +37,4 @@ -
\ No newline at end of file +
From 89def2b319dc5427846f89ac546b6db1c96772b6 Mon Sep 17 00:00:00 2001 From: Avd6977 Date: Wed, 26 Sep 2018 10:55:02 -0500 Subject: [PATCH 3/3] Open categories when searching Open categories when searching so the user can see the results, but then return to the state when query is cleared. --- .../app/shared/components/schema-category.component.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Squidex/app/shared/components/schema-category.component.ts b/src/Squidex/app/shared/components/schema-category.component.ts index 4dff7c540..9d8ee6831 100644 --- a/src/Squidex/app/shared/components/schema-category.component.ts +++ b/src/Squidex/app/shared/components/schema-category.component.ts @@ -75,6 +75,12 @@ export class SchemaCategoryComponent implements OnInit, OnChanges { this.schemasForCategory = this.schemas.filter(x => this.isSameCategory(x)); this.schemasFiltered = this.schemasForCategory.filter(x => !query || x.name.indexOf(query) >= 0); + + if (query) { + this.isOpen = true; + } else { + this.isOpen = this.localStore.get(`schema-category.${this.name}`) !== 'false'; + } } if (changes['name']) {