fix css test and IO squash 17/58217/1
authorYarin Dekel <yarind@amdocs.com>
Tue, 31 Jul 2018 07:10:07 +0000 (10:10 +0300)
committerYarin Dekel <yarind@amdocs.com>
Tue, 31 Jul 2018 10:47:55 +0000 (13:47 +0300)
Issue-ID: SDC-1575
Change-Id: I89017be62905c5e12848057b3c07f113396db1b5
Signed-off-by: Yarin Dekel <yarind@amdocs.com>
17 files changed:
workflow-designer-ui/src/main/frontend/resources/scss/common/_utils.scss
workflow-designer-ui/src/main/frontend/resources/scss/components/_customModal.scss
workflow-designer-ui/src/main/frontend/resources/scss/components/_versionController.scss
workflow-designer-ui/src/main/frontend/resources/scss/features/_general.scss
workflow-designer-ui/src/main/frontend/resources/scss/features/_overview.scss
workflow-designer-ui/src/main/frontend/src/features/version/general/generalApi.js [deleted file]
workflow-designer-ui/src/main/frontend/src/features/version/inputOutput/InputOutputView.jsx
workflow-designer-ui/src/main/frontend/src/features/version/inputOutput/inputOutputConstants.js
workflow-designer-ui/src/main/frontend/src/features/version/inputOutput/inputOutputReducer.js
workflow-designer-ui/src/main/frontend/src/features/version/inputOutput/inputOutputValidations.js
workflow-designer-ui/src/main/frontend/src/features/version/versionController/VersionControllerView.jsx
workflow-designer-ui/src/main/frontend/src/features/version/versionController/views/ActionButtons.js
workflow-designer-ui/src/main/frontend/src/features/version/versionSaga.js
workflow-designer-ui/src/main/frontend/src/features/workflow/create/__tests__/createWorkflowSaga-test.js
workflow-designer-ui/src/main/frontend/src/features/workflow/create/createWorkflowSaga.js
workflow-designer-ui/src/main/frontend/src/features/workflow/workflowConstants.js
workflow-designer-ui/src/main/frontend/src/features/workflow/workflowSelectors.js

index 48cd4cf..2ee8738 100644 (file)
@@ -1,6 +1,6 @@
 .sdc-modal {
   .custom-modal-wrapper {
-    padding: 35px 60px 60px 60px;
+    padding: 35px 60px 20px 60px;
     width: auto;
   }
 
@@ -13,4 +13,9 @@
   button:first-child {
     margin-right: 2em;
   }
+}
+
+textarea.field-section.sdc-input__input {
+   height: 75px;
+   padding-top: 5px;
 }
\ No newline at end of file
index eaa3d7d..45985a6 100644 (file)
                justify-content: space-between;
                align-items: center;
                padding-left: 16px;
