fix artifact not updating with versioning
[sdc/sdc-workflow-designer.git] / workflow-designer-ui / src / main / frontend / src / features / version / versionConstants.js
1 /*
2 * Copyright © 2018 European Support Limited
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 import { createAction } from 'redux-actions';
17
18 export const SET_CURRENT_VERSION = 'workflow/version/SET_CURRENT_VERSION';
19 export const FETCH_REQUESTED = 'workflow/version/FETCH_REQUESTED';
20 export const DETAILS_CHANGED = 'workflow/version/DETAILS_CHANGED';
21 export const FETCH_REQUESTED_FAILED = 'workflow/version/FETCH_REQUESTED_FAILED';
22 export const VERSION_STATE_CHANGED = 'workflow/version/VERSION_STATE_CHANGED';
23 export const TOGGLE_COMPOSITION_UPDATE =
24     'workflow/version/TOGGLE_COMPOSITION_UPDATE';
25 export const SET_OPERRATION_MODE = 'workflow/version/SET_OPERRATION_MODE';
26
27 export const workflowVersionFetchRequestedAction = createAction(
28     FETCH_REQUESTED
29 );
30
31 export const workflowVersionDetailsChangedAction = createAction(
32     DETAILS_CHANGED
33 );
34
35 export const setWorkflowVersionAction = createAction(SET_CURRENT_VERSION);
36 export const fetchWorkflowVersionActionFailed = createAction(
37     FETCH_REQUESTED_FAILED,
38     error => error
39 );
40
41 export const versionStateChangedAction = createAction(
42     VERSION_STATE_CHANGED,
43     payload => payload
44 );
45
46 export const toggleCompositionUpdate = createAction(
47     TOGGLE_COMPOSITION_UPDATE,
48     payload => ({ isCompositionUpdating: payload })
49 );
50
51 export const setOperationModeAction = createAction(SET_OPERRATION_MODE);
52
53 export const getIsCompositionUpdating = state =>
54     state.currentVersion.general.isCompositionUpdating;
55
56 export const versionState = {
57     DRAFT: 'draft',
58     CERTIFIED: 'certified'
59 };