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
1
Merge Requests
1
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
Vincent Bechu
erp5
Commits
921476c1
Commit
921476c1
authored
Oct 26, 2018
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_web_renderjs_ui] Load the notification gadget only when it is needed to display a message
parent
a93ae940
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
8 deletions
+34
-8
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_js.js
...mplateItem/web_page_module/rjs_gadget_erp5_launcher_js.js
+32
-6
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_js.xml
...plateItem/web_page_module/rjs_gadget_erp5_launcher_js.xml
+2
-2
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_js.js
View file @
921476c1
...
@@ -360,7 +360,11 @@
...
@@ -360,7 +360,11 @@
)
{
)
{
return
RSVP
.
all
([
return
RSVP
.
all
([
route
(
this
,
"
header
"
,
'
notifySubmitting
'
),
route
(
this
,
"
header
"
,
'
notifySubmitting
'
),
route
(
this
,
"
notification
"
,
'
notify
'
,
argument_list
)
this
.
deferChangeState
({
// Force calling notify
notification_timestamp
:
new
Date
().
getTime
(),
notification_options
:
argument_list
[
0
]
})
]);
]);
})
})
.
allowPublicAcquisition
(
'
notifySubmitted
'
,
function
notifySubmitted
(
.
allowPublicAcquisition
(
'
notifySubmitted
'
,
function
notifySubmitted
(
...
@@ -368,7 +372,11 @@
...
@@ -368,7 +372,11 @@
)
{
)
{
return
RSVP
.
all
([
return
RSVP
.
all
([
route
(
this
,
"
header
"
,
'
notifySubmitted
'
),
route
(
this
,
"
header
"
,
'
notifySubmitted
'
),
route
(
this
,
"
notification
"
,
'
notify
'
,
argument_list
),
this
.
deferChangeState
({
// Force calling notify
notification_timestamp
:
new
Date
().
getTime
(),
notification_options
:
argument_list
[
0
]
}),
route
(
this
,
"
router
"
,
'
notify
'
,
argument_list
)
route
(
this
,
"
router
"
,
'
notify
'
,
argument_list
)
]);
]);
})
})
...
@@ -377,7 +385,11 @@
...
@@ -377,7 +385,11 @@
)
{
)
{
return
RSVP
.
all
([
return
RSVP
.
all
([
route
(
this
,
"
header
"
,
'
notifyChange
'
),
route
(
this
,
"
header
"
,
'
notifyChange
'
),
route
(
this
,
"
notification
"
,
'
notify
'
,
argument_list
),
this
.
deferChangeState
({
// Force calling notify
notification_timestamp
:
new
Date
().
getTime
(),
notification_options
:
argument_list
[
0
]
}),
route
(
this
,
"
router
"
,
'
notify
'
,
argument_list
)
route
(
this
,
"
router
"
,
'
notify
'
,
argument_list
)
]);
]);
})
})
...
@@ -613,6 +625,21 @@
...
@@ -613,6 +625,21 @@
);
);
}
}
// Update the notification
if
(
modification_dict
.
hasOwnProperty
(
'
notification_options
'
)
||
modification_dict
.
hasOwnProperty
(
'
notification_timestamp
'
))
{
if
(
gadget
.
state
.
notification_options
===
undefined
)
{
promise_list
.
push
(
route
(
gadget
,
"
notification
"
,
'
close
'
)
);
}
else
{
promise_list
.
push
(
route
(
this
,
"
notification
"
,
'
notify
'
,
[
gadget
.
state
.
notification_options
])
);
}
}
return
RSVP
.
all
(
promise_list
);
return
RSVP
.
all
(
promise_list
);
})
})
// Render the page
// Render the page
...
@@ -631,9 +658,6 @@
...
@@ -631,9 +658,6 @@
route
(
gadget
,
'
panel
'
,
'
close
'
),
route
(
gadget
,
'
panel
'
,
'
close
'
),
route
(
gadget
,
'
router
'
,
'
notify
'
,
[{
modified
:
false
}])
route
(
gadget
,
'
router
'
,
'
notify
'
,
[{
modified
:
false
}])
];
];
if
(
keep_message
!==
true
)
{
promise_list
.
push
(
route
(
gadget
,
'
notification
'
,
'
close
'
));
}
return
RSVP
.
all
(
promise_list
);
return
RSVP
.
all
(
promise_list
);
})
})
.
push
(
function
()
{
.
push
(
function
()
{
...
@@ -641,6 +665,8 @@
...
@@ -641,6 +665,8 @@
url
:
route_result
.
url
,
url
:
route_result
.
url
,
options
:
route_result
.
options
,
options
:
route_result
.
options
,
editor_panel_url
:
undefined
,
editor_panel_url
:
undefined
,
notification_options
:
(
keep_message
===
true
)
?
gadget
.
state
.
notification_options
:
undefined
,
// Force calling main gadget render
// Force calling main gadget render
render_timestamp
:
new
Date
().
getTime
()
render_timestamp
:
new
Date
().
getTime
()
});
});
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_js.xml
View file @
921476c1
...
@@ -230,7 +230,7 @@
...
@@ -230,7 +230,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
971.133
51.46212.20787
</string>
</value>
<value>
<string>
971.133
70.40868.64819
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -248,7 +248,7 @@
...
@@ -248,7 +248,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
154056
0524.97
</float>
<float>
154056
1732.08
</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