Commit 16ed72b9 authored by Matija Obreza's avatar Matija Obreza
Browse files

Fix: Navigation between folders and galleries is missing end /

- Reduced console logging
parent 15f7efda
......@@ -47,23 +47,23 @@ class ImageGalleryPage extends React.Component<IRepositoryBrowserProps, any> {
];
public componentWillMount() {
const { path, root, folderPath, gallery, getGallery } = this.props;
console.log(`RepositoryBrowser.componentWillMount...`, folderPath);
const { folderPath, gallery, getGallery } = this.props;
// console.log(`RepositoryBrowser.componentWillMount...`, folderPath);
if (!gallery || (gallery.folder !== folderPath)) {
console.log(`Loading gallery root=${root} path=${path}`);
// console.log(`Loading gallery root=${root} path=${path}`);
getGallery(folderPath);
}
}
public componentWillReceiveProps(nextProps) {
const { path, root, gallery, folderPath } = nextProps;
const { gallery, folderPath } = nextProps;
const { getGallery } = this.props;
console.log(`Props root=${root} path=${path} folderPath=${folderPath}`);
// console.log(`Props root=${root} path=${path} folderPath=${folderPath}`);
if (!gallery || (gallery.folder !== folderPath)) {
console.log(`Loading gallery root=${root} path=${path}`);
// console.log(`Loading gallery root=${root} path=${path}`);
getGallery(folderPath);
}
}
......@@ -82,7 +82,7 @@ class ImageGalleryPage extends React.Component<IRepositoryBrowserProps, any> {
removeGallery(folderPath).then((result) => {
if (result) {
navigateTo(`/admin/repository/f${folderPath}`);
navigateTo(`/admin/repository/f${folderPath}/`);
} else {
confirmAlert(<p>Gallery at <b>{ folderPath }</b> could not be deleted.</p>);
}
......@@ -91,7 +91,7 @@ class ImageGalleryPage extends React.Component<IRepositoryBrowserProps, any> {
protected goToFolder = (e) => {
const { navigateTo, folderPath } = this.props;
navigateTo(`/admin/repository/f${folderPath}`);
navigateTo(`/admin/repository/f${folderPath}/`);
}
public render() {
......@@ -100,7 +100,7 @@ class ImageGalleryPage extends React.Component<IRepositoryBrowserProps, any> {
const stillLoading: boolean = !gallery;
console.log(gallery);
// console.log(gallery);
return (
stillLoading ? <Loading /> : (
......
......@@ -50,23 +50,23 @@ class RepositoryBrowser extends React.Component<IRepositoryBrowserProps, any> {
];
public componentWillMount() {
const { root, path, folder, folderPath, getFolder } = this.props;
console.log(`RepositoryBrowser.componentWillMount...`, normalize(root + path));
const { folder, folderPath, getFolder } = this.props;
// console.log(`RepositoryBrowser.componentWillMount...`, normalize(root + path));
if (!folder || (folder.folder && folder.folder.path !== folderPath)) {
console.log(`Loading folder root=${root} path=${path}`);
// console.log(`Loading folder root=${root} path=${path}`);
getFolder(folderPath);
}
}
public componentWillReceiveProps(nextProps) {
const { path, root, folder, folderPath } = nextProps;
const { folder: oldFolder, getFolder } = this.props;
const { path, folder, folderPath } = nextProps;
const { getFolder } = this.props;
console.log(`Props root=${root} path=${path} folderPath=${folderPath} at=${folder && folder.folder && folder.folder.path}`, oldFolder);
// console.log(`Props root=${root} path=${path} folderPath=${folderPath} at=${folder && folder.folder && folder.folder.path}`, oldFolder);
if (!folder || (!folder.folder && path && path !== '/') || (folder.folder && folder.folder.path !== folderPath)) {
console.log(`Loading folder root=${root} path=${path} ${folderPath}`);
// console.log(`Loading folder root=${root} path=${path} ${folderPath}`);
getFolder(folderPath);
}
}
......@@ -97,7 +97,7 @@ class RepositoryBrowser extends React.Component<IRepositoryBrowserProps, any> {
createGallery(folderPath, folder.folder.name).then((result) => {
if (result) {
navigateTo(`/admin/repository/g${folderPath}`);
navigateTo(`/admin/repository/g${folderPath}/`);
} else {
confirmAlert(<p>Image gallery at <b>{ folderPath }</b> could not be created.</p>);
}
......@@ -106,7 +106,7 @@ class RepositoryBrowser extends React.Component<IRepositoryBrowserProps, any> {
protected goToGallery = (e) => {
const { navigateTo, folderPath } = this.props;
navigateTo(`/admin/repository/g${folderPath}`);
navigateTo(`/admin/repository/g${folderPath}/`);
}
public render() {
......@@ -119,7 +119,7 @@ class RepositoryBrowser extends React.Component<IRepositoryBrowserProps, any> {
const stillLoading: boolean = !folder;
console.log(folder);
// console.log(folder);
return (
stillLoading ? <Loading /> : (
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment