summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPytal <24800714+Pytal@users.noreply.github.com>2024-05-02 02:32:01 -0700
committerGitHub <noreply@github.com>2024-05-02 02:32:01 -0700
commit1098abd399c459769afdc12322275f85b64b2b65 (patch)
treebf42b3322dff2d334b533f694141d36472ff2512
parentf883d804696147eeea18bf61ae8ec8abad5a6810 (diff)
parent15fbee2f0d5c9163e5525a88961e9dfd67f6e718 (diff)
Merge pull request #45131 from nextcloud/chore/location-path-prefix
chore: Remove All files prefix from original location
-rw-r--r--apps/files_trashbin/src/columns.ts4
-rw-r--r--dist/files_trashbin-main.js4
-rw-r--r--dist/files_trashbin-main.js.map2
3 files changed, 5 insertions, 5 deletions
diff --git a/apps/files_trashbin/src/columns.ts b/apps/files_trashbin/src/columns.ts
index 2b5e3ecfd6c..fecf250e34e 100644
--- a/apps/files_trashbin/src/columns.ts
+++ b/apps/files_trashbin/src/columns.ts
@@ -23,7 +23,7 @@
import moment from '@nextcloud/moment'
import { Column, Node } from '@nextcloud/files'
import { getCurrentUser } from '@nextcloud/auth'
-import { dirname, joinPaths } from '@nextcloud/paths'
+import { dirname } from '@nextcloud/paths'
import { translate as t } from '@nextcloud/l10n'
import Vue from 'vue'
@@ -38,7 +38,7 @@ const parseOriginalLocation = (node: Node): string => {
if (dir === path) { // Node is in root folder
return t('files_trashbin', 'All files')
}
- return joinPaths(t('files_trashbin', 'All files'), dir)
+ return dir.replace(/^\//, '')
}
interface DeletedBy {
diff --git a/dist/files_trashbin-main.js b/dist/files_trashbin-main.js
index 9a116149971..d47c9f2bf82 100644
--- a/dist/files_trashbin-main.js
+++ b/dist/files_trashbin-main.js
@@ -1,3 +1,3 @@
/*! For license information please see files_trashbin-main.js.LICENSE.txt */
-(()=>{"use strict";var t,e={42808:(t,e,i)=>{var n=i(85072),r=i.n(n),s=i(97825),o=i.n(s),a=i(77659),l=i.n(a),u=i(55056),d=i.n(u),c=i(10540),h=i.n(c),p=i(41113),f=i.n(p),g=i(98290),m={};m.styleTagTransform=f(),m.setAttributes=d(),m.insert=l().bind(null,"head"),m.domAPI=o(),m.insertStyleElement=h(),r()(g.A,m),g.A&&g.A.locals&&g.A.locals;var v=i(53334),w=i(92457),b=i(53529),x=i(43627),y=i(71089),N=i(63814),E=i(44719);i(36117);const _=null===(A=(0,w.HW)())?(0,b.YK)().setApp("files").build():(0,b.YK)().setApp("files").setUid(A.uid).build();var A,T=(t=>(t.DEFAULT="default",t.HIDDEN="hidden",t))(T||{}),O=(t=>(t[t.NONE=0]="NONE",t[t.CREATE=4]="CREATE",t[t.READ=1]="READ",t[t.UPDATE=2]="UPDATE",t[t.DELETE=8]="DELETE",t[t.SHARE=16]="SHARE",t[t.ALL=31]="ALL",t))(O||{});const I=["d:getcontentlength","d:getcontenttype","d:getetag","d:getlastmodified","d:quota-available-bytes","d:resourcetype","nc:has-preview","nc:is-encrypted","nc:mount-type","oc:comments-unread","oc:favorite","oc:fileid","oc:owner-display-name","oc:owner-id","oc:permissions","oc:size"],P={d:"DAV:",nc:"http://nextcloud.org/ns",oc:"http://owncloud.org/ns",ocs:"http://open-collaboration-services.org/ns"};var C=(t=>(t.Folder="folder",t.File="file",t))(C||{});const S=function(t,e){return null!==t.match(e)},D=(t,e)=>{if(t.id&&"number"!=typeof t.id)throw new Error("Invalid id type of value");if(!t.source)throw new Error("Missing mandatory source");try{new URL(t.source)}catch{throw new Error("Invalid source format, source must be a valid URL")}if(!t.source.startsWith("http"))throw new Error("Invalid source format, only http(s) is supported");if(t.mtime&&!(t.mtime instanceof Date))throw new Error("Invalid mtime type");if(t.crtime&&!(t.crtime instanceof Date))throw new Error("Invalid crtime type");if(!t.mime||"string"!=typeof t.mime||!t.mime.match(/^[-\w.]+\/[-+\w.]+$/gi))throw new Error("Missing or invalid mandatory mime");if("size"in t&&"number"!=typeof t.size&&void 0!==t.size)throw new Error("Invalid size type");if("permissions"in t&&void 0!==t.permissions&&!("number"==typeof t.permissions&&t.permissions>=O.NONE&&t.permissions<=O.ALL))throw new Error("Invalid permissions");if(t.owner&&null!==t.owner&&"string"!=typeof t.owner)throw new Error("Invalid owner type");if(t.attributes&&"object"!=typeof t.attributes)throw new Error("Invalid attributes type");if(t.root&&"string"!=typeof t.root)throw new Error("Invalid root type");if(t.root&&!t.root.startsWith("/"))throw new Error("Root must start with a leading slash");if(t.root&&!t.source.includes(t.root))throw new Error("Root must be part of the source");if(t.root&&S(t.source,e)){const i=t.source.match(e)[0];if(!t.source.includes((0,x.join)(i,t.root)))throw new Error("The root must be relative to the service. e.g /files/emma")}if(t.status&&!Object.values(V).includes(t.status))throw new Error("Status must be a valid NodeStatus")};var V=(t=>(t.NEW="new",t.FAILED="failed",t.LOADING="loading",t.LOCKED="locked",t))(V||{});class k{_data;_attributes;_knownDavService=/(remote|public)\.php\/(web)?dav/i;constructor(t,e){D(t,e||this._knownDavService),this._data=t;const i={set:(t,e,i)=>(this.updateMtime(),Reflect.set(t,e,i)),deleteProperty:(t,e)=>(this.updateMtime(),Reflect.deleteProperty(t,e))};this._attributes=new Proxy(t.attributes||{},i),delete this._data.attributes,e&&(this._knownDavService=e)}get source(){return this._data.source.replace(/\/$/i,"")}get encodedSource(){const{origin:t}=new URL(this.source);return t+(0,y.O0)(this.source.slice(t.length))}get basename(){return(0,x.basename)(this.source)}get extension(){return(0,x.extname)(this.source)}get dirname(){if(this.root){let t=this.source;this.isDavRessource&&(t=t.split(this._knownDavService).pop());const e=t.indexOf(this.root),i=this.root.replace(/\/$/,"");return(0,x.dirname)(t.slice(e+i.length)||"/")}const t=new URL(this.source);return(0,x.dirname)(t.pathname)}get mime(){return this._data.mime}get mtime(){return this._data.mtime}get crtime(){return this._data.crtime}get size(){return this._data.size}get attributes(){return this._attributes}get permissions(){return null!==this.owner||this.isDavRessource?void 0!==this._data.permissions?this._data.permissions:O.NONE:O.READ}get owner(){return this.isDavRessource?this._data.owner:null}get isDavRessource(){return S(this.source,this._knownDavService)}get root(){return this._data.root?this._data.root.replace(/^(.+)\/$/,"$1"):this.isDavRessource&&(0,x.dirname)(this.source).split(this._knownDavService).pop()||null}get path(){if(this.root){let t=this.source;this.isDavRessource&&(t=t.split(this._knownDavService).pop());const e=t.indexOf(this.root),i=this.root.replace(/\/$/,"");return t.slice(e+i.length)||"/"}return(this.dirname+"/"+this.basename).replace(/\/\//g,"/")}get fileid(){return this._data?.id||this.attributes?.fileid}get status(){return this._data?.status}set status(t){this._data.status=t}move(t){D({...this._data,source:t},this._knownDavService),this._data.source=t,this.updateMtime()}rename(t){if(t.includes("/"))throw new Error("Invalid basename");this.move((0,x.dirname)(this.source)+"/"+t)}updateMtime(){this._data.mtime&&(this._data.mtime=new Date)}}class L extends k{get type(){return C.File}}class j extends k{constructor(t){super({...t,mime:"httpd/unix-directory"})}get type(){return C.Folder}get extension(){return null}get mime(){return"httpd/unix-directory"}}(0,N.dC)("dav");class ${_column;c