diff --git a/src/Squidex/app/shared/components/schema-category.component.html b/src/Squidex/app/shared/components/schema-category.component.html index 3bf359965..406e91f13 100644 --- a/src/Squidex/app/shared/components/schema-category.component.html +++ b/src/Squidex/app/shared/components/schema-category.component.html @@ -8,7 +8,7 @@

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

- diff --git a/src/Squidex/app/shared/components/schema-category.component.ts b/src/Squidex/app/shared/components/schema-category.component.ts index bd6479e09..b5d714d9d 100644 --- a/src/Squidex/app/shared/components/schema-category.component.ts +++ b/src/Squidex/app/shared/components/schema-category.component.ts @@ -24,8 +24,6 @@ interface State { schemasFiltered: ImmutableArray; schemasForCategory: ImmutableArray; - isDeletable: boolean; - isOpen: boolean; } @@ -66,7 +64,6 @@ export class SchemaCategoryComponent extends StatefulComponent implements private readonly schemasState: SchemasState ) { super(changeDetector, { - isDeletable: true, schemasFiltered: ImmutableArray.empty(), schemasForCategory: ImmutableArray.empty(), isOpen: true @@ -107,15 +104,12 @@ export class SchemaCategoryComponent extends StatefulComponent implements if (changes['name']) { let displayName = 'Schemas'; - let isDeletable = true; if (this.name && this.name.length > 0) { displayName = this.name; - } else { - isDeletable = false; } - this.next(s => ({ ...s, isDeletable, displayName })); + this.next(s => ({ ...s, displayName })); } } diff --git a/src/Squidex/app/shared/state/schemas.state.ts b/src/Squidex/app/shared/state/schemas.state.ts index f26604e47..3cdc39c85 100644 --- a/src/Squidex/app/shared/state/schemas.state.ts +++ b/src/Squidex/app/shared/state/schemas.state.ts @@ -140,7 +140,9 @@ export class SchemasState extends State { this.next(s => { const schemas = s.schemas.push(created).sortByStringAsc(x => x.displayName); - return { ...s, schemas }; + const categories = buildCategories(s.categories, schemas); + + return { ...s, schemas, categories }; }); }), shareSubscribed(this.dialogs, { silent: true })); @@ -343,8 +345,6 @@ function buildCategories(categories: { [name: string]: boolean }, schemas?: Sche } } - categories[''] = true; - return categories; }