Convert ZaqarActions to named exports
* avoid using 'this' in thunk Change-Id: I94e8c618469d1ee04c8493ba189044de45fc5b67
This commit is contained in:
parent
ea437a5f58
commit
555db647d4
@ -17,7 +17,7 @@
|
|||||||
import { mockStore } from './utils';
|
import { mockStore } from './utils';
|
||||||
import * as ErrorActions from '../../js/actions/ErrorActions';
|
import * as ErrorActions from '../../js/actions/ErrorActions';
|
||||||
import HeatApiService from '../../js/services/HeatApiService';
|
import HeatApiService from '../../js/services/HeatApiService';
|
||||||
import StacksActions from '../../js/actions/StacksActions';
|
import * as StacksActions from '../../js/actions/StacksActions';
|
||||||
|
|
||||||
describe('StacksActions', () => {
|
describe('StacksActions', () => {
|
||||||
describe('fetchStacks (success)', () => {
|
describe('fetchStacks (success)', () => {
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
import { fromJS, Map, OrderedMap } from 'immutable';
|
import { fromJS, Map, OrderedMap } from 'immutable';
|
||||||
|
|
||||||
import { StacksState, Stack } from '../../js/immutableRecords/stacks';
|
import { StacksState, Stack } from '../../js/immutableRecords/stacks';
|
||||||
import StacksActions from '../../js/actions/StacksActions';
|
import * as StacksActions from '../../js/actions/StacksActions';
|
||||||
import stacksReducer from '../../js/reducers/stacksReducer';
|
import stacksReducer from '../../js/reducers/stacksReducer';
|
||||||
|
|
||||||
describe('stacksReducer state', () => {
|
describe('stacksReducer state', () => {
|
||||||
|
@ -21,151 +21,113 @@ import HeatApiService from '../services/HeatApiService';
|
|||||||
import StacksConstants from '../constants/StacksConstants';
|
import StacksConstants from '../constants/StacksConstants';
|
||||||
import { stackSchema } from '../normalizrSchemas/stacks';
|
import { stackSchema } from '../normalizrSchemas/stacks';
|
||||||
|
|
||||||
export default {
|
export const fetchStacksPending = () => ({
|
||||||
fetchStacksPending() {
|
type: StacksConstants.FETCH_STACKS_PENDING
|
||||||
return {
|
});
|
||||||
type: StacksConstants.FETCH_STACKS_PENDING
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
fetchStacksSuccess(data) {
|
export const fetchStacksSuccess = data => ({
|
||||||
return {
|
type: StacksConstants.FETCH_STACKS_SUCCESS,
|
||||||
type: StacksConstants.FETCH_STACKS_SUCCESS,
|
payload: data
|
||||||
payload: data
|
});
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
fetchStacksFailed() {
|
export const fetchStacksFailed = () => ({
|
||||||
return {
|
type: StacksConstants.FETCH_STACKS_FAILED
|
||||||
type: StacksConstants.FETCH_STACKS_FAILED
|
});
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
fetchStacks(planName) {
|
export const fetchStacks = planName => dispatch => {
|
||||||
return (dispatch, getState) => {
|
dispatch(fetchStacksPending());
|
||||||
dispatch(this.fetchStacksPending());
|
return dispatch(HeatApiService.getStacks())
|
||||||
return dispatch(HeatApiService.getStacks())
|
.then(response =>
|
||||||
.then(response =>
|
Promise.all(
|
||||||
Promise.all(
|
response.stacks.map(stack =>
|
||||||
response.stacks.map(stack =>
|
dispatch(HeatApiService.getStack(stack.stack_name, stack.id))
|
||||||
dispatch(HeatApiService.getStack(stack.stack_name, stack.id))
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
.then(responses => {
|
)
|
||||||
const stacks =
|
)
|
||||||
normalize(responses.map(r => r.stack), [stackSchema]).entities
|
.then(responses => {
|
||||||
.stacks || {};
|
const stacks =
|
||||||
dispatch(this.fetchStacksSuccess(stacks));
|
normalize(responses.map(r => r.stack), [stackSchema]).entities.stacks ||
|
||||||
})
|
{};
|
||||||
.catch(error => {
|
dispatch(fetchStacksSuccess(stacks));
|
||||||
dispatch(handleErrors(error, 'Stacks could not be loaded'));
|
})
|
||||||
dispatch(this.fetchStacksFailed());
|
.catch(error => {
|
||||||
});
|
dispatch(handleErrors(error, 'Stacks could not be loaded'));
|
||||||
};
|
dispatch(fetchStacksFailed());
|
||||||
},
|
});
|
||||||
|
};
|
||||||
fetchResourcesPending() {
|
|
||||||
return {
|
export const fetchResourcesPending = () => ({
|
||||||
type: StacksConstants.FETCH_RESOURCES_PENDING
|
type: StacksConstants.FETCH_RESOURCES_PENDING
|
||||||
};
|
});
|
||||||
},
|
|
||||||
|
export const fetchResourcesSuccess = resources => ({
|
||||||
fetchResourcesSuccess(resources) {
|
type: StacksConstants.FETCH_RESOURCES_SUCCESS,
|
||||||
return {
|
payload: resources
|
||||||
type: StacksConstants.FETCH_RESOURCES_SUCCESS,
|
});
|
||||||
payload: resources
|
|
||||||
};
|
export const fetchResourcesFailed = () => ({
|
||||||
},
|
type: StacksConstants.FETCH_RESOURCES_FAILED
|
||||||
|
});
|
||||||
fetchResourcesFailed() {
|
|
||||||
return {
|
export const fetchResources = (stackName, stackId) => dispatch => {
|
||||||
type: StacksConstants.FETCH_RESOURCES_FAILED
|
dispatch(fetchResourcesPending());
|
||||||
};
|
dispatch(HeatApiService.getResources(stackName, stackId))
|
||||||
},
|
.then(({ resources }) => dispatch(fetchResourcesSuccess(resources)))
|
||||||
|
.catch(error => {
|
||||||
fetchResources(stackName, stackId) {
|
dispatch(handleErrors(error, 'Stack Resources could not be loaded'));
|
||||||
return dispatch => {
|
dispatch(fetchResourcesFailed());
|
||||||
dispatch(this.fetchResourcesPending());
|
});
|
||||||
dispatch(HeatApiService.getResources(stackName, stackId))
|
};
|
||||||
.then(({ resources }) =>
|
|
||||||
dispatch(this.fetchResourcesSuccess(resources))
|
export const fetchResourceSuccess = resource => ({
|
||||||
)
|
type: StacksConstants.FETCH_RESOURCE_SUCCESS,
|
||||||
.catch(error => {
|
payload: resource
|
||||||
dispatch(handleErrors(error, 'Stack Resources could not be loaded'));
|
});
|
||||||
dispatch(this.fetchResourcesFailed());
|
|
||||||
});
|
export const fetchResourceFailed = resourceName => ({
|
||||||
};
|
type: StacksConstants.FETCH_RESOURCE_FAILED,
|
||||||
},
|
payload: resourceName
|
||||||
|
});
|
||||||
fetchResourceSuccess(resource) {
|
|
||||||
return {
|
export const fetchResourcePending = () => ({
|
||||||
type: StacksConstants.FETCH_RESOURCE_SUCCESS,
|
type: StacksConstants.FETCH_RESOURCE_PENDING
|
||||||
payload: resource
|
});
|
||||||
};
|
|
||||||
},
|
export const fetchResource = (stack, resourceName) => dispatch => {
|
||||||
|
dispatch(fetchResourcePending());
|
||||||
fetchResourceFailed(resourceName) {
|
dispatch(HeatApiService.getResource(stack, resourceName))
|
||||||
return {
|
.then(({ resource }) => {
|
||||||
type: StacksConstants.FETCH_RESOURCE_FAILED,
|
dispatch(fetchResourceSuccess(resource));
|
||||||
payload: resourceName
|
})
|
||||||
};
|
.catch(error => {
|
||||||
},
|
dispatch(handleErrors(error, 'Stack Resource could not be loaded'));
|
||||||
|
dispatch(fetchResourceFailed(resourceName));
|
||||||
fetchResourcePending() {
|
});
|
||||||
return {
|
};
|
||||||
type: StacksConstants.FETCH_RESOURCE_PENDING
|
|
||||||
};
|
export const fetchEnvironmentSuccess = (stack, environment) => ({
|
||||||
},
|
type: StacksConstants.FETCH_STACK_ENVIRONMENT_SUCCESS,
|
||||||
|
payload: { environment, stack }
|
||||||
fetchResource(stack, resourceName) {
|
});
|
||||||
return dispatch => {
|
|
||||||
dispatch(this.fetchResourcePending());
|
export const fetchEnvironmentFailed = stack => ({
|
||||||
dispatch(HeatApiService.getResource(stack, resourceName))
|
type: StacksConstants.FETCH_STACK_ENVIRONMENT_FAILED,
|
||||||
.then(({ resource }) => {
|
payload: { stack }
|
||||||
dispatch(this.fetchResourceSuccess(resource));
|
});
|
||||||
})
|
|
||||||
.catch(error => {
|
export const fetchEnvironmentPending = stack => ({
|
||||||
dispatch(handleErrors(error, 'Stack Resource could not be loaded'));
|
type: StacksConstants.FETCH_STACK_ENVIRONMENT_PENDING,
|
||||||
dispatch(this.fetchResourceFailed(resourceName));
|
payload: { stack }
|
||||||
});
|
});
|
||||||
};
|
|
||||||
},
|
export const fetchEnvironment = stack => dispatch => {
|
||||||
|
dispatch(fetchEnvironmentPending(stack));
|
||||||
fetchEnvironmentSuccess(stack, environment) {
|
dispatch(HeatApiService.getEnvironment(stack))
|
||||||
return {
|
.then(response => {
|
||||||
type: StacksConstants.FETCH_STACK_ENVIRONMENT_SUCCESS,
|
dispatch(fetchEnvironmentSuccess(stack, response));
|
||||||
payload: { environment, stack }
|
})
|
||||||
};
|
.catch(error => {
|
||||||
},
|
dispatch(handleErrors(error, 'Stack Environment could not be loaded'));
|
||||||
|
dispatch(fetchEnvironmentFailed(stack));
|
||||||
fetchEnvironmentFailed(stack) {
|
});
|
||||||
return {
|
|
||||||
type: StacksConstants.FETCH_STACK_ENVIRONMENT_FAILED,
|
|
||||||
payload: { stack }
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
fetchEnvironmentPending(stack) {
|
|
||||||
return {
|
|
||||||
type: StacksConstants.FETCH_STACK_ENVIRONMENT_PENDING,
|
|
||||||
payload: { stack }
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
fetchEnvironment(stack) {
|
|
||||||
return dispatch => {
|
|
||||||
dispatch(this.fetchEnvironmentPending(stack));
|
|
||||||
dispatch(HeatApiService.getEnvironment(stack))
|
|
||||||
.then(response => {
|
|
||||||
dispatch(this.fetchEnvironmentSuccess(stack, response));
|
|
||||||
})
|
|
||||||
.catch(error => {
|
|
||||||
dispatch(
|
|
||||||
handleErrors(error, 'Stack Environment could not be loaded')
|
|
||||||
);
|
|
||||||
dispatch(this.fetchEnvironmentFailed(stack));
|
|
||||||
});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
@ -41,7 +41,7 @@ import {
|
|||||||
fetchAvailableRolesFinished,
|
fetchAvailableRolesFinished,
|
||||||
selectRolesFinished
|
selectRolesFinished
|
||||||
} from './RolesActions';
|
} from './RolesActions';
|
||||||
import StacksActions from './StacksActions';
|
import { fetchStacksSuccess, fetchResources } from './StacksActions';
|
||||||
import { stackSchema } from '../normalizrSchemas/stacks';
|
import { stackSchema } from '../normalizrSchemas/stacks';
|
||||||
import MistralConstants from '../constants/MistralConstants';
|
import MistralConstants from '../constants/MistralConstants';
|
||||||
import ZaqarWebSocketService from '../services/ZaqarWebSocketService';
|
import ZaqarWebSocketService from '../services/ZaqarWebSocketService';
|
||||||
@ -56,245 +56,222 @@ import {
|
|||||||
} from './DeploymentActions';
|
} from './DeploymentActions';
|
||||||
import { fetchNetworksFinished } from './NetworksActions';
|
import { fetchNetworksFinished } from './NetworksActions';
|
||||||
|
|
||||||
export default {
|
export const handleAuthenticationSuccess = (message, dispatch) => {
|
||||||
handleAuthenticationSuccess(message, dispatch) {
|
message = get(message, ['body', 'message']);
|
||||||
message = get(message, ['body', 'message']);
|
|
||||||
|
|
||||||
if (message === 'Authentified.') {
|
if (message === 'Authentified.') {
|
||||||
dispatch(authenticated());
|
dispatch(authenticated());
|
||||||
dispatch(flushMessages());
|
dispatch(flushMessages());
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
messageReceived(message) {
|
|
||||||
return (dispatch, getState) => {
|
|
||||||
this.handleAuthenticationSuccess(message, dispatch);
|
|
||||||
const { type, payload } = message.body;
|
|
||||||
switch (type) {
|
|
||||||
case MistralConstants.BAREMETAL_REGISTER_OR_UPDATE:
|
|
||||||
dispatch(
|
|
||||||
handleWorkflowMessage(
|
|
||||||
payload.execution.id,
|
|
||||||
nodesRegistrationFinished
|
|
||||||
)
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MistralConstants.BAREMETAL_INTROSPECT:
|
|
||||||
dispatch(
|
|
||||||
handleWorkflowMessage(
|
|
||||||
payload.execution_id,
|
|
||||||
nodesIntrospectionFinished
|
|
||||||
)
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MistralConstants.BAREMETAL_INTROSPECT_INTERNAL:
|
|
||||||
dispatch(
|
|
||||||
handleWorkflowMessage(
|
|
||||||
payload.execution_id,
|
|
||||||
nodeIntrospectionFinished
|
|
||||||
)
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MistralConstants.BAREMETAL_PROVIDE:
|
|
||||||
dispatch(
|
|
||||||
handleWorkflowMessage(payload.execution_id, provideNodesFinished)
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MistralConstants.BAREMETAL_MANAGE:
|
|
||||||
dispatch(
|
|
||||||
handleWorkflowMessage(payload.execution_id, manageNodesFinished)
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MistralConstants.VALIDATIONS_RUN: {
|
|
||||||
// TODO(jtomasek): this conditional is a workaround for proper handling
|
|
||||||
// of a message notifying that validation workflow has started. In that
|
|
||||||
// case we want to keep original polling interval.
|
|
||||||
// Ideally, validation workflow would send a message with
|
|
||||||
// different type rather than sending the same type on start and end
|
|
||||||
let pollTimeout;
|
|
||||||
if (payload.status === 'RUNNING') {
|
|
||||||
pollTimeout = 30000;
|
|
||||||
}
|
|
||||||
dispatch(
|
|
||||||
handleWorkflowMessage(payload.execution.id, undefined, pollTimeout)
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case MistralConstants.PLAN_CREATE: {
|
|
||||||
dispatch(
|
|
||||||
handleWorkflowMessage(payload.execution_id, createPlanFinished)
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case MistralConstants.PLAN_UPDATE: {
|
|
||||||
dispatch(
|
|
||||||
handleWorkflowMessage(payload.execution_id, updatePlanFinished)
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case MistralConstants.DEPLOYMENT_DEPLOY_PLAN: {
|
|
||||||
if (payload.deployment_status === deploymentStates.DEPLOYING) {
|
|
||||||
const { message, plan_name, deployment_status } = payload;
|
|
||||||
dispatch(
|
|
||||||
getDeploymentStatusSuccess(plan_name, {
|
|
||||||
status: deployment_status,
|
|
||||||
message
|
|
||||||
})
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
dispatch(
|
|
||||||
handleWorkflowMessage(payload.execution_id, deploymentFinished)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case MistralConstants.HEAT_STACKS_LIST: {
|
|
||||||
const stacks =
|
|
||||||
normalize(payload.stacks, [stackSchema]).entities.stacks || {};
|
|
||||||
dispatch(StacksActions.fetchStacksSuccess(stacks));
|
|
||||||
|
|
||||||
// TODO(jtomasek): It would be nicer if we could identify that
|
|
||||||
// stack has changed in the component and fetch resources there
|
|
||||||
const { isFetchingResources } = getState().stacks;
|
|
||||||
const currentStack = getCurrentStack(getState());
|
|
||||||
if (!isFetchingResources && currentStack) {
|
|
||||||
const { stack_name, id } = currentStack;
|
|
||||||
dispatch(StacksActions.fetchResources(stack_name, id));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
case MistralConstants.CONFIG_DOWNLOAD_DEPLOY: {
|
|
||||||
const { message, plan_name, deployment_status } = payload;
|
|
||||||
// respond only to messages notifying on deployment_status
|
|
||||||
if (deployment_status) {
|
|
||||||
dispatch(
|
|
||||||
getDeploymentStatusSuccess(plan_name, {
|
|
||||||
status: deployment_status,
|
|
||||||
message
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case MistralConstants.ANSIBLE_PLAYBOOK_DEPLOY_STEPS: {
|
|
||||||
const { message, plan_name } = payload;
|
|
||||||
dispatch(configDownloadMessage(plan_name, message));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case MistralConstants.UNDEPLOY_PLAN: {
|
|
||||||
if (payload.deployment_status === deploymentStates.UNDEPLOYING) {
|
|
||||||
const { message, plan_name, deployment_status } = payload;
|
|
||||||
dispatch(
|
|
||||||
getDeploymentStatusSuccess(plan_name, {
|
|
||||||
status: deployment_status,
|
|
||||||
message
|
|
||||||
})
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
dispatch(
|
|
||||||
handleWorkflowMessage(payload.execution_id, undeployFinished)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case MistralConstants.RECOVER_DEPLOYMENT_STATUS:
|
|
||||||
dispatch(
|
|
||||||
handleWorkflowMessage(
|
|
||||||
payload.execution.id,
|
|
||||||
recoverDeploymentStatusFinished
|
|
||||||
)
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MistralConstants.GET_DEPLOYMENT_FAILURES:
|
|
||||||
dispatch(
|
|
||||||
handleWorkflowMessage(
|
|
||||||
payload.execution.id,
|
|
||||||
getDeploymentFailuresFinished
|
|
||||||
)
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MistralConstants.PLAN_EXPORT: {
|
|
||||||
dispatch(
|
|
||||||
handleWorkflowMessage(payload.execution_id, exportPlanFinished)
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case MistralConstants.DOWNLOAD_LOGS: {
|
|
||||||
dispatch(
|
|
||||||
handleWorkflowMessage(payload.execution.id, downloadLogsFinished)
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case MistralConstants.LIST_AVAILABLE_ROLES: {
|
|
||||||
dispatch(
|
|
||||||
handleWorkflowMessage(
|
|
||||||
payload.execution.id,
|
|
||||||
fetchAvailableRolesFinished
|
|
||||||
)
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
// TODO(jtomasek): change this back once underlining tripleo-common patch is fixed
|
|
||||||
case MistralConstants.SELECT_ROLES: {
|
|
||||||
// case 'tripleo.roles.v1.select_roles': {
|
|
||||||
dispatch(
|
|
||||||
handleWorkflowMessage(payload.execution.id, selectRolesFinished)
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case MistralConstants.NETWORK_LIST: {
|
|
||||||
dispatch(
|
|
||||||
handleWorkflowMessage(payload.execution.id, fetchNetworksFinished)
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
postMessage(queueName, body, ttl = 3600) {
|
|
||||||
return (dispatch, getState) => {
|
|
||||||
const message = {
|
|
||||||
queue_name: queueName,
|
|
||||||
messages: [
|
|
||||||
{
|
|
||||||
body,
|
|
||||||
ttl
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};
|
|
||||||
|
|
||||||
// Drop the message on the floor when there is no `store`
|
|
||||||
if (!getState) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!getState().logger.authenticated) {
|
|
||||||
dispatch(queueMessage(message));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
dispatch(ZaqarWebSocketService.sendMessage('message_post', message));
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const messageReceived = message => (dispatch, getState) => {
|
||||||
|
handleAuthenticationSuccess(message, dispatch);
|
||||||
|
const { type, payload } = message.body;
|
||||||
|
switch (type) {
|
||||||
|
case MistralConstants.BAREMETAL_REGISTER_OR_UPDATE:
|
||||||
|
dispatch(
|
||||||
|
handleWorkflowMessage(payload.execution.id, nodesRegistrationFinished)
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MistralConstants.BAREMETAL_INTROSPECT:
|
||||||
|
dispatch(
|
||||||
|
handleWorkflowMessage(payload.execution_id, nodesIntrospectionFinished)
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MistralConstants.BAREMETAL_INTROSPECT_INTERNAL:
|
||||||
|
dispatch(
|
||||||
|
handleWorkflowMessage(payload.execution_id, nodeIntrospectionFinished)
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MistralConstants.BAREMETAL_PROVIDE:
|
||||||
|
dispatch(
|
||||||
|
handleWorkflowMessage(payload.execution_id, provideNodesFinished)
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MistralConstants.BAREMETAL_MANAGE:
|
||||||
|
dispatch(
|
||||||
|
handleWorkflowMessage(payload.execution_id, manageNodesFinished)
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MistralConstants.VALIDATIONS_RUN: {
|
||||||
|
// TODO(jtomasek): this conditional is a workaround for proper handling
|
||||||
|
// of a message notifying that validation workflow has started. In that
|
||||||
|
// case we want to keep original polling interval.
|
||||||
|
// Ideally, validation workflow would send a message with
|
||||||
|
// different type rather than sending the same type on start and end
|
||||||
|
let pollTimeout;
|
||||||
|
if (payload.status === 'RUNNING') {
|
||||||
|
pollTimeout = 30000;
|
||||||
|
}
|
||||||
|
dispatch(
|
||||||
|
handleWorkflowMessage(payload.execution.id, undefined, pollTimeout)
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case MistralConstants.PLAN_CREATE: {
|
||||||
|
dispatch(handleWorkflowMessage(payload.execution_id, createPlanFinished));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case MistralConstants.PLAN_UPDATE: {
|
||||||
|
dispatch(handleWorkflowMessage(payload.execution_id, updatePlanFinished));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case MistralConstants.DEPLOYMENT_DEPLOY_PLAN: {
|
||||||
|
if (payload.deployment_status === deploymentStates.DEPLOYING) {
|
||||||
|
const { message, plan_name, deployment_status } = payload;
|
||||||
|
dispatch(
|
||||||
|
getDeploymentStatusSuccess(plan_name, {
|
||||||
|
status: deployment_status,
|
||||||
|
message
|
||||||
|
})
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
dispatch(
|
||||||
|
handleWorkflowMessage(payload.execution_id, deploymentFinished)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case MistralConstants.HEAT_STACKS_LIST: {
|
||||||
|
const stacks =
|
||||||
|
normalize(payload.stacks, [stackSchema]).entities.stacks || {};
|
||||||
|
dispatch(fetchStacksSuccess(stacks));
|
||||||
|
|
||||||
|
// TODO(jtomasek): It would be nicer if we could identify that
|
||||||
|
// stack has changed in the component and fetch resources there
|
||||||
|
const { isFetchingResources } = getState().stacks;
|
||||||
|
const currentStack = getCurrentStack(getState());
|
||||||
|
if (!isFetchingResources && currentStack) {
|
||||||
|
const { stack_name, id } = currentStack;
|
||||||
|
dispatch(fetchResources(stack_name, id));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
case MistralConstants.CONFIG_DOWNLOAD_DEPLOY: {
|
||||||
|
const { message, plan_name, deployment_status } = payload;
|
||||||
|
// respond only to messages notifying on deployment_status
|
||||||
|
if (deployment_status) {
|
||||||
|
dispatch(
|
||||||
|
getDeploymentStatusSuccess(plan_name, {
|
||||||
|
status: deployment_status,
|
||||||
|
message
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case MistralConstants.ANSIBLE_PLAYBOOK_DEPLOY_STEPS: {
|
||||||
|
const { message, plan_name } = payload;
|
||||||
|
dispatch(configDownloadMessage(plan_name, message));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case MistralConstants.UNDEPLOY_PLAN: {
|
||||||
|
if (payload.deployment_status === deploymentStates.UNDEPLOYING) {
|
||||||
|
const { message, plan_name, deployment_status } = payload;
|
||||||
|
dispatch(
|
||||||
|
getDeploymentStatusSuccess(plan_name, {
|
||||||
|
status: deployment_status,
|
||||||
|
message
|
||||||
|
})
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
dispatch(handleWorkflowMessage(payload.execution_id, undeployFinished));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case MistralConstants.RECOVER_DEPLOYMENT_STATUS:
|
||||||
|
dispatch(
|
||||||
|
handleWorkflowMessage(
|
||||||
|
payload.execution.id,
|
||||||
|
recoverDeploymentStatusFinished
|
||||||
|
)
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MistralConstants.GET_DEPLOYMENT_FAILURES:
|
||||||
|
dispatch(
|
||||||
|
handleWorkflowMessage(
|
||||||
|
payload.execution.id,
|
||||||
|
getDeploymentFailuresFinished
|
||||||
|
)
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MistralConstants.PLAN_EXPORT: {
|
||||||
|
dispatch(handleWorkflowMessage(payload.execution_id, exportPlanFinished));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case MistralConstants.DOWNLOAD_LOGS: {
|
||||||
|
dispatch(
|
||||||
|
handleWorkflowMessage(payload.execution.id, downloadLogsFinished)
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case MistralConstants.LIST_AVAILABLE_ROLES: {
|
||||||
|
dispatch(
|
||||||
|
handleWorkflowMessage(payload.execution.id, fetchAvailableRolesFinished)
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// TODO(jtomasek): change this back once underlining tripleo-common patch is fixed
|
||||||
|
case MistralConstants.SELECT_ROLES: {
|
||||||
|
// case 'tripleo.roles.v1.select_roles': {
|
||||||
|
dispatch(
|
||||||
|
handleWorkflowMessage(payload.execution.id, selectRolesFinished)
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case MistralConstants.NETWORK_LIST: {
|
||||||
|
dispatch(
|
||||||
|
handleWorkflowMessage(payload.execution.id, fetchNetworksFinished)
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const postMessage = (queueName, body, ttl = 3600) => (
|
||||||
|
dispatch,
|
||||||
|
getState
|
||||||
|
) => {
|
||||||
|
const message = {
|
||||||
|
queue_name: queueName,
|
||||||
|
messages: [
|
||||||
|
{
|
||||||
|
body,
|
||||||
|
ttl
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
// Drop the message on the floor when there is no `store`
|
||||||
|
if (!getState) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!getState().logger.authenticated) {
|
||||||
|
dispatch(queueMessage(message));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
dispatch(ZaqarWebSocketService.sendMessage('message_post', message));
|
||||||
|
};
|
||||||
|
@ -28,7 +28,7 @@ import { GlobalLoader } from './ui/Loader';
|
|||||||
import NavBar from './NavBar';
|
import NavBar from './NavBar';
|
||||||
import Nodes from './nodes/Nodes';
|
import Nodes from './nodes/Nodes';
|
||||||
import Plans from './plan/Plans.js';
|
import Plans from './plan/Plans.js';
|
||||||
import StacksActions from '../actions/StacksActions';
|
import { fetchStacks } from '../actions/StacksActions';
|
||||||
import { fetchPlans } from '../actions/PlansActions';
|
import { fetchPlans } from '../actions/PlansActions';
|
||||||
import { fetchWorkflowExecutions } from '../actions/WorkflowExecutionsActions';
|
import { fetchWorkflowExecutions } from '../actions/WorkflowExecutionsActions';
|
||||||
import ZaqarWebSocketService from '../services/ZaqarWebSocketService';
|
import ZaqarWebSocketService from '../services/ZaqarWebSocketService';
|
||||||
@ -94,7 +94,7 @@ AuthenticatedContent.propTypes = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch, ownProps) => ({
|
const mapDispatchToProps = (dispatch, ownProps) => ({
|
||||||
fetchStacks: () => dispatch(StacksActions.fetchStacks()),
|
fetchStacks: () => dispatch(fetchStacks()),
|
||||||
fetchPlans: () => dispatch(fetchPlans()),
|
fetchPlans: () => dispatch(fetchPlans()),
|
||||||
fetchWorkflowExecutions: () => dispatch(fetchWorkflowExecutions()),
|
fetchWorkflowExecutions: () => dispatch(fetchWorkflowExecutions()),
|
||||||
initializeZaqarConnection: () => dispatch(ZaqarWebSocketService.init())
|
initializeZaqarConnection: () => dispatch(ZaqarWebSocketService.init())
|
||||||
|
@ -34,7 +34,7 @@ import {
|
|||||||
import InlineNotification from '../ui/InlineNotification';
|
import InlineNotification from '../ui/InlineNotification';
|
||||||
import { Loader } from '../ui/Loader';
|
import { Loader } from '../ui/Loader';
|
||||||
import { sanitizeMessage } from '../../utils';
|
import { sanitizeMessage } from '../../utils';
|
||||||
import StacksActions from '../../actions/StacksActions';
|
import { fetchStacks } from '../../actions/StacksActions';
|
||||||
import { startUndeploy } from '../../actions/DeploymentActions';
|
import { startUndeploy } from '../../actions/DeploymentActions';
|
||||||
import StackResources from './StackResources';
|
import StackResources from './StackResources';
|
||||||
|
|
||||||
@ -126,7 +126,7 @@ const mapStateToProps = (state, props) => ({
|
|||||||
|
|
||||||
const mapDispatchToProps = (dispatch, { planName }) => ({
|
const mapDispatchToProps = (dispatch, { planName }) => ({
|
||||||
undeployPlan: () => dispatch(startUndeploy(planName)),
|
undeployPlan: () => dispatch(startUndeploy(planName)),
|
||||||
fetchStacks: () => dispatch(StacksActions.fetchStacks())
|
fetchStacks: () => dispatch(fetchStacks())
|
||||||
});
|
});
|
||||||
|
|
||||||
export default injectIntl(
|
export default injectIntl(
|
||||||
|
@ -147,8 +147,6 @@ class DeploymentProgress extends React.Component {
|
|||||||
DeploymentProgress.propTypes = {
|
DeploymentProgress.propTypes = {
|
||||||
completeResourcesCount: PropTypes.number,
|
completeResourcesCount: PropTypes.number,
|
||||||
deploymentStatus: PropTypes.object.isRequired,
|
deploymentStatus: PropTypes.object.isRequired,
|
||||||
fetchResources: PropTypes.func.isRequired,
|
|
||||||
fetchStacks: PropTypes.func.isRequired,
|
|
||||||
intl: PropTypes.object,
|
intl: PropTypes.object,
|
||||||
isFetchingStacks: PropTypes.bool.isRequired,
|
isFetchingStacks: PropTypes.bool.isRequired,
|
||||||
planName: PropTypes.string.isRequired,
|
planName: PropTypes.string.isRequired,
|
||||||
@ -172,10 +170,4 @@ const mapStateToProps = (state, props) => ({
|
|||||||
stacksLoaded: state.stacks.isLoaded
|
stacksLoaded: state.stacks.isLoaded
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch, { planName }) => ({
|
export default connect(mapStateToProps)(DeploymentProgress);
|
||||||
fetchStacks: () => dispatch(StacksActions.fetchStacks()),
|
|
||||||
fetchResources: (stackName, stackId) =>
|
|
||||||
dispatch(StacksActions.fetchResources(stackName, stackId))
|
|
||||||
});
|
|
||||||
|
|
||||||
export default connect(mapStateToProps, mapDispatchToProps)(DeploymentProgress);
|
|
||||||
|
@ -21,7 +21,7 @@ import PropTypes from 'prop-types';
|
|||||||
import React, { Component, Fragment } from 'react';
|
import React, { Component, Fragment } from 'react';
|
||||||
|
|
||||||
import StackResourcesTable from './StackResourcesTable';
|
import StackResourcesTable from './StackResourcesTable';
|
||||||
import StacksActions from '../../actions/StacksActions';
|
import { fetchResources } from '../../actions/StacksActions';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
title: {
|
title: {
|
||||||
@ -75,8 +75,7 @@ const mapStateToProps = state => ({
|
|||||||
isFetchingResources: state.stacks.isFetchingResources
|
isFetchingResources: state.stacks.isFetchingResources
|
||||||
});
|
});
|
||||||
const mapDispatchToProps = (dispatch, { stack }) => ({
|
const mapDispatchToProps = (dispatch, { stack }) => ({
|
||||||
fetchResources: () =>
|
fetchResources: () => dispatch(fetchResources(stack.stack_name, stack.id))
|
||||||
dispatch(StacksActions.fetchResources(stack.stack_name, stack.id))
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(mapStateToProps, mapDispatchToProps)(StackResources);
|
export default connect(mapStateToProps, mapDispatchToProps)(StackResources);
|
||||||
|
@ -136,8 +136,6 @@ class UndeployProgress extends React.Component {
|
|||||||
|
|
||||||
UndeployProgress.propTypes = {
|
UndeployProgress.propTypes = {
|
||||||
deploymentStatus: PropTypes.object.isRequired,
|
deploymentStatus: PropTypes.object.isRequired,
|
||||||
fetchResources: PropTypes.func.isRequired,
|
|
||||||
fetchStacks: PropTypes.func.isRequired,
|
|
||||||
intl: PropTypes.object,
|
intl: PropTypes.object,
|
||||||
isFetchingStacks: PropTypes.bool.isRequired,
|
isFetchingStacks: PropTypes.bool.isRequired,
|
||||||
planName: PropTypes.string.isRequired,
|
planName: PropTypes.string.isRequired,
|
||||||
@ -158,10 +156,4 @@ const mapStateToProps = (state, props) => ({
|
|||||||
stacksLoaded: state.stacks.isLoaded
|
stacksLoaded: state.stacks.isLoaded
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch, { planName }) => ({
|
export default connect(mapStateToProps)(UndeployProgress);
|
||||||
fetchStacks: () => dispatch(StacksActions.fetchStacks()),
|
|
||||||
fetchResources: (stackName, stackId) =>
|
|
||||||
dispatch(StacksActions.fetchResources(stackName, stackId))
|
|
||||||
});
|
|
||||||
|
|
||||||
export default connect(mapStateToProps, mapDispatchToProps)(UndeployProgress);
|
|
||||||
|
@ -24,7 +24,6 @@ import { deploymentStatusMessages } from '../../constants/DeploymentConstants';
|
|||||||
import { getCurrentPlanDeploymentStatus } from '../../selectors/deployment';
|
import { getCurrentPlanDeploymentStatus } from '../../selectors/deployment';
|
||||||
import InlineNotification from '../ui/InlineNotification';
|
import InlineNotification from '../ui/InlineNotification';
|
||||||
import { sanitizeMessage } from '../../utils';
|
import { sanitizeMessage } from '../../utils';
|
||||||
import StacksActions from '../../actions/StacksActions';
|
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
deleteDeployment: {
|
deleteDeployment: {
|
||||||
@ -75,12 +74,4 @@ const mapStateToProps = (state, props) => ({
|
|||||||
deploymentStatus: getCurrentPlanDeploymentStatus(state)
|
deploymentStatus: getCurrentPlanDeploymentStatus(state)
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch, { planName }) => ({
|
export default injectIntl(connect(mapStateToProps)(DeploymentFailure));
|
||||||
deleteStack: () => {
|
|
||||||
dispatch(StacksActions.deleteStack(planName, ''));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
export default injectIntl(
|
|
||||||
connect(mapStateToProps, mapDispatchToProps)(DeploymentFailure)
|
|
||||||
);
|
|
||||||
|
@ -31,7 +31,7 @@ import {
|
|||||||
getCreateCompleteResources
|
getCreateCompleteResources
|
||||||
} from '../../selectors/stacks';
|
} from '../../selectors/stacks';
|
||||||
import { InlineLoader, Loader } from '../ui/Loader';
|
import { InlineLoader, Loader } from '../ui/Loader';
|
||||||
import StacksActions from '../../actions/StacksActions';
|
import { fetchStacks, fetchResources } from '../../actions/StacksActions';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
initializingDeployment: {
|
initializingDeployment: {
|
||||||
@ -177,12 +177,6 @@ const mapStateToProps = (state, props) => ({
|
|||||||
resourcesCount: state.stacks.resources.size
|
resourcesCount: state.stacks.resources.size
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch, { planName }) => ({
|
|
||||||
fetchStacks: () => dispatch(StacksActions.fetchStacks()),
|
|
||||||
fetchResources: (stackName, stackId) =>
|
|
||||||
dispatch(StacksActions.fetchResources(stackName, stackId))
|
|
||||||
});
|
|
||||||
|
|
||||||
export default injectIntl(
|
export default injectIntl(
|
||||||
connect(mapStateToProps, mapDispatchToProps)(DeploymentProgress)
|
connect(mapStateToProps, { fetchStacks, fetchResources })(DeploymentProgress)
|
||||||
);
|
);
|
||||||
|
@ -32,7 +32,11 @@ import InlineNotification from '../ui/InlineNotification';
|
|||||||
import OvercloudInfo from '../deployment/OvercloudInfo';
|
import OvercloudInfo from '../deployment/OvercloudInfo';
|
||||||
import { Loader } from '../ui/Loader';
|
import { Loader } from '../ui/Loader';
|
||||||
import { startUndeploy } from '../../actions/DeploymentActions';
|
import { startUndeploy } from '../../actions/DeploymentActions';
|
||||||
import StacksActions from '../../actions/StacksActions';
|
import {
|
||||||
|
fetchStacks,
|
||||||
|
fetchEnvironment,
|
||||||
|
fetchResource
|
||||||
|
} from '../../actions/StacksActions';
|
||||||
|
|
||||||
class DeploymentSuccess extends React.Component {
|
class DeploymentSuccess extends React.Component {
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
@ -108,11 +112,10 @@ const mapStateToProps = state => ({
|
|||||||
|
|
||||||
const mapDispatchToProps = dispatch => ({
|
const mapDispatchToProps = dispatch => ({
|
||||||
undeployPlan: planName => dispatch(startUndeploy(planName)),
|
undeployPlan: planName => dispatch(startUndeploy(planName)),
|
||||||
fetchStacks: () => dispatch(StacksActions.fetchStacks()),
|
fetchStacks: () => dispatch(fetchStacks()),
|
||||||
fetchStackEnvironment: stack =>
|
fetchStackEnvironment: stack => dispatch(fetchEnvironment(stack)),
|
||||||
dispatch(StacksActions.fetchEnvironment(stack)),
|
|
||||||
fetchStackResource: (stack, resourceName) =>
|
fetchStackResource: (stack, resourceName) =>
|
||||||
dispatch(StacksActions.fetchResource(stack, resourceName))
|
dispatch(fetchResource(stack, resourceName))
|
||||||
});
|
});
|
||||||
|
|
||||||
export default injectIntl(
|
export default injectIntl(
|
||||||
|
@ -31,7 +31,7 @@ import {
|
|||||||
getDeleteCompleteResources
|
getDeleteCompleteResources
|
||||||
} from '../../selectors/stacks';
|
} from '../../selectors/stacks';
|
||||||
import { InlineLoader, Loader } from '../ui/Loader';
|
import { InlineLoader, Loader } from '../ui/Loader';
|
||||||
import StacksActions from '../../actions/StacksActions';
|
import { fetchStacks, fetchResources } from '../../actions/StacksActions';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
initializingUndeploy: {
|
initializingUndeploy: {
|
||||||
@ -172,12 +172,6 @@ const mapStateToProps = (state, props) => ({
|
|||||||
resourcesCount: state.stacks.resources.size
|
resourcesCount: state.stacks.resources.size
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch, { planName }) => ({
|
|
||||||
fetchStacks: () => dispatch(StacksActions.fetchStacks()),
|
|
||||||
fetchResources: (stackName, stackId) =>
|
|
||||||
dispatch(StacksActions.fetchResources(stackName, stackId))
|
|
||||||
});
|
|
||||||
|
|
||||||
export default injectIntl(
|
export default injectIntl(
|
||||||
connect(mapStateToProps, mapDispatchToProps)(UndeployProgress)
|
connect(mapStateToProps, { fetchStacks, fetchResources })(UndeployProgress)
|
||||||
);
|
);
|
||||||
|
@ -35,7 +35,7 @@ import NodesListView from './NodesListView/NodesListView';
|
|||||||
import NodesToolbar from './NodesToolbar/NodesToolbar';
|
import NodesToolbar from './NodesToolbar/NodesToolbar';
|
||||||
import NodesTableView from './NodesTableView';
|
import NodesTableView from './NodesTableView';
|
||||||
import RegisterNodesDialog from './registerNodes/RegisterNodesDialog';
|
import RegisterNodesDialog from './registerNodes/RegisterNodesDialog';
|
||||||
import StacksActions from '../../actions/StacksActions';
|
import { fetchStacks } from '../../actions/StacksActions';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
loadingNodes: {
|
loadingNodes: {
|
||||||
@ -180,11 +180,10 @@ const mapStateToProps = state => ({
|
|||||||
stacksLoaded: state.stacks.isLoaded
|
stacksLoaded: state.stacks.isLoaded
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapDispatchToProps = dispatch => ({
|
export default injectIntl(
|
||||||
fetchStacks: () => dispatch(StacksActions.fetchStacks()),
|
connect(mapStateToProps, {
|
||||||
fetchNodes: () => dispatch(fetchNodes()),
|
fetchStacks,
|
||||||
fetchNodeIntrospectionData: nodeId =>
|
fetchNodes,
|
||||||
dispatch(fetchNodeIntrospectionData(nodeId))
|
fetchNodeIntrospectionData
|
||||||
});
|
})(Nodes)
|
||||||
|
);
|
||||||
export default injectIntl(connect(mapStateToProps, mapDispatchToProps)(Nodes));
|
|
||||||
|
@ -21,7 +21,7 @@ import {
|
|||||||
getDefaultZaqarQueue,
|
getDefaultZaqarQueue,
|
||||||
getLoggingZaqarQueue
|
getLoggingZaqarQueue
|
||||||
} from '../selectors/appConfig';
|
} from '../selectors/appConfig';
|
||||||
import ZaqarActions from '../actions/ZaqarActions';
|
import { messageReceived } from '../actions/ZaqarActions';
|
||||||
import { notify } from '../actions/NotificationActions';
|
import { notify } from '../actions/NotificationActions';
|
||||||
|
|
||||||
// We're using `console` here to avoid circular imports.
|
// We're using `console` here to avoid circular imports.
|
||||||
@ -65,7 +65,7 @@ export default {
|
|||||||
|
|
||||||
this.socket.onmessage = evt => {
|
this.socket.onmessage = evt => {
|
||||||
const data = JSON.parse(evt.data);
|
const data = JSON.parse(evt.data);
|
||||||
dispatch(ZaqarActions.messageReceived(data));
|
dispatch(messageReceived(data));
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import ZaqarActions from '../../../actions/ZaqarActions';
|
import { postMessage } from '../../../actions/ZaqarActions';
|
||||||
import Adapter from './BaseAdapter';
|
import Adapter from './BaseAdapter';
|
||||||
|
|
||||||
export default class ZaqarAdapter extends Adapter {
|
export default class ZaqarAdapter extends Adapter {
|
||||||
@ -62,7 +62,7 @@ export default class ZaqarAdapter extends Adapter {
|
|||||||
const loggingQueue =
|
const loggingQueue =
|
||||||
(window.tripleOUiConfig || {})['logger-zaqar-queue'] ||
|
(window.tripleOUiConfig || {})['logger-zaqar-queue'] ||
|
||||||
'tripleo-ui-logging';
|
'tripleo-ui-logging';
|
||||||
this._dispatch(ZaqarActions.postMessage(loggingQueue, msg));
|
this._dispatch(postMessage(loggingQueue, msg));
|
||||||
}
|
}
|
||||||
|
|
||||||
debug(...args) {
|
debug(...args) {
|
||||||
|
Loading…
Reference in New Issue
Block a user