Skip to content

Commit 4cfea03

Browse files
authored
Merge pull request #86 from rclone/ui-redesign
Ui redesign v2.0
2 parents 21c6117 + 6a53cd4 commit 4cfea03

File tree

8 files changed

+183
-113
lines changed

8 files changed

+183
-113
lines changed

.github/workflows/nodejs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ on:
66
jobs:
77
build:
88

9-
runs-on: ubuntu-latest
10-
119
strategy:
1210
matrix:
11+
platform: [ubuntu-latest, macos-latest, windows-latest]
1312
node-version: [8.x, 10.x, 12.x]
13+
runs-on: ${{ matrix.platform }}
1414

1515
steps:
1616
- uses: actions/checkout@v1

.github/workflows/prerelease.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Pre Release
2+
3+
on:
4+
push:
5+
# Sequence of patterns matched against refs/tags
6+
tags:
7+
- 'v*-beta' # Push events to matching v*, i.e. v1.0, v20.15.10
8+
jobs:
9+
build:
10+
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [12.x]
16+
17+
steps:
18+
- uses: actions/checkout@v1
19+
- name: Use Node.js ${{ matrix.node-version }}
20+
uses: actions/setup-node@v1
21+
with:
22+
node-version: ${{ matrix.node-version }}
23+
- name: npm install, build, and test
24+
run: |
25+
npm ci
26+
npm run test:cov
27+
npm run build
28+
env:
29+
CI: true
30+
- name: Zip build
31+
run: |
32+
zip -r currentbuild.zip build
33+
- name: Deploy to gh-pages
34+
if: success()
35+
uses: crazy-max/ghaction-github-pages@v1
36+
with:
37+
target_branch: gh-pages
38+
build_dir: build
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
42+
- name: Create Release
43+
id: create_release
44+
uses: actions/[email protected]
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
with:
48+
tag_name: ${{ github.ref }}
49+
release_name: Release ${{ github.ref }}
50+
draft: false
51+
prerelease: true
52+
53+
- name: Upload Release Asset
54+
id: upload-release-asset
55+
if: success()
56+
uses: actions/[email protected]
57+
env:
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
with:
60+
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
61+
asset_path: ./currentbuild.zip
62+
asset_name: currentbuild.zip
63+
asset_content_type: application/zip
64+

src/containers/DefaultLayout/DefaultLayout.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class DefaultLayout extends Component {
4949
}
5050
}
5151

