This repository has been archived by the owner on Apr 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Edit Babel, update Meteor and npm packages. Standard code styling!
Kill Koa and remove test frameworks because they are bloat.
- Loading branch information
Showing
16 changed files
with
665 additions
and
3,246 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,9 +7,8 @@ | |
"Safari >= 9", | ||
"iOS >= 9", | ||
"Edge >= 14" | ||
], | ||
"node": 8 | ||
] | ||
}, | ||
"modules": false | ||
}], "stage-2"] | ||
}], "stage-0"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,16 @@ | ||
module.exports = { | ||
"env": { | ||
"es6": true, | ||
"meteor": true | ||
env: { | ||
es6: true, | ||
meteor: true | ||
}, | ||
"extends": ["plugin:meteor/recommended", "plugin:flowtype/recommended", "eslint-config-airbnb"], | ||
"parser": "babel-eslint", | ||
"parserOptions": { | ||
"ecmaFeatures": { | ||
"experimentalObjectRestSpread": true, | ||
"jsx": true | ||
}, | ||
"sourceType": "module" | ||
}, | ||
"plugins": [ | ||
"react", | ||
"meteor", | ||
"flowtype" | ||
parser: "babel-eslint", | ||
plugins: ["react", "meteor", "flowtype"], | ||
extends: [ | ||
"plugin:meteor/recommended", | ||
"plugin:flowtype/recommended", | ||
"standard", "standard-react" | ||
], | ||
"rules": { | ||
"indent": [ | ||
"error", | ||
2 | ||
], | ||
"linebreak-style": [ | ||
"error", | ||
"windows" | ||
], | ||
"quotes": [ | ||
"error", | ||
"double" | ||
], | ||
"semi": [ | ||
"error", | ||
"always" | ||
], | ||
"no-unused-vars": [ | ||
"error", | ||
{ | ||
"vars": "local", | ||
"args": "after-used" | ||
}], | ||
// For global variable definitions. | ||
"no-var": "off", | ||
// For JSX in .js files. | ||
"react/jsx-filename-extension": "off", | ||
// For import issues with Meteor. | ||
"import/no-extraneous-dependencies": "off", | ||
"import/no-unresolved": "off", | ||
"import/extensions": "off", | ||
rules: { | ||
"meteor/audit-argument-checks": "off" | ||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,17 +4,17 @@ | |
# 'meteor add' and 'meteor remove' will edit this file for you, | ||
# but you can also edit it by hand. | ||
|
||
[email protected].19 # Packages every Meteor app needs to have | ||
[email protected].24 # Packages every Meteor app needs to have | ||
[email protected] # Packages for a great mobile UX | ||
[email protected].19 # The database Meteor supports right now | ||
[email protected].24 # The database Meteor supports right now | ||
static-html | ||
[email protected] # Reactive variable for tracker | ||
[email protected] # Meteor's client-side reactive programming library | ||
|
||
[email protected] # CSS minifier run for production mode | ||
[email protected].19 # JS minifier run for production mode | ||
[email protected].24 # JS minifier run for production mode | ||
[email protected] # ECMAScript 5 compatibility for older browsers. | ||
[email protected].19 # Enable ECMAScript2015+ syntax in app code | ||
[email protected].19 # Server-side component of the `meteor shell` command | ||
[email protected].19 # Runtime support for Meteor 1.5 dynamic import(...) syntax | ||
[email protected].19 # Leaner CSS language | ||
[email protected].24 # Enable ECMAScript2015+ syntax in app code | ||
[email protected].24 # Server-side component of the `meteor shell` command | ||
[email protected].24 # Runtime support for Meteor 1.5 dynamic import(...) syntax | ||
[email protected].24 # Leaner CSS language |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[email protected].19 | ||
[email protected].24 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,89 +1,87 @@ | ||
// @flow | ||
/* eslint-env browser */ | ||
// Import React. | ||
import React from "react"; | ||
import React from 'react' | ||
|
||
// Importing material-ui components. | ||
import List from "material-ui/List/List"; | ||
import List from 'material-ui/List/List' | ||
|
||
// Import Meteor :3 and Minimongo :333 and createContainer :33333 | ||
import { Meteor } from "meteor/meteor"; | ||
import { Meteor } from 'meteor/meteor' | ||
|
||
// Importing the ListCreator. | ||
import ListCreator from "../../imports/ui/ListCreator"; | ||
import ListCreator from '../../imports/ui/ListCreator' | ||
|
||
// Fetching the config from settings.js to get where to initiate the file manager. | ||
import { folderToShow } from "../../settings.json"; | ||
import { folderToShow } from '../../settings.json' | ||
|
||
// State types. | ||
type listItemsState = { name: string, type: string }; | ||
type state = { listItems: Array<listItemsState>, currentFolder: string }; | ||
|
||
// Create the class. | ||
export default class Folder extends React.Component<void, {}, state> { | ||
constructor() { | ||
super(); | ||
export default class Folder extends React.Component<{}, state> { | ||
constructor () { | ||
super() | ||
|
||
this.state = { | ||
listItems: [ | ||
{ | ||
name: "Please wait, data is being fetched from the server.", | ||
type: "dataFetch", | ||
}, | ||
name: 'Please wait, data is being fetched from the server.', | ||
type: 'dataFetch' | ||
} | ||
], | ||
currentFolder: folderToShow, | ||
}; | ||
} | ||
|
||
state: { | ||
listItems: Array<{ name: string, type: string }>, | ||
currentFolder: string | ||
currentFolder: folderToShow | ||
} | ||
} | ||
|
||
componentDidMount() { | ||
componentDidMount () { | ||
// Fetch directory contents in async mode. | ||
Meteor.call("getFolderContents", folderToShow, (err: string, result: Array<listItemsState>) => { | ||
Meteor.call('getFolderContents', folderToShow, (err: string, result: Array<listItemsState>) => { | ||
if (err) console.error('Error while retrieving initial data.') | ||
// set state to the go back item and the items in the directory. | ||
this.setState({ listItems: [{ | ||
name: "Go to parent directory", | ||
type: "..", | ||
}, ...result] }); | ||
}); | ||
name: 'Go to parent directory', | ||
type: '..' | ||
}, ...result] }) | ||
}) | ||
} | ||
|
||
onItemClick(type: string, addition: string) { | ||
onItemClick (type: string, addition: string) { | ||
// Callback function to update folder contents. | ||
const handleNewPath = (err: string, result: string) => { | ||
if (err) console.error('Error during changing folder.') | ||
// In callback, set currentFolder to the joint result. | ||
this.setState({ currentFolder: result }); | ||
this.setState({ currentFolder: result }) | ||
// Now get the folder contents for the result. | ||
Meteor.call("getFolderContents", this.state.currentFolder, (error: string, files: Array<listItemsState>) => { | ||
// set state to the go back item and the items in the directory. | ||
Meteor.call('getFolderContents', this.state.currentFolder, (error: string, files: Array<listItemsState>) => { | ||
if (error) console.error('Error while retrieving folder contents.') | ||
// set state to the go back item and the items in the directory. | ||
this.setState({ listItems: [{ | ||
name: "Go to parent directory", | ||
type: "..", | ||
}, ...files] }); | ||
}); | ||
}; | ||
name: 'Go to parent directory', | ||
type: '..' | ||
}, ...files] }) | ||
}) | ||
} | ||
|
||
if (type === "folder") { | ||
if (type === 'folder') { | ||
// Ask server to join paths. | ||
Meteor.call("joinPaths", this.state.currentFolder, addition, handleNewPath); | ||
} else if (type === "file") { | ||
Meteor.call('joinPaths', this.state.currentFolder, addition, handleNewPath) | ||
} else if (type === 'file') { | ||
// eslint-disable-next-line no-console | ||
console.log("hellooooo! wheeeee! cookies! I'm a fileeee!"); | ||
console.log("hellooooo! wheeeee! cookies! I'm a fileeee!") | ||
} else { | ||
// Ask server to remove the last directory to go up one directory. | ||
Meteor.call("goUpOneDirectory", this.state.currentFolder, handleNewPath); | ||
Meteor.call('goUpOneDirectory', this.state.currentFolder, handleNewPath) | ||
} | ||
} | ||
|
||
render() { | ||
const reactifunc = (t: string, a: string) => this.onItemClick(t, a); | ||
render () { | ||
const reactifunc = (t: string, a: string) => this.onItemClick(t, a) | ||
return ( | ||
<List> | ||
<ListCreator list={this.state.listItems} onItemClick={reactifunc} /> | ||
</List> | ||
); | ||
) | ||
} | ||
} |
Oops, something went wrong.