From d138af461dfe1ccb64af31d64c93dcd4e03184dd Mon Sep 17 00:00:00 2001 From: Lone Iversen <108085781+loivsen@users.noreply.github.com> Date: Fri, 18 Nov 2022 09:42:58 +0100 Subject: [PATCH] adjusted api calls --- .../views/section-view-examine-indexers.ts | 23 +++++++++++++------ .../views/section-view-examine-searchers.ts | 3 +-- .../src/core/mocks/data/examine.data.ts | 20 +++++++--------- .../domains/examine-management.handlers.ts | 11 +++------ 4 files changed, 28 insertions(+), 29 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/dashboards/examine-management/views/section-view-examine-indexers.ts b/src/Umbraco.Web.UI.Client/src/backoffice/dashboards/examine-management/views/section-view-examine-indexers.ts index 86a849176f..8044a9548c 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/dashboards/examine-management/views/section-view-examine-indexers.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/dashboards/examine-management/views/section-view-examine-indexers.ts @@ -179,13 +179,22 @@ export class UmbDashboardExamineIndexElement extends UmbContextConsumerMixin(Lit return html`

Lists the properties of the ${this._indexData.name}

- ${Object.entries(this._indexData).map((entry) => { - //TODO: This should be providerProperties showing up here - return html` - ${entry[0]} - ${JSON.stringify(entry[1]).replace(/,/g, ', ')} - `; - })} + + documentCount + ${this._indexData.documentCount} + + + fieldCount + ${this._indexData.fieldCount} + + ${this._indexData.providerProperties + ? Object.entries(this._indexData.providerProperties).map((entry) => { + return html` + ${entry[0]} + ${JSON.stringify(entry[1]).replace(/,/g, ', ')} + `; + }) + : ''}
`; } diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/dashboards/examine-management/views/section-view-examine-searchers.ts b/src/Umbraco.Web.UI.Client/src/backoffice/dashboards/examine-management/views/section-view-examine-searchers.ts index dc17f4a2ff..ed4a14035d 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/dashboards/examine-management/views/section-view-examine-searchers.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/dashboards/examine-management/views/section-view-examine-searchers.ts @@ -153,8 +153,7 @@ export class UmbDashboardExamineSearcherElement extends UmbContextConsumerMixin( take: 9999, skip: 0, }); - const pagedSearchResults = res.items as PagedSearchResult[]; - this._searchResults = pagedSearchResults[0].items; + this._searchResults = res.items as SearchResult[]; this._updateFieldFilter(); } catch (e) { if (e instanceof ApiError) { diff --git a/src/Umbraco.Web.UI.Client/src/core/mocks/data/examine.data.ts b/src/Umbraco.Web.UI.Client/src/core/mocks/data/examine.data.ts index 012d877932..66aae70e10 100644 --- a/src/Umbraco.Web.UI.Client/src/core/mocks/data/examine.data.ts +++ b/src/Umbraco.Web.UI.Client/src/core/mocks/data/examine.data.ts @@ -17,12 +17,12 @@ export const Indexers: Index[] = [ canRebuild: true, healthStatus: 'Healthy', isHealthy: true, - /* + documentCount: 0, + fieldCount: 0, providerProperties: { CommitCount: 0, DefaultAnalyzer: 'StandardAnalyzer', - DocumentCount: 0, - FieldCount: 0, + LuceneDirectory: 'SimpleFSDirectory', LuceneIndexFolder: '/ /umbraco /data /temp /examineindexes /externalindex', DirectoryFactory: @@ -30,19 +30,18 @@ export const Indexers: Index[] = [ EnableDefaultEventHandler: true, PublishedValuesOnly: true, SupportProtectedContent: false, - },*/ + }, }, { name: 'InternalIndex', canRebuild: true, healthStatus: 'Healthy', isHealthy: true, - /* + documentCount: 0, + fieldCount: 0, providerProperties: { CommitCount: 0, DefaultAnalyzer: 'CultureInvariantWhitespaceAnalyzer', - DocumentCount: 0, - FieldCount: 0, LuceneDirectory: 'SimpleFSDirectory', LuceneIndexFolder: '/ /umbraco /data /temp /examineindexes /internalindex', DirectoryFactory: @@ -52,29 +51,26 @@ export const Indexers: Index[] = [ SupportProtectedContent: true, IncludeFields: ['id', 'nodeName', 'updateDate', 'loginName', 'email', '__Key'], }, - */ }, { name: 'MemberIndex', canRebuild: true, healthStatus: 'Healthy', isHealthy: true, - /* + fieldCount: 0, + documentCount: 0, providerProperties: { CommitCount: 0, DefaultAnalyzer: 'CultureInvariantWhitespaceAnalyzer', DirectoryFactory: 'Umbraco.Cms.Infrastructure.Examine.ConfigurationEnabledDirectoryFactory, Umbraco.Examine.Lucene, Version=10.2.0.0, Culture=neutral, PublicKeyToken=null', - DocumentCount: 0, EnableDefaultEventHandler: true, - FieldCount: 0, IncludeFields: ['id', 'nodeName', 'updateDate', 'loginName', 'email', '__Key'], LuceneDirectory: 'SimpleFSDirectory', LuceneIndexFolder: '/ /umbraco /data /temp /examineindexes /membersindex', PublishedValuesOnly: false, SupportProtectedContent: false, }, - */ }, ]; diff --git a/src/Umbraco.Web.UI.Client/src/core/mocks/domains/examine-management.handlers.ts b/src/Umbraco.Web.UI.Client/src/core/mocks/domains/examine-management.handlers.ts index d72adddc6d..9138b6d894 100644 --- a/src/Umbraco.Web.UI.Client/src/core/mocks/domains/examine-management.handlers.ts +++ b/src/Umbraco.Web.UI.Client/src/core/mocks/domains/examine-management.handlers.ts @@ -2,7 +2,7 @@ import { rest } from 'msw'; import { searchResultMockData, getIndexByName, PagedIndexers } from '../data/examine.data'; import { umbracoPath } from '@umbraco-cms/utils'; -import { Index, PagedIndex, PagedPaged, PagedSearcher, SearchResult } from '@umbraco-cms/backend-api'; +import { Index, PagedIndex, PagedSearcher, PagedSearchResult, SearchResult } from '@umbraco-cms/backend-api'; export const handlers = [ rest.get(umbracoPath('/search/index'), (_req, res, ctx) => { @@ -64,14 +64,9 @@ export const handlers = [ if (searcherName) { return res( ctx.status(200), - ctx.json({ + ctx.json({ total: 0, - items: [ - { - total: 0, - items: searchResultMockData, - }, - ], + items: searchResultMockData, }) ); } else {