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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
jio
Commits
27a3b950
Commit
27a3b950
authored
Mar 12, 2015
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Storage: require default view reference.
Allow to choose which action_reference will be used as default view.
parent
8221432f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
src/jio.storage/erp5storage.js
src/jio.storage/erp5storage.js
+3
-1
test/jio.storage/erp5storage.tests.js
test/jio.storage/erp5storage.tests.js
+6
-3
No files found.
src/jio.storage/erp5storage.js
View file @
27a3b950
...
...
@@ -59,6 +59,7 @@
"
which contains more than one character.
"
);
}
this
.
_url
=
spec
.
url
;
this
.
_default_view_reference
=
spec
.
default_view_reference
;
}
ERP5Storage
.
prototype
.
get
=
function
(
param
)
{
...
...
@@ -93,7 +94,8 @@
var
action
=
param
.
_attachment
;
if
(
action
===
"
view
"
)
{
return
getDocumentAndHateoas
(
this
,
param
,
{
"
_view
"
:
param
.
_attachment
})
return
getDocumentAndHateoas
(
this
,
param
,
{
"
_view
"
:
this
.
_default_view_reference
})
.
push
(
function
(
response
)
{
var
result
=
JSON
.
parse
(
response
.
target
.
responseText
);
result
.
_id
=
param
.
_id
;
...
...
test/jio.storage/erp5storage.tests.js
View file @
27a3b950
...
...
@@ -34,11 +34,13 @@
test
(
"
Storage store URL
"
,
function
()
{
var
jio
=
jIO
.
createJIO
({
type
:
"
erp5
"
,
url
:
domain
url
:
domain
,
default_view_reference
:
"
bar_view
"
});
equal
(
jio
.
__type
,
"
erp5
"
);
deepEqual
(
jio
.
__storage
.
_url
,
domain
);
deepEqual
(
jio
.
__storage
.
_default_view_reference
,
"
bar_view
"
);
});
/////////////////////////////////////////////////////////////////
...
...
@@ -225,7 +227,8 @@
this
.
jio
=
jIO
.
createJIO
({
type
:
"
erp5
"
,
url
:
domain
url
:
domain
,
default_view_reference
:
"
foo_view
"
});
},
teardown
:
function
()
{
...
...
@@ -258,7 +261,7 @@
test
(
"
getAttachment: view uses default form
"
,
function
()
{
var
id
=
"
person_module/1
"
,
traverse_url
=
domain
+
"
?mode=traverse&relative_url=
"
+
encodeURIComponent
(
id
)
+
"
&view=view
"
,
encodeURIComponent
(
id
)
+
"
&view=
foo_
view
"
,
document_hateoas
=
JSON
.
stringify
({
"
title
"
:
"
foo
"
,
"
_bar
"
:
"
john doo
"
,
...
...
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