forked from community/device-mgt-core
Add application Life cycle history UI Closes product-iots#541 See merge request entgra/carbon-device-mgt!566revert-70ac1926
commit
4046bd715c
@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (c) 2020, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved.
|
||||
*
|
||||
* Entgra (pvt) Ltd. licenses this file to you under the Apache License,
|
||||
* Version 2.0 (the "License"); you may not use this file except
|
||||
* in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { Tag, Timeline, Card } from 'antd';
|
||||
import { withConfigContext } from '../../../../../../../../../../components/ConfigContext';
|
||||
|
||||
class LifeCycleHistory extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
render() {
|
||||
const { lifeCycleStates } = this.props;
|
||||
return (
|
||||
<div className="scroll" style={{ height: 500, overflowY: 'auto' }}>
|
||||
<Timeline mode={'alternate'} style={{ marginTop: 10 }}>
|
||||
{lifeCycleStates.map(
|
||||
(state, index) =>
|
||||
state && (
|
||||
<Timeline.Item key={index} label={state.updatedAt}>
|
||||
<Card>
|
||||
<div style={{ textAlign: 'center' }}>
|
||||
{state.previousState === state.currentState ? (
|
||||
'Application Created'
|
||||
) : (
|
||||
<div>
|
||||
State changed from <br />
|
||||
<div style={{ marginTop: 5 }}>
|
||||
<Tag color="blue">{state.previousState}</Tag> to{' '}
|
||||
<Tag color="blue">{state.currentState}</Tag>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
<Tag style={{ marginTop: 5 }}>{state.updatedAt}</Tag>
|
||||
</div>
|
||||
</Card>
|
||||
</Timeline.Item>
|
||||
),
|
||||
)}
|
||||
</Timeline>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default withConfigContext(LifeCycleHistory);
|
Loading…
Reference in new issue