Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nextcloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Nextcloud
Commits
44ecdde1
Commit
44ecdde1
authored
9 years ago
by
Arthur Schiwon
Committed by
Vincent Petry
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
sharee list view: better handle collections
parent
5db1db38
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/js/sharedialogshareelistview.js
+36
-5
36 additions, 5 deletions
core/js/sharedialogshareelistview.js
core/js/shareitemmodel.js
+1
-3
1 addition, 3 deletions
core/js/shareitemmodel.js
with
37 additions
and
8 deletions
core/js/sharedialogshareelistview.js
+
36
−
5
View file @
44ecdde1
...
@@ -78,6 +78,9 @@
...
@@ -78,6 +78,9 @@
/** @type {boolean} **/
/** @type {boolean} **/
showLink
:
true
,
showLink
:
true
,
/** @type {object} **/
_collections
:
{},
initialize
:
function
(
options
)
{
initialize
:
function
(
options
)
{
if
(
!
_
.
isUndefined
(
options
.
configModel
))
{
if
(
!
_
.
isUndefined
(
options
.
configModel
))
{
this
.
configModel
=
options
.
configModel
;
this
.
configModel
=
options
.
configModel
;
...
@@ -91,6 +94,23 @@
...
@@ -91,6 +94,23 @@
});
});
},
},
processCollectionShare
:
function
(
shareIndex
)
{
var
type
=
this
.
model
.
getCollectionType
(
shareIndex
);
var
id
=
this
.
model
.
getCollectionPath
(
shareIndex
);
if
(
type
!==
'
file
'
&&
type
!==
'
folder
'
)
{
id
=
this
.
model
.
getCollectionSource
(
shareIndex
);
}
var
displayName
=
this
.
model
.
getShareWithDisplayName
(
shareIndex
);
if
(
!
_
.
isUndefined
(
this
.
_collections
[
id
]))
{
this
.
_collections
[
id
].
text
=
this
.
_collections
[
id
].
text
+
"
,
"
+
displayName
;
}
else
{
this
.
_collections
[
id
]
=
{};
this
.
_collections
[
id
].
text
=
t
(
'
core
'
,
'
Shared in {item} with {user}
'
,
{
'
item
'
:
id
,
user
:
displayName
});
this
.
_collections
[
id
].
id
=
id
;
this
.
_collections
[
id
].
isCollection
=
true
;
}
},
getCollectionObject
:
function
(
shareIndex
)
{
getCollectionObject
:
function
(
shareIndex
)
{
var
type
=
this
.
model
.
getCollectionType
(
shareIndex
);
var
type
=
this
.
model
.
getCollectionType
(
shareIndex
);
var
id
=
this
.
model
.
getCollectionPath
(
shareIndex
);
var
id
=
this
.
model
.
getCollectionPath
(
shareIndex
);
...
@@ -119,7 +139,6 @@
...
@@ -119,7 +139,6 @@
shareWithDisplayName
=
shareWithDisplayName
+
"
(
"
+
t
(
'
core
'
,
'
remote
'
)
+
'
)
'
;
shareWithDisplayName
=
shareWithDisplayName
+
"
(
"
+
t
(
'
core
'
,
'
remote
'
)
+
'
)
'
;
}
}
return
{
return
{
hasSharePermission
:
this
.
model
.
hasSharePermission
(
shareIndex
),
hasSharePermission
:
this
.
model
.
hasSharePermission
(
shareIndex
),
hasEditPermission
:
this
.
model
.
hasEditPermission
(
shareIndex
),
hasEditPermission
:
this
.
model
.
hasEditPermission
(
shareIndex
),
...
@@ -160,21 +179,34 @@
...
@@ -160,21 +179,34 @@
deletePermission
:
OC
.
PERMISSION_DELETE
deletePermission
:
OC
.
PERMISSION_DELETE
};
};
this
.
_collections
=
{};
// TODO: sharess must have following attributes
// TODO: sharess must have following attributes
// isRemoteShare
// isRemoteShare
// isMailSent
if
(
!
this
.
model
.
hasShares
())
{
if
(
!
this
.
model
.
hasShares
())
{
return
[];
return
[];
}
}
var
shares
=
this
.
model
.
get
(
'
shares
'
);
var
list
=
[];
var
list
=
[];
for
(
var
index
in
this
.
model
.
get
(
'
shares
'
))
{
for
(
var
index
=
0
;
index
<
shares
.
length
;
index
++
)
{
// #### FIXME: LEGACY ####
// this does not belong to a view
var
shareType
=
this
.
model
.
getShareType
(
index
);
if
(
!
OC
.
Share
.
currentShares
[
shareType
])
{
OC
.
Share
.
currentShares
[
shareType
]
=
[];
}
OC
.
Share
.
currentShares
[
shareType
].
push
(
this
.
model
.
getShareWith
(
index
));
// #### /FIXME: LEGACY ####
if
(
this
.
model
.
isCollection
(
index
))
{
if
(
this
.
model
.
isCollection
(
index
))
{
list
.
unshift
(
this
.
get
Collection
Object
(
index
)
)
;
this
.
process
Collection
Share
(
index
);
}
else
{
}
else
{
list
.
push
(
_
.
extend
(
this
.
getShareeObject
(
index
),
universal
))
list
.
push
(
_
.
extend
(
this
.
getShareeObject
(
index
),
universal
))
}
}
list
=
_
.
union
(
_
.
values
(
this
.
_collections
),
list
);
}
}
return
list
;
return
list
;
...
@@ -182,7 +214,6 @@
...
@@ -182,7 +214,6 @@
render
:
function
()
{
render
:
function
()
{
var
shareeListTemplate
=
this
.
template
();
var
shareeListTemplate
=
this
.
template
();
var
list
=
this
.
getShareeList
();
this
.
$el
.
html
(
shareeListTemplate
({
this
.
$el
.
html
(
shareeListTemplate
({
sharees
:
this
.
getShareeList
()
sharees
:
this
.
getShareeList
()
}));
}));
...
...
This diff is collapsed.
Click to expand it.
core/js/shareitemmodel.js
+
1
−
3
View file @
44ecdde1
...
@@ -357,8 +357,6 @@
...
@@ -357,8 +357,6 @@
return
{};
return
{};
}
}
console
.
log
(
data
.
shares
);
var
permissions
=
this
.
get
(
'
possiblePermissions
'
);
var
permissions
=
this
.
get
(
'
possiblePermissions
'
);
if
(
!
_
.
isUndefined
(
data
.
reshare
)
&&
!
_
.
isUndefined
(
data
.
reshare
.
permissions
))
{
if
(
!
_
.
isUndefined
(
data
.
reshare
)
&&
!
_
.
isUndefined
(
data
.
reshare
.
permissions
))
{
permissions
=
permissions
&
data
.
reshare
.
permissions
;
permissions
=
permissions
&
data
.
reshare
.
permissions
;
...
@@ -376,7 +374,7 @@
...
@@ -376,7 +374,7 @@
return
{
return
{
reshare
:
data
.
reshare
,
reshare
:
data
.
reshare
,
shares
:
$
.
map
(
data
.
shares
,
function
(
value
)
{
return
[
value
];
}
),
shares
:
_
.
toArray
(
data
.
shares
),
permissions
:
permissions
,
permissions
:
permissions
,
allowPublicUploadStatus
:
allowPublicUploadStatus
allowPublicUploadStatus
:
allowPublicUploadStatus
};
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment