+
-
diff --git a/src/Squidex/app/shared/components/assets-selector.component.scss b/src/Squidex/app/shared/components/assets-selector.component.scss
index fbb752506..ba605503d 100644
--- a/src/Squidex/app/shared/components/assets-selector.component.scss
+++ b/src/Squidex/app/shared/components/assets-selector.component.scss
@@ -1,2 +1,20 @@
@import '_vars';
-@import '_mixins';
\ No newline at end of file
+@import '_mixins';
+
+:host /deep/ {
+ .search {
+ .form-control {
+ @include border-radius-right;
+ }
+
+ .tags {
+ @include border-radius-left;
+ border-right: 0;
+
+ &:focus,
+ &.focus {
+ z-index: 1000;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Squidex/app/shared/components/assets-selector.component.ts b/src/Squidex/app/shared/components/assets-selector.component.ts
index 0f9266273..4380f6358 100644
--- a/src/Squidex/app/shared/components/assets-selector.component.ts
+++ b/src/Squidex/app/shared/components/assets-selector.component.ts
@@ -56,6 +56,10 @@ export class AssetsSelectorComponent implements OnInit {
this.selected.emit(Object.values(this.selectedAssets));
}
+ public selectTags(tags: string[]) {
+ this.state.selectTags(tags).pipe(onErrorResumeNext()).subscribe();
+ }
+
public selectAsset(asset: AssetDto) {
if (this.selectedAssets[asset.id]) {
delete this.selectedAssets[asset.id];
diff --git a/src/Squidex/app/shared/components/search-form.component.ts b/src/Squidex/app/shared/components/search-form.component.ts
index 60432aa90..20529e113 100644
--- a/src/Squidex/app/shared/components/search-form.component.ts
+++ b/src/Squidex/app/shared/components/search-form.component.ts
@@ -82,7 +82,9 @@ export class SearchFormComponent implements OnChanges, OnInit {
}
public ngOnInit() {
- this.saveKey = this.queries.getSaveKey(this.contentsFilter.valueChanges);
+ if (this.queries) {
+ this.saveKey = this.queries.getSaveKey(this.contentsFilter.valueChanges);
+ }
}
public ngOnChanges() {
@@ -98,7 +100,9 @@ export class SearchFormComponent implements OnChanges, OnInit {
const value = this.saveQueryForm.submit();
if (value) {
- this.queries.add(value.name, this.contentsFilter.value);
+ if (this.queries) {
+ this.queries.add(value.name, this.contentsFilter.value);
+ }
this.saveQueryForm.submitCompleted();
}
diff --git a/src/Squidex/app/shared/state/assets.state.ts b/src/Squidex/app/shared/state/assets.state.ts
index 233010500..39f08819d 100644
--- a/src/Squidex/app/shared/state/assets.state.ts
+++ b/src/Squidex/app/shared/state/assets.state.ts
@@ -41,6 +41,10 @@ export class AssetsState extends State
{
this.tags.pipe(
distinctUntilChanged(), map(x => x.map(t => t.name)));
+ public selectedTagNames =
+ this.changes.pipe(
+ distinctUntilChanged(), map(x => Object.keys(x.tagsSelected)));
+
public assets =
this.changes.pipe(map(x => x.assets),
distinctUntilChanged());
@@ -165,6 +169,20 @@ export class AssetsState extends State {
return this.loadInternal();
}
+ public selectTags(tags: string[]): Observable {
+ this.next(s => {
+ const tagsSelected = {};
+
+ for (let tag of tags) {
+ tagsSelected[tag] = true;
+ }
+
+ return { ...s, assetsPager: new Pager(0, 0, 30), tagsSelected };
+ });
+
+ return this.loadInternal();
+ }
+
public resetTags(): Observable {
this.next(s => ({ ...s, assetsPager: new Pager(0, 0, 30), tagsSelected: {} }));