Skip to content

Commit

Permalink
Applied solution to issue in ServiceWebapp instead of dist/webapp #120
Browse files Browse the repository at this point in the history
  • Loading branch information
unaibrrgn committed Oct 4, 2022
1 parent 87c056c commit 67503db
Showing 1 changed file with 20 additions and 30 deletions.
50 changes: 20 additions & 30 deletions sources/Re3gistry2ServiceWebapp/public_html/js-ecl-v2/app_core.js
Original file line number Diff line number Diff line change
Expand Up @@ -1019,38 +1019,28 @@ function renderItemsBreadcrumb(data) {
function generateBreadcrumbTrail(data) {

let currentUri = data.uri;
let myBreadCrumbElements = [];
let myBreadCrumbElementsURL = [];

//Rest of items
let topconcepts = true;
let currentLevel = data;
while(topconcepts){
try {
myBreadCrumbElements.push(currentLevel.topConceptOf.values[0].value);
myBreadCrumbElementsURL.push(currentLevel.topConceptOf.uri)
currentLevel = currentLevel.topConceptOf;
} catch (error) {
topconcepts = false;
}
}

// Creating the list of additional elements for the breadcrumbs
let breadcrumbElements = currentUri.split('/');
breadcrumbElements = breadcrumbElements.reverse();
let breadcrumbUrls = [];
let tmpUrl = currentUri;
$.each(breadcrumbElements, function (index, item) {
breadcrumbUrls.push(tmpUrl);
tmpUrl = tmpUrl.replace('/' + item, '');
});

myBreadCrumbElements.reverse();
myBreadCrumbElementsURL.reverse();
let liHtml = val_emptyString;
breadcrumbUrls.reverse();
$.each(breadcrumbUrls, function (index, item) {

// Filtering elements not needed in the breadcrumbs or already
// processed (like registry and register or the current element)
if (item !== key_http + ':/' &&
item !== key_http + ':' &&
item !== key_https + ':' &&
item !== key_http + ':/' &&
item !== data.registry.uri &&
item !== data.register.uri &&
item !== data.uri) {

// Filtering the base URI
if (data.registry.uri.indexOf(item) < 0 || data.register.uri.indexOf(item) < 0) {

liHtml += renderBreadcrumbLink(getUriname(item), item);
}
}
});
for(let i= 0 ; i<myBreadCrumbElements.length; i++){
liHtml += renderBreadcrumbLink(myBreadCrumbElements[i], myBreadCrumbElementsURL[i]);
}

// Rendering the last element of the breadcrumb (current element)
liHtml += renderBreadcrumbLastElement(getTitleField(data));
Expand Down

0 comments on commit 67503db

Please sign in to comment.