implements
}
private navigateTo(name: string) {
- const vars = { ...this.content };
-
- vars['accessToken'] = this.authService.user?.accessToken;
+ const vars = { ...this.content, ...this.authService.user || {} };
const url = interpolate(this.schema.previewUrls[name], vars, 'iv');
diff --git a/frontend/src/app/features/schemas/pages/schema/preview/schema-preview-urls-form.component.html b/frontend/src/app/features/schemas/pages/schema/preview/schema-preview-urls-form.component.html
index af868dd64..1d0cccf51 100644
--- a/frontend/src/app/features/schemas/pages/schema/preview/schema-preview-urls-form.component.html
+++ b/frontend/src/app/features/schemas/pages/schema/preview/schema-preview-urls-form.component.html
@@ -22,7 +22,7 @@
-
+
diff --git a/frontend/src/app/features/schemas/pages/schema/preview/schema-preview-urls-form.component.ts b/frontend/src/app/features/schemas/pages/schema/preview/schema-preview-urls-form.component.ts
index a503a6e6d..bd22988ba 100644
--- a/frontend/src/app/features/schemas/pages/schema/preview/schema-preview-urls-form.component.ts
+++ b/frontend/src/app/features/schemas/pages/schema/preview/schema-preview-urls-form.component.ts
@@ -5,27 +5,35 @@
* Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved.
*/
-import { Component, Input } from '@angular/core';
-import { ConfigurePreviewUrlsForm, SchemaDto, SchemasState } from '@app/shared';
+import { Component, Input, OnInit } from '@angular/core';
+import { EMPTY, Observable, shareReplay } from 'rxjs';
+import { ConfigurePreviewUrlsForm, SchemaCompletions, SchemaDto, SchemasService, SchemasState } from '@app/shared';
@Component({
selector: 'sqx-schema-preview-urls-form',
styleUrls: ['./schema-preview-urls-form.component.scss'],
templateUrl: './schema-preview-urls-form.component.html',
})
-export class SchemaPreviewUrlsFormComponent {
+export class SchemaPreviewUrlsFormComponent implements OnInit {
@Input()
public schema!: SchemaDto;
public editForm = new ConfigurePreviewUrlsForm();
+ public fieldCompletions: Observable = EMPTY;
+
public isEditable = false;
constructor(
private readonly schemasState: SchemasState,
+ private readonly schemasService: SchemasService,
) {
}
+ public ngOnInit() {
+ this.fieldCompletions = this.schemasService.getFieldRulesCompletion(this.schemasState.appName, this.schema.name).pipe(shareReplay(1));
+ }
+
public ngOnChanges() {
this.isEditable = this.schema.canUpdateUrls;
diff --git a/frontend/src/app/framework/angular/forms/editors/code-editor.component.scss b/frontend/src/app/framework/angular/forms/editors/code-editor.component.scss
index 2f40df19f..df485e537 100644
--- a/frontend/src/app/framework/angular/forms/editors/code-editor.component.scss
+++ b/frontend/src/app/framework/angular/forms/editors/code-editor.component.scss
@@ -33,6 +33,10 @@
background: $color-border !important;
}
+ .ace_bracket {
+ display: none;
+ }
+
.ace_scroller {
box-shadow: none !important;
}
diff --git a/frontend/src/app/shared/services/schemas.service.spec.ts b/frontend/src/app/shared/services/schemas.service.spec.ts
index 16ad0bb0b..98eecc9bb 100644
--- a/frontend/src/app/shared/services/schemas.service.spec.ts
+++ b/frontend/src/app/shared/services/schemas.service.spec.ts
@@ -629,6 +629,24 @@ describe('SchemasService', () => {
expect(completions!).toEqual([]);
}));
+ it('should make get request to get preview urls completions',
+ inject([SchemasService, HttpTestingController], (schemasService: SchemasService, httpMock: HttpTestingController) => {
+ let completions: SchemaCompletions;
+
+ schemasService.getPreviewUrlsCompletion('my-app', 'my-schema').subscribe(result => {
+ completions = result;
+ });
+
+ const req = httpMock.expectOne('http://service/p/api/apps/my-app/schemas/my-schema/completion/preview-urls');
+
+ expect(req.request.method).toEqual('GET');
+ expect(req.request.headers.get('If-Match')).toBeNull();
+
+ req.flush([]);
+
+ expect(completions!).toEqual([]);
+ }));
+
function schemaPropertiesResponse(id: number, suffix = '') {
const key = `${id}${suffix}`;
diff --git a/frontend/src/app/shared/services/schemas.service.ts b/frontend/src/app/shared/services/schemas.service.ts
index 049f972cf..e4917a7bf 100644
--- a/frontend/src/app/shared/services/schemas.service.ts
+++ b/frontend/src/app/shared/services/schemas.service.ts
@@ -764,6 +764,12 @@ export class SchemasService {
return this.http.get(url);
}
+ public getPreviewUrlsCompletion(appName: string, schemaName: string): Observable {
+ const url = this.apiUrl.buildUrl(`api/apps/${appName}/schemas/${schemaName}/completion/preview-urls`);
+
+ return this.http.get(url);
+ }
+
public getFilters(appName: string, schemaName: string): Observable {
const url = this.apiUrl.buildUrl(`api/apps/${appName}/schemas/${schemaName}/filters`);
diff --git a/frontend/src/app/theme/_bootstrap.scss b/frontend/src/app/theme/_bootstrap.scss
index 3e4d37134..a86ab2776 100644
--- a/frontend/src/app/theme/_bootstrap.scss
+++ b/frontend/src/app/theme/_bootstrap.scss
@@ -394,11 +394,10 @@ a {
}
&.active {
- & {
- background: none;
- border-color: $color-theme-brand;
- color: $color-theme-brand;
- }
+ background: none;
+ border-color: $color-theme-brand;
+ border-radius: $border-radius;
+ color: $color-theme-brand;
i {
color: $color-theme-brand;
@@ -415,6 +414,8 @@ a {
&:hover {
color: $color-theme-brand;
+ border-color: $color-border;
+ border-radius: $border-radius;
i {
color: $color-theme-brand;