Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-webui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-webui
Commits
f857a3f7
Commit
f857a3f7
authored
3 years ago
by
florian
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Add waiting notification when adding bookmarks
parent
aa0db65e
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!47
Release v0.4.0
,
!44
ENH: Add all query results to bookmarks
Pipeline
#15004
passed
3 years ago
Stage: linting
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/core/js/ext_bookmarks.js
+5
-0
5 additions, 0 deletions
src/core/js/ext_bookmarks.js
src/core/js/webcaosdb.js
+13
-12
13 additions, 12 deletions
src/core/js/webcaosdb.js
with
18 additions
and
12 deletions
src/core/js/ext_bookmarks.js
+
5
−
0
View file @
f857a3f7
...
...
@@ -590,12 +590,17 @@ var ext_bookmarks = function ($, logger, config) {
const
add_query_results_to_bookmarks
=
async
function
()
{
const
query_string
=
get_query_from_response
();
const
waiting_id
=
"
caosdb-add-to-bookamrks-waiting-notification
"
;
const
waiting_notification
=
createWaitingNotification
(
"
Adding results to bookmarks. Please wait and do not reload the page.
"
,
id
=
waiting_id
);
$
(
"
#caosdb-add-query-to-bookmarks-row
"
).
append
(
waiting_notification
);
const
resp
=
await
query
(
query_string
);
for
(
const
eid
of
resp
)
{
bookmark_storage
.
setItem
(
get_key
(
getEntityID
(
eid
)),
getEntityID
(
eid
));
}
// re-init for correct display of counter and entities on page
init
();
$
(
"
#
"
+
waiting_id
).
remove
();
}
/**
...
...
This diff is collapsed.
Click to expand it.
src/core/js/webcaosdb.js
+
13
−
12
View file @
f857a3f7
...
...
@@ -164,19 +164,19 @@ this.navbar = new function () {
// show form and hide the show_button
const
_in
=
()
=>
{
// xs means viewport <= 768px
form
.
removeClass
(
"
d-none
"
);
form
.
addClass
(
"
d-xs-inline-block
"
);
show_button
.
removeClass
(
"
d-inline-block
"
);
show_button
.
addClass
(
"
d-none
"
);
// xs means viewport <= 768px
form
.
removeClass
(
"
d-none
"
);
form
.
addClass
(
"
d-xs-inline-block
"
);
show_button
.
removeClass
(
"
d-inline-block
"
);
show_button
.
addClass
(
"
d-none
"
);
}
// hide form and show the show_button
const
_out
=
()
=>
{
// xs means viewport <= 768px
form
.
removeClass
(
"
d-xs-inline-block
"
);
form
.
addClass
(
"
d-none
"
);
show_button
.
removeClass
(
"
d-none
"
);
show_button
.
addClass
(
"
d-inline-block
"
);
// xs means viewport <= 768px
form
.
removeClass
(
"
d-xs-inline-block
"
);
form
.
addClass
(
"
d-none
"
);
show_button
.
removeClass
(
"
d-none
"
);
show_button
.
addClass
(
"
d-inline-block
"
);
}
show_button
.
on
(
"
click
"
,
()
=>
{
// show form...
...
...
@@ -1507,10 +1507,11 @@ function createErrorNotification(msg) {
* Create a waiting notification with a informative message for the waiting user.
*
* @param {String} info, a message for the user
* @param {String} id, optional, the id of the message div. Default is empty
* @return {HTMLElement} A div with class `caosdb-preview-waiting-notification`.
*/
function
createWaitingNotification
(
info
)
{
return
$
(
'
<div class="
'
+
globalClassNames
.
WaitingNotification
+
'
">
'
+
info
+
'
</div>
'
)[
0
];
function
createWaitingNotification
(
info
,
id
=
""
)
{
return
$
(
'
<div class="
'
+
globalClassNames
.
WaitingNotification
+
'
" id="
'
+
id
+
'
">
'
+
info
+
'
</div>
'
)[
0
];
}
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment