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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Rafael Monnerat
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 @@
...
@@ -26,6 +26,8 @@
COMMAND_KEEP_HISTORY_AND_DISPLAY_DIALOG_STATE
=
"
display_dialog_with_history
"
,
COMMAND_KEEP_HISTORY_AND_DISPLAY_DIALOG_STATE
=
"
display_dialog_with_history
"
,
// Display the cancellable url (or the current doc default) + the history
// Display the cancellable url (or the current doc default) + the history
COMMAND_KEEP_HISTORY_AND_CANCEL_DIALOG_STATE
=
"
cancel_dialog_with_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
// Store the jio key for the person document of the user
COMMAND_LOGIN
=
"
login
"
,
COMMAND_LOGIN
=
"
login
"
,
// Display a raw string URL
// Display a raw string URL
...
@@ -65,6 +67,7 @@
...
@@ -65,6 +67,7 @@
VALID_URL_COMMAND_DICT
[
COMMAND_KEEP_HISTORY_CANCEL_AND_DISPLAY_STATE
]
=
null
;
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_DISPLAY_DIALOG_STATE
]
=
null
;
VALID_URL_COMMAND_DICT
[
COMMAND_KEEP_HISTORY_AND_CANCEL_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_DISPLAY_STORED_STATE
]
=
null
;
VALID_URL_COMMAND_DICT
[
COMMAND_CHANGE_STATE
]
=
null
;
VALID_URL_COMMAND_DICT
[
COMMAND_CHANGE_STATE
]
=
null
;
VALID_URL_COMMAND_DICT
[
COMMAND_DISPLAY_ERP5_ACTION
]
=
null
;
VALID_URL_COMMAND_DICT
[
COMMAND_DISPLAY_ERP5_ACTION
]
=
null
;
...
@@ -388,11 +391,10 @@
...
@@ -388,11 +391,10 @@
);
);
}
}
function
execDisplayERP5ActionCommand
(
gadget
,
options
)
{
function
execDisplayERP5ActionCommand
(
gadget
,
previous_options
,
next_options
,
keep_history
)
{
return
gadget
.
jio_getAttachment
(
options
.
jio_key
,
'
links
'
)
return
gadget
.
jio_getAttachment
(
next_
options
.
jio_key
,
'
links
'
)
.
push
(
function
(
document_view
)
{
.
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
)
{
for
(
i
=
0
;
i
<
Object
.
keys
(
document_view
.
_links
).
length
;
i
=
i
+
1
)
{
action
=
Object
.
keys
(
document_view
.
_links
)[
i
];
action
=
Object
.
keys
(
document_view
.
_links
)[
i
];
if
(
document_view
.
_links
.
hasOwnProperty
(
action
))
{
if
(
document_view
.
_links
.
hasOwnProperty
(
action
))
{
...
@@ -401,22 +403,20 @@
...
@@ -401,22 +403,20 @@
}
}
for
(
j
=
0
;
j
<
document_view
.
_links
[
action
].
length
;
j
=
j
+
1
)
{
for
(
j
=
0
;
j
<
document_view
.
_links
[
action
].
length
;
j
=
j
+
1
)
{
action_data
=
document_view
.
_links
[
action
][
j
];
action_data
=
document_view
.
_links
[
action
][
j
];
if
(
action_data
.
name
===
options
.
page
)
{
if
(
action_data
.
name
===
next_
options
.
page
)
{
new_options
=
{
new_options
=
{
jio_key
:
options
.
jio_key
,
jio_key
:
next_
options
.
jio_key
,
view
:
action_data
.
href
view
:
action_data
.
href
};
};
copyStickyParameterDict
(
options
,
new_options
);
if
(
keep_history
)
{
action_url
=
getDisplayUrlFor
(
return
execPushHistoryCommand
(
gadget
,
previous_options
,
new_options
);
options
.
jio_key
,
}
new_options
return
execDisplayCommand
(
gadget
,
new_options
);
);
return
synchronousChangeState
(
action_url
);
}
}
}
}
}
}
}
}
throw
new
Error
(
'
Action not found:
'
+
options
.
name
);
throw
new
Error
(
'
Action not found:
'
+
next_
options
.
name
);
});
});
}
}
...
@@ -433,7 +433,6 @@
...
@@ -433,7 +433,6 @@
}
}
display_url
=
getDisplayUrlFor
(
jio_key
,
options
);
display_url
=
getDisplayUrlFor
(
jio_key
,
options
);
// Only keep state for the default view
// Only keep state for the default view
// otherwise, user will never be able to reset it with the filter panel
// 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
// Do not store state for module subdocument, to not pollute the IDB size
...
@@ -893,6 +892,9 @@
...
@@ -893,6 +892,9 @@
if
(
command_options
.
path
===
COMMAND_KEEP_HISTORY_AND_CANCEL_DIALOG_STATE
)
{
if
(
command_options
.
path
===
COMMAND_KEEP_HISTORY_AND_CANCEL_DIALOG_STATE
)
{
return
execKeepHistoryAndCancelDialogCommand
(
gadget
,
previous_options
);
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
)
{
if
(
command_options
.
path
===
COMMAND_DISPLAY_STORED_STATE
)
{
return
execDisplayStoredStateCommand
(
gadget
,
next_options
,
drop_options
);
return
execDisplayStoredStateCommand
(
gadget
,
next_options
,
drop_options
);
}
}
...
@@ -903,7 +905,7 @@
...
@@ -903,7 +905,7 @@
return
execChangeCommand
(
previous_options
,
next_options
,
drop_options
);
return
execChangeCommand
(
previous_options
,
next_options
,
drop_options
);
}
}
if
(
command_options
.
path
===
COMMAND_DISPLAY_ERP5_ACTION
)
{
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
)
{
if
(
command_options
.
path
===
COMMAND_STORE_AND_CHANGE_STATE
)
{
return
execStoreAndChangeCommand
(
gadget
,
previous_options
,
next_options
,
drop_options
);
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 @@
...
@@ -236,7 +236,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<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>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -254,7 +254,7 @@
...
@@ -254,7 +254,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
15
84027522.41
</float>
<float>
15
96764862.76
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</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