Skip to content

Commit

Permalink
WIP fixes for Statusimage
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Rebetez committed Apr 26, 2020
1 parent ed478ad commit 0eca44e
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Because `wdio` wraps `mocha`, you can send `mocha` args via `wdio.default.conf.j

1. Start oam-api:

`oam-api$ docker-compose up`
`oam-api$ docker-compose up`

2. Start chromedriver:

Expand Down
18 changes: 17 additions & 1 deletion src/components/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,31 @@ export default createReactClass({
// The map parameters form the url take precedence over everything else
// if they're not present try the cookie.
state.map.view = this.getMapViewOrDefault(this.props.params.map);
console.log('state.map.view', state.map.view)

state.selectedSquareQuadkey = this.props.params.square_id;
state.selectedItemId = this.props.params.image_id;

console.log('selectedItemId=' + state.selectedItemId)
/*
this.setState({
map: {
view: this.getMapViewOrDefault(this.props.params.map)
},
selectedSquareQuadkey: this.props.params.square_id,
selectedItemId: this.props.params.image_id
})
*/

if (this.props.params.user_id) {
mapStore.queryUserImagery(this.props.params.user_id);
}

//this.setState(state);

// TODO: Remove => this is already done in the loadImagery callback (which properly respects
// the async nature of queryUserImagery)
state.results = this.getImagery();
console.log('home results', state.results)
this.setState(state);
},

Expand Down
1 change: 1 addition & 0 deletions src/components/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ export default createReactClass({
this.mapGridLayer.on("click", this.onGridSqrClick);

// Map position from path.
console.log('this.props.map', this.props.map)
var mapString = this.stringToMapView(this.props.map.view);
var view = [mapString.lat, mapString.lng];
var zoom = mapString.zoom;
Expand Down
5 changes: 3 additions & 2 deletions src/components/results_pane.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export default createReactClass({
i.uuid.includes(this.props.selectedItemId)
);
});
console.log('setupCurrentImage, currentIndex=' + this.currentIndex)
this.currentResult = this.props.results[this.currentIndex];
} else {
this.currentResult = null;
Expand All @@ -50,8 +51,8 @@ export default createReactClass({

render: function() {
var resultsPane = null;
if (this.props.selectedItemId) {
this.setupCurrentImage();
this.setupCurrentImage();
if (this.currentResult) {
var pg = {
total: this.props.results.length,
current: this.currentIndex + 1,
Expand Down
2 changes: 2 additions & 0 deletions src/components/uploader/StatusImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ function imageClick(event, metadata) {
event.preventDefault();
const modifiedMetdata = Object.assign({}, metadata);
modifiedMetdata._id = metadata.uuid.split("/").slice(-1)[0];
console.log('metadata', metadata)
console.log('extracted id', modifiedMetdata._id)
utils.imageUri(modifiedMetdata);
}

Expand Down

0 comments on commit 0eca44e

Please sign in to comment.