UNPKG

@talend/react-containers

Version:

Provide connected components aka containers for @talend/react-cmf based on @talend/react-components.

53 lines (50 loc) 1.13 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _constants = _interopRequireDefault(require("./constants")); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /** * Action called at the dialog opening|mounting. * @param {object} event * @param {object} data */ function open(event, data) { const { model } = data; const pathname = window.location.pathname; return { type: _constants.default.DIALOG_BOX_DELETE_RESOURCE, cmf: { routerReplace: `${pathname}/${model.id}/delete` }, model, redirectUrl: pathname }; } /** * Action to delete a resource and close the confirm dialog. */ function validate(event, data) { return { type: _constants.default.DIALOG_BOX_DELETE_RESOURCE_OK, data }; } /** * Action to cancel and close the confirm dialog. */ function cancel(event, data) { return { type: _constants.default.DIALOG_BOX_DELETE_RESOURCE_CANCEL, data }; } var _default = exports.default = { open, validate, cancel }; //# sourceMappingURL=actions.js.map