spee.ch/client/build/actions/publish.js

118 lines
2.6 KiB
JavaScript
Raw Normal View History

2018-05-23 04:06:37 +02:00
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.selectFile = selectFile;
exports.clearFile = clearFile;
exports.updateMetadata = updateMetadata;
exports.updateClaim = updateClaim;
exports.setPublishInChannel = setPublishInChannel;
exports.updatePublishStatus = updatePublishStatus;
exports.updateError = updateError;
exports.updateSelectedChannel = updateSelectedChannel;
exports.toggleMetadataInputs = toggleMetadataInputs;
exports.onNewThumbnail = onNewThumbnail;
exports.startPublish = startPublish;
exports.validateClaim = validateClaim;
var actions = _interopRequireWildcard(require("../constants/publish_action_types"));
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
// export action creators
function selectFile(file) {
return {
type: actions.FILE_SELECTED,
data: file
};
}
function clearFile() {
return {
type: actions.FILE_CLEAR
};
}
function updateMetadata(name, value) {
return {
type: actions.METADATA_UPDATE,
data: {
name: name,
value: value
}
};
}
function updateClaim(value) {
return {
type: actions.CLAIM_UPDATE,
data: value
};
}
;
function setPublishInChannel(channel) {
return {
type: actions.SET_PUBLISH_IN_CHANNEL,
channel: channel
};
}
function updatePublishStatus(status, message) {
return {
type: actions.PUBLISH_STATUS_UPDATE,
data: {
status: status,
message: message
}
};
}
function updateError(name, value) {
return {
type: actions.ERROR_UPDATE,
data: {
name: name,
value: value
}
};
}
function updateSelectedChannel(channelName) {
return {
type: actions.SELECTED_CHANNEL_UPDATE,
data: channelName
};
}
function toggleMetadataInputs(showMetadataInputs) {
return {
type: actions.TOGGLE_METADATA_INPUTS,
data: showMetadataInputs
};
}
function onNewThumbnail(file) {
return {
type: actions.THUMBNAIL_NEW,
data: file
};
}
function startPublish(history) {
return {
type: actions.PUBLISH_START,
data: {
history: history
}
};
}
function validateClaim(claim) {
return {
type: actions.CLAIM_AVAILABILITY,
data: claim
};
}