Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Romain Courteaud
jio
Commits
8a4c9916
Commit
8a4c9916
authored
Feb 15, 2019
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
XXX [linshare] Test not using name property
parent
2f890873
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
13 deletions
+21
-13
src/jio.storage/linsharestorage.js
src/jio.storage/linsharestorage.js
+21
-13
No files found.
src/jio.storage/linsharestorage.js
View file @
8a4c9916
...
...
@@ -133,11 +133,18 @@
i
,
len
=
entry_list
.
length
,
entry_name
,
entry_metadata
,
entry
,
result_list
=
[];
for
(
i
=
0
;
i
<
len
;
i
+=
1
)
{
entry_name
=
entry_list
[
i
].
name
;
try
{
entry_metadata
=
JSON
.
parse
(
entry_list
[
i
].
metaData
)
||
{};
}
catch
(
error
)
{
// Metadata are not always JSON
entry_metadata
=
{};
}
entry_name
=
entry_metadata
.
jio_id
||
entry_list
[
i
].
name
;
// If we only need one precise name, no need to check the others
if
(
!
options
.
hasOwnProperty
(
'
only_id
'
)
||
...
...
@@ -150,12 +157,7 @@
_linshare_uuid
:
entry_list
[
i
].
uuid
};
if
(
options
.
include_docs
===
true
)
{
try
{
entry
.
doc
=
JSON
.
parse
(
entry_list
[
i
].
metaData
)
||
{};
}
catch
(
error
)
{
// Metadata are not always JSON
entry
.
doc
=
{};
}
entry
.
doc
=
entry_metadata
.
jio_metadata
||
{};
}
result_list
.
push
(
entry
);
...
...
@@ -206,9 +208,12 @@
var
data
=
new
FormData
();
data
.
append
(
'
file
'
,
blob
,
id
);
data
.
append
(
'
filesize
'
,
blob
.
size
);
data
.
append
(
'
filename
'
,
id
);
data
.
append
(
'
description
'
,
doc
.
title
||
doc
.
description
||
''
);
data
.
append
(
'
metadata
'
,
jIO
.
util
.
stringify
(
doc
));
data
.
append
(
'
filename
'
,
doc
.
title
||
id
);
data
.
append
(
'
description
'
,
doc
.
description
||
id
);
data
.
append
(
'
metadata
'
,
jIO
.
util
.
stringify
({
jio_id
:
id
,
jio_metadata
:
doc
}));
return
makeRequest
(
storage
,
''
,
{
type
:
'
POST
'
,
data
:
data
...
...
@@ -226,9 +231,12 @@
// Update existing document metadata
var
data
=
{
uuid
:
result_list
[
0
].
_linshare_uuid
,
metaData
:
jIO
.
util
.
stringify
(
doc
),
name
:
id
,
description
:
doc
.
title
||
doc
.
description
||
''
metaData
:
jIO
.
util
.
stringify
({
jio_id
:
id
,
jio_metadata
:
doc
}),
name
:
doc
.
title
||
id
,
description
:
doc
.
description
||
id
};
return
makeRequest
(
storage
,
result_list
[
0
].
_linshare_uuid
,
{
type
:
'
PUT
'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment