From b8e2faf476202b6ffe61bc3a9a37df1304881d40 Mon Sep 17 00:00:00 2001 From: Avi Ziv Date: Tue, 18 Jul 2017 19:45:38 +0300 Subject: [SDC] Onboarding 1710 rebase. Change-Id: If3b6b81d221fde13908f1e8160db6f7d9433c535 Signed-off-by: Avi Ziv --- .../nfvo-components/activity-log/ActivityLog.js | 27 ----- .../activity-log/ActivityLogActionHelper.js | 31 ------ .../activity-log/ActivityLogConstants.js | 23 ---- .../activity-log/ActivityLogReducer.js | 25 ----- .../activity-log/ActivityLogView.jsx | 124 --------------------- 5 files changed, 230 deletions(-) delete mode 100644 openecomp-ui/src/nfvo-components/activity-log/ActivityLog.js delete mode 100644 openecomp-ui/src/nfvo-components/activity-log/ActivityLogActionHelper.js delete mode 100644 openecomp-ui/src/nfvo-components/activity-log/ActivityLogConstants.js delete mode 100644 openecomp-ui/src/nfvo-components/activity-log/ActivityLogReducer.js delete mode 100644 openecomp-ui/src/nfvo-components/activity-log/ActivityLogView.jsx (limited to 'openecomp-ui/src/nfvo-components/activity-log') diff --git a/openecomp-ui/src/nfvo-components/activity-log/ActivityLog.js b/openecomp-ui/src/nfvo-components/activity-log/ActivityLog.js deleted file mode 100644 index f7354f96e2..0000000000 --- a/openecomp-ui/src/nfvo-components/activity-log/ActivityLog.js +++ /dev/null @@ -1,27 +0,0 @@ -/*! - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * - * Licensed 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 {connect} from 'react-redux'; -import ActivityLogView from './ActivityLogView.jsx'; - -export const mapStateToProps = ({licenseModel: {activityLog}}) => { - - let activities = activityLog; - return { - activities - }; -}; - -export default connect(mapStateToProps, undefined, null, {withRef: true})(ActivityLogView); diff --git a/openecomp-ui/src/nfvo-components/activity-log/ActivityLogActionHelper.js b/openecomp-ui/src/nfvo-components/activity-log/ActivityLogActionHelper.js deleted file mode 100644 index 01a27abbc5..0000000000 --- a/openecomp-ui/src/nfvo-components/activity-log/ActivityLogActionHelper.js +++ /dev/null @@ -1,31 +0,0 @@ -/*! - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * - * Licensed 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 RestAPIUtil from 'nfvo-utils/RestAPIUtil.js'; -import Configuration from 'sdc-app/config/Configuration.js'; -import ActivityLogConstants from './ActivityLogConstants.js'; - - -function baseUrl(itemId, versionId) { - const restPrefix = Configuration.get('restPrefix'); - return `${restPrefix}/v1.0/activity-logs/${itemId}/versions/${versionId}`; -} - -export default { - - fetchActivityLog(dispatch, {itemId, versionId}){ - return RestAPIUtil.fetch(baseUrl(itemId, versionId)).then(response => dispatch({type: ActivityLogConstants.ACTIVITY_LOG_UPDATED, response})); - } -}; diff --git a/openecomp-ui/src/nfvo-components/activity-log/ActivityLogConstants.js b/openecomp-ui/src/nfvo-components/activity-log/ActivityLogConstants.js deleted file mode 100644 index 69faf7cbb6..0000000000 --- a/openecomp-ui/src/nfvo-components/activity-log/ActivityLogConstants.js +++ /dev/null @@ -1,23 +0,0 @@ -/*! - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * - * Licensed 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 keyMirror from 'nfvo-utils/KeyMirror.js'; - -export default keyMirror({ - - ACTIVITY_LOG_UPDATED: null - -}); - diff --git a/openecomp-ui/src/nfvo-components/activity-log/ActivityLogReducer.js b/openecomp-ui/src/nfvo-components/activity-log/ActivityLogReducer.js deleted file mode 100644 index fc3dfa1515..0000000000 --- a/openecomp-ui/src/nfvo-components/activity-log/ActivityLogReducer.js +++ /dev/null @@ -1,25 +0,0 @@ -/*! - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * - * Licensed 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 ActivityLogConstants from './ActivityLogConstants.js'; - -export default (state = [], action) => { - switch (action.type) { - case ActivityLogConstants.ACTIVITY_LOG_UPDATED: - return [...action.response.results]; - } - - return state; -}; diff --git a/openecomp-ui/src/nfvo-components/activity-log/ActivityLogView.jsx b/openecomp-ui/src/nfvo-components/activity-log/ActivityLogView.jsx deleted file mode 100644 index 6ff3c806a8..0000000000 --- a/openecomp-ui/src/nfvo-components/activity-log/ActivityLogView.jsx +++ /dev/null @@ -1,124 +0,0 @@ -/*! - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * - * Licensed 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, {Component} from 'react'; -import OverlayTrigger from 'react-bootstrap/lib/OverlayTrigger.js'; -import Tooltip from 'react-bootstrap/lib/Tooltip.js'; -import ListEditorView from 'nfvo-components/listEditor/ListEditorView.jsx'; -import SVGIcon from 'nfvo-components/icon/SVGIcon.jsx'; -import i18n from 'nfvo-utils/i18n/i18n.js'; - -function ActivityLogSortableCellHeader({isHeader, data, isDes, onSort}) { - if (isHeader) { - return ( - - {data} - - - ); - } - return ( - - {i18n.dateNormal(data, { - year: 'numeric', month: 'numeric', day: 'numeric' - })} - {i18n.dateNormal(data, { - hour: 'numeric', minute: 'numeric', - hour12: true - })} - - ); -} - -function ActivityLogStatus({status, isHeader}) { - if (isHeader) { - return {status}; - } - let {message, success} = status; - return ( - - {`${success ? i18n('Success') : i18n('Failure')}`} - {success && } - {!success && -
{message}
- }> - {'?'} -
} -
- ); -} - -export function ActivityListItem({activity, isHeader, isDes, onSort}) { - let {type, timestamp, comment, user, status} = activity; - return ( -
  • -
    -
    {type}
    -
    {comment}
    -
    {user}
    -
    -
  • - ); -} - -class ActivityLogView extends Component { - - state = { - localFilter: '', - sortDescending: true - }; - - render() { - return ( -
    - this.setState({localFilter: filter})}> - this.setState({sortDescending: !this.state.sortDescending})}/> - {this.sortActivities(this.filterActivities(), this.state.sortDescending).map(activity => )} - -
    - ); - } - - filterActivities() { - let {activities} = this.props; - let {localFilter} = this.state; - if (localFilter.trim()) { - const filter = new RegExp(escape(localFilter), 'i'); - return activities.filter(({user = '', comment = '', type = ''}) => escape(user).match(filter) || escape(comment).match(filter) || escape(type).match(filter)); - } - else { - return activities; - } - } - - sortActivities(activities) { - if (this.state.sortDescending) { - return activities.sort((a, b) => a.timestamp - b.timestamp); - } - else { - return activities.reverse(); - } - } - -} - -export default ActivityLogView; -- cgit 1.2.3-korg