Refactor make bucket and upload components (#5521)

This commit is contained in:
Kanagaraj M
2018-02-15 08:04:59 +05:30
committed by Harshavardhana
parent 9bfa07ecf5
commit 44f8f7059c
29 changed files with 1329 additions and 213 deletions

View File

@@ -21,9 +21,11 @@ import {
sortObjectsBySize,
sortObjectsByDate
} from "../utils"
import { getCurrentBucket } from "../buckets/selectors"
export const SET_LIST = "objects/SET_LIST"
export const APPEND_LIST = "objects/APPEND_LIST"
export const RESET = "objects/RESET"
export const SET_SORT_BY = "objects/SET_SORT_BY"
export const SET_SORT_ORDER = "objects/SET_SORT_ORDER"
export const SET_CURRENT_PREFIX = "objects/SET_CURRENT_PREFIX"
@@ -52,7 +54,7 @@ export const fetchObjects = append => {
.ListObjects({
bucketName: currentBucket,
prefix: currentPrefix,
marker: marker
marker: append ? marker : ""
})
.then(res => {
let objects = []
@@ -113,7 +115,8 @@ export const setSortOrder = sortOrder => ({
export const selectPrefix = prefix => {
return function(dispatch, getState) {
dispatch(setCurrentPrefix(prefix))
const currentBucket = getState().buckets.currentBucket
dispatch(fetchObjects())
const currentBucket = getCurrentBucket(getState())
history.replace(`/${currentBucket}/${prefix}`)
}
}