diff --git a/.github/workflows/buildah.yml b/.github/workflows/buildah.yml new file mode 100644 index 0000000..370fe85 --- /dev/null +++ b/.github/workflows/buildah.yml @@ -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/buildah-build@v2.2 + with: + image: caracal-edge + tags: v1 ${{ github.sha }} + dockerfiles: | + ./Dockerfile + build-args: | + viewer=develop diff --git a/handlers/dataHandlers.js b/handlers/dataHandlers.js index bc16dc0..7852339 100644 --- a/handlers/dataHandlers.js +++ b/handlers/dataHandlers.js @@ -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();