mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
[ACA-19] Search libraries improvements (#792)
* [ACA-19][ACA-1967] set Libraries columns according to updated requirement * [ACA-19] search term length hint & singular result translation fixes also [ACA-1933]
This commit is contained in:
committed by
Denys Vuika
parent
4a420cc9f9
commit
aeb8ddd1f2
@@ -85,4 +85,10 @@ export class SearchInputControlComponent implements OnDestroy {
|
||||
this.searchTerm = '';
|
||||
this.searchChange.emit('');
|
||||
}
|
||||
|
||||
isTermTooShort() {
|
||||
const alphanumericTerm = this.searchTerm.replace(/[^0-9a-z]/gi, '');
|
||||
|
||||
return this.searchTerm.length && alphanumericTerm.length < 2;
|
||||
}
|
||||
}
|
||||
|
@@ -24,6 +24,8 @@
|
||||
(submit)="onSearchSubmit($event)"
|
||||
(searchChange)="onSearchChange($event)">
|
||||
</app-search-input-control>
|
||||
<mat-hint *ngIf="hasLibraryConstraint()" class="app-search-hint">{{ 'SEARCH.INPUT.HINT' | translate }}</mat-hint>
|
||||
|
||||
<div id="search-options">
|
||||
<mat-checkbox *ngFor="let option of searchOptions"
|
||||
id="{{ option.id }}"
|
||||
|
@@ -88,3 +88,9 @@ $top-margin: 12px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.app-search-hint {
|
||||
position: absolute;
|
||||
font-size: 12px;
|
||||
padding-left: 17px;
|
||||
}
|
||||
|
@@ -210,4 +210,11 @@ export class SearchInputComponent implements OnInit {
|
||||
isContentChecked(): boolean {
|
||||
return this.isFilesChecked() || this.isFoldersChecked();
|
||||
}
|
||||
|
||||
hasLibraryConstraint(): boolean {
|
||||
if (this.isLibrariesChecked()) {
|
||||
return this.searchInputControl.isTermTooShort();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@@ -21,7 +21,10 @@
|
||||
</mat-progress-bar>
|
||||
<div class="adf-search-results__content-header content" *ngIf="data?.list.entries.length">
|
||||
<div class="content__side--left">
|
||||
<div class="adf-search-results--info-text">{{ 'APP.BROWSE.SEARCH_LIBRARIES.FOUND_RESULTS' | translate: { number: totalResults } }}</div>
|
||||
<div class="adf-search-results--info-text"
|
||||
*ngIf="totalResults !== 1">{{ 'APP.BROWSE.SEARCH_LIBRARIES.FOUND_RESULTS' | translate: { number: totalResults } }}</div>
|
||||
<div class="adf-search-results--info-text"
|
||||
*ngIf="totalResults === 1">{{ 'APP.BROWSE.SEARCH_LIBRARIES.FOUND_ONE_RESULT' | translate: { number: totalResults } }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@@ -24,7 +24,10 @@
|
||||
</mat-progress-bar>
|
||||
<div class="adf-search-results__content-header content" *ngIf="data?.list.entries.length">
|
||||
<div class="content__side--left">
|
||||
<div class="adf-search-results--info-text">{{ 'APP.BROWSE.SEARCH.FOUND_RESULTS' | translate: { number: totalResults } }}</div>
|
||||
<div class="adf-search-results--info-text"
|
||||
*ngIf="totalResults !== 1">{{ 'APP.BROWSE.SEARCH.FOUND_RESULTS' | translate: { number: totalResults } }}</div>
|
||||
<div class="adf-search-results--info-text"
|
||||
*ngIf="totalResults === 1">{{ 'APP.BROWSE.SEARCH.FOUND_ONE_RESULT' | translate: { number: totalResults } }}</div>
|
||||
|
||||
<div class="adf-search-results__facets">
|
||||
<adf-search-chip-list [searchFilter]="searchFilter"></adf-search-chip-list>
|
||||
|
@@ -1272,9 +1272,9 @@
|
||||
"desktopOnly": false
|
||||
},
|
||||
{
|
||||
"id": "app.libraries.id",
|
||||
"key": "id",
|
||||
"title": "APP.DOCUMENT_LIST.COLUMNS.ID",
|
||||
"id": "app.libraries.role",
|
||||
"key": "role",
|
||||
"title": "APP.DOCUMENT_LIST.COLUMNS.ROLE",
|
||||
"type": "text",
|
||||
"sortable": true,
|
||||
"desktopOnly": true
|
||||
@@ -1287,14 +1287,6 @@
|
||||
"sortable": true,
|
||||
"template": "app.columns.libraryStatus",
|
||||
"desktopOnly": true
|
||||
},
|
||||
{
|
||||
"id": "app.libraries.role",
|
||||
"key": "role",
|
||||
"title": "APP.DOCUMENT_LIST.COLUMNS.ROLE",
|
||||
"type": "text",
|
||||
"sortable": true,
|
||||
"desktopOnly": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@@ -128,6 +128,7 @@
|
||||
"SEARCH": {
|
||||
"TITLE": "Search Results",
|
||||
"FOUND_RESULTS": "{{ number }} results found",
|
||||
"FOUND_ONE_RESULT": "{{ number }} result found",
|
||||
"CUSTOM_ROW": {
|
||||
"MODIFIED": "Modified",
|
||||
"LOCATION": "Location",
|
||||
@@ -137,7 +138,8 @@
|
||||
},
|
||||
"SEARCH_LIBRARIES": {
|
||||
"TITLE": "Libraries found...",
|
||||
"FOUND_RESULTS": "{{ number }} results"
|
||||
"FOUND_RESULTS": "{{ number }} results",
|
||||
"FOUND_ONE_RESULT": "{{ number }} result"
|
||||
}
|
||||
},
|
||||
"ACTIONS": {
|
||||
@@ -357,7 +359,8 @@
|
||||
"PLACEHOLDER": "Search everywhere",
|
||||
"FILES": "Files",
|
||||
"FOLDERS": "Folders",
|
||||
"LIBRARIES": "Libraries"
|
||||
"LIBRARIES": "Libraries",
|
||||
"HINT": "Query ‘term’ is too short. Must have at least 2 alphanumeric chars"
|
||||
},
|
||||
"SORT": {
|
||||
"RELEVANCE": "Relevance",
|
||||
|
Reference in New Issue
Block a user