-               padding-right: 40px;
+               padding-right: 100px;
                border-left: 1px solid #eaeaea;
 
                .vc-separator {
                        border-left: 1px solid $silver;
                        height: 37px;
-                       margin-left: 5px;
-                       margin-right: 5px;
                }
 
                .version-status-container {
                                }
 
                                .certifyBtn {
-                                       margin-left: 10px;
+                                       margin-left: 20px;
                                }
 
                                .version-control-buttons {
                                        display: flex;
                                        align-items: center;
                                        height: 70px;
+                                       padding: 10px;
 
-                                       &:hover:not(.disabled) {
+                                       &:hover {
                                                background-color: $silver;
                                        }
 
-                                       &:active:not(.disabled) {
+                                       &:active {
                                                background-color: $light-gray;
                                        }
 
index 9189c87..6e8b352 100644 (file)
@@ -1,6 +1,6 @@
 .general-page {
     @include body-1;
-    padding: 0 100px 20px 100px;
+    padding: 0 131px 20px 100px;
     background-color: #fff;
 
     .general-page-title {
@@ -18,6 +18,7 @@
 
         .description-part textarea {
             height: 200px;
+            padding-top: 5px;
         }
 
         .version-info-part {
index f384017..8cb6be7 100644 (file)
@@ -13,6 +13,7 @@
 
       .description-part textarea{
         height: 200px;
+        padding-top: 5px;
       }
 
       .save-description {
@@ -26,7 +27,7 @@
         padding: 20px;
         box-sizing: border-box;
         .label {
-          @include body-3;
+          @include body-1;
           margin-bottom: 5px;
         }
         .value {
@@ -70,6 +71,7 @@
 
     .svg-icon-wrapper {
       justify-content: flex-start;
+      margin: 5px;
     }
 
     .create-new-version {
         }
 
         .tree-view {
-          //background-color: $white;
           flex: 1;
-
+          border-left: 1px solid $silver;
+          &:last-child {
+            border-bottom: 1px solid $silver;
+          }
           .node:not(.selectedNode):hover {
             .outer-circle, .inner-circle {
               transform: scale(1.1);
       .version-list-items {
         @extend .flex-column;
 
+        .item-version, .item-status {
+          font-size: 12px;
+          font-weight: 600;
+        }
         .version-item-row {
-          border-bottom: 1px solid $silver;
-
           &:last-child {
-            border-bottom: none;
+            border-bottom: 1px solid $silver;
           }
         }
       }
diff --git a/workflow-designer-ui/src/main/frontend/src/features/version/general/generalApi.js b/workflow-designer-ui/src/main/frontend/src/features/version/general/generalApi.js
deleted file mode 100644 (file)
index 3c726d1..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-import RestfulAPIUtil from 'services/restAPIUtil';
-import Configuration from 'config/Configuration.js';
-
-function baseUrl() {
-    const restPrefix = Configuration.get('restPrefix');
-    return `${restPrefix}/v1.0/items`;
-}
-
-const Api = {
-    fetchData: () => {
-        return RestfulAPIUtil.fetch(`${baseUrl()}/test`);
-    }
-};
-
-export default Api;
index a2a0618..8f77935 100644 (file)
@@ -20,7 +20,7 @@ import { Translate, I18n } from 'react-redux-i18n';
 import { SVGIcon } from 'sdc-ui/lib/react';
 
 import SearchInput from 'shared/searchInput/SearchInput';
-import { getValidtionsError } from 'features/version/inputOutput/inputOutputValidations';
+import { getValidationsError } from 'features/version/inputOutput/inputOutputValidations';
 import Tab from 'features/version/inputOutput/views/Tab';
 import TableHead from 'features/version/inputOutput/views/TableHead';
 import TableBody from 'features/version/inputOutput/views/TableBody';
@@ -31,7 +31,7 @@ class InputOutputView extends React.Component {
     componentDidUpdate() {
         const { dataRows, error, handleChangeError } = this.props;
 
-        const validationsError = getValidtionsError(dataRows);
+        const validationsError = getValidationsError(dataRows);
 
         const isDiff = Object.keys(validationsError).some(errorKey => {
             if (!error.hasOwnProperty(errorKey)) {
index a660da5..6f29992 100644 (file)
@@ -20,6 +20,7 @@ export const INPUTS = 'inputs';
 export const OUTPUTS = 'outputs';
 
 export const STRING = 'String';
+export const DEFAULT_STRING = 'STRING';
 export const BOOLEAN = 'Boolean';
 export const INTEGER = 'Integer';
 export const FLOAT = 'Float';
index f63c125..881322f 100644 (file)
@@ -18,6 +18,7 @@ import {
     INPUTS,
     OUTPUTS,
     STRING,
+    DEFAULT_STRING,
     BOOLEAN,
     INTEGER,
     FLOAT,
@@ -36,12 +37,12 @@ import {
 export const defaultInputOutput = {
     [INPUTS]: {
         name: '',
-        value: STRING,
+        type: DEFAULT_STRING,
         mandatory: false
     },
     [OUTPUTS]: {
         name: '',
-        value: STRING,
+        type: DEFAULT_STRING,
         mandatory: false
     }
 };
index 88a0a77..a300e21 100644 (file)
@@ -14,7 +14,7 @@
 * limitations under the License.
 */
 
-export const getValidtionsError = dataRows => {
+export const getValidationsError = dataRows => {
     const error = {};
 
     const groupBy = dataRows.reduce((result, value, key) => {
index a147c0d..88a2a7b 100644 (file)
@@ -69,6 +69,15 @@ export default class VersionControllerView extends Component {
         changeVersion({ versionId, workflowId });
     };
 
+    undoClickCallback = () => {
+        const {
+            currentWorkflowVersion,
+            changeVersion,
+            workflowId
+        } = this.props;
+        changeVersion({ versionId: currentWorkflowVersion.id, workflowId });
+    };
+
     render() {
         const {
             currentWorkflowVersion,
@@ -93,6 +102,7 @@ export default class VersionControllerView extends Component {
                         onSaveClick={this.sendSaveParamsToServer}
                         certifyDisabled={isCertifyDisable}
                         onCertifyClick={this.certifyVersion}
+                        onUndoClick={this.undoClickCallback}
                     />
                 </div>
             </div>
index e8cbb4d..b4a0891 100644 (file)
@@ -22,7 +22,7 @@ import SvgButton from 'features/version/versionController/views/SvgButton';
 const Separator = () => <div className="vc-separator" />;
 
 const ActionButtons = props => {
-    const { onSaveClick, certifyDisabled, onCertifyClick } = props;
+    const { onSaveClick, certifyDisabled, onCertifyClick, onUndoClick } = props;
     return (
         <div className="save-submit-cancel-container">
             <div className="action-buttons">
@@ -41,7 +41,7 @@ const ActionButtons = props => {
                         name="version-controller-undo"
                         tooltipText={I18n.t('buttons.undoBtn')}
                         disabled={false}
-                        onClick={() => console.log('undo')}
+                        onClick={onUndoClick}
                     />
                     <Separator />
                     <Button
@@ -60,7 +60,8 @@ const ActionButtons = props => {
 ActionButtons.propTypes = {
     onSaveClick: PropTypes.func,
     certifyDisabled: PropTypes.bool,
-    onCertifyClick: PropTypes.func
+    onCertifyClick: PropTypes.func,
+    onUndoClick: PropTypes.func
 };
 
 export default ActionButtons;
index 244f3da..9ef88f9 100644 (file)
@@ -37,7 +37,6 @@ function* fetchVersion(action) {
     try {
         const data = yield call(versionApi.fetchVersion, action.payload);
         const { inputs, outputs, ...rest } = data;
-
         yield all([
             put(setWorkflowVersionAction(rest)),
             put(setInputsOutputs({ inputs, outputs }))
index a3d7c7c..c9782c1 100644 (file)
@@ -19,12 +19,16 @@ import {
     watchWorkflow,
     watchSubmitWorkflow
 } from 'features/workflow/create/createWorkflowSaga';
+import { put } from 'redux-saga/effects';
 import newWorkflowApi from 'features/workflow/create/createWorkflowApi';
+import { SUBMIT_WORKFLOW } from 'features/workflow/create/createWorkflowConstants';
+import { submitVersionAction } from 'features/version/create/createVersionConstants';
+import { NEW_VERSION } from 'features/workflow/create/createWorkflowConstants';
 import {
-    NEW_VERSION,
-    SUBMIT_WORKFLOW
-} from 'features/workflow/create/createWorkflowConstants';
-import versionApi from 'features/version/versionApi';
+    setWorkflowAction,
+    clearWorkflowAction
+} from 'features/workflow/workflowConstants';
+import { genericNetworkErrorAction } from 'wfapp/appConstants';
 
 describe('New workflow saga test', () => {
     it('Create new workflow', () => {
@@ -46,11 +50,21 @@ describe('New workflow saga test', () => {
         expect(gen.next().value).toEqual(
             call(newWorkflowApi.createNewWorkflow, action.payload)
         );
+        const history = undefined,
+            workflowId = undefined;
         expect(gen.next(action.payload).value).toEqual(
-            call(versionApi.createNewVersion, {
-                workflowId: undefined,
-                ...NEW_VERSION
-            })
+            put(submitVersionAction({ history, workflowId, ...NEW_VERSION }))
         );
+        expect(gen.next().value).toEqual(
+            put(setWorkflowAction({ ...action.payload, id: undefined }))
+        );
+        //handling errors
+        expect(gen.throw({ error: 'error' }).value).toEqual(
+            put(clearWorkflowAction)
+        );
+        expect(gen.next().value).toEqual(
+            put(genericNetworkErrorAction({ error: 'error' }))
+        );
+        expect(gen.next().done).toBe(true);
     });
 });
index 0f057f1..7f98800 100644 (file)
@@ -20,8 +20,8 @@ import {
     clearWorkflowAction
 } from 'features/workflow/workflowConstants';
 import newWorkflowApi from 'features/workflow/create/createWorkflowApi';
-import versionApi from 'features/version/versionApi';
 import { genericNetworkErrorAction } from 'wfapp/appConstants';
+import { submitVersionAction } from 'features/version/create/createVersionConstants';
 import { NEW_VERSION } from 'features/workflow/create/createWorkflowConstants';
 
 export function* watchSubmitWorkflow(action) {
@@ -33,11 +33,7 @@ export function* watchSubmitWorkflow(action) {
         //Calling to create empty version
         const workflowId = workflow.id;
         const { history } = action.payload;
-        yield call(versionApi.createNewVersion, {
-            workflowId,
-            ...NEW_VERSION
-        });
-        yield call(history.push('/workflow/' + workflowId + '/overview'));
+        yield put(submitVersionAction({ history, workflowId, ...NEW_VERSION }));
         yield put(setWorkflowAction(workflow));
     } catch (error) {
         yield put(clearWorkflowAction);
index 06b471e..cedcafe 100644 (file)
@@ -18,5 +18,5 @@ import { createAction } from 'redux-actions';
 export const CLEAR_WORKFLOW_DATA = 'workflow/CLEAR_WORKFLOW_DATA';
 export const SET_WORKFLOW = 'workflow/SET_WORKFLOW';
 
-export const setWorkflowAction = createAction(SET_WORKFLOW);
+export const setWorkflowAction = createAction(SET_WORKFLOW, payload => payload);
 export const clearWorkflowAction = { type: CLEAR_WORKFLOW_DATA };
index 5ea8ff2..140599b 100644 (file)
@@ -14,7 +14,8 @@
 * limitations under the License.
 */
 
-export const getWorkflowName = state => state && state.workflow.data.name;
+export const getWorkflowName = state =>
+    state && state.workflow.data.name && state.workflow.data.name.trim();
 export const getWorkflowId = state => state && state.workflow.data.id;
 export const getWorkflowDescription = state =>
     state && state.workflow.data.description;