Updated Sparky to add ECOMP functionality Browse, Specialized Search, BYOQ, and the...
[aai/sparky-fe.git] / src / app / model / history / components / HistoryGallery.jsx
1 /*
2  * ============LICENSE_START=======================================================
3  * org.onap.aai
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
10  *
11  *       http://www.apache.org/licenses/LICENSE-2.0
12  *
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=========================================================
19  */
20
21 import React from 'react';
22 import Grid from 'react-bootstrap/lib/Grid';
23 import Row from 'react-bootstrap/lib/Row';
24 import HistoryEntry from './HistoryEntry.jsx';
25 /**
26  * This function will take all of the node objects and turn them into
27  * a ui grid of HistoryCard components. This function is essentially a container
28  * for the HistoryCards
29  * @param props
30  * @returns {*}
31  */
32 const HistoryGallery = (props) => {
33
34     let entries = null;
35     if (props.entries && props.entries.length > 0) {
36         entries = props.entries.map((entry, idx) => {
37         return (
38           <HistoryEntry
39             key={idx}
40             triggerState={props.triggerState}
41             entryKey={entry.key}
42             entryType={entry.type}
43             entryValue={entry.value}
44             entryBody= {entry.body}
45             entryHeader= {entry.header}
46             entrySOT={entry.sot}
47             entryAction= {entry.action}
48             entryEpoch= {entry.timeRank}
49             entryNodeId= {props.nodeId}
50             entryDate={entry.displayTimestamp}
51             entryTransId = {entry['tx-id']}/>
52         );
53       });
54     }else{
55         return (<p>No History</p>);
56     }
57
58     return (
59       <div className="list-group">
60         {entries}
61       </div>
62     );
63 };
64
65 export default HistoryGallery;