File API Bugfix

This commit is contained in:
Celine 2021-01-09 23:34:45 +01:00
parent 4fa8c7bf80
commit 9d52ec1832
5 changed files with 1796 additions and 3078 deletions

2
.gitignore vendored Normal file

@ -0,0 +1,2 @@
fileControlPanel/public/

@ -29,7 +29,7 @@ class file_api extends DatabaseScript {
->addRow("File/CreateUploadToken", array(USER_GROUP_ADMIN), "Allows users to create a token to upload files to the virtual filesystem assigned to the users account")
->addRow("File/CreateDownloadToken", array(USER_GROUP_ADMIN), "Allows users to create a token to download files from the virtual filesystem assigned to the users account");
$queries[] = $sql->, array("request", "action", "target", "extra"))
$queries[] = $sql->insert("Route", array("request", "action", "target", "extra"))
->onDuplicateKeyStrategy(new UpdateStrategy(array("request"), array("request" => new Column("request"))))
->addRow("^/files(/.*)?$", "dynamic", "\\Documents\\Files", NULL);

File diff suppressed because it is too large Load Diff

@ -9,10 +9,11 @@
"react-dom": "^16.13.1",
"react-draft-wysiwyg": "^1.14.5",
"react-router-dom": "^5.2.0",
"react-scripts": "^3.4.1"
"react-scripts": "^3.4.4"
},
"scripts": {
"build": "webpack --mode production && mv dist/main.js ../js/files.min.js"
"build": "webpack --mode production && mv dist/main.js ../js/files.min.js",
"debug": "react-scripts start"
},
"eslintConfig": {
"extends": "react-app"
@ -29,13 +30,12 @@
"last 1 safari version"
]
},
"proxy": "http://localhost",
"devDependencies": {
"@babel/core": "^7.10.2",
"@babel/preset-env": "^7.10.2",
"@babel/preset-react": "^7.10.1",
"babel-loader": "^8.1.0",
"babel-polyfill": "^6.26.0",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.11"
"babel-polyfill": "^6.26.0"
}
}

@ -1,6 +1,8 @@
import React from 'react';
import ReactDOM from 'react-dom';
import API from "../../adminPanel/src/api";
import API from "./api";
class FileControlPanel extends React.Component {
@ -14,7 +16,7 @@ class FileControlPanel extends React.Component {
render() {
if (!this.state.loadend) {
if (!this.state.loaded) {
this.api.fetchUser().then(() => {
this.setState({ ...this.state, loaded: true });
});