feat search: search files, depth-first
feat files.view: Open files using Web Activities feat copy/paste: Copy and Paste/Move files fix filters: add "all" filter which clears filters out
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { CREATE_FILE, SHARE_FILE, RENAME_FILE, ACTIVE_FILE, DELETE_FILE } from 'actions/types';
|
||||
import { CREATE_FILE, SHARE_FILE, RENAME_FILE, ACTIVE_FILE, DELETE_FILE, MOVE_FILE, COPY_FILE } from 'actions/types';
|
||||
|
||||
export function create(path, directory = false) {
|
||||
return {
|
||||
@ -21,6 +21,20 @@ export function rename(file, name) {
|
||||
}
|
||||
}
|
||||
|
||||
export function move(file, newPath) {
|
||||
return {
|
||||
type: MOVE_FILE,
|
||||
file, newPath
|
||||
}
|
||||
}
|
||||
|
||||
export function copy(file, newPath) {
|
||||
return {
|
||||
type: COPY_FILE,
|
||||
file, newPath
|
||||
}
|
||||
}
|
||||
|
||||
export function active(file = null) {
|
||||
return {
|
||||
type: ACTIVE_FILE,
|
||||
@ -28,8 +42,7 @@ export function active(file = null) {
|
||||
}
|
||||
}
|
||||
|
||||
export function deleteFile(file) {
|
||||
console.log('constructing deleteFile action', file);
|
||||
export function remove(file) {
|
||||
return {
|
||||
type: DELETE_FILE,
|
||||
file
|
||||
|
@ -1,6 +1,13 @@
|
||||
import { LIST_FILES, FILES_VIEW, SELECT_VIEW, REFRESH } from 'actions/types';
|
||||
import { LIST_FILES, FILES_VIEW, SELECT_VIEW, REFRESH, SEARCH } from 'actions/types';
|
||||
import store from 'store';
|
||||
|
||||
export function listFiles(files) {
|
||||
return {
|
||||
type: LIST_FILES,
|
||||
files
|
||||
};
|
||||
}
|
||||
|
||||
export function refresh() {
|
||||
return {
|
||||
type: REFRESH
|
||||
@ -34,3 +41,10 @@ export function selectView(active = true) {
|
||||
active
|
||||
}
|
||||
}
|
||||
|
||||
export function search(keywords) {
|
||||
return {
|
||||
type: SEARCH,
|
||||
keywords
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +0,0 @@
|
||||
import { LIST_FILES } from 'actions/types';
|
||||
|
||||
export default function listFiles(files) {
|
||||
return {
|
||||
type: LIST_FILES,
|
||||
files
|
||||
};
|
||||
}
|
22
src/js/actions/spinner.js
Normal file
22
src/js/actions/spinner.js
Normal file
@ -0,0 +1,22 @@
|
||||
import { SPINNER } from 'actions/types';
|
||||
|
||||
export function show() {
|
||||
return {
|
||||
type: SPINNER,
|
||||
active: true
|
||||
}
|
||||
}
|
||||
|
||||
export function hide() {
|
||||
return {
|
||||
type: SPINNER,
|
||||
active: false
|
||||
}
|
||||
}
|
||||
|
||||
export function toggle() {
|
||||
return {
|
||||
type: SPINNER,
|
||||
active: 'toggle'
|
||||
}
|
||||
}
|
@ -16,11 +16,15 @@ const TYPES = {
|
||||
RENAME_FILE: Symbol('RENAME_FILE'),
|
||||
ACTIVE_FILE: Symbol('ACTIVE_FILE'),
|
||||
DELETE_FILE: Symbol('DELETE_FILE'),
|
||||
COPY_FILE: Symbol('COPY_FILE'),
|
||||
MOVE_FILE: Symbol('MOVE_FILE'),
|
||||
|
||||
MENU: Symbol('MENU'),
|
||||
|
||||
DIALOG: Symbol('DIALOG'),
|
||||
|
||||
SPINNER: Symbol('SPINNER'),
|
||||
|
||||
SETTINGS: Symbol('SETTINGS'),
|
||||
|
||||
SEARCH: Symbol('SEARCH')
|
||||
|
Reference in New Issue
Block a user