Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
jio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
18
Merge Requests
18
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
jio
Commits
816000e1
Commit
816000e1
authored
Jan 16, 2019
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[linshare] jslint
parent
903ed2df
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
54 deletions
+48
-54
src/jio.storage/linsharestorage.js
src/jio.storage/linsharestorage.js
+44
-50
test/jio.storage/linsharestorage.tests.js
test/jio.storage/linsharestorage.tests.js
+4
-4
No files found.
src/jio.storage/linsharestorage.js
View file @
816000e1
...
...
@@ -23,10 +23,10 @@
* http://download.linshare.org/components/linshare-core/2.2.2/
* Can't set up id, implied can't put new document
*/
/*global Blob, jIO, RSVP, UriTemplate*/
/*global Blob, jIO, RSVP, UriTemplate
, FormData
*/
/*jslint nomen: true*/
(
function
(
jIO
,
RSVP
,
Blob
,
UriTemplate
)
{
(
function
(
jIO
,
RSVP
,
Blob
,
UriTemplate
,
FormData
)
{
"
use strict
"
;
var
default_url
=
"
https://softinst89769.host.vifib.net/erp5/portal_skins/
"
+
"
erp5_http_proxy/ERP5Site_getHTTPResource?url=https://demo.linshare.org/
"
+
...
...
@@ -67,20 +67,20 @@
});
}
function
checkAttachmentMap
(
storage
,
id
,
name
)
{
checkDocumentMap
(
storage
,
id
);
if
(
!
storage
.
_id_map
[
id
].
attachment
.
hasOwnProperty
(
name
))
{
function
checkDocumentMap
(
storage
,
id
)
{
if
(
!
storage
.
_id_map
.
hasOwnProperty
(
id
))
{
throw
new
jIO
.
util
.
jIOError
(
"
Can't find
attachment with name :
"
+
name
,
"
Can't find
document with id :
"
+
id
,
404
);
}
}
function
checkDocumentMap
(
storage
,
id
)
{
if
(
!
storage
.
_id_map
.
hasOwnProperty
(
id
))
{
function
checkAttachmentMap
(
storage
,
id
,
name
)
{
checkDocumentMap
(
storage
,
id
);
if
(
!
storage
.
_id_map
[
id
].
attachment
.
hasOwnProperty
(
name
))
{
throw
new
jIO
.
util
.
jIOError
(
"
Can't find
document with id :
"
+
id
,
"
Can't find
attachment with name :
"
+
name
,
404
);
}
...
...
@@ -171,7 +171,7 @@
var
rows
=
[],
len
=
result
.
length
,
i
;
for
(
i
=
0
;
i
<
len
;
i
+=
1
)
{
for
(
i
=
0
;
i
<
len
;
i
+=
1
)
{
if
(
result
[
i
].
hasOwnProperty
(
'
type
'
))
{
if
(
result
[
i
].
description
===
'
jio/document
'
)
{
rows
.
push
({
id
:
JSON
.
parse
(
result
[
i
].
metaData
).
id
,
value
:
{}});
...
...
@@ -183,14 +183,9 @@
};
// Attachments link by field "description" - Dict
LinshareStorage
.
prototype
.
allAttachments
=
function
(
id
)
{
};
LinshareStorage
.
prototype
.
putAttachment
=
function
(
id
,
name
,
blob
)
{
var
storage
=
this
,
data
=
new
FormData
(),
uuid
;
data
=
new
FormData
();
if
(
!
storage
.
_id_map
.
hasOwnProperty
(
id
))
{
throw
new
jIO
.
util
.
JIOError
(
"
Can't find document with id :
"
+
id
,
...
...
@@ -248,13 +243,12 @@
type
:
"
GET
"
})
.
push
(
function
(
result
)
{
var
rows
=
[],
len
=
result
.
length
,
var
len
=
result
.
length
,
i
,
metadata
,
row
,
id
;
for
(
i
=
0
;
i
<
len
;
i
+=
1
)
{
for
(
i
=
0
;
i
<
len
;
i
+=
1
)
{
row
=
result
[
i
];
if
(
row
.
hasOwnProperty
(
'
description
'
))
{
if
(
row
.
description
===
'
jio/document
'
)
{
...
...
@@ -279,4 +273,4 @@
jIO
.
addStorage
(
'
linshare
'
,
LinshareStorage
);
}(
jIO
,
RSVP
,
Blob
,
UriTemplate
));
\ No newline at end of file
}(
jIO
,
RSVP
,
Blob
,
UriTemplate
,
FormData
));
\ No newline at end of file
test/jio.storage/linsharestorage.tests.js
View file @
816000e1
...
...
@@ -27,6 +27,7 @@
ok
=
QUnit
.
ok
,
expect
=
QUnit
.
expect
,
equal
=
QUnit
.
equal
,
deepEqual
=
QUnit
.
deepEqual
,
module
=
QUnit
.
module
;
/////////////////////////////////////////////////////////////////
...
...
@@ -82,7 +83,6 @@
jio
.
allDocs
({
include_docs
:
true
})
.
then
(
function
(
result
)
{
deepEqual
(
result
,
{},
'
check result
'
);
console
.
warn
(
res
);
})
.
fail
(
function
(
error
)
{
ok
(
false
,
error
);
...
...
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