Skip to content

Commit

Permalink
UI redesign changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
negative0 committed Apr 16, 2020
1 parent 23554a3 commit 1efb2f2
Show file tree
Hide file tree
Showing 18 changed files with 1,091 additions and 1,170 deletions.
11 changes: 11 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 12 additions & 12 deletions src/actions/explorerActions.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import axiosInstance from "../utils/API/API";
import {
ADD_LAYOUT_CONTAINER,
CHANGE_ACTIVE_REMOTE_CONTAINER,
CHANGE_DISTRACTION_FREE_MODE,
CHANGE_LAYOUT_COLS,
GET_CONFIG_FOR_REMOTE,
GET_FILES_LIST,
GET_REMOTE_LIST,
REMOVE_LAYOUT_CONTAINER,
REQUEST_ERROR,
REQUEST_SUCCESS
ADD_LAYOUT_CONTAINER,
CHANGE_ACTIVE_REMOTE_CONTAINER,
CHANGE_DISTRACTION_FREE_MODE,
CHANGE_LAYOUT_COLS,
GET_CONFIG_FOR_REMOTE,
GET_FILES_LIST,
GET_REMOTE_LIST,
REMOVE_LAYOUT_CONTAINER,
REQUEST_ERROR,
REQUEST_SUCCESS
} from "./types";
import {addColonAtLast, isLocalRemoteName, makeUniqueID} from "../utils/Tools";
import {createPath} from "./explorerStateActions";
import {createPath, removePath} from "./explorerStateActions";
import urls from "../utils/API/endpoint";

/**
Expand Down Expand Up @@ -159,7 +159,7 @@ export const addRemoteContainer = (paneID) => (dispatch) => {
* @returns {Function}
*/
export const removeRemoteContainer = (containerID, paneID) => (dispatch) => {
// dispatch(removePath(containerID));
dispatch(removePath(containerID));
// console.log("Removing : " + containerID);
dispatch({
type: REMOVE_LAYOUT_CONTAINER,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ exports[`Remote Explorer renders should match snapshot 1`] = `
"_result": null,
"_status": -1,
},
"name": "New Drive",
"name": "Edit Remote",
"path": "/newdrive/edit/:drivePrefix",
},
Object {
Expand All @@ -134,7 +134,7 @@ exports[`Remote Explorer renders should match snapshot 1`] = `
"_status": -1,
},
"exact": true,
"name": "New Drive",
"name": "New Remote",
"path": "/newdrive",
},
Object {
Expand All @@ -145,7 +145,7 @@ exports[`Remote Explorer renders should match snapshot 1`] = `
"_status": -1,
},
"exact": true,
"name": "New Drive",
"name": "Login Page",
"path": "/login",
},
Object {
Expand Down Expand Up @@ -220,21 +220,21 @@ exports[`Remote Explorer renders should match snapshot 1`] = `
<Switch>
<Route
key="1"
name="New Drive"
name="Edit Remote"
path="/newdrive/edit/:drivePrefix"
render={[Function]}
/>
<Route
exact={true}
key="2"
name="New Drive"
name="New Remote"
path="/newdrive"
render={[Function]}
/>
<Route
exact={true}
key="3"
name="New Drive"
name="Login Page"
path="/login"
render={[Function]}
/>
Expand Down Expand Up @@ -277,25 +277,6 @@ exports[`Remote Explorer renders should match snapshot 1`] = `
</Suspense>
</Container>
</main>
<AppAside
display=""
fixed={true}
isOpen={false}
offCanvas={true}
tag="aside"
>
<Suspense
fallback={
<div
className="animated fadeIn pt-1 text-center"
>
Loading...
</div>
}
>
<lazy />
</Suspense>
</AppAside>
</div>
<AppFooter
fixed={false}
Expand Down
19 changes: 11 additions & 8 deletions src/reducers/explorerReducer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@ describe('Explorer Reducer', function () {
it('should return default state', function () {
const newState = explorerReducer(undefined, {});
expect(newState).toEqual({
configs: {},
remotes: [],
files: {},
hasError: false,
numCols: 0,
distractionFreeMode: false,
});
configs: {},
remotes: [],
files: {},
hasError: false,
numContainers: 0,
containers: [],
activeRemoteContainerID: {},
distractionFreeMode: false,
numCols: 1
});
});

it('should change state for GET_CONFIG_FOR_REMOTE SUCCESS', function () {
Expand Down Expand Up @@ -86,4 +89,4 @@ describe('Explorer Reducer', function () {
expect(newState.hasError).toBe(true);
expect(newState.error).toEqual(error);
});
});
});
96 changes: 49 additions & 47 deletions src/reducers/explorerStateReducer.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import {
CHANGE_GRID_MODE,
CHANGE_LOAD_IMAGES,
CHANGE_PATH,
CHANGE_REMOTE_NAME,
CHANGE_REMOTE_PATH,
CHANGE_SEARCH_QUERY,
CHANGE_SORT_FILTER,
CHANGE_VISIBILITY_FILTER,
CREATE_PATH,
NAVIGATE_BACK,
NAVIGATE_FWD,
NAVIGATE_UP,
REMOVE_PATH
CHANGE_GRID_MODE,
CHANGE_LOAD_IMAGES,
CHANGE_PATH,
CHANGE_REMOTE_NAME,
CHANGE_REMOTE_PATH,
CHANGE_SEARCH_QUERY,
CHANGE_SORT_FILTER,
CHANGE_VISIBILITY_FILTER,
CREATE_PATH,
NAVIGATE_BACK,
NAVIGATE_FWD,
NAVIGATE_UP,
REMOVE_PATH
} from "../actions/types";
import BackStack from "../utils/classes/BackStack";

Expand Down Expand Up @@ -93,38 +93,38 @@ export default function (state = initialState, action) {
break;

case CHANGE_REMOTE_PATH:
backStack.push({remoteName: backStack.peek().remoteName, remotePath: remotePath});
// ptr++;

break;

case CREATE_PATH:
if (!backStack || !(backStack instanceof BackStack))
backStack = new BackStack();
break;
case REMOVE_PATH:
// return {
// ...state,
// backStacks: {...state.backStacks, [id]: undefined},
// currentPaths: {...state.currentPaths, [id]: undefined},
// visibilityFilters: {...state.visibilityFilters, [id]: undefined},
// gridMode: {...state.gridMode, [id]: undefined},
// searchQueries: {...state.searchQueries, [id]: undefined},
// loadImages: {...state.loadImages, [id]: undefined},
// sortFilters: {...state.sortFilters, [id]: undefined},
// sortFiltersAscending: {...state.sortFiltersAscending, [id]: undefined},
// };
break;
case NAVIGATE_UP:
// TODO: Write logic for up, which will navigate one directory up
let current = backStack.peek();

if (current.remotePath && current.remotePath !== "") {
const splitPath = current.remotePath.split('/');
current.remotePath = "";
if (splitPath.length > 1)
for (let i = 0; i < splitPath.length - 1; i++) {
current.remotePath = current.remotePath + ((i !== 0) ? '/' : '') + splitPath[i];
backStack.push({remoteName: backStack.peek().remoteName, remotePath: remotePath});
// ptr++;

break;

case CREATE_PATH:
if (!backStack || !(backStack instanceof BackStack))
backStack = new BackStack();
break;
case REMOVE_PATH:
return {
...state,
backStacks: {...state.backStacks, [id]: undefined},
currentPaths: {...state.currentPaths, [id]: undefined},
visibilityFilters: {...state.visibilityFilters, [id]: undefined},
gridMode: {...state.gridMode, [id]: undefined},
searchQueries: {...state.searchQueries, [id]: undefined},
loadImages: {...state.loadImages, [id]: undefined},
sortFilters: {...state.sortFilters, [id]: undefined},
sortFiltersAscending: {...state.sortFiltersAscending, [id]: undefined},
};
// break;
case NAVIGATE_UP:
// TODO: Write logic for up, which will navigate one directory up
let current = backStack.peek();

if (current.remotePath && current.remotePath !== "") {
const splitPath = current.remotePath.split('/');
current.remotePath = "";
if (splitPath.length > 1)
for (let i = 0; i < splitPath.length - 1; i++) {
current.remotePath = current.remotePath + ((i !== 0) ? '/' : '') + splitPath[i];
}
}
backStack.push(current);
Expand All @@ -138,8 +138,10 @@ export default function (state = initialState, action) {
backStack.moveBack();
break;
case CHANGE_VISIBILITY_FILTER:
if (action.filter)
visibilityFilter = action.filter;
if (action.filter)
visibilityFilter = action.filter;
else
visibilityFilter = "";
break;
case CHANGE_GRID_MODE:
if (action.mode) {
Expand Down
17 changes: 6 additions & 11 deletions src/scss/_custom.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Here you can add other styles
body{
font-family: Noto Sans;
font-family: Noto Sans, sans-serif;
}

.card, .card-header, .card-body {
Expand All @@ -10,7 +10,6 @@ body{
.btn-white {
font-style: normal;
font-weight: normal;
font-size: 20px;
color: rgba(44,44,44,1);
background-color: rgba(232,239,247,1);
}
Expand All @@ -25,20 +24,17 @@ body{
background-color: rgba(188,201,214,1);
font-style: normal;
font-weight: bold;
font-size: 25px;
color: rgba(44,44,44,1);
}

.card .card-subtitle{
font-style: normal;
font-weight: bold;
font-size: 20px;
color: rgba(63,121,173,1);
}
.card .card-text {
font-style: normal;
font-weight: normal;
font-size: 20px;
color: rgba(114,114,114,1);
}

Expand All @@ -51,7 +47,6 @@ body{
.text-choose-layout {
font-style: normal;
font-weight: bold;
font-size: 20px;
color: rgba(114,114,114,1);
}
.layout-change-button{
Expand All @@ -67,7 +62,7 @@ body{

.btn-explorer-action :hover {
border: 1px;
background-color: none;
background: none;
}

.table-fix-head { overflow-y: auto; height: 100px; }
Expand Down Expand Up @@ -140,9 +135,9 @@ body{

.btn-step-count {
border-radius: 100px;
background-color: none;
border: 5px solid rgba(140,140,140,1);
color:rgba(66,66,66,1);
background: none;
border: 5px solid rgba(140, 140, 140, 1);
color: rgba(66, 66, 66, 1);
font-weight: bold;

}
Expand Down Expand Up @@ -177,7 +172,7 @@ body{
.sidebar{
ul.nav {
background-color: #ffffff;
font-family: Nunito;
font-family: Nunito, sans-serif;
font-weight: bold;
}
.nav-link.active {
Expand Down
Loading

0 comments on commit 1efb2f2

Please sign in to comment.