Browse Source

Fixes (#1151)

pull/1153/head
Sebastian Stehle 1 year ago
committed by GitHub
parent
commit
adf0711bc2
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      frontend/src/app/features/content/pages/content/content-page.component.html
  2. 13
      frontend/src/app/features/content/shared/preview-button.component.ts
  3. 2
      frontend/src/app/framework/angular/forms/editors/autocomplete.component.html

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

@ -75,7 +75,7 @@
(languageChange)="changeLanguage($event)"
[languages]="languages"
[percents]="contentForm.translationStatus | async"></sqx-language-selector>
@if (content.canDelete) {
@if (content.canDelete && schema.type !== 'Singleton') {
<button
class="btn btn-outline-secondary ms-2"
#buttonOptions

13
frontend/src/app/features/content/shared/preview-button.component.ts

@ -6,7 +6,7 @@
*/
import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core';
import { ChangeDetectionStrategy, Component, Input, OnChanges } from '@angular/core';
import { Observable } from 'rxjs';
import { take } from 'rxjs/operators';
import { AuthService, ContentDto, DropdownMenuComponent, interpolate, LocalStoreService, ModalDirective, ModalModel, ModalPlacementDirective, SchemaDto, Settings, StatefulComponent, TranslatePipe } from '@app/shared';
@ -32,7 +32,7 @@ interface State {
TranslatePipe,
],
})
export class PreviewButtonComponent extends StatefulComponent<State> implements OnInit {
export class PreviewButtonComponent extends StatefulComponent<State> implements OnChanges {
@Input()
public confirm?: () => Observable<boolean>;
@ -51,7 +51,7 @@ export class PreviewButtonComponent extends StatefulComponent<State> implements
super({ previewNamesMore: [] });
}
public ngOnInit() {
public ngOnChanges() {
let selectedName = this.localStore.get(this.configKey());
if (!selectedName || !this.schema.previewUrls[selectedName]) {
@ -81,11 +81,10 @@ export class PreviewButtonComponent extends StatefulComponent<State> implements
}
private navigateTo(name: string) {
const vars = { ...this.content, ...this.authService.user || {} };
const urlVars = { ...this.content, ...this.authService.user || {} };
const urlLink = interpolate(this.schema.previewUrls[name], urlVars, 'iv');
const url = interpolate(this.schema.previewUrls[name], vars, 'iv');
window.open(url, '_blank');
window.open(urlLink, '_blank');
}
private selectUrl(selectedName: string) {

2
frontend/src/app/framework/angular/forms/editors/autocomplete.component.html

@ -1,5 +1,5 @@
<div class="control-container">
<div class="anchor invisible2" #anchor [class.cursor-size]="startCharacter" [class.full-size]="!startCharacter">
<div class="anchor invisible" #anchor [class.cursor-size]="startCharacter" [class.full-size]="!startCharacter">
<span class="form-control w-100">&nbsp;</span>
</div>

Loading…
Cancel
Save