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
7a59c854
Commit
7a59c854
authored
3 years ago
by
florian
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Add button functionality
parent
8eb922ee
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
#14899
passed
3 years ago
Stage: linting
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/core/js/ext_bookmarks.js
+11
-17
11 additions, 17 deletions
src/core/js/ext_bookmarks.js
with
11 additions
and
17 deletions
src/core/js/ext_bookmarks.js
+
11
−
17
View file @
7a59c854
...
...
@@ -574,7 +574,11 @@ var ext_bookmarks = function ($, logger, config) {
if
(
$
(
"
#
"
+
row_id
).
length
>
0
)
{
return
;
}
const
button_html
=
$
(
`<div class="row" id=
${
row_id
}
><p class="text-end">Bookmark all query results</p></div>`
)[
0
];
const
button_html
=
$
(
`<div class="row" id=
${
row_id
}
>
<p class="text-end">
<button class="btn btn-link" onclick="ext_bookmarks.add_query_results_to_bookmarks();">Bookmark all query results</button>
</p>
</div>`
)[
0
];
// Add to query results box
$
(
"
.caosdb-query-response-heading
"
).
append
(
button_html
);
...
...
@@ -583,27 +587,17 @@ var ext_bookmarks = function ($, logger, config) {
/**
* Execute select query and add all new ids to bookmarks.
*/
const
add_query_results_to_bookmarks
=
function
()
{
const
add_query_results_to_bookmarks
=
async
function
()
{
const
query_string
=
get_query_from_response
();
//
const resp = await query(query_string);
//
for (const eid of resp) {
//
add_to_bookmarks(
getEntityID(eid));
//
}
//
//
re-init for correct display of counter and entities on page
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
();
}
/**
* Add value to bookmarks if its key is new. Do nothing otherwise.
*
* @param {string} value
*/
const
add_to_bookmarks
=
function
(
value
)
{
const
key
=
get_key
(
value
);
}
/**
* Transform a given query it to a "SELECT ID FROM ..." query.
*
...
...
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