mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-31 12:55:02 +01:00
fix (ui): hide UI elements whenever access is not set
This commit is contained in:
parent
be54a23465
commit
b154c559ff
4 changed files with 5 additions and 3 deletions
|
|
@ -15,7 +15,7 @@ window.addEventListener("DOMContentLoaded", () => {
|
|||
const $loader = document.querySelector("#n-lder");
|
||||
|
||||
function render(){
|
||||
ReactDOM.render(<React.StrictMode><Router/></React.StrictMode>, document.querySelector("div[role='main']"));
|
||||
ReactDOM.render(<Router/>, document.querySelector("div[role='main']"));
|
||||
return Promise.resolve();
|
||||
};
|
||||
function waitFor(n){
|
||||
|
|
|
|||
|
|
@ -280,7 +280,7 @@ export class FilesPage extends React.Component {
|
|||
<NgIf cond={this.state.loading === true}>
|
||||
<Loader/>
|
||||
</NgIf>
|
||||
<MobileFileUpload path={this.state.path} />
|
||||
<MobileFileUpload path={this.state.path} accessRight={this.state.metadata || {}} />
|
||||
</div>
|
||||
</div>
|
||||
<div className="upload-footer">
|
||||
|
|
|
|||
|
|
@ -45,6 +45,8 @@ export class MobileFileUpload extends React.Component{
|
|||
render(){
|
||||
if(!window.CONFIG["upload_button"] && /(Android|iPad|iPhone)/.test(navigator.userAgent) === false){
|
||||
return null;
|
||||
} else if(this.props.accessRight.can_create_file === false || this.props.accessRight.can_create_directory === false) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ export class Submenu extends React.Component {
|
|||
<span>{ t("Download") }</span>
|
||||
</ReactCSSTransitionGroup>
|
||||
</NgIf>
|
||||
<NgIf cond={this.props.selected.length > 0} type="inline" onMouseDown={this.onDelete.bind(this, this.props.selected)}>
|
||||
<NgIf cond={this.props.selected.length > 0 && this.props.accessRight.can_delete !== false} type="inline" onMouseDown={this.onDelete.bind(this, this.props.selected)}>
|
||||
<ReactCSSTransitionGroup transitionName="submenuwithSelection" transitionLeave={false} transitionEnter={false} transitionAppear={true} transitionAppearTimeout={10000}>
|
||||
<span>{ t("Remove") }</span>
|
||||
</ReactCSSTransitionGroup>
|
||||
|
|
|
|||
Loading…
Reference in a new issue