From d3be553fd6497a287c4fb01b54396d6fd0e4d852 Mon Sep 17 00:00:00 2001
From: AleksanderSklorz <115619721+AleksanderSklorz@users.noreply.github.com>
Date: Thu, 20 Jul 2023 08:38:34 +0200
Subject: [PATCH] [ACS-5183] properties facet file size and file type (#3347)
* ACS-5183 Started updating configuration for file type and size
* ACS-5183 Corrected file extensions
* ACS-5183 Added more file extensions
* ACS-5183 Corrected configuration
* ACS-5183 Fix e2e
* ACS-5183 Added translation key
* ACS-5183 Changed jira for excluded e2es
* ACS-5183 Corrected import
* ACS-5183 Added license header
---
e2e/protractor/protractor.excludes.json | 10 +-
.../suites/search/search-filters.test.ts | 121 ++++++------------
.../aca-content/assets/app.extensions.json | 50 +++-----
projects/aca-content/assets/i18n/ar.json | 9 +-
projects/aca-content/assets/i18n/cs.json | 9 +-
projects/aca-content/assets/i18n/da.json | 9 +-
projects/aca-content/assets/i18n/de.json | 9 +-
projects/aca-content/assets/i18n/en.json | 11 +-
projects/aca-content/assets/i18n/es.json | 9 +-
projects/aca-content/assets/i18n/fi.json | 9 +-
projects/aca-content/assets/i18n/fr.json | 9 +-
projects/aca-content/assets/i18n/it.json | 9 +-
projects/aca-content/assets/i18n/ja.json | 9 +-
projects/aca-content/assets/i18n/nb.json | 9 +-
projects/aca-content/assets/i18n/nl.json | 9 +-
projects/aca-content/assets/i18n/pl.json | 9 +-
projects/aca-content/assets/i18n/pt-BR.json | 9 +-
projects/aca-content/assets/i18n/ru.json | 9 +-
projects/aca-content/assets/i18n/sv.json | 9 +-
projects/aca-content/assets/i18n/zh-CN.json | 9 +-
.../search/filters/properties-filter.ts | 103 +++++++++++++++
.../components/search/filters/size-filter.ts | 66 ----------
.../src/components/search/index.ts | 2 +-
.../src/components/search/search-filters.ts | 5 +-
24 files changed, 183 insertions(+), 329 deletions(-)
create mode 100644 projects/aca-testing-shared/src/components/search/filters/properties-filter.ts
delete mode 100755 projects/aca-testing-shared/src/components/search/filters/size-filter.ts
diff --git a/e2e/protractor/protractor.excludes.json b/e2e/protractor/protractor.excludes.json
index 353fbcc7d9..d2ea74f07d 100644
--- a/e2e/protractor/protractor.excludes.json
+++ b/e2e/protractor/protractor.excludes.json
@@ -6,14 +6,8 @@
"C286252": "temp, see https://alfresco.atlassian.net/browse/ACS-5189",
"C284666": "temp, see https://alfresco.atlassian.net/browse/ACS-5189",
"C286269": "temp, see https://alfresco.atlassian.net/browse/ACS-5189",
- "C279191": "temp, will be fixed in https://alfresco.atlassian.net/browse/ACS-5183",
- "C279192": "temp, will be fixed in https://alfresco.atlassian.net/browse/ACS-5183",
- "C279193": "temp, will be fixed in https://alfresco.atlassian.net/browse/ACS-5183",
- "C279195": "temp, will be fixed in https://alfresco.atlassian.net/browse/ACS-5183",
- "C280051": "temp, will be fixed in https://alfresco.atlassian.net/browse/ACS-5183",
- "C280052": "temp, will be fixed in https://alfresco.atlassian.net/browse/ACS-5183",
- "C279188": "temp, will be fixed in https://alfresco.atlassian.net/browse/ACS-5183",
- "C308042": "temp, will be fixed in https://alfresco.atlassian.net/browse/ACS-5183",
+ "C280051": "temp, will be fixed in https://alfresco.atlassian.net/browse/ACS-5632",
+ "C308042": "temp, will be fixed in https://alfresco.atlassian.net/browse/ACS-5632",
"C279186": "temp, will be fixed in https://alfresco.atlassian.net/browse/ACS-4985",
"C279219": "temp, will be fixed in https://alfresco.atlassian.net/browse/ACS-4985",
"C279221": "temp, will be fixed in https://alfresco.atlassian.net/browse/ACS-4985",
diff --git a/e2e/protractor/suites/search/search-filters.test.ts b/e2e/protractor/suites/search/search-filters.test.ts
index c8a14853df..d4ac8de309 100644
--- a/e2e/protractor/suites/search/search-filters.test.ts
+++ b/e2e/protractor/suites/search/search-filters.test.ts
@@ -31,7 +31,7 @@ import {
FILES,
SITE_VISIBILITY,
SITE_ROLES,
- SizeOptions
+ SizeOperator
} from '@alfresco/aca-testing-shared';
import { BrowserActions } from '@alfresco/adf-testing';
@@ -62,7 +62,7 @@ describe('Search filters', () => {
source: FILES.pdfFile
};
- const expectedFileTypes = ['Adobe PDF Document (1)', 'JPEG Image (1)'];
+ const expectedFileTypes = ['pdf', 'wpd'];
const expectedCreators = [`${user1} ${user1} (1)`, `${user2} ${user2} (1)`];
const expectedModifiers = [`${user1} ${user1} (1)`, `${user2} ${user2} (1)`];
const expectedLocations = ['_REPOSITORY_ (1)', `${site} (1)`];
@@ -77,7 +77,6 @@ describe('Search filters', () => {
const { searchInput } = page.pageLayoutHeader;
const { dataTable, filters, toolbar } = page;
- const sizeFilter = filters.size;
const fileTypeFilter = filters.fileType;
const createdDateFilter = filters.createdDate;
const creatorFilter = filters.creator;
@@ -118,7 +117,6 @@ describe('Search filters', () => {
});
it('[C279186] Filters are displayed', async () => {
- 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');
@@ -129,64 +127,42 @@ describe('Search filters', () => {
describe('Filter by Size', () => {
afterEach(async () => {
- await sizeFilter.resetPanel();
- });
-
- it('[C279197] Expand / Collapse the Size filter panel', async () => {
- expect(await sizeFilter.isDialogPresent()).toBe(false, 'Size filter panel is 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');
-
- await sizeFilter.closeDialog();
-
- expect(await sizeFilter.isDialogPresent()).toBe(false, 'Size filter panel is expanded');
+ await fileTypeFilter.openDialog();
+ await fileTypeFilter.clickResetButton();
});
- it('[C279199] Filter by Small', async () => {
- await sizeFilter.openDialog();
- await sizeFilter.getSizeCheckboxOption(SizeOptions.Small).click();
- await sizeFilter.clickApplyButton();
+ it('[C279199] Filter existing', async () => {
+ await fileTypeFilter.openDialog();
+ await fileTypeFilter.typeFileSize('1024');
+ await fileTypeFilter.selectFileSizeOperator(SizeOperator.AT_MOST);
+ await fileTypeFilter.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.openDialog();
- await sizeFilter.getSizeCheckboxOption(SizeOptions.Huge).click();
- await sizeFilter.clickApplyButton();
+ it('[C279199] Filter non existing', async () => {
+ await fileTypeFilter.openDialog();
+ await fileTypeFilter.typeFileSize('512000');
+ await fileTypeFilter.clickApplyButton();
expect(await dataTable.isEmpty()).toBe(true, 'list is not empty');
});
- it('[C279203] Filter by multiple size categories', async () => {
- await sizeFilter.openDialog();
- await sizeFilter.getSizeCheckboxOption(SizeOptions.Small).click();
- await sizeFilter.getSizeCheckboxOption(SizeOptions.Medium).click();
- await sizeFilter.getSizeCheckboxOption(SizeOptions.Large).click();
- 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.openDialog();
- await sizeFilter.getSizeCheckboxOption(SizeOptions.Small).click();
- await sizeFilter.getSizeCheckboxOption(SizeOptions.Medium).click();
- await sizeFilter.clickApplyButton();
-
- await sizeFilter.openDialog();
- expect(await sizeFilter.getFiltersCheckedValues()).toEqual(['Small', 'Medium'], 'Incorrect checked Size filters');
+ await fileTypeFilter.openDialog();
+ await fileTypeFilter.typeFileSize('1024');
+ await fileTypeFilter.selectFileSizeOperator(SizeOperator.AT_MOST);
+ await fileTypeFilter.clickApplyButton();
- await sizeFilter.clickResetButton();
- await sizeFilter.openDialog();
- expect(await sizeFilter.getFiltersCheckedValues()).toEqual([], 'Size filters not cleared');
+ await fileTypeFilter.openDialog();
+ expect(await fileTypeFilter.getFileSizeValue()).toEqual('1024', 'Incorrect file size');
+ expect(await fileTypeFilter.getFileSizeOperatorValue()).toEqual(SizeOperator.AT_MOST, 'Incorrect file size operator');
+ await fileTypeFilter.clickResetButton();
+ await fileTypeFilter.closeDialog();
+ await fileTypeFilter.openDialog();
+ expect(await fileTypeFilter.getFileSizeValue()).toEqual('', 'Incorrect file size');
+ expect(await fileTypeFilter.getFileSizeOperatorValue()).toEqual(SizeOperator.AT_LEAST, 'Incorrect file size operator');
});
});
@@ -300,8 +276,7 @@ describe('Search filters', () => {
it('[C279191] Expand / Collapse the File type filter panel', async () => {
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');
+ expect(await fileTypeFilter.getFileTypesValues('pd')).toEqual(expectedFileTypes, 'Incorrect File type filters facets');
await fileTypeFilter.closeDialog();
expect(await fileTypeFilter.isDialogPresent()).toBe(false, 'File type filter panel is expanded');
@@ -309,45 +284,41 @@ describe('Search filters', () => {
it('[C279192] Results are filtered by File type', async () => {
await fileTypeFilter.openDialog();
- await fileTypeFilter.checkCategory('Adobe PDF Document');
+ await fileTypeFilter.selectFileType('pdf');
await fileTypeFilter.clickApplyButton();
- expect(await fileTypeFilter.getChipTitle()).toEqual('Adobe PDF Document');
+ expect(await fileTypeFilter.getChipTitle()).toEqual('pdf');
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.openDialog();
- await fileTypeFilter.checkCategory('JPEG Image');
+ await fileTypeFilter.selectFileType('jpg');
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 fileTypeFilter.getChipTitle()).toEqual(['Adobe PDF Document', 'JPEG Image'].join(', '));
+ expect(await fileTypeFilter.getChipTitle()).toEqual(['pdf', 'jpg'].join(', '));
});
it('[C279193] Clear the File type filter options', async () => {
await fileTypeFilter.openDialog();
- await fileTypeFilter.checkCategory('Adobe PDF Document');
+ await fileTypeFilter.selectFileType('pdf');
await fileTypeFilter.clickApplyButton();
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.openDialog();
- expect(await fileTypeFilter.getFiltersCheckedValues()).toEqual(['Adobe PDF Document (1)']);
+ expect(await fileTypeFilter.getSelectedFileTypeOptions()).toEqual(['pdf']);
await fileTypeFilter.clickResetButton();
+ await fileTypeFilter.closeDialog();
+ await fileTypeFilter.openDialog();
+ 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 fileTypeFilter.getChipTitle()).toEqual('');
});
-
- it('[C279195] Search for a specific file type', async () => {
- 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');
- });
});
describe('Filter by Creator', () => {
@@ -607,12 +578,10 @@ describe('Search filters', () => {
});
it('[C280051] Multiple filters can be applied', async () => {
- await sizeFilter.openDialog();
- await sizeFilter.getSizeCheckboxOption(SizeOptions.Small).click();
- await sizeFilter.clickApplyButton();
-
await fileTypeFilter.openDialog();
- await fileTypeFilter.checkCategory('JPEG Image');
+ await fileTypeFilter.typeFileSize('1024');
+ await fileTypeFilter.selectFileSizeOperator(SizeOperator.AT_MOST);
+ await fileTypeFilter.selectFileType('jpg');
await fileTypeFilter.clickApplyButton();
await creatorFilter.openDialog();
@@ -625,7 +594,7 @@ describe('Search filters', () => {
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 fileTypeFilter.getChipTitle()).toEqual('JPEG Image');
+ expect(await fileTypeFilter.getChipTitle()).toEqual(`${SizeOperator.AT_MOST} 1024 KB, jpg`);
expect(await creatorFilter.getChipTitle()).toEqual(`${user1} ${user1}`);
expect(await locationFilter.getChipTitle()).toEqual(site);
@@ -637,7 +606,7 @@ describe('Search filters', () => {
it('[C280052] Total results is updated correctly', async () => {
await fileTypeFilter.openDialog();
- await fileTypeFilter.checkCategory('JPEG Image');
+ await fileTypeFilter.selectFileType('jpg');
await fileTypeFilter.clickApplyButton();
await creatorFilter.openDialog();
@@ -653,7 +622,7 @@ describe('Search filters', () => {
it('[C279188] Pagination is correct when search results are filtered', async () => {
await fileTypeFilter.openDialog();
- await fileTypeFilter.checkCategory('JPEG Image');
+ await fileTypeFilter.selectFileType('jpg');
await fileTypeFilter.clickApplyButton();
await creatorFilter.openDialog();
@@ -668,10 +637,6 @@ describe('Search filters', () => {
});
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();
@@ -688,10 +653,6 @@ describe('Search filters', () => {
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();
diff --git a/projects/aca-content/assets/app.extensions.json b/projects/aca-content/assets/app.extensions.json
index 6e1c8cb071..2431f34593 100644
--- a/projects/aca-content/assets/app.extensions.json
+++ b/projects/aca-content/assets/app.extensions.json
@@ -1428,31 +1428,25 @@
}
},
{
- "id": "size",
- "name": "SEARCH.CATEGORIES.SIZE",
+ "id": "properties",
+ "name": "SEARCH.CATEGORIES.PROPERTIES",
"enabled": true,
"component": {
- "selector": "check-list",
+ "selector": "properties",
"settings": {
- "allowUpdateOnChange": false,
- "hideDefaultAction": true,
- "options": [
- {
- "name": "SEARCH.CATEGORIES.SIZE_OPTIONS.SMALL",
- "value": "content.size:[0 TO 1048576>"
- },
- {
- "name": "SEARCH.CATEGORIES.SIZE_OPTIONS.MEDIUM",
- "value": "content.size:[1048576 TO 52428800]"
- },
- {
- "name": "SEARCH.CATEGORIES.SIZE_OPTIONS.LARGE",
- "value": "content.size:<52428800 TO 524288000]"
- },
- {
- "name": "SEARCH.CATEGORIES.SIZE_OPTIONS.HUGE",
- "value": "content.size:<524288000 TO MAX]"
- }
+ "field": "content.size,cm:name",
+ "fileExtensions": [
+ "3g2", "3gp", "acp", "aep", "ai", "aiff", "apk", "arw", "avi", "bin", "bmp", "cgm", "class", "cr2",
+ "css", "csv", "dita", "dng", "doc", "docm", "docx", "dotm","dwg", "dwt", "eps", "flac", "flv", "fm",
+ "fodg", "gif", "gtar", "gz", "htm", "html", "icns", "ics", "ief", "indd", "jar", "java", "jp2", "jpeg",
+ "jpg", "js", "json", "jsp", "m4v", "man", "md", "mov", "mp3", "mp4", "mpeg", "mpp", "mrw", "msg", "nef",
+ "numbers", "odb", "odf", "odg", "odi", "odm", "odp", "ods", "odt", "oga", "ogg", "ogv", "ogx", "orf",
+ "ott", "pages", "pbm", "pdf", "pef", "pgm", "pmd", "png", "pnm", "pot", "potx", "ppam", "ppj", "pps",
+ "ppsm", "ppt", "pptm", "pptx", "ps", "psd", "rad", "raf", "rar", "rgb", "rss", "rtf", "rw2", "rwl",
+ "sda", "sdc", "sdd", "sdp", "sds", "sdw", "sgi", "sgl", "sgml", "sh", "sldm", "smf", "stw", "svg",
+ "swf", "sxi", "tar", "tex", "texi", "tif", "tiff", "ts", "tsv", "txt", "vsd", "vsdm", "vsdx", "vssm",
+ "vstm", "vstx", "wav", "webm", "wma", "wmv", "wpd", "wrl", "x3f", "xdp", "xhtml", "xla", "xlam", "xls",
+ "xlsb", "xlsm", "xlsx", "xltm", "xml", "xpm", "xwd", "z", "zip"
]
}
}
@@ -1487,18 +1481,6 @@
}
}
},
- {
- "id": "fileType",
- "name": "SEARCH.FACET_FIELDS.FILE_TYPE",
- "component": {
- "selector": "",
- "settings": {
- "allowUpdateOnChange": false,
- "hideDefaultAction": true,
- "field": "content.mimetype"
- }
- }
- },
{
"id": "location",
"name": "SEARCH.FACET_FIELDS.LOCATION",
diff --git a/projects/aca-content/assets/i18n/ar.json b/projects/aca-content/assets/i18n/ar.json
index be265b9f53..5464b385b0 100644
--- a/projects/aca-content/assets/i18n/ar.json
+++ b/projects/aca-content/assets/i18n/ar.json
@@ -526,7 +526,6 @@
"CREATE_DATE": "تاريخ الإنشاء"
},
"FACET_FIELDS": {
- "FILE_TYPE": "نوع الملف",
"CREATOR": "المنشئ",
"MODIFIER": "المعدل",
"LOCATION": "مكان",
@@ -534,13 +533,6 @@
},
"CATEGORIES": {
"MODIFIED_DATE": "تاريخ التعديل",
- "SIZE": "الحجم",
- "SIZE_OPTIONS": {
- "SMALL": "صغير",
- "MEDIUM": "متوسط",
- "LARGE": "كبير",
- "HUGE": "ضخم"
- },
"CREATED_DATE": "تاريخ الإنشاء",
"EFFECTIVITY_FROM": "فعالية من",
"EFFECTIVITY_TO": "فعالية ل",
@@ -614,3 +606,4 @@
}
}
}
+
diff --git a/projects/aca-content/assets/i18n/cs.json b/projects/aca-content/assets/i18n/cs.json
index 33f3afa2a7..6132213ff3 100644
--- a/projects/aca-content/assets/i18n/cs.json
+++ b/projects/aca-content/assets/i18n/cs.json
@@ -526,7 +526,6 @@
"CREATE_DATE": "Datum vytvoření"
},
"FACET_FIELDS": {
- "FILE_TYPE": "Typ souboru",
"CREATOR": "Autor",
"MODIFIER": "Upravující",
"LOCATION": "Umístění",
@@ -534,13 +533,6 @@
},
"CATEGORIES": {
"MODIFIED_DATE": "Datum úpravy",
- "SIZE": "Velikost",
- "SIZE_OPTIONS": {
- "SMALL": "Malá",
- "MEDIUM": "Střední",
- "LARGE": "Velká",
- "HUGE": "Obrovská"
- },
"CREATED_DATE": "Datum vytvoření",
"EFFECTIVITY_FROM": "Platnost od",
"EFFECTIVITY_TO": "Platnost do",
@@ -614,3 +606,4 @@
}
}
}
+
diff --git a/projects/aca-content/assets/i18n/da.json b/projects/aca-content/assets/i18n/da.json
index 6d6a63fc8d..99d2f9a0d0 100644
--- a/projects/aca-content/assets/i18n/da.json
+++ b/projects/aca-content/assets/i18n/da.json
@@ -526,7 +526,6 @@
"CREATE_DATE": "Oprettelsesdato"
},
"FACET_FIELDS": {
- "FILE_TYPE": "Filtype",
"CREATOR": "Oprettet af",
"MODIFIER": "Ændret af",
"LOCATION": "Placering",
@@ -534,13 +533,6 @@
},
"CATEGORIES": {
"MODIFIED_DATE": "Ændringsdato",
- "SIZE": "Størrelse",
- "SIZE_OPTIONS": {
- "SMALL": "Lille",
- "MEDIUM": "Medium",
- "LARGE": "Stor",
- "HUGE": "Meget stor"
- },
"CREATED_DATE": "Oprettelsesdato",
"EFFECTIVITY_FROM": "Gældende periode fra",
"EFFECTIVITY_TO": "Gældende periode til",
@@ -614,3 +606,4 @@
}
}
}
+
diff --git a/projects/aca-content/assets/i18n/de.json b/projects/aca-content/assets/i18n/de.json
index a679747096..e3fc043a53 100644
--- a/projects/aca-content/assets/i18n/de.json
+++ b/projects/aca-content/assets/i18n/de.json
@@ -526,7 +526,6 @@
"CREATE_DATE": "Datum der Erstellung"
},
"FACET_FIELDS": {
- "FILE_TYPE": "Dateityp",
"CREATOR": "Ersteller",
"MODIFIER": "Bearbeiter",
"LOCATION": "Speicherort",
@@ -534,13 +533,6 @@
},
"CATEGORIES": {
"MODIFIED_DATE": "Datum der Änderung",
- "SIZE": "Größe",
- "SIZE_OPTIONS": {
- "SMALL": "Klein",
- "MEDIUM": "Mittel",
- "LARGE": "Groß",
- "HUGE": "Riesig"
- },
"CREATED_DATE": "Datum der Erstellung",
"EFFECTIVITY_FROM": "Effektiv ab",
"EFFECTIVITY_TO": "Effektiv bis",
@@ -614,3 +606,4 @@
}
}
}
+
diff --git a/projects/aca-content/assets/i18n/en.json b/projects/aca-content/assets/i18n/en.json
index c9368b0e3e..271f149b1c 100644
--- a/projects/aca-content/assets/i18n/en.json
+++ b/projects/aca-content/assets/i18n/en.json
@@ -526,7 +526,6 @@
"CREATE_DATE": "Created date"
},
"FACET_FIELDS": {
- "FILE_TYPE": "File type",
"CREATOR": "Creator",
"MODIFIER": "Modifier",
"LOCATION": "Location",
@@ -534,17 +533,11 @@
},
"CATEGORIES": {
"MODIFIED_DATE": "Modified date",
- "SIZE": "Size",
- "SIZE_OPTIONS": {
- "SMALL": "Small",
- "MEDIUM": "Medium",
- "LARGE": "Large",
- "HUGE": "Huge"
- },
"CREATED_DATE": "Created date",
"EFFECTIVITY_FROM": "Effectivity from",
"EFFECTIVITY_TO": "Effectivity to",
- "LOGIC": "Logic"
+ "LOGIC": "Logic",
+ "PROPERTIES": "Properties"
},
"SEARCH_HEADER" : {
"TITLE":"Filter",
diff --git a/projects/aca-content/assets/i18n/es.json b/projects/aca-content/assets/i18n/es.json
index f413d0dd94..a8f71a2be1 100644
--- a/projects/aca-content/assets/i18n/es.json
+++ b/projects/aca-content/assets/i18n/es.json
@@ -526,7 +526,6 @@
"CREATE_DATE": "Fecha de creación"
},
"FACET_FIELDS": {
- "FILE_TYPE": "Tipo de fichero",
"CREATOR": "Creador",
"MODIFIER": "Modificador",
"LOCATION": "Ubicación",
@@ -534,13 +533,6 @@
},
"CATEGORIES": {
"MODIFIED_DATE": "Fecha de modificación",
- "SIZE": "Tamaño",
- "SIZE_OPTIONS": {
- "SMALL": "Pequeño",
- "MEDIUM": "Mediano",
- "LARGE": "Grande",
- "HUGE": "Enorme"
- },
"CREATED_DATE": "Fecha de creación",
"EFFECTIVITY_FROM": "Válido desde",
"EFFECTIVITY_TO": "Válido hasta",
@@ -614,3 +606,4 @@
}
}
}
+
diff --git a/projects/aca-content/assets/i18n/fi.json b/projects/aca-content/assets/i18n/fi.json
index 142dfac187..2be115e859 100644
--- a/projects/aca-content/assets/i18n/fi.json
+++ b/projects/aca-content/assets/i18n/fi.json
@@ -526,7 +526,6 @@
"CREATE_DATE": "Luontipäivämäärä"
},
"FACET_FIELDS": {
- "FILE_TYPE": "Tiedostotyyppi",
"CREATOR": "Tekijä",
"MODIFIER": "Muokkaaja",
"LOCATION": "Sijainti",
@@ -534,13 +533,6 @@
},
"CATEGORIES": {
"MODIFIED_DATE": "Muokkauspäivämäärä",
- "SIZE": "Koko",
- "SIZE_OPTIONS": {
- "SMALL": "Pieni",
- "MEDIUM": "Keskikokoinen",
- "LARGE": "Suuri",
- "HUGE": "Valtava"
- },
"CREATED_DATE": "Luontipäivämäärä",
"EFFECTIVITY_FROM": "Voimassaolon alku",
"EFFECTIVITY_TO": "Voimassaolon loppu",
@@ -614,3 +606,4 @@
}
}
}
+
diff --git a/projects/aca-content/assets/i18n/fr.json b/projects/aca-content/assets/i18n/fr.json
index 4f2f7e801f..8dc4ad2249 100644
--- a/projects/aca-content/assets/i18n/fr.json
+++ b/projects/aca-content/assets/i18n/fr.json
@@ -526,7 +526,6 @@
"CREATE_DATE": "Date de création"
},
"FACET_FIELDS": {
- "FILE_TYPE": "Type de fichier",
"CREATOR": "Créateur",
"MODIFIER": "Modificateur",
"LOCATION": "Emplacement",
@@ -534,13 +533,6 @@
},
"CATEGORIES": {
"MODIFIED_DATE": "Date de modification",
- "SIZE": "Taille",
- "SIZE_OPTIONS": {
- "SMALL": "Petite",
- "MEDIUM": "Moyenne",
- "LARGE": "Grande",
- "HUGE": "Enorme"
- },
"CREATED_DATE": "Date de création",
"EFFECTIVITY_FROM": "Date de début d'effectivité",
"EFFECTIVITY_TO": "Date de fin d'effectivité",
@@ -614,3 +606,4 @@
}
}
}
+
diff --git a/projects/aca-content/assets/i18n/it.json b/projects/aca-content/assets/i18n/it.json
index 0737ce6771..5fb1d6aa74 100644
--- a/projects/aca-content/assets/i18n/it.json
+++ b/projects/aca-content/assets/i18n/it.json
@@ -526,7 +526,6 @@
"CREATE_DATE": "Data di creazione"
},
"FACET_FIELDS": {
- "FILE_TYPE": "Tipo di file",
"CREATOR": "Creatore",
"MODIFIER": "Modificatore",
"LOCATION": "Posizione",
@@ -534,13 +533,6 @@
},
"CATEGORIES": {
"MODIFIED_DATE": "Data di modifica",
- "SIZE": "Dimensione",
- "SIZE_OPTIONS": {
- "SMALL": "Piccola",
- "MEDIUM": "Media",
- "LARGE": "Grande",
- "HUGE": "Enorme"
- },
"CREATED_DATE": "Data di creazione",
"EFFECTIVITY_FROM": "Inizio validità",
"EFFECTIVITY_TO": "Fine validità",
@@ -614,3 +606,4 @@
}
}
}
+
diff --git a/projects/aca-content/assets/i18n/ja.json b/projects/aca-content/assets/i18n/ja.json
index 2da9b26231..20c65d5a2a 100644
--- a/projects/aca-content/assets/i18n/ja.json
+++ b/projects/aca-content/assets/i18n/ja.json
@@ -526,7 +526,6 @@
"CREATE_DATE": "作成日"
},
"FACET_FIELDS": {
- "FILE_TYPE": "ファイルのタイプ",
"CREATOR": "作成者",
"MODIFIER": "変更者",
"LOCATION": "場所",
@@ -534,13 +533,6 @@
},
"CATEGORIES": {
"MODIFIED_DATE": "変更日",
- "SIZE": "サイズ",
- "SIZE_OPTIONS": {
- "SMALL": "小",
- "MEDIUM": "中",
- "LARGE": "大",
- "HUGE": "特大"
- },
"CREATED_DATE": "作成日",
"EFFECTIVITY_FROM": "有効性の開始",
"EFFECTIVITY_TO": "有効性の終了",
@@ -614,3 +606,4 @@
}
}
}
+
diff --git a/projects/aca-content/assets/i18n/nb.json b/projects/aca-content/assets/i18n/nb.json
index 22e6621288..635fdcca07 100644
--- a/projects/aca-content/assets/i18n/nb.json
+++ b/projects/aca-content/assets/i18n/nb.json
@@ -526,7 +526,6 @@
"CREATE_DATE": "Opprettelsesdato"
},
"FACET_FIELDS": {
- "FILE_TYPE": "Filtype",
"CREATOR": "Oppretter",
"MODIFIER": "Modifikator",
"LOCATION": "Sted",
@@ -534,13 +533,6 @@
},
"CATEGORIES": {
"MODIFIED_DATE": "Endringsdato",
- "SIZE": "Størrelse",
- "SIZE_OPTIONS": {
- "SMALL": "Liten",
- "MEDIUM": "Middels",
- "LARGE": "Stor",
- "HUGE": "Enorm"
- },
"CREATED_DATE": "Opprettelsesdato",
"EFFECTIVITY_FROM": "Effektivitet fra",
"EFFECTIVITY_TO": "Effektivitet til",
@@ -614,3 +606,4 @@
}
}
}
+
diff --git a/projects/aca-content/assets/i18n/nl.json b/projects/aca-content/assets/i18n/nl.json
index fc4d1e42c4..153e915fac 100644
--- a/projects/aca-content/assets/i18n/nl.json
+++ b/projects/aca-content/assets/i18n/nl.json
@@ -526,7 +526,6 @@
"CREATE_DATE": "Datum gemaakt"
},
"FACET_FIELDS": {
- "FILE_TYPE": "Bestandstype",
"CREATOR": "Maker",
"MODIFIER": "Gewijzigd door",
"LOCATION": "Locatie",
@@ -534,13 +533,6 @@
},
"CATEGORIES": {
"MODIFIED_DATE": "Datum gewijzigd",
- "SIZE": "Grootte",
- "SIZE_OPTIONS": {
- "SMALL": "Klein",
- "MEDIUM": "Gemiddeld",
- "LARGE": "Groot",
- "HUGE": "Zeer groot"
- },
"CREATED_DATE": "Datum gemaakt",
"EFFECTIVITY_FROM": "Effectiviteit vanaf",
"EFFECTIVITY_TO": "Effectiviteit tot",
@@ -614,3 +606,4 @@
}
}
}
+
diff --git a/projects/aca-content/assets/i18n/pl.json b/projects/aca-content/assets/i18n/pl.json
index 728e421d91..448407b096 100644
--- a/projects/aca-content/assets/i18n/pl.json
+++ b/projects/aca-content/assets/i18n/pl.json
@@ -526,7 +526,6 @@
"CREATE_DATE": "Data utworzenia"
},
"FACET_FIELDS": {
- "FILE_TYPE": "Typ pliku",
"CREATOR": "Twórca",
"MODIFIER": "Modyfikator",
"LOCATION": "Lokalizacja",
@@ -534,13 +533,6 @@
},
"CATEGORIES": {
"MODIFIED_DATE": "Data modyfikacji",
- "SIZE": "Rozmiar",
- "SIZE_OPTIONS": {
- "SMALL": "Mały",
- "MEDIUM": "Średni",
- "LARGE": "Duży",
- "HUGE": "Ogromny"
- },
"CREATED_DATE": "Data utworzenia",
"EFFECTIVITY_FROM": "Data początku obowiązywania",
"EFFECTIVITY_TO": "Data końca obowiązywania",
@@ -614,3 +606,4 @@
}
}
}
+
diff --git a/projects/aca-content/assets/i18n/pt-BR.json b/projects/aca-content/assets/i18n/pt-BR.json
index f322452de7..a2768ce94f 100644
--- a/projects/aca-content/assets/i18n/pt-BR.json
+++ b/projects/aca-content/assets/i18n/pt-BR.json
@@ -526,7 +526,6 @@
"CREATE_DATE": "Data de criação"
},
"FACET_FIELDS": {
- "FILE_TYPE": "Tipo de arquivo",
"CREATOR": "Criador",
"MODIFIER": "Modificador",
"LOCATION": "Localização",
@@ -534,13 +533,6 @@
},
"CATEGORIES": {
"MODIFIED_DATE": "Data de modificação",
- "SIZE": "Tamanho",
- "SIZE_OPTIONS": {
- "SMALL": "Pequeno",
- "MEDIUM": "Médio",
- "LARGE": "Grande",
- "HUGE": "Enorme"
- },
"CREATED_DATE": "Data de criação",
"EFFECTIVITY_FROM": "Eficácia de",
"EFFECTIVITY_TO": "Eficácia para",
@@ -614,3 +606,4 @@
}
}
}
+
diff --git a/projects/aca-content/assets/i18n/ru.json b/projects/aca-content/assets/i18n/ru.json
index 7f6f8a9c0b..0f9da8f4f7 100644
--- a/projects/aca-content/assets/i18n/ru.json
+++ b/projects/aca-content/assets/i18n/ru.json
@@ -526,7 +526,6 @@
"CREATE_DATE": "Дата создания"
},
"FACET_FIELDS": {
- "FILE_TYPE": "Тип файла",
"CREATOR": "Создатель",
"MODIFIER": "Редактор",
"LOCATION": "Местоположение",
@@ -534,13 +533,6 @@
},
"CATEGORIES": {
"MODIFIED_DATE": "Дата изменения",
- "SIZE": "Размер",
- "SIZE_OPTIONS": {
- "SMALL": "Маленький",
- "MEDIUM": "Средний",
- "LARGE": "Большой",
- "HUGE": "Огромный"
- },
"CREATED_DATE": "Дата создания",
"EFFECTIVITY_FROM": "Действует с",
"EFFECTIVITY_TO": "Действует до",
@@ -614,3 +606,4 @@
}
}
}
+
diff --git a/projects/aca-content/assets/i18n/sv.json b/projects/aca-content/assets/i18n/sv.json
index 9e2666d077..02c28539f3 100644
--- a/projects/aca-content/assets/i18n/sv.json
+++ b/projects/aca-content/assets/i18n/sv.json
@@ -526,7 +526,6 @@
"CREATE_DATE": "Skapad datum"
},
"FACET_FIELDS": {
- "FILE_TYPE": "Filtyp",
"CREATOR": "Skapad av",
"MODIFIER": "Ändrad av",
"LOCATION": "Plats",
@@ -534,13 +533,6 @@
},
"CATEGORIES": {
"MODIFIED_DATE": "Modifierad datum",
- "SIZE": "Storlek",
- "SIZE_OPTIONS": {
- "SMALL": "Litet",
- "MEDIUM": "Medium",
- "LARGE": "Stort",
- "HUGE": "Jättestort"
- },
"CREATED_DATE": "Skapad datum",
"EFFECTIVITY_FROM": "Giltighet från",
"EFFECTIVITY_TO": "Giltighet till",
@@ -614,3 +606,4 @@
}
}
}
+
diff --git a/projects/aca-content/assets/i18n/zh-CN.json b/projects/aca-content/assets/i18n/zh-CN.json
index c7ac84031c..b658f8c04d 100644
--- a/projects/aca-content/assets/i18n/zh-CN.json
+++ b/projects/aca-content/assets/i18n/zh-CN.json
@@ -526,7 +526,6 @@
"CREATE_DATE": "创建日期"
},
"FACET_FIELDS": {
- "FILE_TYPE": "文件类型",
"CREATOR": "创建者",
"MODIFIER": "修改者",
"LOCATION": "位置",
@@ -534,13 +533,6 @@
},
"CATEGORIES": {
"MODIFIED_DATE": "修改日期",
- "SIZE": "大小",
- "SIZE_OPTIONS": {
- "SMALL": "小",
- "MEDIUM": "中",
- "LARGE": "大",
- "HUGE": "特大"
- },
"CREATED_DATE": "创建日期",
"EFFECTIVITY_FROM": "有效开始",
"EFFECTIVITY_TO": "有效结束",
@@ -614,3 +606,4 @@
}
}
}
+
diff --git a/projects/aca-testing-shared/src/components/search/filters/properties-filter.ts b/projects/aca-testing-shared/src/components/search/filters/properties-filter.ts
new file mode 100644
index 0000000000..464236e701
--- /dev/null
+++ b/projects/aca-testing-shared/src/components/search/filters/properties-filter.ts
@@ -0,0 +1,103 @@
+/*!
+ * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
+ *
+ * Alfresco Example Content Application
+ *
+ * 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 .
+ */
+
+import { GenericFilter } from './generic-filter';
+import { by, element, ElementArrayFinder, ElementFinder } from 'protractor';
+
+export enum SizeOperator {
+ AT_LEAST = 'At Least',
+ AT_MOST = 'At Most',
+ EXACTLY = 'Exactly'
+}
+
+export class PropertiesFilter extends GenericFilter {
+ private readonly locators = {
+ fileSizeOperatorSelect: '[data-automation-id=adf-search-properties-file-size-operator-select]',
+ fileSizeOperatorOption: '.mat-option-text',
+ selectedFileSizeOperatorOption: '.mat-select-min-line',
+ fileSizeInput: '[data-automation-id=adf-search-properties-file-size-input]',
+ fileTypeInput: '[data-automation-id=adf-search-chip-autocomplete-input]',
+ fileTypeOption: '.mat-option-text',
+ selectedFileTypeOption: 'adf-search-chip-autocomplete-input .mat-chip span'
+ };
+
+ constructor() {
+ super('Properties');
+ }
+
+ get fileTypeInput(): ElementFinder {
+ return this.filterDialogOpened.element(by.css(this.locators.fileTypeInput));
+ }
+
+ get fileTypeOptions(): ElementArrayFinder {
+ return element.all(by.css(this.locators.fileTypeOption));
+ }
+
+ get fileSizeInput(): ElementFinder {
+ return this.filterDialogOpened.element(by.css(this.locators.fileSizeInput));
+ }
+
+ get fileSizeOperatorSelect(): ElementFinder {
+ return this.filterDialogOpened.element(by.css(this.locators.fileSizeOperatorSelect));
+ }
+
+ get fileTypeOperatorOptions(): ElementArrayFinder {
+ return element.all(by.css(this.locators.fileSizeOperatorOption));
+ }
+
+ get selectedFileTypeOperatorOption(): ElementFinder {
+ return this.filterDialogOpened.element(by.css(this.locators.selectedFileSizeOperatorOption));
+ }
+
+ async getFileTypesValues(filterValue: string): Promise {
+ await this.fileTypeInput.sendKeys(filterValue);
+ return this.fileTypeOptions.map((option) => option.getText());
+ }
+
+ async selectFileType(option: string): Promise {
+ await this.fileTypeInput.sendKeys(option);
+ return this.fileTypeOptions.filter(async (element) => (await element.getText()) === option).click();
+ }
+
+ async getSelectedFileTypeOptions(): Promise {
+ return this.filterDialogOpened.all(by.css(this.locators.selectedFileTypeOption)).map((option) => option.getText());
+ }
+
+ async typeFileSize(fileSize: string): Promise {
+ await this.fileSizeInput.sendKeys(fileSize);
+ }
+
+ async selectFileSizeOperator(option: string): Promise {
+ await this.fileSizeOperatorSelect.click();
+ await this.fileTypeOperatorOptions.filter(async (element) => (await element.getText() === option)).click();
+ }
+
+ async getFileSizeOperatorValue(): Promise {
+ return this.selectedFileTypeOperatorOption.getText();
+ }
+
+ async getFileSizeValue(): Promise {
+ return this.fileSizeInput.getAttribute('value');
+ }
+}
diff --git a/projects/aca-testing-shared/src/components/search/filters/size-filter.ts b/projects/aca-testing-shared/src/components/search/filters/size-filter.ts
deleted file mode 100755
index 3f9b7894e3..0000000000
--- a/projects/aca-testing-shared/src/components/search/filters/size-filter.ts
+++ /dev/null
@@ -1,66 +0,0 @@
-/*!
- * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
- *
- * Alfresco Example Content Application
- *
- * 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 .
- */
-
-import { by, ElementArrayFinder } from 'protractor';
-import { GenericFilter } from './generic-filter';
-import { BrowserActions, TestElement } from '@alfresco/adf-testing';
-
-export enum SizeOptions {
- Small = 'SMALL',
- Medium = 'MEDIUM',
- Large = 'LARGE',
- Huge = 'HUGE'
-}
-export class SizeFilter extends GenericFilter {
- constructor() {
- super('Size');
- }
-
- facets: ElementArrayFinder = this.filterDialogOpened.all(by.css('.mat-checkbox'));
- selectedFacets: ElementArrayFinder = this.filterDialogOpened.all(by.css('.mat-checkbox.mat-checkbox-checked'));
- public getSizeCheckboxOption = (sizeOption: SizeOptions) =>
- TestElement.byCss(`[data-automation-id="checkbox-SEARCH.CATEGORIES.SIZE_OPTIONS.${sizeOption}"] [type="checkbox"]`);
-
- async getFiltersValues(): Promise {
- return this.facets.map((option) => {
- return option.getText();
- });
- }
-
- async getFiltersCheckedValues(): Promise {
- return this.selectedFacets.map((option) => {
- return option.getText();
- });
- }
-
- async resetPanel(): Promise {
- if ((await this.selectedFacets.count()) > 0) {
- await this.openDialog();
- await this.selectedFacets.each(async (elem) => {
- await BrowserActions.click(elem);
- });
- }
- await this.closeDialog();
- }
-}
diff --git a/projects/aca-testing-shared/src/components/search/index.ts b/projects/aca-testing-shared/src/components/search/index.ts
index 27d1710fe4..ac60627bf2 100644
--- a/projects/aca-testing-shared/src/components/search/index.ts
+++ b/projects/aca-testing-shared/src/components/search/index.ts
@@ -26,7 +26,7 @@ export * from './filters/autocomplete-chips-filter';
export * from './filters/created-date-filter';
export * from './filters/facet-filter';
export * from './filters/generic-filter';
-export * from './filters/size-filter';
+export * from './filters/properties-filter';
export * from './search-filters';
export * from './search-input';
export * from './search-sorting-picker';
diff --git a/projects/aca-testing-shared/src/components/search/search-filters.ts b/projects/aca-testing-shared/src/components/search/search-filters.ts
index 2c5206eb21..5496c69945 100755
--- a/projects/aca-testing-shared/src/components/search/search-filters.ts
+++ b/projects/aca-testing-shared/src/components/search/search-filters.ts
@@ -24,17 +24,16 @@
import { by, browser } from 'protractor';
import { Component } from '../component';
-import { SizeFilter } from './filters/size-filter';
import { CreatedDateFilter } from './filters/created-date-filter';
import { FacetFilter } from './filters/facet-filter';
import { AutocompleteChipsFilter } from './filters/autocomplete-chips-filter';
+import { PropertiesFilter } from './filters/properties-filter';
export class SearchFilters extends Component {
resetAllButton = browser.element(by.css('button[adf-reset-search]'));
- size = new SizeFilter();
createdDate = new CreatedDateFilter();
- fileType = new FacetFilter('File type');
+ fileType = new PropertiesFilter();
creator = new FacetFilter('Creator');
modifier = new FacetFilter('Modifier');
location = new AutocompleteChipsFilter('Location');