Browse Source

Merge branch 'master' of github.com:Squidex/squidex

pull/350/head
Sebastian Stehle 7 years ago
parent
commit
1b16aeff55
  1. 2
      src/Squidex/app/features/schemas/pages/schemas/schemas-page.component.html
  2. 4
      src/Squidex/app/framework/angular/forms/tag-editor.component.ts
  3. 6
      src/Squidex/app/framework/utils/interpolator.spec.ts
  4. 2
      src/Squidex/app/framework/utils/interpolator.ts

2
src/Squidex/app/features/schemas/pages/schemas/schemas-page.component.html

@ -9,7 +9,7 @@
<sqx-shortcut keys="ctrl+shift+g" (trigger)="addSchemaDialog.show()"></sqx-shortcut>
<sqx-shortcut keys="ctrl+shift+f" (trigger)="inputFind.focus()"></sqx-shortcut>
<button type="button" class="btn btn-success subheader-button" (click)="createSchema()" title="New Schema (CTRL + SHIFT + G)">
<button type="button" class="btn btn-success subheader-button" (click)="createSchema()" title="New Schema (CTRL + SHIFT + G)" titlePosition="top-left">
<i class="icon-plus"></i>
</button>

4
src/Squidex/app/framework/angular/forms/tag-editor.component.ts

@ -152,7 +152,7 @@ export class TagEditorComponent extends StatefulControlComponent<State, any[]> i
this.resetSize();
}),
map(query => <string>query),
map(query => query ? query.trim() : query),
map(query => query ? query.trim().toLowerCase() : query),
tap(query => {
if (!query) {
this.resetAutocompletion();
@ -161,7 +161,7 @@ export class TagEditorComponent extends StatefulControlComponent<State, any[]> i
distinctUntilChanged(),
map(query => {
if (Types.isArray(this.suggestions) && query && query.length > 0) {
return this.suggestions.filter(s => s.indexOf(query) >= 0 && this.snapshot.items.indexOf(s) < 0);
return this.suggestions.filter(s => s.toLowerCase().indexOf(query) >= 0 && this.snapshot.items.indexOf(s) < 0);
} else {
return [];
}

6
src/Squidex/app/framework/utils/interpolator.spec.ts

@ -21,6 +21,12 @@ describe('interpolate', () => {
expect(result).toEqual('hello world');
});
it('should interpolate with multiple object values', () => {
const result = interpolate('hello ${string1}${string2}', { string1: 'world', string2: '!' });
expect(result).toEqual('hello world!');
});
it('should interpolate with array value', () => {
const result = interpolate('hello ${1}', ['my', 'world']);

2
src/Squidex/app/framework/utils/interpolator.ts

@ -8,7 +8,7 @@
import { DateTime } from './date-time';
import { Types } from './types';
const regex = /\${[^}]+}/;
const regex = /\${[^}]+}/g;
export function interpolate(pattern: string, value?: any, shortcut?: string, fallback = 'undefined'): string {
const result = pattern.replace(regex, (match: string) => {

Loading…
Cancel
Save