diff --git a/browser/app/js/__tests__/App.test.js b/browser/app/js/__tests__/App.test.js index 14ec5cedc..842f4e145 100644 --- a/browser/app/js/__tests__/App.test.js +++ b/browser/app/js/__tests__/App.test.js @@ -31,7 +31,7 @@ describe("App", () => { const wrapper = mount( - , + ) expect(wrapper.text()).toBe("Login") }) @@ -40,7 +40,7 @@ describe("App", () => { const wrapper = mount( - , + ) expect(wrapper.text()).toBe("Browser") }) @@ -49,7 +49,7 @@ describe("App", () => { const wrapper = mount( - , + ) expect(wrapper.text()).toBe("Browser") }) @@ -58,7 +58,7 @@ describe("App", () => { const wrapper = mount( - , + ) expect(wrapper.text()).toBe("Browser") }) diff --git a/browser/app/js/__tests__/jsonrpc-test.js b/browser/app/js/__tests__/jsonrpc-test.js index a2e96dd93..30d15b7de 100644 --- a/browser/app/js/__tests__/jsonrpc-test.js +++ b/browser/app/js/__tests__/jsonrpc-test.js @@ -21,7 +21,7 @@ describe("jsonrpc", () => { try { let jsonRPC = new JSONrpc({ endpoint: "htt://localhost:9000", - namespace: "Test", + namespace: "Test" }) } catch (e) { done() @@ -30,7 +30,7 @@ describe("jsonrpc", () => { it("should succeed with valid endpoint", () => { let jsonRPC = new JSONrpc({ endpoint: "http://localhost:9000/webrpc", - namespace: "Test", + namespace: "Test" }) expect(jsonRPC.version).toEqual("2.0") expect(jsonRPC.host).toEqual("localhost") diff --git a/browser/app/js/alert/AlertContainer.js b/browser/app/js/alert/AlertContainer.js index d3202e420..a36e9910d 100644 --- a/browser/app/js/alert/AlertContainer.js +++ b/browser/app/js/alert/AlertContainer.js @@ -28,13 +28,13 @@ export const AlertContainer = ({ alert, clearAlert }) => { const mapStateToProps = state => { return { - alert: state.alert, + alert: state.alert } } const mapDispatchToProps = dispatch => { return { - clearAlert: () => dispatch(alertActions.clear()), + clearAlert: () => dispatch(alertActions.clear()) } } diff --git a/browser/app/js/alert/__tests___/Alert.test.js b/browser/app/js/alert/__tests___/Alert.test.js index bcedcaa7f..b6a9e6268 100644 --- a/browser/app/js/alert/__tests___/Alert.test.js +++ b/browser/app/js/alert/__tests___/Alert.test.js @@ -26,10 +26,10 @@ describe("Alert", () => { it("should call onDismiss when close button is clicked", () => { const onDismiss = jest.fn() const wrapper = mount( - , + ) - wrapper.find("button").simulate("click", { - preventDefault: jest.fn(), + wrapper.find("i").simulate("click", { + preventDefault: jest.fn() }) expect(onDismiss).toHaveBeenCalled() }) diff --git a/browser/app/js/alert/__tests___/AlertContainer.test.js b/browser/app/js/alert/__tests___/AlertContainer.test.js index f748e1915..d41bc6f02 100644 --- a/browser/app/js/alert/__tests___/AlertContainer.test.js +++ b/browser/app/js/alert/__tests___/AlertContainer.test.js @@ -21,15 +21,13 @@ import { AlertContainer } from "../AlertContainer" describe("Alert", () => { it("should render without crashing", () => { shallow( - , + ) }) it("should render nothing if message is empty", () => { const wrapper = shallow( - , + ) expect(wrapper.find("Alert").length).toBe(0) }) diff --git a/browser/app/js/alert/__tests___/actions.test.js b/browser/app/js/alert/__tests___/actions.test.js index b06eed57a..4dc616a3e 100644 --- a/browser/app/js/alert/__tests___/actions.test.js +++ b/browser/app/js/alert/__tests___/actions.test.js @@ -32,15 +32,15 @@ describe("Alert actions", () => { alert: { id: 0, message: "Test alert", - type: "danger", - }, - }, + type: "danger" + } + } ] store.dispatch( actionsAlert.set({ message: "Test alert", - type: "danger", - }), + type: "danger" + }) ) const actions = store.getActions() expect(actions).toEqual(expectedActions) @@ -53,20 +53,20 @@ describe("Alert actions", () => { type: "alert/SET", alert: { id: 1, - message: "Test alert", - }, + message: "Test alert" + } }, { type: "alert/CLEAR", alert: { - id: 1, - }, - }, + id: 1 + } + } ] store.dispatch( actionsAlert.set({ - message: "Test alert", - }), + message: "Test alert" + }) ) jest.runAllTimers() const actions = store.getActions() @@ -77,8 +77,8 @@ describe("Alert actions", () => { const store = mockStore() const expectedActions = [ { - type: "alert/CLEAR", - }, + type: "alert/CLEAR" + } ] store.dispatch(actionsAlert.clear()) const actions = store.getActions() diff --git a/browser/app/js/alert/__tests___/reducer.test.js b/browser/app/js/alert/__tests___/reducer.test.js index a875228b8..69099710b 100644 --- a/browser/app/js/alert/__tests___/reducer.test.js +++ b/browser/app/js/alert/__tests___/reducer.test.js @@ -21,7 +21,7 @@ describe("alert reducer", () => { it("should return the initial state", () => { expect(reducer(undefined, {})).toEqual({ show: false, - type: "danger", + type: "danger" }) }) @@ -32,14 +32,14 @@ describe("alert reducer", () => { alert: { id: 1, type: "danger", - message: "Test message", - }, - }), + message: "Test message" + } + }) ).toEqual({ show: true, id: 1, type: "danger", - message: "Test message", + message: "Test message" }) }) @@ -49,15 +49,15 @@ describe("alert reducer", () => { { show: true, type: "danger", - message: "Test message", + message: "Test message" }, { - type: actionsAlert.CLEAR, - }, - ), + type: actionsAlert.CLEAR + } + ) ).toEqual({ show: false, - type: "danger", + type: "danger" }) }) @@ -68,18 +68,18 @@ describe("alert reducer", () => { show: true, id: 1, type: "danger", - message: "Test message", + message: "Test message" }, { type: actionsAlert.CLEAR, alert: { - id: 1, - }, - }, - ), + id: 1 + } + } + ) ).toEqual({ show: false, - type: "danger", + type: "danger" }) }) @@ -90,20 +90,20 @@ describe("alert reducer", () => { show: true, id: 1, type: "danger", - message: "Test message", + message: "Test message" }, { type: actionsAlert.CLEAR, alert: { - id: 2, - }, - }, - ), + id: 2 + } + } + ) ).toEqual({ show: true, id: 1, type: "danger", - message: "Test message", + message: "Test message" }) }) }) diff --git a/browser/app/js/alert/actions.js b/browser/app/js/alert/actions.js index 17a518234..6afd182ed 100644 --- a/browser/app/js/alert/actions.js +++ b/browser/app/js/alert/actions.js @@ -27,22 +27,22 @@ export const set = alert => { dispatch({ type: CLEAR, alert: { - id, - }, + id + } }) }, 5000) } dispatch({ type: SET, alert: Object.assign({}, alert, { - id, - }), + id + }) }) } } export const clear = () => { return { - type: CLEAR, + type: CLEAR } } diff --git a/browser/app/js/alert/reducer.js b/browser/app/js/alert/reducer.js index 04ff594ea..3bcd4fddb 100644 --- a/browser/app/js/alert/reducer.js +++ b/browser/app/js/alert/reducer.js @@ -18,7 +18,7 @@ import * as actionsAlert from "./actions" const initialState = { show: false, - type: "danger", + type: "danger" } export default (state = initialState, action) => { switch (action.type) { @@ -27,7 +27,7 @@ export default (state = initialState, action) => { show: true, id: action.alert.id, type: action.alert.type, - message: action.alert.message, + message: action.alert.message } case actionsAlert.CLEAR: if (action.alert && action.alert.id != state.id) { diff --git a/browser/app/js/browser/BrowserDropdown.js b/browser/app/js/browser/BrowserDropdown.js index defb04d0d..1676d4d1f 100644 --- a/browser/app/js/browser/BrowserDropdown.js +++ b/browser/app/js/browser/BrowserDropdown.js @@ -28,29 +28,29 @@ export class BrowserDropdown extends React.Component { super(props) this.state = { showAboutModal: false, - showChangePasswordModal: false, + showChangePasswordModal: false } } showAbout(e) { e.preventDefault() this.setState({ - showAboutModal: true, + showAboutModal: true }) } hideAbout() { this.setState({ - showAboutModal: false, + showAboutModal: false }) } showChangePassword(e) { e.preventDefault() this.setState({ - showChangePasswordModal: true, + showChangePasswordModal: true }) } hideChangePassword() { this.setState({ - showChangePasswordModal: false, + showChangePasswordModal: false }) } componentDidMount() { @@ -142,13 +142,13 @@ export class BrowserDropdown extends React.Component { const mapStateToProps = state => { return { - serverInfo: state.browser.serverInfo, + serverInfo: state.browser.serverInfo } } const mapDispatchToProps = dispatch => { return { - fetchServerInfo: () => dispatch(browserActions.fetchServerInfo()), + fetchServerInfo: () => dispatch(browserActions.fetchServerInfo()) } } diff --git a/browser/app/js/browser/ChangePasswordModal.js b/browser/app/js/browser/ChangePasswordModal.js index c9d0aaef9..d6a6584dc 100644 --- a/browser/app/js/browser/ChangePasswordModal.js +++ b/browser/app/js/browser/ChangePasswordModal.js @@ -24,7 +24,7 @@ import { Modal, ModalBody, ModalHeader, - OverlayTrigger, + OverlayTrigger } from "react-bootstrap" export class ChangePasswordModal extends React.Component { @@ -33,7 +33,7 @@ export class ChangePasswordModal extends React.Component { this.state = { accessKey: "", secretKey: "", - keysReadOnly: false, + keysReadOnly: false } } // When its shown, it loads the access key and secret key. @@ -45,13 +45,13 @@ export class ChangePasswordModal extends React.Component { this.setState({ accessKey: "xxxxxxxxx", secretKey: "xxxxxxxxx", - keysReadOnly: true, + keysReadOnly: true }) } else { web.GetAuth().then(data => { this.setState({ accessKey: data.accessKey, - secretKey: data.secretKey, + secretKey: data.secretKey }) }) } @@ -60,19 +60,19 @@ export class ChangePasswordModal extends React.Component { // Handle field changes from inside the modal. accessKeyChange(e) { this.setState({ - accessKey: e.target.value, + accessKey: e.target.value }) } secretKeyChange(e) { this.setState({ - secretKey: e.target.value, + secretKey: e.target.value }) } secretKeyVisible(secretKeyVisible) { this.setState({ - secretKeyVisible, + secretKeyVisible }) } @@ -84,18 +84,18 @@ export class ChangePasswordModal extends React.Component { web .SetAuth({ accessKey, - secretKey, + secretKey }) .then(data => { showAlert({ type: "success", - message: "Changed credentials", + message: "Changed credentials" }) }) .catch(err => { showAlert({ type: "danger", - message: err.message, + message: err.message }) }) } @@ -105,7 +105,7 @@ export class ChangePasswordModal extends React.Component { this.setState({ accessKey: data.accessKey, secretKey: data.secretKey, - secretKeyVisible: true, + secretKeyVisible: true }) }) } @@ -136,7 +136,7 @@ export class ChangePasswordModal extends React.Component { { return { - serverInfo: state.browser.serverInfo, + serverInfo: state.browser.serverInfo } } const mapDispatchToProps = dispatch => { return { - showAlert: alert => dispatch(alertActions.set(alert)), + showAlert: alert => dispatch(alertActions.set(alert)) } } diff --git a/browser/app/js/browser/ConfirmModal.js b/browser/app/js/browser/ConfirmModal.js index 9e0236725..75bb89a75 100644 --- a/browser/app/js/browser/ConfirmModal.js +++ b/browser/app/js/browser/ConfirmModal.js @@ -26,7 +26,7 @@ let ConfirmModal = ({ cancelText, okHandler, cancelHandler, - show, + show }) => { return ( { return (
- +
) diff --git a/browser/app/js/browser/Login.js b/browser/app/js/browser/Login.js index 64ba57621..f9f758ce5 100644 --- a/browser/app/js/browser/Login.js +++ b/browser/app/js/browser/Login.js @@ -40,7 +40,7 @@ export class Login extends React.Component { web .Login({ username: document.getElementById("accessKey").value, - password: document.getElementById("secretKey").value, + password: document.getElementById("secretKey").value }) .then(res => { history.push("/") @@ -114,10 +114,10 @@ const mapDispatchToProps = dispatch => { dispatch( actionsAlert.set({ type: type, - message: message, - }), + message: message + }) ), - clearAlert: () => dispatch(actionsAlert.clear()), + clearAlert: () => dispatch(actionsAlert.clear()) } } diff --git a/browser/app/js/browser/MainActions.js b/browser/app/js/browser/MainActions.js index 3354b2f64..ee1d44a64 100644 --- a/browser/app/js/browser/MainActions.js +++ b/browser/app/js/browser/MainActions.js @@ -25,7 +25,7 @@ import { getPrefixWritable } from "../objects/selectors" export const MainActions = ({ prefixWritable, uploadFile, - showMakeBucketModal, + showMakeBucketModal }) => { const uploadTooltip = Upload file const makeBucketTooltip = ( @@ -89,14 +89,14 @@ export const MainActions = ({ const mapStateToProps = state => { return { - prefixWritable: getPrefixWritable(state), + prefixWritable: getPrefixWritable(state) } } const mapDispatchToProps = dispatch => { return { uploadFile: file => dispatch(uploadsActions.uploadFile(file)), - showMakeBucketModal: () => dispatch(actionsBuckets.showMakeBucketModal()), + showMakeBucketModal: () => dispatch(actionsBuckets.showMakeBucketModal()) } } diff --git a/browser/app/js/browser/SideBar.js b/browser/app/js/browser/SideBar.js index 9250f544e..fc3eb88c9 100644 --- a/browser/app/js/browser/SideBar.js +++ b/browser/app/js/browser/SideBar.js @@ -30,7 +30,7 @@ export const SideBar = ({ sidebarOpen }) => {