|
|
|
@ -5,13 +5,13 @@ |
|
|
|
* Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. |
|
|
|
*/ |
|
|
|
|
|
|
|
import { AsyncPipe, NgIf, NgSwitch, NgSwitchCase } from '@angular/common'; |
|
|
|
import { AsyncPipe, Location, NgIf, NgSwitch, NgSwitchCase } from '@angular/common'; |
|
|
|
import { Component, OnInit } from '@angular/core'; |
|
|
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms'; |
|
|
|
import { ActivatedRoute, Router, RouterLink, RouterLinkActive, RouterOutlet } from '@angular/router'; |
|
|
|
import { Observable, of } from 'rxjs'; |
|
|
|
import { filter, map, tap } from 'rxjs/operators'; |
|
|
|
import { AnnotationCreate, AnnotationCreateAfterNavigate, AnnotationsSelect, AnnotationsSelectAfterNavigate, ApiUrlConfig, AppLanguageDto, AppsState, AuthService, AutoSaveKey, AutoSaveService, CanComponentDeactivate, CollaborationService, CommentsState, ConfirmClickDirective, ContentDto, ContentsState, defined, DialogService, DropdownMenuComponent, EditContentForm, LanguageSelectorComponent, LanguagesState, LayoutComponent, LocalStoreService, MessageBus, ModalDirective, ModalModel, ModalPlacementDirective, NotifoComponent, ResolveAssets, ResolveContents, SchemaDto, SchemasState, Settings, ShortcutDirective, SidebarMenuDirective, Subscriptions, TempService, TitleComponent, ToolbarComponent, ToolbarService, TooltipDirective, TourHintDirective, TourStepDirective, TranslatePipe, Types, Version, WatchingUsersComponent } from '@app/shared'; |
|
|
|
import { AnnotationCreate, AnnotationCreateAfterNavigate, AnnotationsSelect, AnnotationsSelectAfterNavigate, ApiUrlConfig, AppLanguageDto, AppsState, AuthService, AutoSaveKey, AutoSaveService, CanComponentDeactivate, CollaborationService, CommentsState, ConfirmClickDirective, ContentDto, ContentsState, defined, DialogService, DropdownMenuComponent, EditContentForm, LanguageSelectorComponent, LanguagesState, LayoutComponent, LocalStoreService, MessageBus, ModalDirective, ModalModel, ModalPlacementDirective, NotifoComponent, PreviousUrl, ResolveAssets, ResolveContents, SchemaDto, SchemasState, Settings, ShortcutDirective, SidebarMenuDirective, Subscriptions, TempService, TitleComponent, ToolbarComponent, ToolbarService, TooltipDirective, TourHintDirective, TourStepDirective, TranslatePipe, Types, Version, WatchingUsersComponent } from '@app/shared'; |
|
|
|
import { ContentExtensionComponent } from '../../shared/content-extension.component'; |
|
|
|
import { PreviewButtonComponent } from '../../shared/preview-button.component'; |
|
|
|
import { ContentEditorComponent } from './editor/content-editor.component'; |
|
|
|
@ -97,6 +97,8 @@ export class ContentPageComponent implements CanComponentDeactivate, OnInit { |
|
|
|
private readonly messageBus: MessageBus, |
|
|
|
private readonly languagesState: LanguagesState, |
|
|
|
private readonly localStore: LocalStoreService, |
|
|
|
private readonly location: Location, |
|
|
|
private readonly previousUrl: PreviousUrl, |
|
|
|
private readonly route: ActivatedRoute, |
|
|
|
private readonly router: Router, |
|
|
|
private readonly schemasState: SchemasState, |
|
|
|
@ -290,7 +292,11 @@ export class ContentPageComponent implements CanComponentDeactivate, OnInit { |
|
|
|
} |
|
|
|
|
|
|
|
public back() { |
|
|
|
this.router.navigate([this.schema.name], { relativeTo: this.route.parent!.parent, replaceUrl: true }); |
|
|
|
if (this.previousUrl.pathStartsWith(`/app/${this.contentsState.appName}/content/${this.schema.name}`)) { |
|
|
|
this.location.back(); |
|
|
|
} else { |
|
|
|
this.router.navigate([this.schema.name], { relativeTo: this.route.parent!.parent, replaceUrl: true }); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public delete() { |
|
|
|
|