|
|
|
@ -11,7 +11,7 @@ import { FormsModule } from '@angular/forms'; |
|
|
|
import { ActivatedRoute, Router, RouterLink, RouterLinkActive, RouterOutlet } from '@angular/router'; |
|
|
|
import { firstValueFrom, Observable, of } from 'rxjs'; |
|
|
|
import { tap } from 'rxjs/operators'; |
|
|
|
import { AnnotationCreate, AnnotationCreateAfterNavigate, AnnotationsSelected, AnnotationsSelectedAfterNavigate, ApiUrlConfig, AppLanguageDto, AppsState, AuthService, AutoSaveKey, AutoSaveService, CanComponentDeactivate, CollaborationService, CommentsState, ConfirmClickDirective, ContentDto, ContentsState, DialogService, DropdownMenuComponent, EditContentForm, LanguageSelectorComponent, LanguagesState, LayoutComponent, LocalStoreService, MessageBus, ModalDirective, ModalModel, ModalPlacementDirective, NotifoComponent, PreviousUrl, queryParam, ResolveAssets, ResolveContents, SchemaDto, SchemasState, Settings, ShortcutDirective, SidebarMenuDirective, TempService, TitleComponent, ToolbarComponent, ToolbarService, TooltipDirective, TourHintDirective, TourStepDirective, TranslatePipe, Types, Version, WatchingUsersComponent } from '@app/shared'; |
|
|
|
import { allParams, AnnotationCreate, AnnotationCreateAfterNavigate, AnnotationsSelected, AnnotationsSelectedAfterNavigate, ApiUrlConfig, AppLanguageDto, AppsState, AuthService, AutoSaveKey, AutoSaveService, CanComponentDeactivate, CollaborationService, CommentsState, ConfirmClickDirective, ContentDto, ContentsState, DialogService, DropdownMenuComponent, EditContentForm, LanguageSelectorComponent, LanguagesState, LayoutComponent, LocalStoreService, MessageBus, ModalDirective, ModalModel, ModalPlacementDirective, NotifoComponent, PreviousUrl, queryParam, ResolveAssets, ResolveContents, SchemaDto, SchemasState, Settings, ShortcutDirective, SidebarMenuDirective, 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'; |
|
|
|
@ -361,6 +361,12 @@ export class ContentPageComponent implements CanComponentDeactivate { |
|
|
|
return of(true); |
|
|
|
} |
|
|
|
|
|
|
|
const schemaName = allParams(this.route)['schemaName']; |
|
|
|
const schema = this.schema(); |
|
|
|
if (schemaName !== schema.name && schemaName !== schema.id) { |
|
|
|
return of(true); |
|
|
|
} |
|
|
|
|
|
|
|
return this.contentForm().hasChanged() ? |
|
|
|
this.dialogs.confirm('i18n:contents.pendingChangesTitle', text) : |
|
|
|
of(true); |
|
|
|
|