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.
39 lines
1.0 KiB
39 lines
1.0 KiB
/*
|
|
* Squidex Headless CMS
|
|
*
|
|
* @license
|
|
* Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved.
|
|
*/
|
|
|
|
import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnChanges, Output } from '@angular/core';
|
|
|
|
import { ContentDto, HistoryEventDto } from '@app/shared';
|
|
|
|
@Component({
|
|
selector: 'sqx-content-event',
|
|
styleUrls: ['./content-event.component.scss'],
|
|
templateUrl: './content-event.component.html',
|
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
})
|
|
export class ContentEventComponent implements OnChanges {
|
|
@Output()
|
|
public dataLoad = new EventEmitter();
|
|
|
|
@Output()
|
|
public dataCompare = new EventEmitter();
|
|
|
|
@Input()
|
|
public event: HistoryEventDto;
|
|
|
|
@Input()
|
|
public content: ContentDto;
|
|
|
|
public canLoadOrCompare: boolean;
|
|
|
|
public ngOnChanges() {
|
|
this.canLoadOrCompare =
|
|
(this.event.eventType === 'ContentUpdatedEvent' ||
|
|
this.event.eventType === 'ContentCreatedEventV2') &&
|
|
!this.event.version.eq(this.content.version);
|
|
}
|
|
}
|