From 76ca37c5dd158f1700946e17f5448e0dc1bfa8fa Mon Sep 17 00:00:00 2001 From: Yarin Dekel Date: Sun, 29 Jul 2018 10:44:54 +0300 Subject: add api integration and add review comments Issue-ID: SDC-1562 Change-Id: I0aa3a099f3a36da9e8493708b8bfe52e5f991885 Signed-off-by: Yarin Dekel --- .../src/features/version/create/CreateVersion.js | 2 +- .../features/version/create/CreateVersionView.jsx | 2 +- .../__tests__/CreateVersionView_snapshot-test.js | 28 +++ .../CreateVersionView_snapshot-test.js.snap | 75 ++++++++ .../src/features/version/general/General.js | 4 +- .../src/features/version/general/GeneralView.js | 17 +- .../features/version/general/generalSelectors.js | 15 +- .../frontend/src/features/version/versionApi.js | 8 +- .../version/versionController/VersionController.js | 21 +-- .../versionController/VersionControllerView.jsx | 27 ++- .../VersionControllerView_snapshot-test.js | 7 +- .../VersionControllerView_snapshot-test.js.snap | 2 +- .../versionControllerConstants.js | 3 +- .../versionController/views/VersionSelect.js | 18 +- .../versionController/views/VersionsContainer.js | 26 +-- .../frontend/src/features/version/versionSaga.js | 9 +- .../workflow/create/createWorkflowConstants.js | 2 +- .../src/features/workflow/overview/Overview.js | 4 +- .../features/workflow/overview/OverviewView.jsx | 37 ++-- .../__tests__/OverviewView_snapshot-test.js | 39 +++++ .../OverviewView_snapshot-test.js.snap | 193 +++++++++++++++++++++ .../overview/__tests__/overviewReducer-test.js | 96 ++++++++++ .../workflow/overview/overviewSelectors.js | 10 +- .../src/shared/components/VersionInfo/index.js | 20 +-- .../src/main/frontend/webpack.config.js | 3 - 25 files changed, 542 insertions(+), 126 deletions(-) create mode 100644 workflow-designer-ui/src/main/frontend/src/features/version/create/__tests__/CreateVersionView_snapshot-test.js create mode 100644 workflow-designer-ui/src/main/frontend/src/features/version/create/__tests__/__snapshots__/CreateVersionView_snapshot-test.js.snap create mode 100644 workflow-designer-ui/src/main/frontend/src/features/workflow/overview/__tests__/OverviewView_snapshot-test.js create mode 100644 workflow-designer-ui/src/main/frontend/src/features/workflow/overview/__tests__/__snapshots__/OverviewView_snapshot-test.js.snap create mode 100644 workflow-designer-ui/src/main/frontend/src/features/workflow/overview/__tests__/overviewReducer-test.js (limited to 'workflow-designer-ui/src/main') diff --git a/workflow-designer-ui/src/main/frontend/src/features/version/create/CreateVersion.js b/workflow-designer-ui/src/main/frontend/src/features/version/create/CreateVersion.js index e659bb6b..d78f3bc7 100644 --- a/workflow-designer-ui/src/main/frontend/src/features/version/create/CreateVersion.js +++ b/workflow-designer-ui/src/main/frontend/src/features/version/create/CreateVersion.js @@ -30,7 +30,7 @@ import { function mapStateToProps(state) { return { workflowId: getWorkflowId(state), - versionBaseId: getLatestBaseId(state) + baseVersionId: getLatestBaseId(state) }; } diff --git a/workflow-designer-ui/src/main/frontend/src/features/version/create/CreateVersionView.jsx b/workflow-designer-ui/src/main/frontend/src/features/version/create/CreateVersionView.jsx index 555dbf9e..080329e9 100644 --- a/workflow-designer-ui/src/main/frontend/src/features/version/create/CreateVersionView.jsx +++ b/workflow-designer-ui/src/main/frontend/src/features/version/create/CreateVersionView.jsx @@ -48,7 +48,7 @@ class CreateVersionView extends Component { submitNewVersion({ description: this.state.newVersion.description, workflowId: workflowId, - baseVersionId: baseVersionId || null, + baseId: baseVersionId || null, history: history }); }; diff --git a/workflow-designer-ui/src/main/frontend/src/features/version/create/__tests__/CreateVersionView_snapshot-test.js b/workflow-designer-ui/src/main/frontend/src/features/version/create/__tests__/CreateVersionView_snapshot-test.js new file mode 100644 index 00000000..13faac14 --- /dev/null +++ b/workflow-designer-ui/src/main/frontend/src/features/version/create/__tests__/CreateVersionView_snapshot-test.js @@ -0,0 +1,28 @@ +/* +* Copyright © 2018 European Support Limited +* +* 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 from 'react'; +import renderer from 'react-test-renderer'; + +import CreateVersionView from '../CreateVersionView'; + +describe('Create new version snapshot', () => { + it('renders correctly', () => { + const tree = renderer.create().toJSON(); + + expect(tree).toMatchSnapshot(); + }); +}); diff --git a/workflow-designer-ui/src/main/frontend/src/features/version/create/__tests__/__snapshots__/CreateVersionView_snapshot-test.js.snap b/workflow-designer-ui/src/main/frontend/src/features/version/create/__tests__/__snapshots__/CreateVersionView_snapshot-test.js.snap new file mode 100644 index 00000000..25c7b932 --- /dev/null +++ b/workflow-designer-ui/src/main/frontend/src/features/version/create/__tests__/__snapshots__/CreateVersionView_snapshot-test.js.snap @@ -0,0 +1,75 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Create new version snapshot renders correctly 1`] = ` +
+
+
+ + +
+
+
+
+ description +
+