Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-webui-legacy-adapter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-webui-legacy-adapter
Commits
5c6390c6
Verified
Commit
5c6390c6
authored
Aug 3, 2023
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
DOC: update CHANGELOG
parent
9657c688
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!6
Release 0.2.0
,
!4
F map bundle
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
CHANGELOG.md
+2
-0
2 additions, 0 deletions
CHANGELOG.md
src/map.js
+17
-27
17 additions, 27 deletions
src/map.js
src/query-form.js
+8
-4
8 additions, 4 deletions
src/query-form.js
src/queryCallback.js
+3
-1
3 additions, 1 deletion
src/queryCallback.js
with
30 additions
and
32 deletions
CHANGELOG.md
+
2
−
0
View file @
5c6390c6
...
@@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
...
@@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added ###
### Added ###
*
Map component @indiscale/caosdb-webui-ext-map
### Changed ###
### Changed ###
### Deprecated ###
### Deprecated ###
...
...
This diff is collapsed.
Click to expand it.
src/map.js
+
17
−
27
View file @
5c6390c6
...
@@ -2,28 +2,22 @@ import React from "react";
...
@@ -2,28 +2,22 @@ import React from "react";
import
ReactDOM
from
"
react-dom/client
"
;
import
ReactDOM
from
"
react-dom/client
"
;
import
"
regenerator-runtime/runtime
"
;
import
"
regenerator-runtime/runtime
"
;
import
{
TransactionService
}
from
"
@indiscale/caosdb-webui-entity-service
"
;
import
{
TransactionService
}
from
"
@indiscale/caosdb-webui-entity-service
"
;
import
{
import
{
Map
,
ToggleMapButton
}
from
"
@indiscale/caosdb-webui-ext-map
"
;
Map
,
ToggleMapButton
}
from
"
@indiscale/caosdb-webui-ext-map
"
;
import
{
queryCallback
}
from
"
./queryCallback
"
;
import
{
queryCallback
}
from
"
./queryCallback
"
;
const
caosdb_map_2
=
{
const
caosdb_map_2
=
{
/**
/**
* Initialize the map panel.
* Create the map panel (div.caosdb-f-map-panel) and insert it into the dom
*
* tree. Then return the map panel.
* The map panel is the HTMLElement which contains the map. Is is
* hidden or shown when the user clicks on the toggle map button.
*
* @param {boolean} show - show this panel immediately.
*/
*/
init_map_panel
:
function
()
{
init_map_panel
:
function
()
{
// remove old
// remove old
if
(
document
.
querySelector
(
'
.caosdb-f-map-panel
'
))
{
if
(
document
.
querySelector
(
"
.caosdb-f-map-panel
"
))
{
document
.
querySelector
(
'
.caosdb-f-map-panel
'
).
remove
();
document
.
querySelector
(
"
.caosdb-f-map-panel
"
).
remove
();
}
}
let
panel
=
this
.
create_map_panel
();
const
panel
=
document
.
createElement
(
"
div
"
);
panel
.
classList
=
"
caosdb-f-map-panel container mb-2
"
;
document
.
querySelector
(
"
nav
"
).
after
(
panel
);
document
.
querySelector
(
"
nav
"
).
after
(
panel
);
...
@@ -31,15 +25,11 @@ const caosdb_map_2 = {
...
@@ -31,15 +25,11 @@ const caosdb_map_2 = {
},
},
/**
/**
* Create map panel (div.caosdb-f-map-panel).
* Create a button item in the navbar and return it.
*
* The button contains a dummy link tag which is to be removed/overriden when
* React inserts the ToggleMapButton component.
*/
*/
create_map_panel
:
function
()
{
let
panel
=
document
.
createElement
(
"
div
"
);
panel
.
classList
=
"
caosdb-f-map-panel container mb-2
"
;
return
panel
;
},
create_navbar_item
:
function
()
{
create_navbar_item
:
function
()
{
const
dummy
=
document
.
createElement
(
"
a
"
);
const
dummy
=
document
.
createElement
(
"
a
"
);
return
navbar
.
add_button
(
dummy
);
return
navbar
.
add_button
(
dummy
);
...
@@ -65,8 +55,8 @@ const caosdb_map_2 = {
...
@@ -65,8 +55,8 @@ const caosdb_map_2 = {
<
ToggleMapButton
className
=
"
nav-link
"
/>
<
ToggleMapButton
className
=
"
nav-link
"
/>
<
/React.StrictMode
>
<
/React.StrictMode
>
);
);
}
}
,
}
}
;
$
(
document
).
ready
(
function
()
{
$
(
document
).
ready
(
function
()
{
caosdb_modules
.
register
(
caosdb_map_2
);
caosdb_modules
.
register
(
caosdb_map_2
);
...
...
This diff is collapsed.
Click to expand it.
src/query-form.js
+
8
−
4
View file @
5c6390c6
...
@@ -63,9 +63,13 @@ function resolveDefaultTab(tabs, defaultTab) {
...
@@ -63,9 +63,13 @@ function resolveDefaultTab(tabs, defaultTab) {
async
function
initQueryPanel
()
{
async
function
initQueryPanel
()
{
if
(
!
document
.
getElementById
(
"
caosdb-navbar-query
"
))
{
if
(
!
document
.
getElementById
(
"
caosdb-navbar-query
"
))
{
// document not ready, retrigger when ready
// document not ready, retrigger when ready
document
.
addEventListener
(
'
DOMContentLoaded
'
,
function
()
{
document
.
addEventListener
(
"
DOMContentLoaded
"
,
function
()
{
initQueryPanel
();
initQueryPanel
();
},
false
);
},
false
);
return
;
return
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/queryCallback.js
+
3
−
1
View file @
5c6390c6
const
queryCallback
=
(
queryString
,
pageSize
)
=>
{
const
queryCallback
=
(
queryString
,
pageSize
)
=>
{
const
paging
=
pageSize
<
1
?
""
:
`&P=0L
${
pageSize
||
10
}
`
;
const
paging
=
pageSize
<
1
?
""
:
`&P=0L
${
pageSize
||
10
}
`
;
const
newHref
=
connection
.
getEntityUri
([])
+
`?query=
${
encodeURIComponent
(
queryString
)}${
paging
}
`
;
const
newHref
=
connection
.
getEntityUri
([])
+
`?query=
${
encodeURIComponent
(
queryString
)}${
paging
}
`
;
window
.
location
.
href
=
newHref
;
window
.
location
.
href
=
newHref
;
};
};
...
...
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