Added a new column URL

Added a new column URL (full path & filename)
Searchable only if visible
Requested from Issue #977
This commit is contained in:
Alezia Kurdis 2021-02-10 23:30:18 -05:00 committed by GitHub
parent 55753abf51
commit 6ffb848596
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -156,6 +156,14 @@ const COLUMNS = {
initialWidth: 0.38,
defaultSortOrder: DESCENDING_SORT,
},
urlWithPath: {
columnHeader: "URL",
dropdownLabel: "URL",
propertyID: "urlWithPath",
initialWidth: 0.54,
initiallyShown: false,
defaultSortOrder: ASCENDING_SORT,
},
};
const FILTER_TYPES = [
@ -942,6 +950,7 @@ function loaded() {
type: type,
url: entity.certificateID === "" ? filename : "<i>" + CERTIFIED_PLACEHOLDER + "</i>",
fullUrl: entity.certificateID === "" ? filename : CERTIFIED_PLACEHOLDER,
urlWithPath: entity.certificateID === "" ? entity.url : "<i>" + CERTIFIED_PLACEHOLDER + "</i>",
locked: entity.locked,
visible: entity.visible,
certificateID: entity.certificateID,
@ -981,6 +990,8 @@ function loaded() {
let searchFilter = searchTerm === '' || (e.name.toLowerCase().indexOf(searchTerm) > -1 ||
e.type.toLowerCase().indexOf(searchTerm) > -1 ||
e.fullUrl.toLowerCase().indexOf(searchTerm) > -1 ||
(e.urlWithPath.toLowerCase().indexOf(searchTerm) > -1 &&
columnsByID["urlWithPath"].elTh.style.visibility === "visible")||
e.id.toLowerCase().indexOf(searchTerm) > -1);
return typeFilter && searchFilter;
});