Skip to content

Commit

Permalink
Merge dev into new config feature branch (#541)
Browse files Browse the repository at this point in the history
* Fix click on vectortile

* Fix missing Missions/mission path on tile layers

* #465 Disable Globe more thoroughly when off (#466)

* #467 GENERATE_SOURCEMAP ENV (#468)

* #469 Fix Tool Drag Handle Remains on Screen (#470)

* #471 Additional Body Metadata for Draw Webhooks (#472)

* #471 Webhook fields 1

* #471 Additional Body Metadata for Draw Webhooks

* #471 Add raw_file_description

* #474 ShadeTool - Fix Entity height calculation (#475)

* #474 ShadeTool- Fix Entity height calculation

* #474 Remove comment of bad calculation line

* #473 MeasureTool and IdentifierTool Layer Vars (#476)

* #473 Layer Specific IdentifierTool vars 1

* #473 MeasureTool and IdentifierTool Layer Vars

* #477 DrawTool - Filter state management (#478)

* #479 Remove restriction on Layer names (#480)

* #479 Remove Layer Name restrictions

* #479 Remove console.log

* #481 ShadeTool Touchups (#482)

* #481 ShadeTool Touchups

* #481 Fix docs

* #483 MeasureTool Fix nodata issue (#484)

* Minor ShadeTool Fixes - hide point and regen at med res

* Check for empty time configs in TimeControl

* #489 DrawTool - Move (#490)

* #489 Draggable DrawTool Features part 1

* #489 DrawTool - Move 2

* #494 Dropdown in the topbar for a selected feature’s properties links (#495)

* #485 Rover Image Overlay Improvements (#486)

* #485 Rover Image Overlay Improvments

* #485 Prevent reload/updates to layers through the mmgisAPI if one is already taking place

* #485 Support initialOpacity for imageOverlays w/ docs

* Remove dev consolelog

* #485 Rover Improvement fixes

* #485 Image overlay chache works (but is offset badly now)

* #485 Fix image_overlay updateVectorLayer flickering

* #485 Fix layerObj ref

* #496 Support Symbols in DrawTool Folders and Tags (#497)

* #491 panorama angle of view wonky near poles (#499)

* #492 updateVectorLayer calls causes flat panorama view to revert to wrapped panorama view (#501)

* Fix time replacement in IdentifierTool

* #500 getFiles if deeplinked to draw tool (#502)

* Update docker installation docs

* Fix typo in docs

* mmgisAPI.appendLineString returns false if layer was in a blocking state

* Touch up, move extraneous DrawTool destory

* If Globe Panel disabled, do not even run empty animate loop

* Bug: Deeplinked DrawTool layers are now immediately clickable

* Bug: Webhooks identify symbols in draw tags

* Minor bug fixes - missing deeplink layer error gone, search bar recenters and can force makelayer

* #505 Dynamic Vector Layers (#506)

* #505 Dynamic Vector Layer querying 1

* #505 Time queries, reselect improvement, download extent or full

* #505 Dynamic vector layers

* #504 ShadeTool Improvements and Multi-missionize (#507)

* #504 ShadeTool - User settable AzElRange

* #504 SPICE kernel scheduled downloads

* #504 update shadetool css

* #504 Update docs for SPICE conf

* #505 [Bug]: Support dynamicExtentMoveThresholf for non-geodatasets

* #508 Upgrade Dockerfile to Node.JS v20+ (#509)

* #508 Upgrade to NodeJS v20.11.1

* #508 Update Dockerfile 2, update nupmy

* Geodatasets to use spatial index, also DB_POOL envs

* #510 Temporal Geodatasets (#511)

* #510 Temporal Geodatasets

* #510 Fix new doc page path

* #270 Fix nested header expansion (#512)

* #498 LayersTool - Prevent toggle of loading layer (#513)

* Bump 2.11 (#515)

* Docs - Time Tiles - Clarify tagging

* Fix css misaligned panel arrows due to browser update

* Bugfix: Send options to WMS layers (#517)

* Bugfix: Send options to WMS layers

* remove console.log

* Bugfix: TimeUI zoom - use wheel instead of mousewheel event for ff

* Bugfix: Catch errors in api/shorten/expand

* #519 fix mmgisAPI.setTime start (#520)

* #518 time={starttime} in a WMS URL is filled with endtime (#522)

* ts-518 Inject time tile params better

* #518 Stop wms layer options for override wms parameters

* Bugfix: LayersTool - Fix collapse all headers

* #523 Chronice fix second loss (#524)

* Info.go

* #270 Fix nested header expansion - quickfix

* Fix Chronice overflow, update spice-kernel-conf-example and fix TimeUI startInPointMode

* #525 Make dynamicExtent requery timeEnabled aware. (#526)

* #525 Make dynamicExtent requery timeEnabled aware.

* #525 Make dynamicExtent requery controlled aware.

* #527 Bugfix: Vector layers with headings/bearings do not toggle on/off based on zoom cutoffs (#528)

* #529 Viewshed set initial target and observer heights, also doc improvements (#530)

* #531 Viewshed in-app docs (#532)

* #531 partial

* #531 Viewshed in-app docs

* gdal2customtiles.py remove downscale for dem tiles

* #533 Allow adding relative seconds to initial times (#534)

* #533 Allow adding relative seconds to initial times

* #533 Make sure not to overwrite config time value for initialend

* #535 dynamicExtent vector layer and filtering issues (#536)

* Spelling fixes

* #452 Updated Identifier tool to be a separated floating tool

- Need to test different UI combinations with other separated tools
- We may possibly want an option to make the tool not be separated to
maintain compatibility

* Fixed Identifier tool bug when using old config with non-separated tool

Bug was causing other tools to not open. This makes it backwards
compatible.

* JS-API - setTime: add customtimes

* Fix docs typo

* Allow Identifier and Legend tools to be on different sides if specified

* Bug fix - MeasureTool without dem config variable set

* DrawTool - include Created and Modified time part in file info

* Fix no data dynamicExtent responses

* Remove minor debug field

---------

Co-authored-by: Joe Roberts <joe.t.roberts@jpl.nasa.gov>
Co-authored-by: Joe T. Roberts <5315956+jtroberts@users.noreply.github.com>
  • Loading branch information
3 people authored May 20, 2024
1 parent e46b87f commit 5f95f60
Show file tree
Hide file tree
Showing 114 changed files with 6,646 additions and 3,201 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
/config/pre/toolConfigs.json
/src/pre/tools.js

/spice/kernels/*
!/spice/kernels/.gitkeep
/Missions/spice-kernels-conf.json
!/Missions/spice-kernels-conf.example.json

/build/*
/data/*
*__pycache__
Expand Down
16 changes: 0 additions & 16 deletions API/Backend/Config/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,24 +116,8 @@ const isValidLayerName = (name) => {
errs.push(
err("Found a layer with name: undefined", ["layers[layer].name"])
);
if (!validCSSName(name))
errs.push(
err(
`Layer: '${name}' must not be empty, a non-string, contain symbols or begin with numbers.`,
["layers[layer].name"]
)
);

return errs;

function validCSSName(name) {
if (name == null || typeof name !== "string") return false;

const match = name.match(/[_A-Z ]+[_A-Z0-9- ]+/gi);
if (match && match[0].length === name.length) return true;

return false;
}
};

const isValidUrl = (layer) => {
Expand Down
27 changes: 19 additions & 8 deletions API/Backend/Draw/routes/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -517,19 +517,19 @@ router.post("/change", function (req, res, next) {
router.post("/modifykeyword", function (req, res, next) {
let Table = req.body.test === "true" ? UserfilesTEST : Userfiles;

const keyword = req.body.keyword;
let keyword = req.body.keyword;
const type = req.body.type;
const newKeyword = req.body.newKeyword;
let symbol = null;
switch (type.toLowerCase()) {
case "tags":
symbol = "#";
symbol = "~#";
break;
case "folders":
symbol = "@";
symbol = "~@";
break;
case "efolders":
symbol = "^";
symbol = "~^";
break;
default:
break;
Expand All @@ -538,12 +538,16 @@ router.post("/modifykeyword", function (req, res, next) {
if (
symbol == null ||
keyword == null ||
keyword.match(/^[a-z0-9_]+$/i) == null ||
(newKeyword != null && newKeyword.match(/^[a-z0-9_]+$/i) == null)
(keyword != null &&
(keyword.indexOf(" ") > -1 || keyword.indexOf("~") > -1)) ||
(newKeyword != null &&
(newKeyword.indexOf(" ") > -1 ||
newKeyword.indexOf("~") > -1 ||
newKeyword.indexOf("$") > -1))
) {
res.send({
status: "failure",
message: `Bad Input. Either: no 'keyword', no 'type', 'keyword' or 'newKeyword' contains non-alphanumerics.`,
message: `Bad Input. Either: no 'keyword', no 'type', 'keyword' or 'newKeyword' contains spaces, dollar-signs, tildes.`,
body: {},
});
return;
Expand All @@ -564,7 +568,14 @@ router.post("/modifykeyword", function (req, res, next) {
},
{
where: {
file_description: { [Sequelize.Op.iRegexp]: `[${existing}]` },
file_description: {
// Escape special chars so that regex works
[Sequelize.Op.like]: sequelize.literal(
`'%${existing
.replaceAll("%", "$%")
.replaceAll("_", "$_")}%' ESCAPE '$'`
),
},
},
}
)
Expand Down
111 changes: 98 additions & 13 deletions API/Backend/Geodatasets/models/geodatasets.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ function makeNewGeodatasetTable(name, success, failure) {
allowNull: true,
defaultValue: {},
},
start_time: {
type: Sequelize.BIGINT,
allowNull: true,
},
end_time: {
type: Sequelize.BIGINT,
allowNull: true,
},
geometry_type: {
type: Sequelize.STRING,
unique: false,
Expand Down Expand Up @@ -62,13 +70,51 @@ function makeNewGeodatasetTable(name, success, failure) {
{ where: { name: name }, silent: true }
)
.then((r) => {
success({
name: result.dataValues.name,
table: result.dataValues.table,
tableObj: GeodatasetTable,
});
sequelize
.query(
`CREATE INDEX IF NOT EXISTS ${result.dataValues.table}_geom_idx on ${result.dataValues.table} USING gist (geom);`
)
.then(() => {
sequelize
.query(
`CREATE INDEX IF NOT EXISTS ${result.dataValues.table}_time_idx on ${result.dataValues.table} USING gist (start_time, end_time);`
)
.then(() => {
success({
name: result.dataValues.name,
table: result.dataValues.table,
tableObj: GeodatasetTable,
});

return null;
return null;
})
.catch((err) => {
logger(
"error",
"Failed to recreate temporal index for geodataset table.",
"geodatasets",
null,
err
);
failure({
status: "failure",
message: "Failed to recreate temporal index",
});
});
})
.catch((err) => {
logger(
"error",
"Failed to recreate spatial index for geodataset table.",
"geodatasets",
null,
err
);
failure({
status: "failure",
message: "Failed to recreate spatial index",
});
});
})
.catch((err) => {
logger(
Expand All @@ -89,6 +135,7 @@ function makeNewGeodatasetTable(name, success, failure) {
.then(([results]) => {
let newTable =
"g" + (parseInt(results[0].count) + 1) + "_geodatasets";

Geodatasets.create({
name: name,
table: newTable,
Expand All @@ -102,12 +149,50 @@ function makeNewGeodatasetTable(name, success, failure) {
sequelize
.sync()
.then(() => {
success({
name: name,
table: newTable,
tableObj: GeodatasetTable,
});
return null;
sequelize
.query(
`CREATE INDEX ${newTable}_geom_idx on ${newTable} USING gist (geom);`
)
.then(() => {
sequelize
.query(
`CREATE INDEX ${newTable}_time_idx on ${newTable} USING gist (start_time, end_time);`
)
.then(() => {
success({
name: name,
table: newTable,
tableObj: GeodatasetTable,
});
return null;
})
.catch((err) => {
logger(
"error",
"Failed to create temporal index for geodataset table.",
"geodatasets",
null,
err
);
failure({
status: "failure",
message: "Failed to create temporal index",
});
});
})
.catch((err) => {
logger(
"error",
"Failed to create spatial index for geodataset table.",
"geodatasets",
null,
err
);
failure({
status: "failure",
message: "Failed to create spatial index",
});
});
})
.catch((err) => {
logger(
Expand Down Expand Up @@ -168,7 +253,7 @@ function makeNewGeodatasetTable(name, success, failure) {
failure({
status: "failure",
message: "Failed to find existing geodatasets",
error: error,
error: err,
name: name,
});
});
Expand Down
Loading

0 comments on commit 5f95f60

Please sign in to comment.