mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-12 17:04:46 +00:00
[ACS-9012] Truncate text in saved searches description (#4265)
* [ACS-9012] Truncate text in saved searches description * [ACS-9012] Truncate name column and navigation menu items * [ACS-9012] Unit test fixes
This commit is contained in:
parent
fe8d5039bc
commit
93157d2e60
@ -590,6 +590,14 @@
|
||||
"description": "Toggles resizable state of the column",
|
||||
"type": "boolean"
|
||||
},
|
||||
"draggable": {
|
||||
"description": "Toggles draggable state of the column",
|
||||
"type": "boolean"
|
||||
},
|
||||
"isHidden": {
|
||||
"description": "Toggles hidden state of the column",
|
||||
"type": "boolean"
|
||||
},
|
||||
"template": {
|
||||
"description": "Column template id",
|
||||
"type": "string"
|
||||
@ -597,6 +605,10 @@
|
||||
"desktopOnly": {
|
||||
"description": "Display column only for large screens",
|
||||
"type": "boolean"
|
||||
},
|
||||
"maxTextLength": {
|
||||
"description": "Maximum text length before truncation",
|
||||
"type": "number"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -51,7 +51,9 @@ describe('UniqueSearchNameValidator', () => {
|
||||
});
|
||||
|
||||
it('should return error when name is not unique', (done) => {
|
||||
validator.validate(new FormControl({ value: 'test', disabled: false })).subscribe((result) => {
|
||||
const form = new FormControl({ value: 'test', disabled: false });
|
||||
form.markAsDirty();
|
||||
validator.validate(form).subscribe((result) => {
|
||||
expect(result).toEqual({ message: 'APP.BROWSE.SEARCH.SAVE_SEARCH.SEARCH_NAME_NOT_UNIQUE_ERROR' });
|
||||
done();
|
||||
});
|
||||
|
@ -34,7 +34,9 @@ export class UniqueSearchNameValidator implements AsyncValidator {
|
||||
validate(control: AbstractControl): Observable<ValidationErrors | null> {
|
||||
return this.savedSearchesService.getSavedSearches().pipe(
|
||||
map((searches) =>
|
||||
searches.some((search) => search.name === control.value) ? { message: 'APP.BROWSE.SEARCH.SAVE_SEARCH.SEARCH_NAME_NOT_UNIQUE_ERROR' } : null
|
||||
searches.some((search) => search.name === control.value && control.dirty)
|
||||
? { message: 'APP.BROWSE.SEARCH.SAVE_SEARCH.SEARCH_NAME_NOT_UNIQUE_ERROR' }
|
||||
: null
|
||||
),
|
||||
catchError(() => of(null))
|
||||
);
|
||||
|
@ -30,7 +30,8 @@ export const savedSearchesListSchema = {
|
||||
title: 'APP.BROWSE.SEARCH.SAVE_SEARCH.LIST.NAME',
|
||||
class: 'adf-ellipsis-cell',
|
||||
sortable: false,
|
||||
draggable: false
|
||||
draggable: false,
|
||||
maxTextLength: 250
|
||||
},
|
||||
{
|
||||
type: 'text',
|
||||
@ -38,7 +39,8 @@ export const savedSearchesListSchema = {
|
||||
title: 'APP.BROWSE.SEARCH.SAVE_SEARCH.LIST.DESCRIPTION',
|
||||
class: 'adf-ellipsis-cell',
|
||||
sortable: false,
|
||||
draggable: false
|
||||
draggable: false,
|
||||
maxTextLength: 250
|
||||
}
|
||||
]
|
||||
};
|
||||
|
@ -67,6 +67,7 @@ describe('SaveSearchSidenavComponent', () => {
|
||||
id: 'manage-saved-searches',
|
||||
icon: '',
|
||||
title: 'APP.BROWSE.SEARCH.SAVE_SEARCH.NAVBAR.MANAGE_BUTTON',
|
||||
description: 'APP.BROWSE.SEARCH.SAVE_SEARCH.NAVBAR.MANAGE_BUTTON',
|
||||
route: 'saved-searches',
|
||||
url: 'saved-searches'
|
||||
}
|
||||
@ -84,6 +85,7 @@ describe('SaveSearchSidenavComponent', () => {
|
||||
expect(component.item.children[0]).toEqual({
|
||||
icon: '',
|
||||
title: '1',
|
||||
description: '1',
|
||||
route: 'search?q=abc',
|
||||
url: 'search?q=abc',
|
||||
id: 'search1'
|
||||
|
@ -69,6 +69,7 @@ export class SaveSearchSidenavComponent implements OnInit {
|
||||
id: 'search' + child.name,
|
||||
icon: '',
|
||||
title: child.name,
|
||||
description: child.name,
|
||||
route: `search?q=${child.encodedUrl}`,
|
||||
url: `search?q=${child.encodedUrl}`
|
||||
}))
|
||||
@ -78,6 +79,7 @@ export class SaveSearchSidenavComponent implements OnInit {
|
||||
id: this.manageSearchesId,
|
||||
icon: '',
|
||||
title: 'APP.BROWSE.SEARCH.SAVE_SEARCH.NAVBAR.MANAGE_BUTTON',
|
||||
description: 'APP.BROWSE.SEARCH.SAVE_SEARCH.NAVBAR.MANAGE_BUTTON',
|
||||
route: 'saved-searches',
|
||||
url: 'saved-searches'
|
||||
});
|
||||
|
@ -1,3 +1,5 @@
|
||||
@import '@alfresco/adf-core/lib/styles/mat-selectors';
|
||||
|
||||
.aca-sidenav {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
@ -108,6 +110,11 @@
|
||||
line-height: 32px;
|
||||
justify-content: start;
|
||||
|
||||
#{$mat-button-label} {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
&--active {
|
||||
color: var(--theme-sidenav-active-text-color);
|
||||
background: var(--theme-selected-background-color);
|
||||
|
Loading…
x
Reference in New Issue
Block a user