Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Lu Xu
erp5
Commits
bb695c0b
Commit
bb695c0b
authored
Jul 13, 2020
by
Gabriel Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_renderjs_ui: Add command to keep history when displaying an erp5 action
parent
eb729104
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
17 deletions
+19
-17
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_router_js.js
...TemplateItem/web_page_module/rjs_gadget_erp5_router_js.js
+17
-15
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_router_js.xml
...emplateItem/web_page_module/rjs_gadget_erp5_router_js.xml
+2
-2
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_router_js.js
View file @
bb695c0b
...
...
@@ -26,6 +26,8 @@
COMMAND_KEEP_HISTORY_AND_DISPLAY_DIALOG_STATE
=
"
display_dialog_with_history
"
,
// Display the cancellable url (or the current doc default) + the history
COMMAND_KEEP_HISTORY_AND_CANCEL_DIALOG_STATE
=
"
cancel_dialog_with_history
"
,
// Display an action on the jio document + the history
COMMAND_KEEP_HISTORY_AND_DISPLAY_ERP5_ACTION
=
"
display_erp5_action_with_history
"
,
// Store the jio key for the person document of the user
COMMAND_LOGIN
=
"
login
"
,
// Display a raw string URL
...
...
@@ -65,6 +67,7 @@
VALID_URL_COMMAND_DICT
[
COMMAND_KEEP_HISTORY_CANCEL_AND_DISPLAY_STATE
]
=
null
;
VALID_URL_COMMAND_DICT
[
COMMAND_KEEP_HISTORY_AND_DISPLAY_DIALOG_STATE
]
=
null
;
VALID_URL_COMMAND_DICT
[
COMMAND_KEEP_HISTORY_AND_CANCEL_DIALOG_STATE
]
=
null
;
VALID_URL_COMMAND_DICT
[
COMMAND_KEEP_HISTORY_AND_DISPLAY_ERP5_ACTION
]
=
null
;
VALID_URL_COMMAND_DICT
[
COMMAND_DISPLAY_STORED_STATE
]
=
null
;
VALID_URL_COMMAND_DICT
[
COMMAND_CHANGE_STATE
]
=
null
;
VALID_URL_COMMAND_DICT
[
COMMAND_DISPLAY_ERP5_ACTION
]
=
null
;
...
...
@@ -388,11 +391,10 @@
);
}
function
execDisplayERP5ActionCommand
(
gadget
,
options
)
{
return
gadget
.
jio_getAttachment
(
options
.
jio_key
,
'
links
'
)
function
execDisplayERP5ActionCommand
(
gadget
,
previous_options
,
next_options
,
keep_history
)
{
return
gadget
.
jio_getAttachment
(
next_
options
.
jio_key
,
'
links
'
)
.
push
(
function
(
document_view
)
{
var
action
,
action_data
,
action_url
,
i
,
j
,
new_options
;
var
queue
,
action
,
action_data
,
action_url
,
i
,
j
,
new_options
;
for
(
i
=
0
;
i
<
Object
.
keys
(
document_view
.
_links
).
length
;
i
=
i
+
1
)
{
action
=
Object
.
keys
(
document_view
.
_links
)[
i
];
if
(
document_view
.
_links
.
hasOwnProperty
(
action
))
{
...
...
@@ -401,22 +403,20 @@
}
for
(
j
=
0
;
j
<
document_view
.
_links
[
action
].
length
;
j
=
j
+
1
)
{
action_data
=
document_view
.
_links
[
action
][
j
];
if
(
action_data
.
name
===
options
.
page
)
{
if
(
action_data
.
name
===
next_
options
.
page
)
{
new_options
=
{
jio_key
:
options
.
jio_key
,
jio_key
:
next_
options
.
jio_key
,
view
:
action_data
.
href
};
copyStickyParameterDict
(
options
,
new_options
);
action_url
=
getDisplayUrlFor
(
options
.
jio_key
,
new_options
);
return
synchronousChangeState
(
action_url
);
if
(
keep_history
)
{
return
execPushHistoryCommand
(
gadget
,
previous_options
,
new_options
);
}
return
execDisplayCommand
(
gadget
,
new_options
);
}
}
}
}
throw
new
Error
(
'
Action not found:
'
+
options
.
name
);
throw
new
Error
(
'
Action not found:
'
+
next_
options
.
name
);
});
}
...
...
@@ -433,7 +433,6 @@
}
display_url
=
getDisplayUrlFor
(
jio_key
,
options
);
// Only keep state for the default view
// otherwise, user will never be able to reset it with the filter panel
// Do not store state for module subdocument, to not pollute the IDB size
...
...
@@ -893,6 +892,9 @@
if
(
command_options
.
path
===
COMMAND_KEEP_HISTORY_AND_CANCEL_DIALOG_STATE
)
{
return
execKeepHistoryAndCancelDialogCommand
(
gadget
,
previous_options
);
}
if
(
command_options
.
path
===
COMMAND_KEEP_HISTORY_AND_DISPLAY_ERP5_ACTION
)
{
return
execDisplayERP5ActionCommand
(
gadget
,
previous_options
,
next_options
,
true
);
}
if
(
command_options
.
path
===
COMMAND_DISPLAY_STORED_STATE
)
{
return
execDisplayStoredStateCommand
(
gadget
,
next_options
,
drop_options
);
}
...
...
@@ -903,7 +905,7 @@
return
execChangeCommand
(
previous_options
,
next_options
,
drop_options
);
}
if
(
command_options
.
path
===
COMMAND_DISPLAY_ERP5_ACTION
)
{
return
execDisplayERP5ActionCommand
(
gadget
,
next_options
);
return
execDisplayERP5ActionCommand
(
gadget
,
previous_options
,
next_options
);
}
if
(
command_options
.
path
===
COMMAND_STORE_AND_CHANGE_STATE
)
{
return
execStoreAndChangeCommand
(
gadget
,
previous_options
,
next_options
,
drop_options
);
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_router_js.xml
View file @
bb695c0b
...
...
@@ -236,7 +236,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
98
2.31305.20902.62242
</string>
</value>
<value>
<string>
98
5.49865.7906.35925
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>
15
84027522.41
</float>
<float>
15
96764862.76
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
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