Skip to content

Commit

Permalink
Merge pull request #69 from camicroscope/develop
Browse files Browse the repository at this point in the history
For 3.9.0
  • Loading branch information
birm authored Mar 4, 2021
2 parents d65d05a + 02034db commit afb8151
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 19 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/buildah.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Buildah via Dockerfile
on: [push]

jobs:
build:
name: Build image
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Buildah Action
uses: redhat-actions/[email protected]
with:
image: caracal-edge
tags: v1 ${{ github.sha }}
dockerfiles: |
./Dockerfile
build-args: |
viewer=develop
47 changes: 28 additions & 19 deletions handlers/dataHandlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,36 +344,45 @@ Mark.spatial = function(req, res, next) {
};

Mark.multi = function(req, res, next) {
var query = req.query;
if (query.nameList) {
query['provenance.analysis.execution_id'] = {
'$in': JSON.parse(query.nameList),
};
delete query.nameList;
var query = {};

var postQuery = JSON.parse(req.body);

// handle source
if (postQuery.source) {
query['provenance.analysis.source'] = postQuery.source;
}
delete query.token;

// handle notes
if (postQuery.notes) {
query['properties.annotations.notes'] = postQuery.notes;
}

if (postQuery.ids) {
query['provenance.analysis.execution_id'] = {'$in': postQuery.ids};
}

// handle x0, y0, x1, y1, footprint
if (req.query.x0 && req.query.x1) {
if (postQuery.x0 && postQuery.x1) {
query.x = {
'$gt': parseFloat(req.query.x0),
'$lt': parseFloat(req.query.x1),
'$gt': parseFloat(postQuery.x0),
'$lt': parseFloat(postQuery.x1),
};
}
delete query.x0;
delete query.x1;
if (req.query.y0 && req.query.y1) {

if (postQuery.y0 && postQuery.y1) {
query.y = {
'$gt': parseFloat(req.query.y0),
'$lt': parseFloat(req.query.y1),
'$gt': parseFloat(postQuery.y0),
'$lt': parseFloat(postQuery.y1),
};
}
delete query.y0;
delete query.y1;
if (query.footprint) {

if (postQuery.footprint) {
query.footprint = {
'$gt': parseFloat(query.footprint),
'$gt': parseFloat(postQuery.footprint),
};
}

mongoFind('camic', 'mark', query).then((x) => {
req.data = x;
next();
Expand Down

0 comments on commit afb8151

Please sign in to comment.