Read more about filtering in the
Documentation.
diff --git a/src/Squidex/app/shared/components/search-form.component.ts b/src/Squidex/app/shared/components/search-form.component.ts
index 3865782e1..d62b3e57a 100644
--- a/src/Squidex/app/shared/components/search-form.component.ts
+++ b/src/Squidex/app/shared/components/search-form.component.ts
@@ -39,15 +39,6 @@ export class SearchFormComponent implements OnInit {
@Input()
public filter: FilterState;
- @Input()
- public statuses: [] = [];
-
- @Input()
- public status: string[];
-
- @Output()
- public statusChange = new EventEmitter<[]>();
-
@Input()
public schemaName = '';
diff --git a/src/Squidex/app/shared/services/contents.service.spec.ts b/src/Squidex/app/shared/services/contents.service.spec.ts
index 4cbe177c5..29e5d759a 100644
--- a/src/Squidex/app/shared/services/contents.service.spec.ts
+++ b/src/Squidex/app/shared/services/contents.service.spec.ts
@@ -47,11 +47,11 @@ describe('ContentsService', () => {
let contents: ContentsDto;
- contentsService.getContents('my-app', 'my-schema', 17, 13, undefined, undefined, ['Draft', 'Published']).subscribe(result => {
+ contentsService.getContents('my-app', 'my-schema', 17, 13, undefined, undefined).subscribe(result => {
contents = result;
});
- const req = httpMock.expectOne('http://service/p/api/content/my-app/my-schema?$top=17&$skip=13&status=Draft&status=Published');
+ const req = httpMock.expectOne('http://service/p/api/content/my-app/my-schema?$top=17&$skip=13');
expect(req.request.method).toEqual('GET');
expect(req.request.headers.get('If-Match')).toBeNull();
@@ -66,7 +66,7 @@ describe('ContentsService', () => {
});
expect(contents!).toEqual(
- new ContentsDto(['Draft', 'Published'], 10, [
+ new ContentsDto(10, [
createContent(12),
createContent(13)
]));
diff --git a/src/Squidex/app/shared/services/contents.service.ts b/src/Squidex/app/shared/services/contents.service.ts
index fae6b1927..082e81af2 100644
--- a/src/Squidex/app/shared/services/contents.service.ts
+++ b/src/Squidex/app/shared/services/contents.service.ts
@@ -35,15 +35,6 @@ export class ScheduleDto {
}
export class ContentsDto extends ResultSet
{
- constructor(
- public readonly statuses: string[],
- total: number,
- items: ContentDto[],
- links?: ResourceLinks
- ) {
- super(total, items, links);
- }
-
public get canCreate() {
return hasAnyLink(this._links, 'create');
}
@@ -98,7 +89,7 @@ export class ContentsService {
) {
}
- public getContents(appName: string, schemaName: string, take: number, skip: number, query?: string, ids?: string[], status?: string[]): Observable {
+ public getContents(appName: string, schemaName: string, take: number, skip: number, query?: string, ids?: string[]): Observable {
const queryParts: string[] = [];
if (query && query.length > 0) {
@@ -123,21 +114,15 @@ export class ContentsService {
queryParts.push(`ids=${ids.join(',')}`);
}
- if (status) {
- for (let s of status) {
- queryParts.push(`status=${s}`);
- }
- }
-
const fullQuery = queryParts.join('&');
const url = this.apiUrl.buildUrl(`/api/content/${appName}/${schemaName}?${fullQuery}`);
- return this.http.get<{ total: number, items: [], statuses: string[] } & Resource>(url).pipe(
- map(({ total, items, statuses, _links }) => {
+ return this.http.get<{ total: number, items: [] } & Resource>(url).pipe(
+ map(({ total, items, _links }) => {
const contents = items.map(x => parseContent(x));
- return new ContentsDto(statuses, total, contents, _links);
+ return new ContentsDto(total, contents, _links);
}),
pretifyError('Failed to load contents. Please reload.'));
}
diff --git a/src/Squidex/app/shared/state/contents.state.ts b/src/Squidex/app/shared/state/contents.state.ts
index 5fbf38412..99c7d4d6c 100644
--- a/src/Squidex/app/shared/state/contents.state.ts
+++ b/src/Squidex/app/shared/state/contents.state.ts
@@ -40,12 +40,6 @@ interface Snapshot {
// Indicates if the contents are loaded.
isLoaded?: boolean;
- // All statuses.
- statuses?: string[];
-
- // Indicates which status is shown.
- status?: string[];
-
// The selected content.
selectedContent?: ContentDto | null;
@@ -84,14 +78,6 @@ export abstract class ContentsStateBase extends State {
this.changes.pipe(map(x => !!x.isLoaded),
distinctUntilChanged());
- public status =
- this.changes.pipe(map(x => x.status),
- distinctUntilChanged());
-
- public statuses =
- this.changes.pipe(map(x => x.statuses),
- distinctUntilChanged());
-
public canCreateAny =
this.changes.pipe(map(x => !!x.canCreate || !!x.canCreateAndPublish),
distinctUntilChanged());
@@ -152,9 +138,8 @@ export abstract class ContentsStateBase extends State {
return this.contentsService.getContents(this.appName, this.schemaName,
this.snapshot.contentsPager.pageSize,
this.snapshot.contentsPager.skip,
- this.snapshot.contentsQuery, undefined,
- this.snapshot.status).pipe(
- tap(({ total, items, _links, statuses, canCreate, canCreateAndPublish }) => {
+ this.snapshot.contentsQuery, undefined).pipe(
+ tap(({ total, items, _links, canCreate, canCreateAndPublish }) => {
if (isReload) {
this.dialogs.notifyInfo('Contents reloaded.');
}
@@ -163,13 +148,6 @@ export abstract class ContentsStateBase extends State {
const contents = ImmutableArray.of(items);
const contentsPager = s.contentsPager.setCount(total);
- statuses = s.statuses || statuses;
-
- const status =
- s.statuses ?
- s.status :
- statuses;
-
let selectedContent = s.selectedContent;
if (selectedContent) {
@@ -182,8 +160,6 @@ export abstract class ContentsStateBase extends State {
contentsPager,
isLoaded: true,
selectedContent,
- status,
- statuses,
_links
};
});
@@ -305,19 +281,18 @@ export abstract class ContentsStateBase extends State {
if (!oldVersion || !oldVersion.eq(content.version)) {
return this.next(s => {
const contents = s.contents.replaceBy('id', content);
- const selectedContent = s.selectedContent && s.selectedContent.id === content.id ? content : s.selectedContent;
+
+ const selectedContent =
+ s.selectedContent &&
+ s.selectedContent.id === content.id ?
+ content :
+ s.selectedContent;
return { ...s, contents, selectedContent };
});
}
}
- public filterStatus(status: string[]): Observable {
- this.next(s => ({ ...s, contentsPager: new Pager(0), status }));
-
- return this.loadInternal();
- }
-
public search(contentsQuery?: string): Observable {
this.next(s => ({ ...s, contentsPager: new Pager(0), contentsQuery }));