-
+
{{ pathPart }}
/
@@ -182,6 +182,17 @@
[selectionData]="list.selectionData"
#filterEditor
> -->
+
+
+
+
+
diff --git a/src-ui/src/app/components/explorer/explorer.component.ts b/src-ui/src/app/components/explorer/explorer.component.ts
index d09b39e43..dd4d50ed3 100644
--- a/src-ui/src/app/components/explorer/explorer.component.ts
+++ b/src-ui/src/app/components/explorer/explorer.component.ts
@@ -6,18 +6,9 @@ import {
ViewChild,
ViewChildren,
} from '@angular/core'
-import { ActivatedRoute, Router, convertToParamMap } from '@angular/router'
+import { ActivatedRoute, Router } from '@angular/router'
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
-import {
- Subject,
- filter,
- first,
- map,
- switchMap,
- take,
- takeUntil,
- tap,
-} from 'rxjs'
+import { Subject, takeUntil } from 'rxjs'
import {
FilterRule,
filterRulesDiffer,
@@ -26,6 +17,7 @@ import {
import { FILTER_FULLTEXT_MORELIKE } from 'src/app/data/filter-rule-type'
import { PaperlessDocument } from 'src/app/data/paperless-document'
import { PaperlessSavedView } from 'src/app/data/paperless-saved-view'
+import { PaperlessStoragePath } from 'src/app/data/paperless-storage-path'
import { SETTINGS_KEYS } from 'src/app/data/paperless-uisettings'
import {
SortEvent,
@@ -41,9 +33,9 @@ import { SavedViewService } from 'src/app/services/rest/saved-view.service'
import { SettingsService } from 'src/app/services/settings.service'
import { StoragePathListViewService } from 'src/app/services/storage-path-list-view.service'
import { ToastService } from 'src/app/services/toast.service'
+import { FolderCreateDialogComponent } from '../common/create-dialog/folder-create-dialog/folder-create-dialog.component'
import { ComponentWithPermissions } from '../with-permissions/with-permissions.component'
import { FilterEditorComponent } from './filter-editor/filter-editor.component'
-import { PaperlessStoragePath } from 'src/app/data/paperless-storage-path'
@Component({
selector: 'app-explorer',
@@ -169,9 +161,11 @@ export class ExplorerComponent
}
clickPathPart(index: number) {
+ if (index === 0) return this.router.navigate(['explorer'])
const pathUntilPart = this.folderPath
+ .replace('DMS/', '')
.split('/')
- .slice(0, index + 1)
+ .slice(0, index)
.join('/')
this.list.getStoragePathByPath(pathUntilPart).subscribe((storagePath) => {
this.router.navigate(['explorer'], {
@@ -180,6 +174,19 @@ export class ExplorerComponent
})
}
+ createFolder() {
+ var modal = this.modalService.open(FolderCreateDialogComponent, {
+ backdrop: 'static',
+ })
+ modal.componentInstance.dialogMode = 'create'
+ modal.componentInstance.object = {
+ path: this.folderPath.replace('DMS/', ''),
+ }
+ modal.componentInstance.succeeded
+ .pipe(takeUntil(this.unsubscribeNotifier))
+ .subscribe(() => this.list.reload())
+ }
+
openDocumentDetail(storagePath: PaperlessStoragePath) {
this.router.navigate(['explorer'], {
queryParams: { spid: storagePath.id },
diff --git a/src-ui/src/app/services/rest/custom-storage-path.service.ts b/src-ui/src/app/services/rest/custom-storage-path.service.ts
index d877d8eaa..3d2f5d3ad 100644
--- a/src-ui/src/app/services/rest/custom-storage-path.service.ts
+++ b/src-ui/src/app/services/rest/custom-storage-path.service.ts
@@ -51,7 +51,7 @@ export class CustomStoragePathService extends AbstractPaperlessService
{
- params.path__istartswith = storagePath.path
+ params.path__istartswith = storagePath.path + '/'
return this.list(page, pageSize, sortField, sortReverse, params).pipe(
map((results) => {
results.results = results.results.filter((s) => {
diff --git a/src-ui/src/app/services/storage-path-list-view.service.ts b/src-ui/src/app/services/storage-path-list-view.service.ts
index 0b059a4c3..0e10b23df 100644
--- a/src-ui/src/app/services/storage-path-list-view.service.ts
+++ b/src-ui/src/app/services/storage-path-list-view.service.ts
@@ -1,18 +1,12 @@
import { Injectable } from '@angular/core'
import { ParamMap, Router } from '@angular/router'
import { Observable } from 'rxjs'
-import {
- FilterRule,
- cloneFilterRules,
- filterRulesDiffer,
- isFullTextFilterRule,
-} from '../data/filter-rule'
+import { FilterRule, isFullTextFilterRule } from '../data/filter-rule'
import { PaperlessDocument } from '../data/paperless-document'
-import { PaperlessSavedView } from '../data/paperless-saved-view'
import { PaperlessStoragePath } from '../data/paperless-storage-path'
import { SETTINGS_KEYS } from '../data/paperless-uisettings'
import { DOCUMENT_LIST_SERVICE } from '../data/storage-keys'
-import { paramsFromViewState, paramsToViewState } from '../utils/query-params'
+import { paramsToViewState } from '../utils/query-params'
import { CustomStoragePathService } from './rest/custom-storage-path.service'
import { DOCUMENT_SORT_FIELDS, SelectionData } from './rest/document.service'
import { SettingsService } from './settings.service'
@@ -136,29 +130,38 @@ export class StoragePathListViewService {
if (queryParams.has('spid')) {
newState.storagePathId = parseInt(queryParams.get('spid'))
}
+ } else {
+ newState = this.defaultListViewState()
}
if (newState == undefined) newState = this.defaultListViewState() // if nothing in local storage
+ this.activeListViewState.filterRules = newState.filterRules
+ this.activeListViewState.sortField = newState.sortField
+ this.activeListViewState.sortReverse = newState.sortReverse
+ this.activeListViewState.currentPage = newState.currentPage
+ this.activeListViewState.storagePathId = newState.storagePathId
+ this.activeListViewState.parentStoragePath = newState.parentStoragePath
+ this.reload(null, isParamsEmpty)
// only reload if things have changed
- if (
- !this.initialized ||
- isParamsEmpty ||
- this.activeListViewState.sortField !== newState.sortField ||
- this.activeListViewState.sortReverse !== newState.sortReverse ||
- this.activeListViewState.currentPage !== newState.currentPage ||
- this.activeListViewState.storagePathId !== newState.storagePathId ||
- filterRulesDiffer(
- this.activeListViewState.filterRules,
- newState.filterRules
- )
- ) {
- this.activeListViewState.filterRules = newState.filterRules
- this.activeListViewState.sortField = newState.sortField
- this.activeListViewState.sortReverse = newState.sortReverse
- this.activeListViewState.currentPage = newState.currentPage
- this.activeListViewState.storagePathId = newState.storagePathId
- this.reload(null, isParamsEmpty) // update the params if there arent any
- }
+ // if (
+ // !this.initialized ||
+ // isParamsEmpty ||
+ // this.activeListViewState.sortField !== newState.sortField ||
+ // this.activeListViewState.sortReverse !== newState.sortReverse ||
+ // this.activeListViewState.currentPage !== newState.currentPage ||
+ // this.activeListViewState.storagePathId !== newState.storagePathId ||
+ // filterRulesDiffer(
+ // this.activeListViewState.filterRules,
+ // newState.filterRules
+ // )
+ // ) {
+ // this.activeListViewState.filterRules = newState.filterRules
+ // this.activeListViewState.sortField = newState.sortField
+ // this.activeListViewState.sortReverse = newState.sortReverse
+ // this.activeListViewState.currentPage = newState.currentPage
+ // this.activeListViewState.storagePathId = newState.storagePathId
+ // this.reload(null, isParamsEmpty) // update the params if there arent any
+ // }
}
getStoragePathByPath(path: string): Observable {
@@ -297,7 +300,8 @@ export class StoragePathListViewService {
}
get currentFolderPath(): string {
- return this.activeListViewState.parentStoragePath?.path || '/'
+ const path = this.activeListViewState.parentStoragePath?.path
+ return path ? 'DMS/' + path : 'DMS/'
}
setSort(field: string, reverse: boolean) {