Skip to content

Commit

Permalink
[TASK] Improve UX and accessibility of "Indexing" submodules
Browse files Browse the repository at this point in the history
Several minor adjustments have been made to the submodules of the
“Indexing” backend module to improve the UX and accessibility.

This includes, among other things, the following:
* move action links to a dedicated control/button-group column
* use badges for label 'Not indexed'
* set unique h1 in all submodules
* use correct heading levels (h2/h3)
* show infobox when either no page has been selected or no results
  exists and unify locallang labels
* add label to back-button in statisticDetailsAction
* move back-button to docheader in wordDetailAction

Resolves: #103593
Releases: main
Change-Id: I078ba09de3c0a9e3ae000231c63b29bc203af8d1
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/83733
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: core-ci <typo3@b13.com>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
  • Loading branch information
minapok authored and georgringer committed Apr 17, 2024
1 parent b23029d commit 74c8d0e
Show file tree
Hide file tree
Showing 9 changed files with 353 additions and 265 deletions.
Expand Up @@ -37,7 +37,6 @@ public function checkExpectedTextOnIndexedSearchPages(ApplicationTester $I): voi
$I->switchToContentFrame();
$I->seeElement('.t3-js-jumpMenuBox');
$I->selectOption('.t3-js-jumpMenuBox', 'General statistics');
$I->see('Indexing Engine Statistics', '.t3js-module-body');
$I->see('General statistics', '.t3js-module-body');
$I->see('Row count by database table', '.t3js-module-body');
// Select only "Row count by database table"
Expand All @@ -47,16 +46,14 @@ public function checkExpectedTextOnIndexedSearchPages(ApplicationTester $I): voi
$I->assertIsNumeric($count);
}

$I->selectOption('.t3-js-jumpMenuBox', 'List: Pages');
$I->see('Indexing Engine Statistics', '.t3js-module-body');
$I->see('Pages', '.t3js-module-body');
$I->selectOption('.t3-js-jumpMenuBox', 'List of indexed pages');
$I->see('List of indexed pages', '.t3js-module-body');

$I->selectOption('.t3-js-jumpMenuBox', 'List: External documents');
$I->see('Indexing Engine Statistics', '.t3js-module-body');
$I->see('External documents', '.t3js-module-body');
$I->selectOption('.t3-js-jumpMenuBox', 'List of indexed external documents');
$I->see('List of indexed external documents', '.t3js-module-body');

$I->selectOption('.t3-js-jumpMenuBox', 'Detailed statistics');
$I->see('Indexing Engine Statistics', '.t3js-module-body');
$I->see('Please select a page from the page tree.', '.t3js-module-body');
$I->see('Detailed statistics', '.t3js-module-body');
$I->see('Please select a page in the page tree.', '.t3js-module-body');
}
}
Expand Up @@ -199,6 +199,7 @@ protected function pagesAction(): ResponseInterface
$view->assignMultiple([
'extensionConfiguration' => $this->indexerConfig,
'records' => $this->administrationRepository->getPageStatistic(),
'pageUid' => $this->pageUid,
]);
return $view->renderResponse('Administration/Pages');
}
Expand All @@ -212,6 +213,7 @@ protected function externalDocumentsAction(): ResponseInterface
$view->assignMultiple([
'extensionConfiguration' => $this->indexerConfig,
'records' => $this->administrationRepository->getExternalDocumentsStatistic(),
'pageUid' => $this->pageUid,
]);
return $view->renderResponse('Administration/ExternalDocuments');
}
Expand All @@ -228,7 +230,8 @@ protected function statisticDetailsAction(string $pageHash): ResponseInterface
$backButton = $buttonBar
->makeLinkButton()
->setTitle($this->getLanguageService()->sL('LLL:EXT:indexed_search/Resources/Private/Language/locallang.xlf:administration.back'))
->setIcon($this->iconFactory->getIcon('actions-view-go-up', IconSize::SMALL))
->setShowLabelText(true)
->setIcon($this->iconFactory->getIcon('actions-view-go-back', IconSize::SMALL))
->setHref($this->uriBuilder->reset()->uriFor('statistic', [], 'Administration'));
$buttonBar->addButton($backButton);

