[ACA-4487] support search forms layout (#2195)

* [ACA-4487] support search chips -initial commit

* * update adf, fixed comments and e2e

* * update context menu test

* * update tool bar test

* * remove await expect

* * add e2e back
This commit is contained in:
Dharan 2021-06-27 16:25:28 +05:30 committed by GitHub
parent 35d6fb7b5c
commit 8a54b113a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
50 changed files with 423 additions and 588 deletions

View File

@ -118,9 +118,6 @@ Below is the list of public actions types you can use in the plugin definitions
| 1.7.0 | FULLSCREEN_VIEWER | n/a | Enters fullscreen mode to view the file opened in the Viewer. |
| 1.7.0 | LOGOUT | n/a | Log out and redirect to Login screen. |
| 1.7.0 | RELOAD_DOCUMENT_LIST | n/a | Reload active document list |
| 1.7.0 | TOGGLE_SEARCH_FILTER | n/a | Toggle Filter component visibility in Search Results. |
| 1.7.0 | SHOW_SEARCH_FILTER | n/a | Show Filter component in Search Results. |
| 1.7.0 | HIDE_SEARCH_FILTER | n/a | Hide Filter component in Search Results |
| 1.8.0 | VIEW_NODE | NodeId<`string`> , [ViewNodeExtras](../features/file-viewer.md#details)<`any`> | Lightweight preview of a node by id. Can be invoked from extensions. For details also see [File Viewer](../features/file-viewer.md#details) |
| 1.8.0 | CLOSE_PREVIEW | n/a | Closes the viewer ( preview of the item ) |
| 1.9.0 | RESET_SELECTION | n/a | Resets active document list selection |

View File

@ -119,9 +119,6 @@ export class MyService {
| 1.7.0 | FULLSCREEN_VIEWER | n/a | ビューアで開いたファイルを表示するために、フルスクリーンモードを開始します。 |
| 1.7.0 | LOGOUT | n/a | ログアウトして、ログイン画面にリダイレクトします。 |
| 1.7.0 | RELOAD_DOCUMENT_LIST | n/a | アクティブなドキュメントリストを再読み込みします。 |
| 1.7.0 | TOGGLE_SEARCH_FILTER | n/a | 検索結果のフィルターコンポーネントの表示を切り替えます。 |
| 1.7.0 | SHOW_SEARCH_FILTER | n/a | 検索結果にフィルターコンポーネントを表示します。 |
| 1.7.0 | HIDE_SEARCH_FILTER | n/a | 検索結果でフィルターコンポーネントを非表示にします |
| 1.8.0 | VIEW_NODE | string | ID によるノードの軽量プレビュー。拡張機能から呼び出すことができます。 |
| 1.8.0 | CLOSE_PREVIEW | n/a | ビューア (アイテムのプレビュー) を閉じます。 |
| 1.9.0 | RESET_SELECTION | n/a | アクティブなドキュメントリストの選択をリセットします |

View File

@ -262,18 +262,6 @@
}
],
"toolbar": [
{
"id": "app.toolbar.searchFilter",
"order": 50,
"title": "APP.BROWSE.SEARCH.TOGGLE_SEARCH_FILTER",
"icon": "view_list",
"actions": {
"click": "TOGGLE_SEARCH_FILTER"
},
"rules": {
"visible": "app.navigation.isSearchResults"
}
},
{
"id": "app.toolbar.share",
"type": "custom",

View File

@ -262,18 +262,6 @@
}
],
"toolbar": [
{
"id": "app.toolbar.searchFilter",
"order": 50,
"title": "APP.BROWSE.SEARCH.TOGGLE_SEARCH_FILTER",
"icon": "view_list",
"actions": {
"click": "TOGGLE_SEARCH_FILTER"
},
"rules": {
"visible": "app.navigation.isSearchResults"
}
},
{
"id": "app.toolbar.share",
"type": "custom",

View File

@ -289,18 +289,6 @@
}
],
"toolbar": [
{
"id": "app.toolbar.searchFilter",
"order": 50,
"title": "APP.BROWSE.SEARCH.TOGGLE_SEARCH_FILTER",
"icon": "view_list",
"actions": {
"click": "TOGGLE_SEARCH_FILTER"
},
"rules": {
"visible": "app.navigation.isSearchResults"
}
},
{
"id": "app.toolbar.share",
"type": "custom",

View File

@ -262,18 +262,6 @@
}
],
"toolbar": [
{
"id": "app.toolbar.searchFilter",
"order": 50,
"title": "APP.BROWSE.SEARCH.TOGGLE_SEARCH_FILTER",
"icon": "view_list",
"actions": {
"click": "TOGGLE_SEARCH_FILTER"
},
"rules": {
"visible": "app.navigation.isSearchResults"
}
},
{
"id": "app.toolbar.share",
"type": "custom",

View File

@ -262,18 +262,6 @@
}
],
"toolbar": [
{
"id": "app.toolbar.searchFilter",
"order": 50,
"title": "APP.BROWSE.SEARCH.TOGGLE_SEARCH_FILTER",
"icon": "view_list",
"actions": {
"click": "TOGGLE_SEARCH_FILTER"
},
"rules": {
"visible": "app.navigation.isSearchResults"
}
},
{
"id": "app.toolbar.share",
"type": "custom",

View File

@ -262,18 +262,6 @@
}
],
"toolbar": [
{
"id": "app.toolbar.searchFilter",
"order": 50,
"title": "APP.BROWSE.SEARCH.TOGGLE_SEARCH_FILTER",
"icon": "view_list",
"actions": {
"click": "TOGGLE_SEARCH_FILTER"
},
"rules": {
"visible": "app.navigation.isSearchResults"
}
},
{
"id": "app.toolbar.share",
"type": "custom",

View File

@ -262,18 +262,6 @@
}
],
"toolbar": [
{
"id": "app.toolbar.searchFilter",
"order": 50,
"title": "APP.BROWSE.SEARCH.TOGGLE_SEARCH_FILTER",
"icon": "view_list",
"actions": {
"click": "TOGGLE_SEARCH_FILTER"
},
"rules": {
"visible": "app.navigation.isSearchResults"
}
},
{
"id": "app.toolbar.share",
"type": "custom",

View File

@ -155,7 +155,7 @@ describe('Generic tests : ', () => {
await searchInput.clickSearchButton();
await searchInput.searchFor('*');
expect(await toolbar.getButtons()).toEqual(['Toggle search filter']);
expect(await toolbar.isEmpty()).toEqual(true);
});
});

View File

@ -382,8 +382,8 @@ const searchDocxContextMenu = [
'Edit Aspects',
'Permissions'
];
const searchToolbarPrimary = ['Toggle search filter', 'Share', 'Download', 'View', 'View Details', 'More Actions'];
const searchSharedToolbarPrimary = ['Toggle search filter', 'Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions'];
const searchToolbarPrimary = ['Share', 'Download', 'View', 'View Details', 'More Actions'];
const searchSharedToolbarPrimary = ['Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions'];
const searchFavLockedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions'];
const searchSharedFavLockedContextMenu = [
'Shared Link Settings',
@ -818,7 +818,7 @@ const favoritesFolderFavContextMenu = ['Download', 'Edit', 'Remove Favorite', 'M
const favoritesFolderFavToolbarMore = ['Edit', 'Remove Favorite', 'Move', 'Copy', 'Delete'];
const searchFolderContextMenu = ['Download', 'Edit', 'Favorite', 'Copy', 'Edit Aspects', 'Permissions'];
const searchFolderToolbarPrimary = ['Toggle search filter', 'Download', 'View Details', 'More Actions'];
const searchFolderToolbarPrimary = ['Download', 'View Details', 'More Actions'];
const searchFolderToolbarMore = ['Edit', 'Favorite', 'Copy', 'Edit Aspects', 'Permissions'];
const searchFolderFavContextMenu = ['Download', 'Edit', 'Remove Favorite', 'Copy', 'Edit Aspects', 'Permissions'];
const searchFolderFavToolbarMore = ['Edit', 'Remove Favorite', 'Copy', 'Edit Aspects', 'Permissions'];
@ -887,7 +887,7 @@ const favoritesMultipleSelAllFavToolbarMore = ['Remove Favorite', 'Move', 'Copy'
const searchMultipleSelContextMenu = ['Download', 'Favorite', 'Copy', 'Permissions'];
// TODO: raise issue to remove 'Permissions'
const searchMultipleSelAllFavContextMenu = ['Download', 'Remove Favorite', 'Copy', 'Permissions'];
const searchMultipleSelToolbarPrimary = ['Toggle search filter', 'Download', 'View Details', 'More Actions'];
const searchMultipleSelToolbarPrimary = ['Download', 'View Details', 'More Actions'];
// TODO: raise issue to remove 'Permissions'
const searchMultipleSelToolbarMore = ['Favorite', 'Copy', 'Permissions'];
// TODO: raise issue to remove 'Permissions'

View File

@ -36,9 +36,9 @@ const memberNotFavContextMenu = ['Leave Library', 'Delete', 'Favorite'];
const memberToolbarPrimary = ['Leave Library', 'View Details', 'More Actions'];
const favToolbarMore = ['Delete', 'Remove Favorite'];
const notFavToolbarMore = ['Delete', 'Favorite'];
const searchMemberToolbarPrimary = ['Toggle search filter', 'Leave Library', 'View Details', 'More Actions'];
const searchReqJoinToolbarPrimary = ['Toggle search filter', 'Cancel Join Request', 'More Actions'];
const searchNotMemberToolbarPrimary = ['Toggle search filter', 'Join', 'More Actions'];
const searchMemberToolbarPrimary = ['Leave Library', 'View Details', 'More Actions'];
const searchReqJoinToolbarPrimary = ['Cancel Join Request', 'More Actions'];
const searchNotMemberToolbarPrimary = ['Join', 'More Actions'];
const reqJoinToolbarMore = ['Cancel Join Request', 'More Actions'];
const notMemberFavContextMenu = ['Join', 'Delete', 'Remove Favorite'];
const notMemberNotFavContextMenu = ['Join', 'Delete', 'Favorite'];

View File

@ -77,7 +77,7 @@ export function collaboratorTests(siteName?: string) {
await searchInput.clickSearchButton();
await searchInput.searchFor(testData.fileSharedFav.name);
const expectedToolbarPrimary = ['Toggle search filter', 'Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions'];
const expectedToolbarPrimary = ['Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions'];
const expectedToolbarMore = ['Edit Offline', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Edit Aspects', 'Permissions'];
await testUtil.checkToolbarActions(testData.fileSharedFav.name, expectedToolbarPrimary, expectedToolbarMore);
@ -208,7 +208,7 @@ export function filesLockedByCurrentUser(siteName?: string) {
await searchInput.searchFor(testData.fileLockedByUser);
await searchResultsPage.waitForResults();
const expectedToolbarPrimary = ['Toggle search filter', 'Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions'];
const expectedToolbarPrimary = ['Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions'];
const expectedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions'];
await testUtil.checkToolbarActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);
@ -314,7 +314,7 @@ export function filesLockedByOtherUser(siteName?: string) {
await searchInput.searchFor(testData.fileLockedByUser);
await searchResultsPage.waitForResults();
const expectedToolbarPrimary = ['Toggle search filter', 'Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions'];
const expectedToolbarPrimary = ['Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions'];
const expectedToolbarMore = ['Cancel Editing', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions'];
await testUtil.checkToolbarActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore);

View File

@ -37,8 +37,8 @@ const consumerSharedFavContextMenu = ['Shared Link Settings', 'Download', 'View'
const consumerToolbarPrimary = ['Share', 'Download', 'View', 'View Details', 'More Actions'];
const consumerSharedToolbarPrimary = ['Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions'];
const searchConsumerToolbarPrimary = ['Toggle search filter', 'Share', 'Download', 'View', 'View Details', 'More Actions'];
const searchConsumerSharedToolbarPrimary = ['Toggle search filter', 'Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions'];
const searchConsumerToolbarPrimary = ['Share', 'Download', 'View', 'View Details', 'More Actions'];
const searchConsumerSharedToolbarPrimary = ['Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions'];
const consumerToolbarMore = ['Favorite', 'Copy', 'Manage Versions'];
const consumerFavToolbarMore = ['Remove Favorite', 'Copy', 'Manage Versions'];
@ -323,7 +323,7 @@ export const fileLockedByUser = `file-${random}-my-locked.txt`;
const consumerFolderContextMenu = ['Download', 'Favorite', 'Copy'];
const consumerFolderToolbarPrimary = ['Download', 'View Details', 'More Actions'];
const consumerFolderToolbarMore = ['Favorite', 'Copy'];
const searchConsumerFolderToolbarPrimary = ['Toggle search filter', 'Download', 'View Details', 'More Actions'];
const searchConsumerFolderToolbarPrimary = ['Download', 'View Details', 'More Actions'];
const consumerFolderFavContextMenu = ['Download', 'Remove Favorite', 'Copy'];
const consumerFolderFavToolbarMore = ['Remove Favorite', 'Copy'];
@ -369,7 +369,7 @@ const multipleSelAllFavContextMenu = ['Download', 'Remove Favorite', 'Copy'];
const multipleSelToolbarPrimary = ['Download', 'View Details', 'More Actions'];
const multipleSelToolbarMore = ['Favorite', 'Copy'];
const multipleSelAllFavToolbarMore = ['Remove Favorite', 'Copy'];
const searchMultipleSelToolbarPrimary = ['Toggle search filter', 'Download', 'View Details', 'More Actions'];
const searchMultipleSelToolbarPrimary = ['Download', 'View Details', 'More Actions'];
// ---- FAVORITES workarounds ----

View File

@ -23,13 +23,12 @@
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
import { AdminActions, LoginPage, BrowsingPage, SearchResultsPage, Utils } from '@alfresco/aca-testing-shared';
import { AdminActions, BrowsingPage, LoginPage, Utils } from '@alfresco/aca-testing-shared';
describe('Empty list views', () => {
const username = `user-${Utils.random()}`;
const loginPage = new LoginPage();
const page = new BrowsingPage();
const searchResultsPage = new SearchResultsPage();
const { dataTable, pagination } = page;
const { searchInput } = page.header;
const adminApiActions = new AdminActions();
@ -150,15 +149,6 @@ describe('Empty list views', () => {
expect(await pagination.isNextButtonPresent()).toBe(false, 'Next button is present');
});
it('[C279189] Search filters panel is displayed on empty Search Results page', async () => {
await searchInput.clickSearchButton();
/* cspell:disable-next-line */
await searchInput.searchFor('qwertyuiop');
await dataTable.waitForBody();
expect(await searchResultsPage.filters.isSearchFiltersPanelDisplayed()).toBe(true, 'Search filters panel is not present');
});
it('[C290020] Empty Search results - Libraries', async () => {
await searchInput.clickSearchButton();
await searchInput.checkLibraries();

View File

@ -111,13 +111,13 @@ describe('Search filters', () => {
});
it('[C279186] Filters are displayed', async () => {
expect(await sizeFilter.isPanelDisplayed()).toBe(true, 'Size filter panel not displayed');
expect(await createdDateFilter.isPanelDisplayed()).toBe(true, 'Created date filter panel not displayed');
expect(await fileTypeFilter.isPanelDisplayed()).toBe(true, 'File type filter panel not displayed');
expect(await creatorFilter.isPanelDisplayed()).toBe(true, 'Creator filter panel not displayed');
expect(await modifierFilter.isPanelDisplayed()).toBe(true, 'Modifier filter panel not displayed');
expect(await locationFilter.isPanelDisplayed()).toBe(true, 'Location filter panel not displayed');
expect(await modifiedDateFilter.isPanelDisplayed()).toBe(true, 'Modified date filter panel not displayed');
expect(await sizeFilter.isDisplayed()).toBe(true, 'Size filter panel not displayed');
expect(await createdDateFilter.isDisplayed()).toBe(true, 'Created date filter panel not displayed');
expect(await fileTypeFilter.isDisplayed()).toBe(true, 'File type filter panel not displayed');
expect(await creatorFilter.isDisplayed()).toBe(true, 'Creator filter panel not displayed');
expect(await modifierFilter.isDisplayed()).toBe(true, 'Modifier filter panel not displayed');
expect(await locationFilter.isDisplayed()).toBe(true, 'Location filter panel not displayed');
expect(await modifiedDateFilter.isDisplayed()).toBe(true, 'Modified date filter panel not displayed');
});
describe('Filter by Size', () => {
@ -127,51 +127,59 @@ describe('Search filters', () => {
});
it('[C279197] Expand / Collapse the Size filter panel', async () => {
expect(await sizeFilter.isPanelExpanded()).toBe(false, 'Size filter panel is expanded');
expect(await sizeFilter.isDialogPresent()).toBe(false, 'Size filter panel is expanded');
await sizeFilter.expandPanel();
expect(await sizeFilter.isPanelExpanded()).toBe(true, 'Size filter panel not expanded');
await sizeFilter.openDialog();
expect(await sizeFilter.isDialogPresent()).toBe(true, 'Size filter panel not expanded');
const expectedSizes = ['Small', 'Medium', 'Large', 'Huge'];
expect(await sizeFilter.getFiltersValues()).toEqual(expectedSizes, 'Incorrect Size filters facets');
expect(await sizeFilter.isClearButtonEnabled()).toBe(true, 'Size filter Clear button not enabled');
await sizeFilter.collapsePanel();
expect(await sizeFilter.isPanelExpanded()).toBe(false, 'Size filter panel is expanded');
await sizeFilter.closeDialog();
expect(await sizeFilter.isDialogPresent()).toBe(false, 'Size filter panel is expanded');
});
it('[C279199] Filter by Small', async () => {
await sizeFilter.expandPanel();
await sizeFilter.openDialog();
await sizeFilter.checkSizeSmall();
await sizeFilter.clickApplyButton();
expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, `${fileJpgUser1.name} not in the list`);
expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(true, `${filePdfUser2.name} not in the list`);
});
it('[C279202] Filter by Huge', async () => {
await sizeFilter.expandPanel();
await sizeFilter.openDialog();
await sizeFilter.checkSizeHuge();
await sizeFilter.clickApplyButton();
expect(await dataTable.isEmpty()).toBe(true, 'list is not empty');
});
it('[C279203] Filter by multiple size categories', async () => {
await sizeFilter.expandPanel();
await sizeFilter.openDialog();
await sizeFilter.checkSizeSmall();
await sizeFilter.checkSizeMedium();
await sizeFilter.checkSizeLarge();
await sizeFilter.clickApplyButton();
expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, `${fileJpgUser1.name} not in the list`);
expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(true, `${filePdfUser2.name} not in the list`);
});
it('[C279198] Clear the Size filter options', async () => {
await sizeFilter.expandPanel();
await sizeFilter.openDialog();
await sizeFilter.checkSizeSmall();
await sizeFilter.checkSizeMedium();
await sizeFilter.clickApplyButton();
await sizeFilter.openDialog();
expect(await sizeFilter.getFiltersCheckedValues()).toEqual(['Small', 'Medium'], 'Incorrect checked Size filters');
await sizeFilter.clickClearButton();
await sizeFilter.clickResetButton();
await sizeFilter.openDialog();
expect(await sizeFilter.getFiltersCheckedValues()).toEqual([], 'Size filters not cleared');
});
});
@ -182,31 +190,26 @@ describe('Search filters', () => {
const future = moment().add(1, 'month').format('DD-MMM-YY');
afterEach(async (done) => {
await createdDateFilter.expandPanel();
await createdDateFilter.resetPanel();
await Utils.pressEscape();
await BrowserActions.click(filters.resetAllButton);
done();
});
it('[C279211] Expand / Collapse the Created date filter panel', async () => {
expect(await createdDateFilter.isPanelExpanded()).toBe(false, 'Created date filter panel is expanded');
expect(await createdDateFilter.isDialogPresent()).toBe(false, 'Created date filter panel is expanded');
await createdDateFilter.expandPanel();
expect(await createdDateFilter.isPanelExpanded()).toBe(true, 'Created date filter panel not expanded');
await createdDateFilter.openDialog();
expect(await createdDateFilter.isDialogPresent()).toBe(true, 'Created date filter panel not expanded');
expect(await createdDateFilter.isClearButtonEnabled()).toBe(true, 'Created date CLEAR button not enabled');
expect(await createdDateFilter.isApplyButtonEnabled()).toBe(false, 'Created date APPLY button not disabled');
await createdDateFilter.collapsePanel();
expect(await createdDateFilter.isPanelExpanded()).toBe(false, 'Created date filter panel is expanded');
await createdDateFilter.closeDialog();
expect(await createdDateFilter.isDialogPresent()).toBe(false, 'Created date filter panel is expanded');
});
it('[C279217] Results are filtered by Created date', async () => {
await createdDateFilter.expandPanel();
await createdDateFilter.openDialog();
await createdDateFilter.enterFromDate(yesterday);
await createdDateFilter.enterToDate(yesterday);
expect(await createdDateFilter.isApplyButtonEnabled()).toBe(true, 'Created date filter Apply button not enabled');
await createdDateFilter.clickApplyButton();
expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(false, 'PDF file is displayed');
@ -215,8 +218,6 @@ describe('Search filters', () => {
await createdDateFilter.enterFromDate(yesterday);
await createdDateFilter.enterToDate(today);
expect(await createdDateFilter.isApplyButtonEnabled()).toBe(true, 'Created date filter Apply button not enabled');
await createdDateFilter.clickApplyButton();
expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(true, 'PDF file not displayed');
@ -224,16 +225,18 @@ describe('Search filters', () => {
});
it('[C279216] Clear the Created date filter options', async () => {
await createdDateFilter.expandPanel();
await createdDateFilter.openDialog();
await createdDateFilter.enterFromDate(yesterday);
await createdDateFilter.enterToDate(yesterday);
await createdDateFilter.clickApplyButton();
await createdDateFilter.openDialog();
expect(await createdDateFilter.getFromValue()).toContain(yesterday);
expect(await createdDateFilter.getToValue()).toContain(yesterday);
await createdDateFilter.clickClearButton();
await createdDateFilter.clickResetButton();
await createdDateFilter.openDialog();
expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(true, 'PDF file is displayed');
expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file is displayed');
expect(await createdDateFilter.getFromValue()).toEqual('', 'From field not empty');
@ -241,7 +244,7 @@ describe('Search filters', () => {
});
it('[C279212] From and To values are required', async () => {
await createdDateFilter.expandPanel();
await createdDateFilter.openDialog();
await createdDateFilter.enterFromDate('');
await createdDateFilter.enterToDate('');
@ -252,7 +255,7 @@ describe('Search filters', () => {
});
it('[C279213] Error message is displayed when entering an incorrect date format', async () => {
await createdDateFilter.expandPanel();
await createdDateFilter.openDialog();
await createdDateFilter.enterFromDate('03.31.2019');
await createdDateFilter.enterToDate('invalid text');
@ -263,7 +266,7 @@ describe('Search filters', () => {
});
it('[C279214] Error message is displayed when entering a date from the future', async () => {
await createdDateFilter.expandPanel();
await createdDateFilter.openDialog();
await createdDateFilter.enterFromDate(future);
await createdDateFilter.enterToDate(future);
@ -274,7 +277,7 @@ describe('Search filters', () => {
});
it('[C279215] Error message is displayed when From value is bigger than To value', async () => {
await createdDateFilter.expandPanel();
await createdDateFilter.openDialog();
await createdDateFilter.enterFromDate(today);
await createdDateFilter.enterToDate(yesterday);
@ -285,52 +288,58 @@ describe('Search filters', () => {
describe('Filter by File type', () => {
afterEach(async (done) => {
await Utils.pressEscape();
await BrowserActions.click(filters.resetAllButton);
done();
});
it('[C279191] Expand / Collapse the File type filter panel', async () => {
expect(await fileTypeFilter.isPanelExpanded()).toBe(true, 'File type filter panel not expanded');
await fileTypeFilter.openDialog();
expect(await fileTypeFilter.isDialogPresent()).toBe(true, 'File type filter panel not expanded');
expect(await fileTypeFilter.getFiltersValues()).toEqual(expectedFileTypes, 'Incorrect File type filters facets');
expect(await fileTypeFilter.isFilterCategoryInputDisplayed()).toBe(true, 'File type filter categories not displayed');
await fileTypeFilter.collapsePanel();
expect(await fileTypeFilter.isPanelExpanded()).toBe(false, 'File type filter panel is expanded');
await fileTypeFilter.closeDialog();
expect(await fileTypeFilter.isDialogPresent()).toBe(false, 'File type filter panel is expanded');
});
it('[C279192] Results are filtered by File type', async () => {
await fileTypeFilter.expandPanel();
await fileTypeFilter.openDialog();
await fileTypeFilter.checkCategory('Adobe PDF Document');
await fileTypeFilter.clickApplyButton();
expect(await fileTypeFilter.getChipTitle()).toEqual('Adobe PDF Document');
expect(await fileTypeFilter.isClearButtonEnabled()).toBe(true, 'File type filter Clear button not enabled');
expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(true, 'PDF file not displayed');
expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(false, 'JPG file is displayed');
expect(await page.getResultsChipsValues()).toEqual(['Adobe PDF Document']);
await fileTypeFilter.openDialog();
await fileTypeFilter.checkCategory('JPEG Image');
await fileTypeFilter.clickApplyButton();
expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(true, 'PDF file not displayed');
expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');
expect(await page.getResultsChipsValues()).toEqual(['Adobe PDF Document', 'JPEG Image']);
expect(await fileTypeFilter.getChipTitle()).toEqual(['Adobe PDF Document', 'JPEG Image'].join(', '));
});
it('[C279193] Clear the File type filter options', async () => {
await fileTypeFilter.expandPanel();
await fileTypeFilter.openDialog();
await fileTypeFilter.checkCategory('Adobe PDF Document');
await fileTypeFilter.clickApplyButton();
expect(await fileTypeFilter.getFiltersCheckedValues()).toEqual(['Adobe PDF Document (1)']);
expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(true, 'PDF file not displayed');
expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(false, 'JPG file is displayed');
await fileTypeFilter.clickClearButton();
await fileTypeFilter.openDialog();
expect(await fileTypeFilter.getFiltersCheckedValues()).toEqual(['Adobe PDF Document (1)']);
await fileTypeFilter.clickResetButton();
expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(true, 'PDF file not displayed');
expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');
expect(await fileTypeFilter.getFiltersCheckedValues()).toEqual([], 'File types selection not cleared');
expect(await fileTypeFilter.getChipTitle()).toEqual('');
});
it('[C279195] Search for a specific file type', async () => {
await fileTypeFilter.expandPanel();
await fileTypeFilter.openDialog();
expect(await fileTypeFilter.getFiltersValues()).toEqual(expectedFileTypes, 'Incorrect File type filters facets');
await fileTypeFilter.filterCategoriesBy('PDF');
expect(await fileTypeFilter.getFiltersValues()).toEqual(['Adobe PDF Document (1)'], 'Incorrect File type filters facets');
@ -339,53 +348,59 @@ describe('Search filters', () => {
describe('Filter by Creator', () => {
afterEach(async (done) => {
await Utils.pressEscape();
await BrowserActions.click(filters.resetAllButton);
done();
});
it('[C279205] Expand / Collapse the Creator filter panel', async () => {
expect(await creatorFilter.isPanelExpanded()).toBe(true, 'Creator filter panel not expanded');
await creatorFilter.openDialog();
expect(await creatorFilter.isDialogPresent()).toBe(true, 'Creator filter panel not expanded');
expect(await creatorFilter.getFiltersValues()).toEqual(expectedCreators, 'Incorrect Creator filters facets');
expect(await creatorFilter.isFilterCategoryInputDisplayed()).toBe(true, 'Creator filter categories not displayed');
await creatorFilter.collapsePanel();
expect(await creatorFilter.isPanelExpanded()).toBe(false, 'Creator filter panel is expanded');
await creatorFilter.closeDialog();
expect(await creatorFilter.isDialogPresent()).toBe(false, 'Creator filter panel is expanded');
});
it('[C279206] Results are filtered by Creator', async () => {
await creatorFilter.expandPanel();
await creatorFilter.openDialog();
await creatorFilter.checkCategory(user1);
await creatorFilter.clickApplyButton();
expect(await creatorFilter.isClearButtonEnabled()).toBe(true, 'Creator filter Clear button not enabled');
expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(false, 'PDF file is displayed');
expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');
expect(await page.getResultsChipsValues()).toEqual([`${user1} ${user1}`]);
expect(await creatorFilter.getChipTitle()).toEqual(`${user1} ${user1}`);
await creatorFilter.openDialog();
await creatorFilter.checkCategory(user2);
await creatorFilter.clickApplyButton();
expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(true, 'PDF file not displayed');
expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');
expect(await page.getResultsChipsValues()).toEqual([`${user1} ${user1}`, `${user2} ${user2}`]);
expect(await creatorFilter.getChipTitle()).toEqual(`${user1} ${user1}, ${user2} ${user2}`);
});
it('[C279207] Clear the Creator filter options', async () => {
await creatorFilter.expandPanel();
await creatorFilter.openDialog();
await creatorFilter.checkCategory(user1);
await creatorFilter.clickApplyButton();
expect(await creatorFilter.getFiltersCheckedValues()).toEqual([`${user1} ${user1} (1)`]);
expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(false, 'PDF file is displayed');
expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');
await creatorFilter.clickClearButton();
await creatorFilter.openDialog();
expect(await creatorFilter.getFiltersCheckedValues()).toEqual([`${user1} ${user1} (1)`]);
await creatorFilter.clickResetButton();
expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(true, 'PDF file not displayed');
expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');
expect(await creatorFilter.getFiltersCheckedValues()).toEqual([], 'Creator selection not cleared');
expect(await creatorFilter.getChipTitle()).toEqual('', 'Creator selection not cleared');
});
it('[C279208] Search for a specific creator', async () => {
await creatorFilter.expandPanel();
await creatorFilter.openDialog();
expect(await creatorFilter.getFiltersValues()).toEqual(expectedCreators, 'Incorrect Creator filters facets');
await creatorFilter.filterCategoriesBy(user1);
expect(await creatorFilter.getFiltersValues()).toEqual([`${user1} ${user1} (1)`], 'Incorrect Creator filters facets');
@ -394,53 +409,61 @@ describe('Search filters', () => {
describe('Filter by Modifier', () => {
afterEach(async (done) => {
await Utils.pressEscape();
await BrowserActions.click(filters.resetAllButton);
done();
});
it('[C279224] Expand / Collapse the Modifier filter panel', async () => {
expect(await modifierFilter.isPanelExpanded()).toBe(true, 'Modifier filter panel not expanded');
await modifierFilter.openDialog();
expect(await modifierFilter.isDialogPresent()).toBe(true, 'Modifier filter panel not expanded');
expect(await modifierFilter.getFiltersValues()).toEqual(expectedModifiers, 'Incorrect Modifier filters facets');
expect(await modifierFilter.isFilterCategoryInputDisplayed()).toBe(true, 'Modifier filter categories not displayed');
await modifierFilter.collapsePanel();
expect(await modifierFilter.isPanelExpanded()).toBe(false, 'Modifier filter panel is expanded');
await modifierFilter.closeDialog();
expect(await modifierFilter.isDialogPresent()).toBe(false, 'Modifier filter panel is expanded');
});
it('[C279225] Results are filtered by Modifier', async () => {
await modifierFilter.expandPanel();
await modifierFilter.openDialog();
await modifierFilter.checkCategory(user1);
await modifierFilter.clickApplyButton();
expect(await modifierFilter.isClearButtonEnabled()).toBe(true, 'Modifier filter Clear button not enabled');
expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(false, 'PDF file is displayed');
expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');
expect(await page.getResultsChipsValues()).toEqual([`${user1} ${user1}`]);
expect(await modifierFilter.getChipTitle()).toEqual(`${user1} ${user1}`, 'Incorrect File type filters facets');
await modifierFilter.openDialog();
await modifierFilter.checkCategory(user2);
await modifierFilter.clickApplyButton();
expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(true, 'PDF file not displayed');
expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');
expect(await page.getResultsChipsValues()).toEqual([`${user1} ${user1}`, `${user2} ${user2}`]);
expect(await modifierFilter.getChipTitle()).toEqual(`${user1} ${user1}, ${user2} ${user2}`, 'Incorrect modifier filters facets');
});
it('[C279226] Clear the Modifier filter options', async () => {
await modifierFilter.expandPanel();
await modifierFilter.openDialog();
await modifierFilter.checkCategory(user1);
await modifierFilter.clickApplyButton();
expect(await modifierFilter.getFiltersCheckedValues()).toEqual([`${user1} ${user1} (1)`]);
expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(false, 'PDF file is displayed');
expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');
await modifierFilter.clickClearButton();
await modifierFilter.openDialog();
expect(await modifierFilter.getFiltersCheckedValues()).toEqual([`${user1} ${user1} (1)`]);
await modifierFilter.clickResetButton();
expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(true, 'PDF file not displayed');
expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');
await modifierFilter.openDialog();
expect(await modifierFilter.getFiltersCheckedValues()).toEqual([], 'Modifier selection not cleared');
});
it('[C279227] Search for a specific modifier', async () => {
await modifierFilter.expandPanel();
await modifierFilter.openDialog();
expect(await modifierFilter.getFiltersValues()).toEqual(expectedModifiers, 'Incorrect Modifier filters facets');
await modifierFilter.filterCategoriesBy(user1);
expect(await modifierFilter.getFiltersValues()).toEqual([`${user1} ${user1} (1)`], 'Incorrect Modifier filters facets');
@ -449,53 +472,60 @@ describe('Search filters', () => {
describe('Filter by Location', () => {
afterEach(async (done) => {
await Utils.pressEscape();
await BrowserActions.click(filters.resetAllButton);
done();
});
it('[C279230] Expand / Collapse the Location filter panel', async () => {
expect(await locationFilter.isPanelExpanded()).toBe(true, 'Location filter panel not expanded');
await locationFilter.openDialog();
expect(await locationFilter.isDialogPresent()).toBe(true, 'Location filter panel not expanded');
expect(await locationFilter.getFiltersValues()).toEqual(expectedLocations, 'Incorrect Location filters facets');
expect(await locationFilter.isFilterCategoryInputDisplayed()).toBe(true, 'Location filter categories not displayed');
await locationFilter.collapsePanel();
expect(await locationFilter.isPanelExpanded()).toBe(false, 'Location filter panel is expanded');
await locationFilter.closeDialog();
expect(await locationFilter.isDialogPresent()).toBe(false, 'Location filter panel is expanded');
});
it('[C279231] Results are filtered by Location', async () => {
await locationFilter.expandPanel();
await locationFilter.openDialog();
await locationFilter.checkCategory(site);
await locationFilter.clickApplyButton();
expect(await locationFilter.isClearButtonEnabled()).toBe(true, 'Location filter Clear button not enabled');
expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(false, 'PDF file is displayed');
expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');
expect(await page.getResultsChipsValues()).toEqual([site]);
expect(await locationFilter.getChipTitle()).toEqual(site, 'Incorrect location filter selected');
await locationFilter.openDialog();
await locationFilter.checkCategory('_REPOSITORY_');
await locationFilter.clickApplyButton();
expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(true, 'PDF file not displayed');
expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');
expect(await page.getResultsChipsValues()).toEqual([site, '_REPOSITORY_']);
expect(await locationFilter.getChipTitle()).toEqual(`_REPOSITORY_, ${site}`, 'Incorrect location filter selected');
});
it('[C279232] Clear the Location filter options', async () => {
await locationFilter.expandPanel();
await locationFilter.openDialog();
await locationFilter.checkCategory(site);
await locationFilter.clickApplyButton();
expect(await locationFilter.getFiltersCheckedValues()).toEqual([`${site} (1)`]);
expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(false, 'PDF file is displayed');
expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');
await locationFilter.clickClearButton();
expect(await locationFilter.getChipTitle()).toEqual(`${site}`, 'Incorrect location filter selected');
await locationFilter.openDialog();
expect(await locationFilter.getFiltersCheckedValues()).toEqual([`${site} (1)`]);
await locationFilter.clickResetButton();
expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(true, 'PDF file not displayed');
expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');
expect(await locationFilter.getFiltersCheckedValues()).toEqual([], 'Location selection not cleared');
expect(await locationFilter.getChipTitle()).toEqual('', 'Location selection not cleared');
});
it('[C279233] Search for a specific location', async () => {
await locationFilter.expandPanel();
await locationFilter.openDialog();
expect(await locationFilter.getFiltersValues()).toEqual(expectedLocations, 'Incorrect Location filters facets');
await locationFilter.filterCategoriesBy(site);
expect(await locationFilter.getFiltersValues()).toEqual([`${site} (1)`], 'Incorrect Location filters facets');
@ -506,52 +536,62 @@ describe('Search filters', () => {
const expectedDateFilters = ['Today (2)', 'This week (2)', 'This month (2)', 'In the last 6 months (2)', 'This year (2)'];
afterEach(async (done) => {
await Utils.pressEscape();
await BrowserActions.click(filters.resetAllButton);
done();
});
it('[C279219] Expand / Collapse the Modified date filter panel', async () => {
expect(await modifiedDateFilter.isPanelExpanded()).toBe(true, 'Modified Date filter panel not expanded');
await modifiedDateFilter.openDialog();
expect(await modifiedDateFilter.isDialogPresent()).toBe(true, 'Modified Date filter panel not expanded');
expect(await modifiedDateFilter.getFiltersValues()).toEqual(expectedDateFilters, 'Incorrect Modified Date filters facets');
expect(await modifiedDateFilter.isFilterCategoryInputDisplayed()).toBe(true, 'Modified Date filter categories not displayed');
await modifiedDateFilter.collapsePanel();
expect(await modifiedDateFilter.isPanelExpanded()).toBe(false, 'Modified Date filter panel is expanded');
await modifiedDateFilter.closeDialog();
expect(await modifiedDateFilter.isDialogPresent()).toBe(false, 'Modified Date filter panel is expanded');
});
it('[C279221] Results are filtered by Modified date', async () => {
await modifiedDateFilter.expandPanel();
await modifiedDateFilter.openDialog();
await modifiedDateFilter.checkCategory('Today');
await modifiedDateFilter.clickApplyButton();
expect(await modifiedDateFilter.isClearButtonEnabled()).toBe(true, 'Modified date filter Clear button not enabled');
expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(true, 'PDF file not displayed');
expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');
expect(await page.getResultsChipsValues()).toEqual(['Today']);
expect(await modifiedDateFilter.getChipTitle()).toEqual('Today', 'Incorrect Modified DateFilter selected');
await modifiedDateFilter.openDialog();
await modifiedDateFilter.checkCategory('This week');
await modifiedDateFilter.clickApplyButton();
expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(true, 'PDF file not displayed');
expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');
expect(await page.getResultsChipsValues()).toEqual(['Today', 'This week']);
expect(await modifiedDateFilter.getChipTitle()).toEqual('Today, This week', 'Incorrect Modified DateFilter selected');
});
it('[C279220] Clear the Modified date filter options', async () => {
await modifiedDateFilter.expandPanel();
await modifiedDateFilter.openDialog();
await modifiedDateFilter.checkCategory('Today');
await modifiedDateFilter.checkCategory('This week');
await modifiedDateFilter.checkCategory('This month');
await modifiedDateFilter.checkCategory('In the last 6 months');
await modifiedDateFilter.checkCategory('This year');
await modifiedDateFilter.clickApplyButton();
expect(await modifiedDateFilter.getChipTitle()).toEqual(
`Today, This week, This month, In the last 6 months, This year`,
'Incorrect checked Modified date filters'
);
await modifiedDateFilter.openDialog();
expect(await modifiedDateFilter.getFiltersCheckedValues()).toEqual(expectedDateFilters, 'Incorrect checked Modified date filters');
await modifiedDateFilter.clickResetButton();
await modifiedDateFilter.clickClearButton();
expect(await modifiedDateFilter.getFiltersCheckedValues()).toEqual([], 'Modified date selection not cleared');
expect(await modifiedDateFilter.getChipTitle()).toEqual('', 'Modified date selection not cleared');
});
it('[C325006] Search for a specific modified date option', async () => {
await modifiedDateFilter.expandPanel();
await modifiedDateFilter.openDialog();
expect(await modifiedDateFilter.getFiltersValues()).toEqual(expectedDateFilters, 'Incorrect Modified date filters facets');
await modifiedDateFilter.filterCategoriesBy('This');
expect(await modifiedDateFilter.getFiltersValues()).toEqual(
@ -563,73 +603,108 @@ describe('Search filters', () => {
describe('Multiple filters', () => {
afterEach(async (done) => {
await Utils.pressEscape();
await BrowserActions.click(filters.resetAllButton);
await sizeFilter.resetPanel();
done();
});
it('[C280051] Multiple filters can be applied', async () => {
await sizeFilter.expandPanel();
await sizeFilter.openDialog();
await sizeFilter.checkSizeSmall();
await sizeFilter.clickApplyButton();
await fileTypeFilter.expandPanel();
await fileTypeFilter.openDialog();
await fileTypeFilter.checkCategory('JPEG Image');
await fileTypeFilter.clickApplyButton();
await creatorFilter.openDialog();
await creatorFilter.checkCategory(user1);
await creatorFilter.clickApplyButton();
await locationFilter.openDialog();
await locationFilter.checkCategory(site);
await locationFilter.clickApplyButton();
expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(false, 'PDF file is displayed');
expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');
expect(await page.getResultsChipsValues()).toEqual(['JPEG Image', `${user1} ${user1}`, site]);
expect(await fileTypeFilter.getChipTitle()).toEqual('JPEG Image');
expect(await creatorFilter.getChipTitle()).toEqual(`${user1} ${user1}`);
expect(await locationFilter.getChipTitle()).toEqual(site);
await page.removeChip('JPEG Image');
await page.removeChip(`${user1} ${user1}`);
await page.removeChip(site);
await BrowserActions.click(filters.resetAllButton);
expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(true, 'PDF file not displayed');
expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');
expect(await page.getResultsChipsValues()).toEqual([]);
});
it('[C280052] Total results is updated correctly', async () => {
await fileTypeFilter.expandPanel();
await fileTypeFilter.openDialog();
await fileTypeFilter.checkCategory('JPEG Image');
await fileTypeFilter.clickApplyButton();
await creatorFilter.openDialog();
await creatorFilter.checkCategory(user1);
await creatorFilter.clickApplyButton();
expect(await page.getResultsFoundText()).toEqual('1 result found');
expect(await dataTable.getRowsCount()).toEqual(1, 'expected 1 result');
await page.removeChip('JPEG Image');
await page.removeChip(`${user1} ${user1}`);
await BrowserActions.click(filters.resetAllButton);
expect(await page.getResultsFoundText()).toEqual('2 results found');
expect(await dataTable.getRowsCount()).toEqual(2, 'expected 2 result');
});
it('[C279188] Pagination is correct when search results are filtered', async () => {
await fileTypeFilter.expandPanel();
await fileTypeFilter.openDialog();
await fileTypeFilter.checkCategory('JPEG Image');
await fileTypeFilter.clickApplyButton();
await creatorFilter.openDialog();
await creatorFilter.checkCategory(user1);
await creatorFilter.clickApplyButton();
expect(await page.pagination.getRange()).toEqual('Showing 1-1 of 1');
await page.removeChip('JPEG Image');
await page.removeChip(`${user1} ${user1}`);
await BrowserActions.click(filters.resetAllButton);
expect(await page.pagination.getRange()).toEqual('Showing 1-2 of 2');
});
it('[C308042] The filter facets display is updated when making a new query', async () => {
await fileTypeFilter.openDialog();
expect(await fileTypeFilter.getFiltersValues()).toEqual(expectedFileTypes);
await fileTypeFilter.closeDialog();
await creatorFilter.openDialog();
expect(await creatorFilter.getFiltersValues()).toEqual(expectedCreators);
await creatorFilter.closeDialog();
await modifierFilter.openDialog();
expect(await modifierFilter.getFiltersValues()).toEqual(expectedModifiers);
await modifierFilter.closeDialog();
await locationFilter.openDialog();
expect(await locationFilter.getFiltersValues()).toEqual(expectedLocations);
await locationFilter.closeDialog();
await searchInput.clickSearchButton();
await searchInput.searchFor(fileJpgUser1.name);
await dataTable.waitForBody();
await fileTypeFilter.openDialog();
expect(await fileTypeFilter.getFiltersValues()).toEqual(['JPEG Image (1)']);
await fileTypeFilter.closeDialog();
await creatorFilter.openDialog();
expect(await creatorFilter.getFiltersValues()).toEqual([`${user1} ${user1} (1)`]);
await creatorFilter.closeDialog();
await modifierFilter.openDialog();
expect(await modifierFilter.getFiltersValues()).toEqual([`${user1} ${user1} (1)`]);
await modifierFilter.closeDialog();
await locationFilter.openDialog();
expect(await locationFilter.getFiltersValues()).toEqual([`${site} (1)`]);
await locationFilter.closeDialog();
});
});
});

38
package-lock.json generated
View File

@ -5,12 +5,12 @@
"requires": true,
"dependencies": {
"@alfresco/adf-cli": {
"version": "4.5.0-32942",
"resolved": "https://registry.npmjs.org/@alfresco/adf-cli/-/adf-cli-4.5.0-32942.tgz",
"integrity": "sha512-gr6zQYC6rj1oHOWJwZYdsEM1/BAzKkrDLdiYy0vpkc81KwufBlcx7EsycvYi7XovpWDhztYN/wbNB1B1pBI01A==",
"version": "4.5.0-32949",
"resolved": "https://registry.npmjs.org/@alfresco/adf-cli/-/adf-cli-4.5.0-32949.tgz",
"integrity": "sha512-9f7n6jEn/E24M7iXVj4mVdEEnj8Mu9PGcrQf+NXaam6ZI9UVA96zGPBfMnxP7OfhCp+Fw35//c4Bhzj/DT4Bmw==",
"dev": true,
"requires": {
"@alfresco/js-api": "4.5.0-3603",
"@alfresco/js-api": "4.5.0-3637",
"commander": "^4.0.0",
"ejs": "^2.6.1",
"license-checker": "^25.0.1",
@ -30,43 +30,43 @@
}
},
"@alfresco/adf-content-services": {
"version": "4.5.0-32942",
"resolved": "https://registry.npmjs.org/@alfresco/adf-content-services/-/adf-content-services-4.5.0-32942.tgz",
"integrity": "sha512-IJYTlrEMAkdcbHUhgXYsF7K2z1M8fYtxhxegdMkdOHogrO6X/KbW1tjC5OnJ3e6WL6aqmWVQezOlRSu6/9tBpQ==",
"version": "4.5.0-32949",
"resolved": "https://registry.npmjs.org/@alfresco/adf-content-services/-/adf-content-services-4.5.0-32949.tgz",
"integrity": "sha512-bZcwqJz0HW1TF2U+SAFx8qmeijMJkTz946sLrY+szOm9jFdo5pH3qLT2B1EqD1hBGJ/dM6DrkENdkhW5mC8kIg==",
"requires": {
"tslib": "^2.0.0"
}
},
"@alfresco/adf-core": {
"version": "4.5.0-32942",
"resolved": "https://registry.npmjs.org/@alfresco/adf-core/-/adf-core-4.5.0-32942.tgz",
"integrity": "sha512-ocy6HnpFnJVStWhfdGiEiuXSOZJyewIMV90ENDGiM8M1rB+jhh0bb+KCtMX5I+qlBG4Jj5uC3BT/MbOimE//pQ==",
"version": "4.5.0-32949",
"resolved": "https://registry.npmjs.org/@alfresco/adf-core/-/adf-core-4.5.0-32949.tgz",
"integrity": "sha512-GFaklPy+4ML+yN0NrYPwGGTHlqb/WMS0pdAXaaP/ithyQijs9PDJ2Ad/4d2F+1z/iWhITkJQUY76ImNgh2iHeQ==",
"requires": {
"cropperjs": "1.5.11",
"tslib": "^2.0.0"
}
},
"@alfresco/adf-extensions": {
"version": "4.5.0-32942",
"resolved": "https://registry.npmjs.org/@alfresco/adf-extensions/-/adf-extensions-4.5.0-32942.tgz",
"integrity": "sha512-IRbuJicX+Rg3/gk5p/NGXus/LvmetRwmTW1gxeHLxin4vKdHHIXsxSpRyx/3hJfck0bpoyn8+CCWMqrNmvWqrQ==",
"version": "4.5.0-32949",
"resolved": "https://registry.npmjs.org/@alfresco/adf-extensions/-/adf-extensions-4.5.0-32949.tgz",
"integrity": "sha512-yvaiGbQ+YTUWtHWp94WHgfTDkfap1h97KbXSxKh8X+vkZcDmoWwl/7iQGEUkxqlbY5eqs21I3n6TJdmWbuMZbQ==",
"requires": {
"tslib": "^2.0.0"
}
},
"@alfresco/adf-testing": {
"version": "4.5.0-32942",
"resolved": "https://registry.npmjs.org/@alfresco/adf-testing/-/adf-testing-4.5.0-32942.tgz",
"integrity": "sha512-QmbKM48M8XeysYoKdhyVAdvV/gAe+T1HS0mf1k2b1a/r7YNhtlUddzpuHFWoC2OqC6u9XJ8j8F/RwLuu+1HoCQ==",
"version": "4.5.0-32949",
"resolved": "https://registry.npmjs.org/@alfresco/adf-testing/-/adf-testing-4.5.0-32949.tgz",
"integrity": "sha512-XtsaS0K6fx6t2JRmkp2pO5YPCAc77iEmpd6q2ZrONNjkrC6/8gB08ObWn9cgxwDwRFQD/FOZTLMP8iJRwJgUcw==",
"dev": true,
"requires": {
"tslib": "^2.0.0"
}
},
"@alfresco/js-api": {
"version": "4.5.0-3603",
"resolved": "https://registry.npmjs.org/@alfresco/js-api/-/js-api-4.5.0-3603.tgz",
"integrity": "sha512-VNBmtR9wMnggVcG7fV/wkCLhUcuPXOQKZeF7WGKVGBP5hp4bzOaZ+N5RuFSF0lR9G1UVWlynQ8G3rnYPQa4cVA==",
"version": "4.5.0-3637",
"resolved": "https://registry.npmjs.org/@alfresco/js-api/-/js-api-4.5.0-3637.tgz",
"integrity": "sha512-X6kTPDFQJk8lnY9vxvMJ8El5staZS9Fz0jQr8psMHy4G/a38O1WPs5XR+KBzuodzqALuvXbR/2xAGdMEFaBg+w==",
"requires": {
"event-emitter": "^0.3.5",
"minimatch": "3.0.4",

View File

@ -24,10 +24,10 @@
},
"private": true,
"dependencies": {
"@alfresco/adf-content-services": "4.5.0-32942",
"@alfresco/adf-core": "4.5.0-32942",
"@alfresco/adf-extensions": "4.5.0-32942",
"@alfresco/js-api": "4.5.0-3603",
"@alfresco/adf-content-services": "4.5.0-32949",
"@alfresco/adf-core": "4.5.0-32949",
"@alfresco/adf-extensions": "4.5.0-32949",
"@alfresco/js-api": "4.5.0-3637",
"@angular/animations": "10.0.4",
"@angular/cdk": "^10.0.2",
"@angular/common": "10.0.4",
@ -56,8 +56,8 @@
"zone.js": "~0.10.2"
},
"devDependencies": {
"@alfresco/adf-cli": "4.5.0-32942",
"@alfresco/adf-testing": "4.5.0-32942",
"@alfresco/adf-cli": "4.5.0-32949",
"@alfresco/adf-testing": "4.5.0-32949",
"@angular-custom-builders/lite-serve": "^0.2.3",
"@angular-devkit/build-angular": "^0.1002.0",
"@angular-devkit/build-ng-packagr": "^0.1002.0",

View File

@ -27,25 +27,10 @@ import { Action } from '@ngrx/store';
import { SearchOptionModel } from '../models/search-option.model';
export enum SearchActionTypes {
SearchByTerm = 'SEARCH_BY_TERM',
ToggleFilter = 'TOGGLE_SEARCH_FILTER',
ShowFilter = 'SHOW_SEARCH_FILTER',
HideFilter = 'HIDE_SEARCH_FILTER'
SearchByTerm = 'SEARCH_BY_TERM'
}
export class SearchByTermAction implements Action {
readonly type = SearchActionTypes.SearchByTerm;
constructor(public payload: string, public searchOptions?: SearchOptionModel[]) {}
}
export class ToggleSearchFilterAction implements Action {
readonly type = SearchActionTypes.ToggleFilter;
}
export class ShowSearchFilterAction implements Action {
readonly type = SearchActionTypes.ShowFilter;
}
export class HideSearchFilterAction implements Action {
readonly type = SearchActionTypes.HideFilter;
}

View File

@ -23,24 +23,22 @@
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
import { ElementFinder, by, protractor } from 'protractor';
import { GenericFilterPanel } from './generic-filter-panel';
import { by, ElementFinder, protractor } from 'protractor';
import { GenericFilter } from './generic-filter';
import { isPresentAndDisplayed } from '../../../utilities/utils';
import { BrowserActions } from '@alfresco/adf-testing';
export class CreatedDateFilter extends GenericFilterPanel {
export class CreatedDateFilter extends GenericFilter {
constructor() {
super('Created date');
}
fromField: ElementFinder = this.panelExpanded.element(by.cssContainingText('.adf-search-date-range .mat-form-field', 'From'));
fromField: ElementFinder = this.filterDialogOpened.element(by.cssContainingText('.adf-search-date-range .mat-form-field', 'From'));
fromInput: ElementFinder = this.fromField.element(by.css(`[data-automation-id='date-range-from-input']`));
fromFieldError: ElementFinder = this.fromField.element(by.css(`[data-automation-id='date-range-from-error']`));
toField: ElementFinder = this.panelExpanded.element(by.cssContainingText('.adf-search-date-range .mat-form-field', 'To'));
toField: ElementFinder = this.filterDialogOpened.element(by.cssContainingText('.adf-search-date-range .mat-form-field', 'To'));
toInput: ElementFinder = this.toField.element(by.css(`[data-automation-id='date-range-to-input']`));
toFieldError: ElementFinder = this.toField.element(by.css(`[data-automation-id='date-range-to-error']`));
clearButton: ElementFinder = this.panel.element(by.css('.adf-facet-buttons [data-automation-id="date-range-clear-btn"]'));
applyButton: ElementFinder = this.panel.element(by.css('.adf-facet-buttons [data-automation-id="date-range-apply-btn"]'));
async isFromFieldDisplayed(): Promise<boolean> {
return isPresentAndDisplayed(this.fromField);
@ -58,26 +56,6 @@ export class CreatedDateFilter extends GenericFilterPanel {
return isPresentAndDisplayed(this.toFieldError);
}
async isClearButtonEnabled(): Promise<boolean> {
return this.clearButton.isEnabled();
}
async isApplyButtonEnabled(): Promise<boolean> {
return this.applyButton.isEnabled();
}
async clickClearButton(): Promise<void> {
if (await this.isClearButtonEnabled()) {
await BrowserActions.click(this.clearButton);
}
}
async clickApplyButton(): Promise<void> {
if (await this.isApplyButtonEnabled()) {
await BrowserActions.click(this.applyButton);
}
}
async getFromValue(): Promise<string> {
return BrowserActions.getInputValue(this.fromInput);
}
@ -106,20 +84,20 @@ export class CreatedDateFilter extends GenericFilterPanel {
const fromValue = await this.getFromValue();
const toValue = await this.getToValue();
if (fromValue.length > 0 || toValue.length > 0) {
await this.expandPanel();
await this.clickClearButton();
await this.collapsePanel();
await this.openDialog();
await this.clickResetButton();
await this.closeDialog();
}
}
async enterFromDate(date: string): Promise<void> {
await this.expandPanel();
await this.openDialog();
await BrowserActions.clearWithBackSpace(this.fromInput);
await this.fromInput.sendKeys(date, protractor.Key.TAB);
}
async enterToDate(date: string): Promise<void> {
await this.expandPanel();
await this.openDialog();
await BrowserActions.clearWithBackSpace(this.toInput);
await this.toInput.sendKeys(date, protractor.Key.TAB);
}

View File

@ -24,29 +24,25 @@
*/
import { ElementFinder, ElementArrayFinder, by, browser } from 'protractor';
import { GenericFilterPanel } from './generic-filter-panel';
import { GenericFilter } from './generic-filter';
import { BrowserActions } from '@alfresco/adf-testing';
export class FacetFilter extends GenericFilterPanel {
export class FacetFilter extends GenericFilter {
private readonly locators = {
checkbox: '.mat-checkbox',
checkboxChecked: '.mat-checkbox.mat-checkbox-checked',
button: '.adf-facet-buttons button',
categoryInput: 'input[data-automation-id^="facet-result-filter"]',
facetsFilter: '.adf-facet-result-filter'
checkbox: '.mat-menu-content .mat-checkbox',
checkboxChecked: '.mat-menu-content .mat-checkbox.mat-checkbox-checked',
categoryInput: '.mat-menu-content input[data-automation-id^="facet-result-filter"]',
facetsFilter: '.mat-menu-content .adf-facet-result-filter'
};
get facets(): ElementArrayFinder {
return this.panelExpanded.all(by.css(this.locators.checkbox));
return this.filterDialogOpened.all(by.css(this.locators.checkbox));
}
get selectedFacets(): ElementArrayFinder {
return this.panel.all(by.css(this.locators.checkboxChecked));
}
get clearButton(): ElementFinder {
return this.panel.element(by.cssContainingText(this.locators.button, 'Clear all'));
return this.filterDialogOpened.all(by.css(this.locators.checkboxChecked));
}
get facetsFilter(): ElementFinder {
return this.panelExpanded.element(by.css(this.locators.facetsFilter));
return this.filterDialogOpened.element(by.css(this.locators.facetsFilter));
}
get filterCategoryInput(): ElementFinder {
return this.facetsFilter.element(by.css(this.locators.categoryInput));
@ -66,28 +62,18 @@ export class FacetFilter extends GenericFilterPanel {
async resetPanel(): Promise<void> {
if ((await this.selectedFacets.count()) > 0) {
await this.expandPanel();
await this.openDialog();
await this.selectedFacets.each(async (elem) => {
await BrowserActions.click(elem);
});
}
await this.expandPanel();
await this.openDialog();
}
async isFilterFacetsDisplayed(): Promise<boolean> {
return this.facetsFilter.isDisplayed();
}
async isClearButtonEnabled(): Promise<boolean> {
return this.clearButton.isEnabled();
}
async clickClearButton(): Promise<void> {
if (await this.isClearButtonEnabled()) {
await BrowserActions.click(this.clearButton);
}
}
async isFilterCategoryInputDisplayed(): Promise<boolean> {
return this.filterCategoryInput.isDisplayed();
}

View File

@ -1,78 +0,0 @@
/*!
* @license
* Alfresco Example Content Application
*
* Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
import { ElementFinder, by, browser } from 'protractor';
import { isPresentAndDisplayed } from '../../../utilities/utils';
import { BrowserActions } from '@alfresco/adf-testing';
export class GenericFilterPanel {
private filterName: string;
constructor(filterName: string) {
this.filterName = filterName;
}
private readonly selectors = {
root: 'adf-search-filter',
panel: '.mat-expansion-panel',
panelExpanded: '.mat-expansion-panel.mat-expanded',
panelHeader: '.mat-expansion-panel-header'
};
get panel(): ElementFinder {
return browser.element(by.cssContainingText(this.selectors.panel, this.filterName));
}
get panelExpanded(): ElementFinder {
return browser.element(by.cssContainingText(this.selectors.panelExpanded, this.filterName));
}
get panelHeader(): ElementFinder {
return this.panel.element(by.css(this.selectors.panelHeader));
}
async clickPanelHeader(): Promise<void> {
await BrowserActions.click(this.panelHeader);
}
async isPanelDisplayed(): Promise<boolean> {
return isPresentAndDisplayed(this.panel);
}
async isPanelExpanded(): Promise<boolean> {
return isPresentAndDisplayed(this.panelExpanded);
}
async expandPanel(): Promise<void> {
if (!(await this.isPanelExpanded())) {
await this.clickPanelHeader();
}
}
async collapsePanel(): Promise<void> {
if (await this.isPanelExpanded()) {
await this.clickPanelHeader();
}
}
}

View File

@ -0,0 +1,84 @@
/*!
* @license
* Alfresco Example Content Application
*
* Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
import { ElementFinder, by, browser } from 'protractor';
import { isPresentAndDisplayed, Utils } from '../../../utilities/utils';
import { BrowserActions, TestElement } from '@alfresco/adf-testing';
export class GenericFilter {
private filterName: string;
constructor(filterName: string) {
this.filterName = filterName;
}
private readonly selectors = {
root: 'adf-search-filter-chips',
chip: '.mat-chip',
chipDialog: '.mat-menu-content .adf-search-filter-menu-card'
};
get chip(): ElementFinder {
return browser.element(by.cssContainingText(this.selectors.chip, this.filterName));
}
get filterDialogOpened(): ElementFinder {
return browser.element(by.cssContainingText(this.selectors.chipDialog, this.filterName));
}
async getChipTitle(): Promise<string> {
return browser.element(by.cssContainingText(`${this.selectors.root} ${this.selectors.chip}`, this.filterName)).getAttribute('title');
}
async clickApplyButton(): Promise<void> {
await TestElement.byId('apply-filter-button').click();
}
async clickResetButton(): Promise<void> {
await TestElement.byId('cancel-filter-button').click();
}
async isDisplayed(): Promise<boolean> {
return isPresentAndDisplayed(this.chip);
}
async isDialogPresent(): Promise<boolean> {
return isPresentAndDisplayed(this.filterDialogOpened);
}
async openDialog(): Promise<void> {
if (!(await this.isDialogPresent())) {
await this.chip.click();
await BrowserActions.waitUntilActionMenuIsVisible();
}
}
async closeDialog(): Promise<void> {
if (await this.isDialogPresent()) {
await Utils.pressEscape();
await BrowserActions.waitUntilActionMenuIsNotVisible();
}
}
}

View File

@ -23,18 +23,17 @@
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
import { ElementFinder, by, ElementArrayFinder } from 'protractor';
import { GenericFilterPanel } from './generic-filter-panel';
import { by, ElementArrayFinder } from 'protractor';
import { GenericFilter } from './generic-filter';
import { BrowserActions } from '@alfresco/adf-testing';
export class SizeFilter extends GenericFilterPanel {
export class SizeFilter extends GenericFilter {
constructor() {
super('Size');
}
facets: ElementArrayFinder = this.panelExpanded.all(by.css('.mat-checkbox'));
selectedFacets: ElementArrayFinder = this.panel.all(by.css('.mat-checkbox.mat-checkbox-checked'));
clearButton: ElementFinder = this.panel.element(by.cssContainingText('.adf-facet-buttons button', 'Clear all'));
facets: ElementArrayFinder = this.filterDialogOpened.all(by.css('.mat-checkbox'));
selectedFacets: ElementArrayFinder = this.filterDialogOpened.all(by.css('.mat-checkbox.mat-checkbox-checked'));
async getFiltersValues(): Promise<string[]> {
return this.facets.map((option) => {
@ -50,22 +49,12 @@ export class SizeFilter extends GenericFilterPanel {
async resetPanel(): Promise<void> {
if ((await this.selectedFacets.count()) > 0) {
await this.expandPanel();
await this.openDialog();
await this.selectedFacets.each(async (elem) => {
await BrowserActions.click(elem);
});
}
await this.collapsePanel();
}
async isClearButtonEnabled(): Promise<boolean> {
return this.clearButton.isEnabled();
}
async clickClearButton(): Promise<void> {
if (await this.isClearButtonEnabled()) {
await BrowserActions.click(this.clearButton);
}
await this.closeDialog();
}
async checkSizeSmall(): Promise<void> {

View File

@ -25,7 +25,7 @@
export * from './filters/created-date-filter';
export * from './filters/facet-filter';
export * from './filters/generic-filter-panel';
export * from './filters/generic-filter';
export * from './filters/size-filter';
export * from './search-filters';
export * from './search-input';

View File

@ -32,7 +32,7 @@ import { isPresentAndDisplayed } from '../../utilities/utils';
export class SearchFilters extends Component {
mainPanel = browser.element(by.css('adf-search-filter'));
resetAllButton = this.byCssText('.mat-button', 'Reset all');
resetAllButton = browser.element(by.css('button[adf-reset-search]'));
size = new SizeFilter();
createdDate = new CreatedDateFilter();

View File

@ -36,7 +36,6 @@ export class Toolbar extends Component {
shareButton = this.byCss(`.mat-icon-button[title='Share']`);
shareEditButton = this.byCss(`.mat-icon-button[title='Shared Link Settings']`);
viewButton = this.byCss(`.mat-icon-button[title='View']`);
searchFiltersToggleButton = this.byCss(`.mat-icon-button[title='Toggle search filter']`);
downloadButton = this.byCss(`.mat-icon-button[title='Download']`);
editFolderButton = this.byId('app.toolbar.editFolder');
viewDetailsButton = this.byCss(`.mat-icon-button[title='View Details']`);

View File

@ -285,22 +285,38 @@
{
"mincount": 1,
"field": "content.mimetype",
"label": "SEARCH.FACET_FIELDS.FILE_TYPE"
"label": "SEARCH.FACET_FIELDS.FILE_TYPE",
"settings": {
"allowUpdateOnChange": false,
"hideDefaultAction": true
}
},
{
"mincount": 1,
"field": "creator",
"label": "SEARCH.FACET_FIELDS.CREATOR"
"label": "SEARCH.FACET_FIELDS.CREATOR",
"settings": {
"allowUpdateOnChange": false,
"hideDefaultAction": true
}
},
{
"mincount": 1,
"field": "modifier",
"label": "SEARCH.FACET_FIELDS.MODIFIER"
"label": "SEARCH.FACET_FIELDS.MODIFIER",
"settings": {
"allowUpdateOnChange": false,
"hideDefaultAction": true
}
},
{
"mincount": 1,
"field": "SITE",
"label": "SEARCH.FACET_FIELDS.LOCATION"
"label": "SEARCH.FACET_FIELDS.LOCATION",
"settings": {
"allowUpdateOnChange": false,
"hideDefaultAction": true
}
}
]
},
@ -328,7 +344,11 @@
"label": "SEARCH.FACET_QUERIES.THIS_YEAR",
"query": "cm:modified:[NOW/DAY-1YEAR TO NOW/DAY+1DAY]"
}
]
],
"settings": {
"allowUpdateOnChange": false,
"hideDefaultAction": true
}
},
"categories": [
{
@ -338,6 +358,8 @@
"component": {
"selector": "check-list",
"settings": {
"allowUpdateOnChange": false,
"hideDefaultAction": true,
"options": [
{
"name": "SEARCH.CATEGORIES.SIZE_OPTIONS.SMALL",
@ -366,6 +388,8 @@
"component": {
"selector": "date-range",
"settings": {
"allowUpdateOnChange": false,
"hideDefaultAction": true,
"field": "cm:created",
"dateFormat": "DD-MMM-YY",
"maxDate": "today"

View File

@ -11,13 +11,6 @@
<aca-page-layout-content>
<div class="main-content">
<div class="adf-search-results">
<adf-search-filter
#searchFilter
[ngClass]="{
'adf-search-filter--hidden':
!(showFacetFilter$ | async)
}"
></adf-search-filter>
<div class="adf-search-results__content">
<mat-progress-bar
*ngIf="isLoading"
@ -26,37 +19,15 @@
>
</mat-progress-bar>
<div class="adf-search-results__content-header content">
<adf-search-form (formChange)="onFormChange($event)"></adf-search-form>
<div class="content__side--left">
<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>
<adf-search-form class="content__side--left"></adf-search-form>
<div class="adf-search-results__facets">
<adf-search-chip-list
[searchFilter]="searchFilter"
></adf-search-chip-list>
</div>
</div>
<mat-divider [vertical]="true" class="content__divider"></mat-divider>
<adf-search-sorting-picker
class="content__side--right"
></adf-search-sorting-picker>
<adf-search-filter-chips class="content__filter"></adf-search-filter-chips>
<button mat-button adf-reset-search class='content__reset-action'><mat-icon> refresh </mat-icon></button>
<adf-search-sorting-picker class="content__sort-picker"></adf-search-sorting-picker>
</div>
<adf-document-list

View File

@ -71,18 +71,31 @@
}
.content {
@include flex-row;
flex: unset;
height: unset;
padding-top: 8px;
padding-bottom: 8px;
flex-wrap: wrap;
box-sizing: border-box;
display: flex;
place-content: flex-start space-between;
align-items: flex-start;
padding: 16px 12px;
&__side--left {
@include flex-column;
height: unset;
padding-right: 15px;
padding-left: 15px;
&__button {
padding: 0 12px;
}
&__divider {
height: 100%;
}
&__filter {
padding: 0 12px;
flex: 1 1 auto;
}
&__reset-action {
line-height: 33px;
}
&__sort-picker {
min-width: 220px;
}
}

View File

@ -23,10 +23,10 @@
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
import { Component, OnInit, ViewChild, ViewEncapsulation } from '@angular/core';
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
import { MinimalNodeEntity, Pagination, ResultSetPaging } from '@alfresco/js-api';
import { ActivatedRoute, Params, Router } from '@angular/router';
import { SearchFilterComponent, SearchForm, SearchQueryBuilderService } from '@alfresco/adf-content-services';
import { SearchQueryBuilderService } from '@alfresco/adf-content-services';
import { PageComponent } from '../../page.component';
import { Store } from '@ngrx/store';
import {
@ -52,17 +52,12 @@ import { takeUntil } from 'rxjs/operators';
styleUrls: ['./search-results.component.scss']
})
export class SearchResultsComponent extends PageComponent implements OnInit {
@ViewChild('searchFilter', { static: true })
searchFilter: SearchFilterComponent;
showFacetFilter$: Observable<boolean>;
infoDrawerPreview$: Observable<boolean>;
searchedWord: string;
queryParamName = 'q';
data: ResultSetPaging;
totalResults = 0;
hasSelectedFilters = false;
sorting = ['name', 'asc'];
isLoading = false;
showHeader: ShowHeaderMode = ShowHeaderMode.Never;
@ -205,24 +200,6 @@ export class SearchResultsComponent extends PageComponent implements OnInit {
onSearchResultLoaded(nodePaging: ResultSetPaging) {
this.data = nodePaging;
this.totalResults = this.getNumberOfResults();
this.hasSelectedFilters = this.isFiltered();
}
getNumberOfResults() {
if (this.data && this.data.list && this.data.list.pagination) {
return this.data.list.pagination.totalItems;
}
return 0;
}
isFiltered(): boolean {
return this.searchFilter.selectedBuckets.length > 0 || this.hasCheckedCategories();
}
hasCheckedCategories() {
const checkedCategory = this.queryBuilder.categories.find((category) => !!this.queryBuilder.queryFragments[category.id]);
return !!checkedCategory;
}
onPaginationChanged(pagination: Pagination) {
@ -254,18 +231,10 @@ export class SearchResultsComponent extends PageComponent implements OnInit {
}
}
onFormChange(form: SearchForm) {
this.queryBuilder.updateSelectedConfiguration(form.index);
}
handleNodeClick(event: Event) {
this.onNodeDoubleClick((event as CustomEvent).detail?.node);
}
hideSearchFilter() {
return !this.totalResults && !this.hasSelectedFilters;
}
onPreviewClosed() {
this.store.dispatch(new ShowInfoDrawerPreviewAction());
}

View File

@ -28,7 +28,6 @@ import {
AppState,
AppActionTypes,
NodeActionTypes,
SearchActionTypes,
SetUserProfileAction,
SetCurrentFolderAction,
SetCurrentUrlAction,
@ -87,15 +86,6 @@ export function appReducer(state: AppState = INITIAL_APP_STATE, action: Action):
case AppActionTypes.SetRepositoryInfo:
newState = updateRepositoryStatus(state, action as SetRepositoryInfoAction);
break;
case SearchActionTypes.ToggleFilter:
newState = toggleSearchFilter(state);
break;
case SearchActionTypes.ShowFilter:
newState = showSearchFilter(state);
break;
case SearchActionTypes.HideFilter:
newState = hideSearchFilter(state);
break;
case AppActionTypes.SetFileUploadingDialog:
newState = setUploadDialogVisibility(state, action as SetFileUploadingDialogAction);
break;
@ -112,27 +102,6 @@ export function appReducer(state: AppState = INITIAL_APP_STATE, action: Action):
return newState;
}
function toggleSearchFilter(state: AppState): AppState {
return {
...state,
showFacetFilter: !state.showFacetFilter
};
}
function hideSearchFilter(state: AppState): AppState {
return {
...state,
showFacetFilter: false
};
}
function showSearchFilter(state: AppState): AppState {
return {
...state,
showFacetFilter: true
};
}
function updateUser(state: AppState, action: SetUserProfileAction): AppState {
const newState = { ...state };
const user = action.payload.person;

View File

@ -302,18 +302,6 @@
}
],
"toolbar": [
{
"id": "app.toolbar.searchFilter",
"order": 50,
"title": "APP.BROWSE.SEARCH.TOGGLE_SEARCH_FILTER",
"icon": "view_list",
"actions": {
"click": "TOGGLE_SEARCH_FILTER"
},
"rules": {
"visible": "app.navigation.isSearchResults"
}
},
{
"id": "app.toolbar.share",
"type": "custom",

View File

@ -179,7 +179,6 @@
"UNKNOWN_LOCATION": "غير معروف",
"NO_RESULTS": "أرجع البحث 0 نتائج",
"NO_FILTER_RESULTS": "أعاد الفلتر 0 نتيجة",
"TOGGLE_SEARCH_FILTER": "تبديل عامل تصفية البحث",
"ERRORS": {
"500": "حدث خطأ أثناء معالجة استعلام البحث [500]",
"GENERIC": "حدث خطأ أثناء معالجة استعلام البحث"
@ -599,4 +598,4 @@
"BASELINE-LOCK-24PX": "ملف مؤمن"
}
}
}
}

View File

@ -179,7 +179,6 @@
"UNKNOWN_LOCATION": "Neznámé",
"NO_RESULTS": "Parametrům hledání odpovídá 0 výsledků",
"NO_FILTER_RESULTS": "K vašemu filtru je 0 výsledků",
"TOGGLE_SEARCH_FILTER": "Přepnout filtr hledání",
"ERRORS": {
"500": "Při pokusu o zpracování dotazu hledání došlo k chybě [500]",
"GENERIC": "Při pokusu o zpracování dotazu hledání došlo k chybě"
@ -445,7 +444,7 @@
},
"INFO_PANEL": {
"TABS": {
},
"DETAILS": "Podrobnosti"
},
@ -599,4 +598,4 @@
"BASELINE-LOCK-24PX": "uzamčený soubor"
}
}
}
}

View File

@ -179,7 +179,6 @@
"UNKNOWN_LOCATION": "Ukendt",
"NO_RESULTS": "Der blev ikke fundet nogen søgeresultater",
"NO_FILTER_RESULTS": "Dit filter gav 0 resultater",
"TOGGLE_SEARCH_FILTER": "Slå søgefilter til/fra",
"ERRORS": {
"500": "Der opstod en fejl under behandling af søgeforespørgslen [500]",
"GENERIC": "Der opstod en fejl under behandling af søgeforespørgslen"
@ -599,4 +598,4 @@
"BASELINE-LOCK-24PX": "låst fil"
}
}
}
}

View File

@ -179,7 +179,6 @@
"UNKNOWN_LOCATION": "Unbekannt",
"NO_RESULTS": "Es wurden 0 Suchergebnisse gefunden",
"NO_FILTER_RESULTS": "Der Filter hat 0 Treffer gefunden",
"TOGGLE_SEARCH_FILTER": "Suchfilter umschalten",
"ERRORS": {
"500": "Bei der Bearbeitung der Suchanfrage ist ein Fehler aufgetreten [500]",
"GENERIC": "Bei der Bearbeitung der Suchanfrage ist ein Fehler aufgetreten"
@ -599,4 +598,4 @@
"BASELINE-LOCK-24PX": "gesperrte Datei"
}
}
}
}

View File

@ -181,7 +181,6 @@
"NO_RESULTS": "Your search returned 0 results",
"EMPTY_SEARCH": "Search term required",
"NO_FILTER_RESULTS": "Your filter returned 0 results",
"TOGGLE_SEARCH_FILTER": "Toggle search filter",
"ERRORS": {
"500": "There was an error processing the search query [500]",
"GENERIC": "There was an error processing the search query"

View File

@ -179,7 +179,6 @@
"UNKNOWN_LOCATION": "Desconocido",
"NO_RESULTS": "Su búsqueda arrojó 0 resultados",
"NO_FILTER_RESULTS": "Su filtro ha devuelto 0 resultados",
"TOGGLE_SEARCH_FILTER": "Alternar filtro de búsqueda",
"ERRORS": {
"500": "Error al procesar la consulta de búsqueda [500]",
"GENERIC": "Error al procesar la consulta de búsqueda"
@ -599,4 +598,4 @@
"BASELINE-LOCK-24PX": "fichero bloqueado"
}
}
}
}

View File

@ -179,7 +179,6 @@
"UNKNOWN_LOCATION": "Tuntematon",
"NO_RESULTS": "Hakusi ei tuottanut yhtään tulosta",
"NO_FILTER_RESULTS": "Suodatin ei tuottanut yhtään tulosta",
"TOGGLE_SEARCH_FILTER": "Näytä tai piilota hakusuodatin",
"ERRORS": {
"500": "Hakusanan käsittelyssä tapahtui virhe [500]",
"GENERIC": "Hakusanan käsittelyssä tapahtui virhe"
@ -599,4 +598,4 @@
"BASELINE-LOCK-24PX": "tiedosto lukittu"
}
}
}
}

View File

@ -179,7 +179,6 @@
"UNKNOWN_LOCATION": "Inconnu",
"NO_RESULTS": "Votre recherche a renvoyé 0 résultat",
"NO_FILTER_RESULTS": "Votre filtre a renvoyé 0 résultat",
"TOGGLE_SEARCH_FILTER": "Activer/désactiver le filtre de recherche",
"ERRORS": {
"500": "Une erreur s'est produite lors du traitement de la requête [500]",
"GENERIC": "Une erreur s'est produite lors du traitement de la requête"
@ -599,4 +598,4 @@
"BASELINE-LOCK-24PX": "fichier verrouillé"
}
}
}
}

View File

@ -179,7 +179,6 @@
"UNKNOWN_LOCATION": "Sconosciuto",
"NO_RESULTS": "La ricerca ha restituito 0 risultati",
"NO_FILTER_RESULTS": "Il filtro ha restituito 0 risultati",
"TOGGLE_SEARCH_FILTER": "Attiva filtro di ricerca",
"ERRORS": {
"500": "Si è verificato un errore di elaborazione della query di ricerca [500]",
"GENERIC": "Si è verificato un errore di elaborazione della query di ricerca"
@ -599,4 +598,4 @@
"BASELINE-LOCK-24PX": "File bloccato"
}
}
}
}

View File

@ -179,7 +179,6 @@
"UNKNOWN_LOCATION": "不明",
"NO_RESULTS": "検索結果は 0 件です",
"NO_FILTER_RESULTS": "フィルタによる検索結果は 0 件です",
"TOGGLE_SEARCH_FILTER": "検索フィルタを切り替えます",
"ERRORS": {
"500": "検索クエリの処理中にエラーが発生しました [500]",
"GENERIC": "検索クエリの処理中にエラーが発生しました"
@ -599,4 +598,4 @@
"BASELINE-LOCK-24PX": "ロックされているファイル"
}
}
}
}

View File

@ -179,7 +179,6 @@
"UNKNOWN_LOCATION": "Ukjent",
"NO_RESULTS": "Søket ditt ga 0 resultater",
"NO_FILTER_RESULTS": "Filter ditt ga 0 resultater",
"TOGGLE_SEARCH_FILTER": "Aktiver/deaktiver søkefilter",
"ERRORS": {
"500": "Det oppstod en feil med behandling av søkespørringen [500]",
"GENERIC": "Det oppstod en feil med behandling av søkespørringen"
@ -599,4 +598,4 @@
"BASELINE-LOCK-24PX": "låst fil"
}
}
}
}

View File

@ -179,7 +179,6 @@
"UNKNOWN_LOCATION": "Onbekend",
"NO_RESULTS": "Uw zoekopdracht heeft 0 resultaten opgeleverd",
"NO_FILTER_RESULTS": "Uw filter heeft 0 resultaten opgeleverd",
"TOGGLE_SEARCH_FILTER": "Zoekfilter in- of uitschakelen",
"ERRORS": {
"500": "Er is een fout opgetreden bij het verwerken van de zoekquery [500]",
"GENERIC": "Er is een fout opgetreden bij het verwerken van de zoekquery"
@ -599,4 +598,4 @@
"BASELINE-LOCK-24PX": "Vergrendeld bestand"
}
}
}
}

View File

@ -179,7 +179,6 @@
"UNKNOWN_LOCATION": "Nieznane",
"NO_RESULTS": "Wyszukiwanie nie zwróciło żadnych wyników",
"NO_FILTER_RESULTS": "Filtr zwrócił 0 wyników",
"TOGGLE_SEARCH_FILTER": "Przełącz filtr wyszukiwania",
"ERRORS": {
"500": "Podczas przetwarzania zapytania wyszukiwania wystąpił błąd [500]",
"GENERIC": "Podczas przetwarzania zapytania wyszukiwania wystąpił błąd"
@ -599,4 +598,4 @@
"BASELINE-LOCK-24PX": "zablokowany plik"
}
}
}
}

View File

@ -179,7 +179,6 @@
"UNKNOWN_LOCATION": "Desconhecido",
"NO_RESULTS": "Sua pesquisa retornou 0 resultados",
"NO_FILTER_RESULTS": "Seu filtro retornou 0 resultados",
"TOGGLE_SEARCH_FILTER": "Alternar filtro de pesquisa",
"ERRORS": {
"500": "Houve um erro ao processar a consulta da pesquisa [500]",
"GENERIC": "Houve um erro ao processar a consulta da pesquisa"
@ -599,4 +598,4 @@
"BASELINE-LOCK-24PX": "arquivo bloqueado"
}
}
}
}

View File

@ -179,7 +179,6 @@
"UNKNOWN_LOCATION": "Неизвестно",
"NO_RESULTS": "По вашему запросу ничего не найдено",
"NO_FILTER_RESULTS": "Ваш фильтр вернул 0 результатов",
"TOGGLE_SEARCH_FILTER": "Переключить фильтр поиска",
"ERRORS": {
"500": "При обработке поискового запроса [500] возникла ошибка",
"GENERIC": "При обработке поискового запроса возникла ошибка"
@ -599,4 +598,4 @@
"BASELINE-LOCK-24PX": "заблокированный файл"
}
}
}
}

View File

@ -179,7 +179,6 @@
"UNKNOWN_LOCATION": "Okänd",
"NO_RESULTS": "Din sökning gav inga resultat",
"NO_FILTER_RESULTS": "Ditt filter gav inga resultat",
"TOGGLE_SEARCH_FILTER": "Växla sökfilter",
"ERRORS": {
"500": "Det uppstod ett fel när sökförfrågan behandlades [500]",
"GENERIC": "Det uppstod ett fel när sökförfrågan behandlades"
@ -599,4 +598,4 @@
"BASELINE-LOCK-24PX": "låst fil"
}
}
}
}

View File

@ -179,7 +179,6 @@
"UNKNOWN_LOCATION": "未知",
"NO_RESULTS": "您的搜索返回了 0 个结果",
"NO_FILTER_RESULTS": "您的筛选返回了 0 个结果",
"TOGGLE_SEARCH_FILTER": "切换搜索过滤器",
"ERRORS": {
"500": "处理搜索查询时发生错误 [500]",
"GENERIC": "处理搜索查询时发生错误"
@ -599,4 +598,4 @@
"BASELINE-LOCK-24PX": "无法完成该操作。将此信息告知您的 IT 团队:将 {{data}} 反序列化为 {{contentType}} 过程中出错"
}
}
}
}