Headless CMS and Content Managment Hub
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

46 lines
1.2 KiB

/*
* Squidex Headless CMS
*
* @license
* Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved.
*/
import { Component, OnInit } from '@angular/core';
import { FormControl } from '@angular/forms';
import { LocalStoreService, SchemaCategory, SchemasState } from '@app/shared';
@Component({
selector: 'sqx-schemas-page',
styleUrls: ['./schemas-page.component.scss'],
templateUrl: './schemas-page.component.html'
})
export class SchemasPageComponent implements OnInit {
public schemasFilter = new FormControl();
public isCollapsed: boolean;
public get width() {
return this.isCollapsed ? '4rem' : '16rem';
}
constructor(
public readonly schemasState: SchemasState,
private readonly localStore: LocalStoreService
) {
this.isCollapsed = localStore.getBoolean('content.schemas.collapsed');
}
public ngOnInit() {
this.schemasState.load();
}
public toggle() {
this.isCollapsed = !this.isCollapsed;
this.localStore.setBoolean('content.schemas.collapsed', this.isCollapsed);
}
public trackByCategory(_index: number, category: SchemaCategory) {
return category.name;
}
}