Expand Down Expand Up @@ -391,7 +394,7 @@ protected function saveStopwordsKeywordsAction(string $pageHash, int $pageId, ar
/**
* Statistics for a given word id
*/
protected function wordDetailAction(string $wordHash, string $pageHash): ResponseInterface
protected function wordDetailAction(string $wordHash, string $pageHash, string $wordTitle): ResponseInterface
{
$queryBuilder = $this->connectionPool->getQueryBuilderForTable('index_phash');
$rows = $queryBuilder
Expand All @@ -418,10 +421,22 @@ protected function wordDetailAction(string $wordHash, string $pageHash): Respons
->fetchAllAssociative();

$view = $this->initializeModuleTemplate($this->request);
$buttonBar = $view->getDocHeaderComponent()->getButtonBar();

// Set back button
$backButton = $buttonBar
->makeLinkButton()
->setTitle($this->getLanguageService()->sL('LLL:EXT:indexed_search/Resources/Private/Language/locallang.xlf:administration.back'))
->setShowLabelText(true)
->setIcon($this->iconFactory->getIcon('actions-view-go-back', IconSize::SMALL))
->setHref($this->uriBuilder->reset()->uriFor('statisticDetails', ['pageHash' => $pageHash], 'Administration'));
$buttonBar->addButton($backButton);

$view->assignMultiple([
'extensionConfiguration' => $this->indexerConfig,
'rows' => $rows,
'phash' => $pageHash,
'wordTitle' => $wordTitle,
]);
return $view->renderResponse('Administration/WordDetail');
}
Expand Down
Expand Up @@ -57,7 +57,6 @@
<source>Advanced search</source>
</trans-unit>


<trans-unit id="searchTypes.0" resname="searchTypes.0">
<source>Distinct word</source>
</trans-unit>
Expand Down Expand Up @@ -243,27 +242,48 @@
<trans-unit id="displayResults" resname="displayResults">
<source><![CDATA[Displaying results <strong>%1$s to %2$s</strong> out of <strong>%3$s</strong>]]></source>
</trans-unit>

<trans-unit id="administration.menu.general" resname="administration.menu.general">
<source>General statistics</source>
</trans-unit>
<trans-unit id="administration.menu.pages" resname="administration.menu.pages">
<source>List: Pages</source>
<source>List of indexed pages</source>
</trans-unit>
<trans-unit id="administration.menu.externalDocuments" resname="administration.menu.externalDocuments">
<source>List: External documents</source>
<source>List of indexed external documents</source>
</trans-unit>
<trans-unit id="administration.menu.searchStatistic" resname="administration.menu.searchStatistic">
<source>Search statistics</source>
</trans-unit>
<trans-unit id="administration.menu.statistic" resname="administration.menu.statistic">
<source>Detailed statistics</source>
</trans-unit>
<trans-unit id="administration.index.description" resname="administration.index.description">

<trans-unit id="administration.externalDocuments.headline" resname="administration.externalDocuments.headline">
<source>List of indexed external documents</source>
</trans-unit>
<trans-unit id="administration.index.headline" resname="administration.index.headline">
<source>General statistics</source>
</trans-unit>
<trans-unit id="administration.statistics" resname="administration.statistics">
<source>Indexing Engine Statistics</source>
<trans-unit id="administration.pages.headline" resname="administration.pages.headline">
<source>List of indexed pages</source>
</trans-unit>
<trans-unit id="administration.statistic.headline" resname="administration.statistic.headline">
<source>Detailed statistics</source>
</trans-unit>
<trans-unit id="administration.statisticDetails.headline" resname="administration.statisticDetails.headline">
<source>Details for a single result row</source>
</trans-unit>
<trans-unit id="administration.statisticDetails.headlineWithItemTitle" resname="administration.statisticDetails.headlineWithItemTitle">
<source>Details for single result row "%s"</source>
</trans-unit>
<trans-unit id="administration.wordDetail.headline" resname="administration.wordDetail.headline">
<source>Detail view of a single word</source>
</trans-unit>
<trans-unit id="administration.wordDetail.headlineWithWordTitle" resname="administration.wordDetail.headlineWithWordTitle">
<source>Detail view of single word "%s"</source>
</trans-unit>

<trans-unit id="administration.statistics.header" resname="administration.statistics.header">
<source>Row count by database table</source>
</trans-unit>
Expand Down Expand Up @@ -297,17 +317,8 @@
<trans-unit id="administration.statistics.mostSearched.last24hours" resname="administration.statistics.mostSearched.last24hours">
<source>Last 24 hours</source>
</trans-unit>
<trans-unit id="administration.statistics.noResult" resname="administration.statistics.noResult">
<source>No result found</source>
</trans-unit>
<trans-unit id="administration.statistics.noResultForPage" resname="administration.statistics.noResultForPage">
<source>No result for the selected page found.</source>
</trans-unit>
<trans-unit id="administration.statistics.selectPage" resname="administration.statistics.selectPage">
<source>Please select a page in the page tree.</source>
</trans-unit>
<trans-unit id="administration.external.title" resname="administration.external.title">
<source>External documents</source>
<trans-unit id="field.pageTitle" resname="field.pageTitle">
<source>Page title</source>
</trans-unit>
<trans-unit id="field.fileName" resname="field.fileName">
<source>Filename</source>
Expand Down Expand Up @@ -358,7 +369,7 @@
<source>Page Id</source>
</trans-unit>
<trans-unit id="field.uniqueId" resname="field.uniqueId">
<source>Unique Id</source>
<source>Uid</source>
</trans-unit>
<trans-unit id="field.type" resname="field.type">
<source>Type</source>
Expand All @@ -379,12 +390,9 @@
<source>Content</source>
</trans-unit>
<trans-unit id="administration.notIndexed" resname="administration.notIndexed">
<source>Not indexed?</source>
<source>Not indexed</source>
</trans-unit>

<trans-unit id="administration.document.description" resname="administration.document.description">
<source>Details for a single result row</source>
</trans-unit>
<trans-unit id="administration.document.words" resname="administration.document.words">
<source>All words found on page</source>
</trans-unit>
Expand All @@ -409,12 +417,6 @@
<trans-unit id="administration.stopWordsKeywords.save" resname="administration.stopWordsKeywords.save">
<source>Save keywords and stop words</source>
</trans-unit>
<trans-unit id="administration.word.description" resname="administration.word.description">
<source>Detail view of a single word</source>
</trans-unit>
<trans-unit id="administration.linkBack" resname="administration.linkBack">
<source>Back</source>
</trans-unit>
<trans-unit id="administration.statistics.sectionRecords" resname="administration.statistics.sectionRecords">
<source>Section records for this phash</source>
</trans-unit>
Expand All @@ -439,15 +441,27 @@
<trans-unit id="administration.back" resname="administration.back">
<source>Back</source>
</trans-unit>
<trans-unit id="administration.noPageSelected" resname="administration.noPageSelected">
<source>Please select a page from the page tree.</source>
</trans-unit>
<trans-unit id="administration.moduleFunctions.mode" resname="administration.moduleFunctions.mode">
<source>Mode</source>
</trans-unit>
<trans-unit id="administration.moduleFunctions.depth" resname="administration.moduleFunctions.depth">
<source>Depth</source>
</trans-unit>
<trans-unit id="administration.btn.info.title" resname="administration.btn.info.title">
<source>Display information</source>
</trans-unit>
<trans-unit id="administration.noPageSelected" resname="administration.noPageSelected">
<source>Please select a page in the page tree.</source>
</trans-unit>
<trans-unit id="administration.noRecords" resname="administration.noRecords">
<source>No records found.</source>
</trans-unit>
<trans-unit id="administration.noResult" resname="administration.noResult">
<source>No result found.</source>
</trans-unit>
<trans-unit id="administration.noResultForPage" resname="administration.noResultForPage">
<source>No result for the selected page found.</source>
</trans-unit>
<trans-unit id="error.noTypoScript" resname="error.noTypoScript">
<source>Error: Please check that TypoScript for the Indexed Search plugin is included.</source>
</trans-unit>
Expand Down
Expand Up @@ -7,70 +7,87 @@
<f:layout name="Module" />

<f:section name="Content">
<h1><f:translate key="administration.statistics" /></h1>
<h2><f:translate key="administration.external.title" /></h2>
<f:if condition="{records}">
<div class="table-fit">
<table class="table table-striped table-hover">
<thead>
<tr>
<th><f:translate key="field.fileName" /></th>
<th><f:translate key="field.fileSize" /></th>
<th><f:translate key="field.wordCount" /></th>
<th><f:translate key="field.mtime" /></th>
<th><f:translate key="field.indexed" /></th>
<th><f:translate key="field.updated" /></th>
<th><f:translate key="field.parseTime" /></th>
<th><f:translate key="field.groups" /></th>
<th><f:translate key="field.sub" /></th>
<th><f:translate key="field.staticPageArguments" /></th>
<th><f:translate key="field.pHash" /></th>
<th><f:translate key="field.path" /></th>
</tr>
</thead>
<tbody>
<f:for each="{records}" as="data">
<tr>
<td>
<f:format.crop maxCharacters="30">{data.item_title}</f:format.crop>
</td>
<td>
<f:format.bytes decimals="1">{data.item_size}</f:format.bytes>
</td>
<td>{data.numberOfWords}</td>
<td>
<is:format.dateTime>{data.item_mtime}</is:format.dateTime>
</td>
<td>
<is:format.dateTime>{data.crdate}</is:format.dateTime>
</td>
<td>
<f:if condition="{date.tstamp}=={date.crdate}">
<f:then></f:then>
<f:else>
<is:format.dateTime>{data.tstamp}</is:format.dateTime>
</f:else>
</f:if>
</td>
<td>{data.parsetime}</td>
<td>{data.numberOfSections}/{data.grList.0.pcount}/{data.numberOfFulltext}</td>
<td>{data.pcount}</td>
<td>
<f:if condition="{data.static_page_arguments}">
<f:for each="{data.static_page_arguments}" as="value" key="key">
{key}={value}<br>
</f:for>
</f:if>
</td>
<td>{data.phash}</td>
<td>
<f:format.crop maxCharacters="100">{data.data_filename}</f:format.crop>
</td>
</tr>
</f:for>
</tbody>
</table>
</div>
<h1><f:translate key="administration.externalDocuments.headline" /></h1>
<f:if condition="{pageUid}">
<f:then>
<f:if condition="{records}">
<f:then>
<div class="table-fit">
<table class="table table-striped table-hover">
<thead>
<tr>
<th><f:translate key="field.fileName" /></th>
<th><f:translate key="field.fileSize" /></th>
<th><f:translate key="field.wordCount" /></th>
<th><f:translate key="field.mtime" /></th>
<th><f:translate key="field.indexed" /></th>
<th><f:translate key="field.updated" /></th>
<th><f:translate key="field.parseTime" /></th>
<th><f:translate key="field.groups" /></th>
<th><f:translate key="field.sub" /></th>
<th><f:translate key="field.staticPageArguments" /></th>
<th><f:translate key="field.pHash" /></th>
<th><f:translate key="field.path" /></th>
</tr>
</thead>
<tbody>
<f:for each="{records}" as="data">
<tr>
<td>
<f:format.crop maxCharacters="30">{data.item_title}</f:format.crop>
</td>
<td>
<f:format.bytes decimals="1">{data.item_size}</f:format.bytes>
</td>
<td>{data.numberOfWords}</td>
<td>
<is:format.dateTime>{data.item_mtime}</is:format.dateTime>
</td>
<td>
<is:format.dateTime>{data.crdate}</is:format.dateTime>
</td>
<td>
<f:if condition="{date.tstamp}=={date.crdate}">
<f:then></f:then>
<f:else>
<is:format.dateTime>{data.tstamp}</is:format.dateTime>
</f:else>
</f:if>
</td>
<td>{data.parsetime}</td>
<td>{data.numberOfSections}/{data.grList.0.pcount}/{data.numberOfFulltext}</td>
<td>{data.pcount}</td>
<td>
<f:if condition="{data.static_page_arguments}">
<f:for each="{data.static_page_arguments}" as="value" key="key">
{key}={value}<br>
</f:for>
</f:if>
</td>
<td>{data.phash}</td>
<td>
<f:format.crop maxCharacters="100">{data.data_filename}</f:format.crop>
</td>
</tr>
</f:for>
</tbody>
</table>
</div>
</f:then>
<f:else>
<f:be.infobox
message="{f:translate(key:'LLL:EXT:indexed_search/Resources/Private/Language/locallang.xlf:administration.noRecords')}"
state="-2"
/>
</f:else>
</f:if>
</f:then>
<f:else>
<f:be.infobox
message="{f:translate(key:'LLL:EXT:indexed_search/Resources/Private/Language/locallang.xlf:administration.noPageSelected')}"
state="-1"
/>
</f:else>
</f:if>
</f:section>

Expand Down

0 comments on commit 74c8d0e

Please sign in to comment.