diff --git a/browser/app/js/objects/__tests__/actions.test.js b/browser/app/js/objects/__tests__/actions.test.js
index 1cab87e62..6d2da8129 100644
--- a/browser/app/js/objects/__tests__/actions.test.js
+++ b/browser/app/js/objects/__tests__/actions.test.js
@@ -26,6 +26,8 @@ jest.mock("../../web", () => ({
.fn(() => true)
.mockReturnValueOnce(true)
.mockReturnValueOnce(false)
+ .mockReturnValueOnce(true)
+ .mockReturnValueOnce(true)
.mockReturnValueOnce(false),
ListObjects: jest.fn(({ bucketName }) => {
if (bucketName === "test-deny") {
@@ -405,7 +407,7 @@ describe("Objects actions", () => {
store.dispatch(actionsObjects.downloadObject("obj1"))
const url = `${
window.location.origin
- }${minioBrowserPrefix}/download/bk1/${encodeURI("pre1/obj1")}?token=''`
+ }${minioBrowserPrefix}/download/bk1/${encodeURI("pre1/obj1")}?token=`
expect(setLocation).toHaveBeenCalledWith(url)
})
diff --git a/browser/app/js/objects/actions.js b/browser/app/js/objects/actions.js
index 3268ecde7..c89bb0208 100644
--- a/browser/app/js/objects/actions.js
+++ b/browser/app/js/objects/actions.js
@@ -16,11 +16,7 @@
import web from "../web"
import history from "../history"
-import {
- sortObjectsByName,
- sortObjectsBySize,
- sortObjectsByDate
-} from "../utils"
+import { sortObjectsByName, sortObjectsBySize, sortObjectsByDate } from "../utils"
import { getCurrentBucket } from "../buckets/selectors"
import { getCurrentPrefix, getCheckedList } from "./selectors"
import * as alertActions from "../alert/actions"
@@ -60,10 +56,7 @@ export const appendList = (objects, marker, isTruncated) => ({
export const fetchObjects = append => {
return function(dispatch, getState) {
- const {
- buckets: { currentBucket },
- objects: { currentPrefix, marker }
- } = getState()
+ const {buckets: {currentBucket}, objects: {currentPrefix, marker}} = getState()
if (currentBucket) {
return web
.ListObjects({
@@ -110,7 +103,7 @@ export const fetchObjects = append => {
export const sortObjects = sortBy => {
return function(dispatch, getState) {
- const { objects } = getState()
+ const {objects} = getState()
const sortOrder = objects.sortBy == sortBy ? !objects.sortOrder : true
dispatch(setSortBy(sortBy))
dispatch(setSortOrder(sortOrder))
@@ -210,30 +203,39 @@ export const shareObject = (object, days, hours, minutes) => {
const currentPrefix = getCurrentPrefix(getState())
const objectName = `${currentPrefix}${object}`
const expiry = days * 24 * 60 * 60 + hours * 60 * 60 + minutes * 60
- return web
- .PresignedGet({
- host: location.host,
- bucket: currentBucket,
- object: objectName,
- expiry
- })
- .then(obj => {
- dispatch(showShareObject(object, obj.url))
- dispatch(
- alertActions.set({
- type: "success",
- message: `Object shared. Expires in ${days} days ${hours} hours ${minutes} minutes`
- })
- )
- })
- .catch(err => {
- dispatch(
- alertActions.set({
- type: "danger",
- message: err.message
- })
- )
- })
+ if (web.LoggedIn()) {
+ return web
+ .PresignedGet({
+ host: location.host,
+ bucket: currentBucket,
+ object: objectName
+ })
+ .then(obj => {
+ dispatch(showShareObject(object, obj.url))
+ dispatch(
+ alertActions.set({
+ type: "success",
+ message: `Object shared. Expires in ${days} days ${hours} hours ${minutes} minutes`
+ })
+ )
+ })
+ .catch(err => {
+ dispatch(
+ alertActions.set({
+ type: "danger",
+ message: err.message
+ })
+ )
+ })
+ } else {
+ dispatch(showShareObject(object, `${location.host}` + '/' + `${currentBucket}` + '/' + encodeURI(objectName)))
+ dispatch(
+ alertActions.set({
+ type: "success",
+ message: `Object shared.`
+ })
+ )
+ }
}
}
@@ -279,7 +281,7 @@ export const downloadObject = object => {
} else {
const url = `${
window.location.origin
- }${minioBrowserPrefix}/download/${currentBucket}/${encObjectName}?token=''`
+ }${minioBrowserPrefix}/download/${currentBucket}/${encObjectName}?token=`
window.location = url
}
}
@@ -308,7 +310,7 @@ export const downloadCheckedObjects = () => {
objects: getCheckedList(state)
}
if (!web.LoggedIn()) {
- const requestUrl = location.origin + "/minio/zip?token=''"
+ const requestUrl = location.origin + "/minio/zip?token="
downloadZip(requestUrl, req, dispatch)
} else {
return web
@@ -319,14 +321,13 @@ export const downloadCheckedObjects = () => {
}${minioBrowserPrefix}/zip?token=${res.token}`
downloadZip(requestUrl, req, dispatch)
})
- .catch(err =>
- dispatch(
- alertActions.set({
- type: "danger",
- message: err.message
- })
- )
+ .catch(err => dispatch(
+ alertActions.set({
+ type: "danger",
+ message: err.message
+ })
)
+ )
}
}
}
@@ -349,8 +350,7 @@ const downloadZip = (url, req, dispatch) => {
var separator = req.prefix.length > 1 ? "-" : ""
anchor.href = blobUrl
- anchor.download =
- req.bucketName + separator + req.prefix.slice(0, -1) + ".zip"
+ anchor.download = req.bucketName + separator + req.prefix.slice(0, -1) + ".zip"
anchor.click()
window.URL.revokeObjectURL(blobUrl)
diff --git a/browser/ui-assets.go b/browser/ui-assets.go
index f016508f3..c0023cd0e 100644
--- a/browser/ui-assets.go
+++ b/browser/ui-assets.go
@@ -4,7 +4,7 @@
// production/favicon.ico
// production/firefox.png
// production/index.html
-// production/index_bundle-2018-09-20T05-24-40Z.js
+// production/index_bundle-2018-11-14T00-11-05Z.js
// production/loader.css
// production/logo.svg
// production/safari.png
@@ -14,7 +14,6 @@ package browser
import (
"fmt"
- "github.com/elazarl/go-bindata-assetfs"
"io/ioutil"
"os"
"path/filepath"
@@ -65,7 +64,7 @@ func productionChromePng() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "production/chrome.png", size: 3726, mode: os.FileMode(420), modTime: time.Unix(1537421095, 0)}
+ info := bindataFileInfo{name: "production/chrome.png", size: 3726, mode: os.FileMode(420), modTime: time.Unix(1542154284, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
@@ -82,7 +81,7 @@ func productionFaviconIco() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "production/favicon.ico", size: 501, mode: os.FileMode(420), modTime: time.Unix(1537421095, 0)}
+ info := bindataFileInfo{name: "production/favicon.ico", size: 501, mode: os.FileMode(420), modTime: time.Unix(1542154284, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
@@ -99,7 +98,7 @@ func productionFirefoxPng() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "production/firefox.png", size: 4795, mode: os.FileMode(420), modTime: time.Unix(1537421095, 0)}
+ info := bindataFileInfo{name: "production/firefox.png", size: 4795, mode: os.FileMode(420), modTime: time.Unix(1542154284, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
@@ -156,8 +155,8 @@ var _productionIndexHTML = []byte(`
-
-
+
+