52-
componentWillMount() {
52+
componentDidMount() {
5353
if (!localStorage.getItem(AUTH_KEY)) {
5454
this.props.history.push('/login');
5555
} else {

src/utils/Tools.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,15 @@ export function validateDuration(str) {
173173
return baseValidator(regex, str);
174174
}
175175

176+
/**
177+
* Validate the allowed drive name
178+
* @returns {boolean|*|never}
179+
* */
180+
export function validateDriveName(name) {
181+
const regex = /^[0-9A-Za-z_-]*$/i;
182+
return baseValidator(regex, name);
183+
}
184+
176185
/**
177186
* Opens the specified URL in a new tab and focus on it.
178187
* @param url {string} URL to be opened.

src/views/Base/BackendStatusCard/BackendStatusCard.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function TaskModal() {
2525
class BackendStatusCard extends React.Component {
2626

2727

28-
componentWillMount() {
28+
componentDidMount() {
2929

3030
// Check if the connection to the backend is active
3131
this.props.getStatus();

src/views/Explorer/FilesView/FilesView.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ const filesTarget = {
5656
},
5757
canDrop(props, monitor) {
5858
const {remoteName, remotePath} = monitor.getItem();
59-
console.log(remoteName, props.currentPath.remoteName, remotePath, props.currentPath.remotePath);
6059
const destRemoteName = props.currentPath.remoteName;
6160
const destRemotePath = props.currentPath.remotePath;
6261
if (destRemoteName === remoteName) {

src/views/Explorer/RemoteExplorerLayout/RemoteExplorerLayout.js

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {connect} from "react-redux";
88
import {compose} from "redux";
99
import {createPath} from "../../../actions/explorerStateActions";
1010
import * as PropTypes from 'prop-types';
11-
import {changeDistractionFreeMode, changeNumCols} from "../../../actions/explorerActions";
11+
import {addRemoteContainer, changeDistractionFreeMode, changeNumCols} from "../../../actions/explorerActions";
1212
import ErrorBoundary from "../../../ErrorHandling/ErrorBoundary";
1313

1414
import singlePaneImg from '../../../assets/img/single-pane.png';
@@ -19,25 +19,24 @@ import TabsLayout from "../TabsLayout/TabsLayout";
1919

2020
class RemoteExplorerLayout extends React.Component {
2121

22+
changeLayout = (nos, mode) => {
23+
const {changeNumCols} = this.props;
24+
// Check if the current layout is not same as previous
25+
if (nos !== changeNumCols) {
26+
changeNumCols(nos, mode);
27+
}
28+
};
2229

23-
changeLayout = (nos, mode) => {
24-
const {changeNumCols} = this.props;
25-
// Check if the current layout is not same as previous
26-
if(nos !== changeNumCols){
27-
changeNumCols(nos, mode);
28-
}
29-
};
30-
31-
componentDidMount() {
32-
//Load one explorer layout
33-
const {numCols, changeNumCols} = this.props;
30+
componentDidMount() {
31+
//Load one explorer layout
32+
const {numContainers, addRemoteContainer} = this.props;
3433

35-
if (numCols < 1) {
36-
changeNumCols(1, "horizontal");
37-
}
38-
}
34+
if (numContainers < 1) {
35+
addRemoteContainer(0)
36+
}
37+
}
3938

40-
toggleDistractionFreeMode = (_) => {
39+
toggleDistractionFreeMode = (_) => {
4140
const {distractionFreeMode, changeDistractionFreeMode} = this.props;
4241
// this.setState((prevState) => ({
4342
// distractionFreeMode: !prevState.distractionFreeMode
@@ -68,9 +67,6 @@ class RemoteExplorerLayout extends React.Component {
6867
}
6968
})
7069
}
71-
{/*{activeRemoteContainerID && activeRemoteContainerID[pane] && activeRemoteContainerID[pane] !== "" &&*/}
72-
{/*<RemoteExplorer containerID={activeRemoteContainerID[pane]} className={"d-none"}*/}
73-
{/* distractionFreeMode={distractionFreeMode}/>}*/}
7470

7571
</Col>
7672
))
@@ -135,12 +131,13 @@ class RemoteExplorerLayout extends React.Component {
135131
}
136132

137133
const mapStateToProps = (state) => ({
138-
backStacks: state.explorer.backStacks,
139-
numCols: state.remote.numCols,
140-
distractionFreeMode: state.remote.distractionFreeMode,
141-
splitMode: state.remote.splitMode,
142-
activeRemoteContainerID: state.remote.activeRemoteContainerID,
143-
containers: state.remote.containers,
134+
backStacks: state.explorer.backStacks,
135+
numCols: state.remote.numCols,
136+
numContainers: state.remote.numContainers,
137+
distractionFreeMode: state.remote.distractionFreeMode,
138+
splitMode: state.remote.splitMode,
139+
activeRemoteContainerID: state.remote.activeRemoteContainerID,
140+
containers: state.remote.containers,
144141
});
145142

146143
RemoteExplorerLayout.propTypes = {
@@ -151,6 +148,6 @@ RemoteExplorerLayout.propTypes = {
151148
};
152149

153150
export default compose(
154-
connect(mapStateToProps, {createPath, changeNumCols, changeDistractionFreeMode}),
155-
DragDropContext(HTML5Backend)
151+
connect(mapStateToProps, {createPath, changeNumCols, changeDistractionFreeMode, addRemoteContainer}),
152+
DragDropContext(HTML5Backend)
156153
)(RemoteExplorerLayout);

0 commit comments

Comments
 (0)