2018-01-24 11:24:49 -08:00
|
|
|
import * as actions from 'constants/publish_action_types';
|
2018-01-08 17:06:31 -08:00
|
|
|
|
|
|
|
// export action creators
|
|
|
|
export function selectFile (file) {
|
|
|
|
return {
|
2018-01-16 11:38:37 -08:00
|
|
|
type: actions.FILE_SELECTED,
|
2018-02-06 12:11:44 -08:00
|
|
|
data: file,
|
2018-01-08 17:06:31 -08:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
export function clearFile () {
|
|
|
|
return {
|
2018-01-16 11:38:37 -08:00
|
|
|
type: actions.FILE_CLEAR,
|
2018-01-08 17:06:31 -08:00
|
|
|
};
|
|
|
|
};
|
2018-01-08 17:46:17 -08:00
|
|
|
|
|
|
|
export function updateMetadata (name, value) {
|
|
|
|
return {
|
2018-01-16 11:38:37 -08:00
|
|
|
type: actions.METADATA_UPDATE,
|
2018-02-06 12:11:44 -08:00
|
|
|
data: {
|
|
|
|
name,
|
|
|
|
value,
|
|
|
|
},
|
2018-01-08 17:46:17 -08:00
|
|
|
};
|
|
|
|
};
|
2018-01-09 18:25:38 -08:00
|
|
|
|
|
|
|
export function updateClaim (value) {
|
|
|
|
return {
|
2018-01-16 11:38:37 -08:00
|
|
|
type: actions.CLAIM_UPDATE,
|
2018-02-06 12:11:44 -08:00
|
|
|
data: value,
|
2018-01-09 18:25:38 -08:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2018-01-11 12:51:38 -08:00
|
|
|
export function setPublishInChannel (channel) {
|
2018-01-09 18:25:38 -08:00
|
|
|
return {
|
2018-01-16 11:38:37 -08:00
|
|
|
type: actions.SET_PUBLISH_IN_CHANNEL,
|
2018-01-11 12:51:38 -08:00
|
|
|
channel,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2018-01-11 15:37:32 -08:00
|
|
|
export function updatePublishStatus (status, message) {
|
2018-01-11 12:51:38 -08:00
|
|
|
return {
|
2018-01-16 11:38:37 -08:00
|
|
|
type: actions.PUBLISH_STATUS_UPDATE,
|
2018-02-06 12:11:44 -08:00
|
|
|
data: {
|
|
|
|
status,
|
|
|
|
message,
|
|
|
|
},
|
2018-01-09 18:25:38 -08:00
|
|
|
};
|
2018-01-11 12:51:38 -08:00
|
|
|
};
|
2018-01-12 14:27:34 -08:00
|
|
|
|
|
|
|
export function updateError (name, value) {
|
|
|
|
return {
|
2018-01-16 11:38:37 -08:00
|
|
|
type: actions.ERROR_UPDATE,
|
2018-02-06 12:11:44 -08:00
|
|
|
data: {
|
|
|
|
name,
|
|
|
|
value,
|
|
|
|
},
|
2018-01-12 14:27:34 -08:00
|
|
|
};
|
|
|
|
};
|
2018-01-19 10:16:55 -08:00
|
|
|
|
2018-02-06 12:11:44 -08:00
|
|
|
export function updateSelectedChannel (channelName) {
|
2018-01-19 10:16:55 -08:00
|
|
|
return {
|
|
|
|
type: actions.SELECTED_CHANNEL_UPDATE,
|
2018-02-06 12:11:44 -08:00
|
|
|
data: channelName,
|
2018-01-19 10:16:55 -08:00
|
|
|
};
|
|
|
|
};
|
2018-01-19 16:03:49 -08:00
|
|
|
|
2018-02-06 12:11:44 -08:00
|
|
|
export function toggleMetadataInputs (showMetadataInputs) {
|
2018-01-19 16:03:49 -08:00
|
|
|
return {
|
|
|
|
type: actions.TOGGLE_METADATA_INPUTS,
|
2018-02-06 12:11:44 -08:00
|
|
|
data: showMetadataInputs,
|
2018-01-19 16:03:49 -08:00
|
|
|
};
|
|
|
|
};
|
2018-02-05 18:14:12 -08:00
|
|
|
|
2018-03-02 14:57:25 -08:00
|
|
|
export function onNewThumbnail (file) {
|
2018-02-05 18:14:12 -08:00
|
|
|
return {
|
2018-03-02 14:57:25 -08:00
|
|
|
type: actions.THUMBNAIL_NEW,
|
2018-02-28 21:25:51 -08:00
|
|
|
data: file,
|
2018-02-05 18:14:12 -08:00
|
|
|
};
|
|
|
|
};
|
2018-03-01 11:54:49 -08:00
|
|
|
|
2018-03-01 14:00:29 -08:00
|
|
|
export function startPublish (history) {
|
2018-03-01 11:54:49 -08:00
|
|
|
return {
|
|
|
|
type: actions.PUBLISH_START,
|
2018-03-01 14:00:29 -08:00
|
|
|
data: { history },
|
2018-03-01 11:54:49 -08:00
|
|
|
};
|
|
|
|
}
|