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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xiaowu Zhang
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
Show 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 @@
...
@@ -59,6 +59,7 @@
"
which contains more than one character.
"
);
"
which contains more than one character.
"
);
}
}
this
.
_url
=
spec
.
url
;
this
.
_url
=
spec
.
url
;
this
.
_default_view_reference
=
spec
.
default_view_reference
;
}
}
ERP5Storage
.
prototype
.
get
=
function
(
param
)
{
ERP5Storage
.
prototype
.
get
=
function
(
param
)
{
...
@@ -93,7 +94,8 @@
...
@@ -93,7 +94,8 @@
var
action
=
param
.
_attachment
;
var
action
=
param
.
_attachment
;
if
(
action
===
"
view
"
)
{
if
(
action
===
"
view
"
)
{
return
getDocumentAndHateoas
(
this
,
param
,
{
"
_view
"
:
param
.
_attachment
})
return
getDocumentAndHateoas
(
this
,
param
,
{
"
_view
"
:
this
.
_default_view_reference
})
.
push
(
function
(
response
)
{
.
push
(
function
(
response
)
{
var
result
=
JSON
.
parse
(
response
.
target
.
responseText
);
var
result
=
JSON
.
parse
(
response
.
target
.
responseText
);
result
.
_id
=
param
.
_id
;
result
.
_id
=
param
.
_id
;
...
...
test/jio.storage/erp5storage.tests.js
View file @
27a3b950
...
@@ -34,11 +34,13 @@
...
@@ -34,11 +34,13 @@
test
(
"
Storage store URL
"
,
function
()
{
test
(
"
Storage store URL
"
,
function
()
{
var
jio
=
jIO
.
createJIO
({
var
jio
=
jIO
.
createJIO
({
type
:
"
erp5
"
,
type
:
"
erp5
"
,
url
:
domain
url
:
domain
,
default_view_reference
:
"
bar_view
"
});
});
equal
(
jio
.
__type
,
"
erp5
"
);
equal
(
jio
.
__type
,
"
erp5
"
);
deepEqual
(
jio
.
__storage
.
_url
,
domain
);
deepEqual
(
jio
.
__storage
.
_url
,
domain
);
deepEqual
(
jio
.
__storage
.
_default_view_reference
,
"
bar_view
"
);
});
});
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
...
@@ -225,7 +227,8 @@
...
@@ -225,7 +227,8 @@
this
.
jio
=
jIO
.
createJIO
({
this
.
jio
=
jIO
.
createJIO
({
type
:
"
erp5
"
,
type
:
"
erp5
"
,
url
:
domain
url
:
domain
,
default_view_reference
:
"
foo_view
"
});
});
},
},
teardown
:
function
()
{
teardown
:
function
()
{
...
@@ -258,7 +261,7 @@
...
@@ -258,7 +261,7 @@
test
(
"
getAttachment: view uses default form
"
,
function
()
{
test
(
"
getAttachment: view uses default form
"
,
function
()
{
var
id
=
"
person_module/1
"
,
var
id
=
"
person_module/1
"
,
traverse_url
=
domain
+
"
?mode=traverse&relative_url=
"
+
traverse_url
=
domain
+
"
?mode=traverse&relative_url=
"
+
encodeURIComponent
(
id
)
+
"
&view=view
"
,
encodeURIComponent
(
id
)
+
"
&view=
foo_
view
"
,
document_hateoas
=
JSON
.
stringify
({
document_hateoas
=
JSON
.
stringify
({
"
title
"
:
"
foo
"
,
"
title
"
:
"
foo
"
,
"
_bar
"
:
"
john doo
"
,
"
_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