Browse Source

Formatting fixes.

pull/462/head
Sebastian 6 years ago
parent
commit
637565a620
  1. 2
      frontend/app/features/content/pages/content/content-page.component.html
  2. 22
      frontend/app/features/content/pages/content/content-page.component.ts

2
frontend/app/features/content/pages/content/content-page.component.html

@ -1,7 +1,7 @@
<sqx-title [message]="schema.displayName"></sqx-title> <sqx-title [message]="schema.displayName"></sqx-title>
<form [formGroup]="contentForm.form" (ngSubmit)="saveAndPublish()"> <form [formGroup]="contentForm.form" (ngSubmit)="saveAndPublish()">
<sqx-panel desiredWidth="*" minWidth="60rem" [showSidebar]="hasContent" grid="true"> <sqx-panel desiredWidth="*" minWidth="60rem" [showSidebar]="!!content" grid="true">
<ng-container title> <ng-container title>
<a class="btn btn-text" (click)="back()" *ngIf="!schema.isSingleton"> <a class="btn btn-text" (click)="back()" *ngIf="!schema.isSingleton">
<i class="icon-angle-left"></i> <i class="icon-angle-left"></i>

22
frontend/app/features/content/pages/content/content-page.component.ts

@ -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();
}); });

Loading…
Cancel
Save