2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright © 2017-2021 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 import React from 'react';
22 import Col from 'react-bootstrap/lib/Col';
23 import Label from 'react-bootstrap/lib/Label';
24 import { Link } from 'react-router-dom';
25 import {GlobalExtConstants} from 'utils/GlobalExtConstants.js';
27 const modelBreadcrumb = (props) => {
30 let historyStackArr = [];
31 var setURIInSession = function(uri){
32 sessionStorage.setItem(GlobalExtConstants.ENVIRONMENT + 'URI', uri);
34 if (props.historyStackString) {
35 historyStackArr = props.historyStackString.split('||');
36 for(var i = 0; i < historyStackArr.length; i++){
37 historyStackArr[i] = historyStackArr[i].split(',');
38 console.log('[ModelBreadcrumb.jsx] previous url ' + historyStackArr[i][0] + ' previous api call '+ historyStackArr[i][1]);
40 links = historyStackArr.map((link, idx) => {
41 let breadCrumbTxt=decodeURI(link[2]).replace(/%2F/g,'/');
43 <div className='customBreadCrumb'>
44 {idx === historyStackArr.length - 2 ? (
45 <b id={'breadcrumbStatic' + idx} style={{'float' : 'left'}}>{breadCrumbTxt}</b>
46 ) : idx !== historyStackArr.length - 1 ? (
47 <div id={'breadcrumbLink' + idx}>
48 <div style={{'float' : 'left'}}>
54 historyStackString: (breadCrumbTxt==='Origin')?'':props.historyStackString
55 }} onClick={() => setURIInSession(link[1])}>{breadCrumbTxt}
58 <div style={{'float' : 'left'}}> >> </div>
66 <Col md={12} className='addPaddingTop'>
72 export default modelBreadcrumb;