|
|
@ -48,6 +48,9 @@ export class ContentPageComponent extends ResourceOwner implements CanComponentD |
|
|
private isLoadingContent: boolean; |
|
|
private isLoadingContent: boolean; |
|
|
private autoSaveKey: AutoSaveKey; |
|
|
private autoSaveKey: AutoSaveKey; |
|
|
|
|
|
|
|
|
|
|
|
@ViewChild('dueTimeSelector', { static: false }) |
|
|
|
|
|
public dueTimeSelector: DueTimeSelectorComponent; |
|
|
|
|
|
|
|
|
public schema: SchemaDetailsDto; |
|
|
public schema: SchemaDetailsDto; |
|
|
|
|
|
|
|
|
public formContext: any; |
|
|
public formContext: any; |
|
|
@ -62,15 +65,8 @@ export class ContentPageComponent extends ResourceOwner implements CanComponentD |
|
|
public language: AppLanguageDto; |
|
|
public language: AppLanguageDto; |
|
|
public languages: ReadonlyArray<AppLanguageDto>; |
|
|
public languages: ReadonlyArray<AppLanguageDto>; |
|
|
|
|
|
|
|
|
public get hasContent() { |
|
|
|
|
|
return !!this.content; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public trackByFieldFn: (index: number, field: FieldDto) => any; |
|
|
public trackByFieldFn: (index: number, field: FieldDto) => any; |
|
|
|
|
|
|
|
|
@ViewChild('dueTimeSelector', { static: false }) |
|
|
|
|
|
public dueTimeSelector: DueTimeSelectorComponent; |
|
|
|
|
|
|
|
|
|
|
|
constructor(apiUrl: ApiUrlConfig, authService: AuthService, |
|
|
constructor(apiUrl: ApiUrlConfig, authService: AuthService, |
|
|
public readonly contentsState: ContentsState, |
|
|
public readonly contentsState: ContentsState, |
|
|
private readonly autoSaveService: AutoSaveService, |
|
|
private readonly autoSaveService: AutoSaveService, |
|
|
@ -237,14 +233,18 @@ export class ContentPageComponent extends ResourceOwner implements CanComponentD |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public discardChanges() { |
|
|
public discardChanges() { |
|
|
if (this.content) { |
|
|
const content = this.content; |
|
|
this.contentsState.discardDraft(this.content); |
|
|
|
|
|
|
|
|
if (content) { |
|
|
|
|
|
this.contentsState.discardDraft(content); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public delete() { |
|
|
public delete() { |
|
|
if (this.content) { |
|
|
const content = this.content; |
|
|
this.contentsState.deleteMany([this.content]).pipe(onErrorResumeNext()) |
|
|
|
|
|
|
|
|
if (content) { |
|
|
|
|
|
this.contentsState.deleteMany([content]).pipe(onErrorResumeNext()) |
|
|
.subscribe(() => { |
|
|
.subscribe(() => { |
|
|
this.back(); |
|
|
this.back(); |
|
|
}); |
|
|
}); |
|
|
|