mirror of https://github.com/Squidex/squidex.git
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.
38 lines
1.1 KiB
38 lines
1.1 KiB
/*
|
|
* Squidex Headless CMS
|
|
*
|
|
* @license
|
|
* Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved.
|
|
*/
|
|
|
|
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
import { defined } from '@app/framework/internal';
|
|
import { ContentsState, SchemasState } from '@app/shared';
|
|
import { combineLatest } from 'rxjs';
|
|
import { map } from 'rxjs/operators';
|
|
|
|
@Component({
|
|
selector: 'sqx-sidebar-page',
|
|
styleUrls: ['./sidebar-page.component.scss'],
|
|
templateUrl: './sidebar-page.component.html',
|
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
})
|
|
export class SidebarPageComponent {
|
|
public url = combineLatest([
|
|
this.schemasState.selectedSchema.pipe(defined()),
|
|
this.contentsState.selectedContent
|
|
]).pipe(map(([schema, content]) => {
|
|
const url =
|
|
content ?
|
|
schema.properties.contentSidebarUrl :
|
|
schema.properties.contentsSidebarUrl;
|
|
|
|
return url;
|
|
}));
|
|
|
|
constructor(
|
|
public readonly contentsState: ContentsState,
|
|
public readonly schemasState: SchemasState
|
|
) {
|
|
}
|
|
}
|