Skip to content

Commit

Permalink
cleans up console
Browse files Browse the repository at this point in the history
  • Loading branch information
ajrothwell committed Nov 2, 2023
1 parent 382d946 commit e4c18fb
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 23 deletions.
2 changes: 1 addition & 1 deletion src/clients/esri-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ class EsriClient extends BaseClient {

fetchBySpatialQuery(dataSourceKey, url, relationship, targetGeom, parameters = {}, options = {}, calculateDistancePt) {
let token = this.store.state.agoToken;
console.log('esri-client fetchBySpatialQuery, token:', token, 'dataSourceKey:', dataSourceKey, 'url:', url, 'relationship:', relationship, 'targetGeom:', targetGeom, 'parameters:', parameters, 'typeof(parameters.sourceValue):', typeof(parameters.sourceValue), 'options:', options, 'calculateDistancePt:', calculateDistancePt);
// console.log('esri-client fetchBySpatialQuery, token:', token, 'dataSourceKey:', dataSourceKey, 'url:', url, 'relationship:', relationship, 'targetGeom:', targetGeom, 'parameters:', parameters, 'typeof(parameters.sourceValue):', typeof(parameters.sourceValue), 'options:', options, 'calculateDistancePt:', calculateDistancePt);

let query = url + '/query'; //+ [relationship](targetGeom);
let theGeom, theGeomType, theSpatialRel;
Expand Down
2 changes: 1 addition & 1 deletion src/clients/geocode-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class GeocodeClient extends BaseClient {

// fetch(input, category) {
async fetch(input) {
console.log('geocode client fetch, input:', input, 'this.config.geocoder:', this.config.geocoder, 'this.store.state:', this.store.state);
// console.log('geocode client fetch, input:', input, 'this.config.geocoder:', this.config.geocoder, 'this.store.state:', this.store.state);

const store = this.store;
let geocodeConfig;
Expand Down
8 changes: 4 additions & 4 deletions src/clients/http-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import BaseClient from './base-client';
class HttpClient extends BaseClient {

fetchDataInSegments(feature, dataSource, dataSourceKey, targetIdFn, params) {
console.log('http-client fetchDataInSegments, feature:', feature, 'dataSource:', dataSource, 'dataSourceKey:', dataSourceKey, 'targetIdFn:', targetIdFn, 'params:', params);
// console.log('http-client fetchDataInSegments, feature:', feature, 'dataSource:', dataSource, 'dataSourceKey:', dataSourceKey, 'targetIdFn:', targetIdFn, 'params:', params);

let featureArr = feature.properties[dataSource.splitField].split('|');
console.log("Here is the featureArr: ", featureArr, "length: ", featureArr.length);
// console.log("Here is the featureArr: ", featureArr, "length: ", featureArr.length);
// Divide feature into groups of 200 so the url won't create an error

let featuresObj = [];
Expand Down Expand Up @@ -42,7 +42,7 @@ class HttpClient extends BaseClient {
}
// console.log('url', url);
const successFn = options.success;
console.log('in fetchDataInSegments, successFn:', successFn);
// console.log('in fetchDataInSegments, successFn:', successFn);

let responseResult = [];

Expand All @@ -54,7 +54,7 @@ class HttpClient extends BaseClient {

let params = this.evaluateParams(features, dataSource);
let featureResponse = await axios.get(url, { params });
console.log('params:', params, 'featureResponse:', featureResponse);
// console.log('params:', params, 'featureResponse:', featureResponse);
data = await data.concat(successFn(featureResponse.data));

if (targetIdFn) {
Expand Down
20 changes: 10 additions & 10 deletions src/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class Controller {
// }

initializeStatuses(input, searchCategory) {
console.log('initializeStatuses is running', input, 'searchCategory:', searchCategory);
// console.log('initializeStatuses is running', input, 'searchCategory:', searchCategory);
if (!searchCategory || searchCategory === 'address') {
this.store.commit('setGeocodeInput', input);
this.store.commit('setGeocodeStatus', null);
Expand Down Expand Up @@ -164,7 +164,7 @@ class Controller {
}

if (!this.config.pinboard && this.store.state.lastSearchMethod !== 'buffer search') {
console.log('in initializeStatuses, removing BufferShape, this.store.state.lastSearchMethod:', this.store.state.lastSearchMethod);
// console.log('in initializeStatuses, removing BufferShape, this.store.state.lastSearchMethod:', this.store.state.lastSearchMethod);
this.store.commit('setBufferShape', null);
}
}
Expand Down Expand Up @@ -221,7 +221,7 @@ class Controller {
let aisResponse = this.clients.geocode.fetch(value);
return;
}
console.log('phila-vue-datafetch controller.js, handleSearchFormSubmit is running, value:', value, 'searchCategory:', searchCategory);
// console.log('phila-vue-datafetch controller.js, handleSearchFormSubmit is running, value:', value, 'searchCategory:', searchCategory);

this.initializeStatuses(value, searchCategory);
if(searchCategory === "keyword") {
Expand Down Expand Up @@ -262,9 +262,9 @@ class Controller {
// console.log('after await initializeStatuses is running');

// TODO rename to aisResponse
console.log('controller.js handleSearchFormSubmit about to call ais');
// console.log('controller.js handleSearchFormSubmit about to call ais');
let aisResponse = await this.clients.geocode.fetch(value);
console.log('after await aisResponse:', aisResponse);//, 'this.clients:', this.clients);
// console.log('after await aisResponse:', aisResponse);//, 'this.clients:', this.clients);
// console.log('after await aisResponse:', aisResponse, 'aisResponse.properties.street_address:', aisResponse.properties.street_address);//, 'this.clients:', this.clients);

if (aisResponse && !this.store.state.bufferMode && !blockSearchCheck) {
Expand All @@ -278,21 +278,21 @@ class Controller {
}
} else if (!this.store.state.bufferMode && blockSearchCheck === true) {
this.dataManager.clearOwnerSearch();
console.log('else if 1 is running, block search is true, value:', value);
// console.log('else if 1 is running, block search is true, value:', value);
this.dataManager.resetGeocode();
aisResponse = await this.clients.blockSearch.fetch(value);
} else if (!this.store.state.bufferMode) {
console.log('else if 2 is running');
// console.log('else if 2 is running');
this.dataManager.clearBlockSearch();
if (this.config.onGeocodeFail && this.config.onGeocodeFail.data === 'tips') {
console.log('elseif 2 if is running, onGeocodeFail exists');
// console.log('elseif 2 if is running, onGeocodeFail exists');
let feature = {
properties: {},
};
feature.properties.opa_account_num = this.store.state.geocode.input;
this.dataManager.fetchData(feature);
} else {
console.log('elseif 2 else is running, this used to do an owner search');
// console.log('elseif 2 else is running, this used to do an owner search');
// aisResponse = await this.clients.ownerSearch.fetch(value);
// this.router.setRouteByOwnerSearch();
}
Expand Down Expand Up @@ -388,7 +388,7 @@ class Controller {
}
}

console.log('about to call processParcels, response:', response);
// console.log('about to call processParcels, response:', response);
let errorValue = false;
if (response) {
errorValue = response.error ? true : false;
Expand Down
14 changes: 7 additions & 7 deletions src/data-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ class DataManager {
}

fetchData(optionalFeature) {
console.log('\nFETCH DATA STARTING, optionalFeature:', optionalFeature);
// console.log('\nFETCH DATA STARTING, optionalFeature:', optionalFeature);
// console.log('-----------');
let geocodeObj;
let ownerSearchObj;
Expand Down Expand Up @@ -434,7 +434,7 @@ class DataManager {
targetIdFn);
}
} else if (dataSource.segments == true) {
console.log('segments is true, http-get, target:', target, 'dataSource:', dataSource, 'dataSourceKey:', dataSourceKey, 'targetIdFn:', targetIdFn);
// console.log('segments is true, http-get, target:', target, 'dataSource:', dataSource, 'dataSourceKey:', dataSourceKey, 'targetIdFn:', targetIdFn);
this.clients.http.fetchDataInSegments(target,
dataSource,
dataSourceKey,
Expand Down Expand Up @@ -485,15 +485,15 @@ class DataManager {
}

didFetchData(key, status, dataOrNull, targetId, targetIdFn) {
console.log('didFetchData, this.config.dataSources[key]:', this.config.dataSources[key]);
// console.log('didFetchData, this.config.dataSources[key]:', this.config.dataSources[key]);

let data = status === 'error' ? null : dataOrNull;
// console.log('data-manager DID FETCH DATA, key:', key, 'targetId:', targetId || '', 'data:', data.features[0], 'targetIdFn:', targetIdFn);
// console.log('data-manager DID FETCH DATA, key:', key, 'data:', data, 'targetId:', targetId || '', 'targetIdFn:', targetIdFn);

// assign feature ids
if (Array.isArray(data)) {
console.log('didFetchData if is running, data:', data, 'key:', key);
// console.log('didFetchData if is running, data:', data, 'key:', key);
if (this.config.dataSources[key].segments) {
let value = [];
let dataPoints;
Expand All @@ -513,12 +513,12 @@ class DataManager {
value = data[dataPoints];
}
data = value;
console.log('didFetchData key:', key, 'dataPoints:', dataPoints, 'value:', value);
// console.log('didFetchData key:', key, 'dataPoints:', dataPoints, 'value:', value);
} else {
data = this.assignFeatureIds(data, key, targetId);
}
} else if (data) {
console.log('didFetchData else if is running, data:', data, 'key:', key, 'targetId:', targetId);
// console.log('didFetchData else if is running, data:', data, 'key:', key, 'targetId:', targetId);
if (data.rows && data.rows.length) {
data.rows = this.assignFeatureIds(data.rows, key, targetId);
} else if (data.records && data.records.length) {
Expand Down Expand Up @@ -657,7 +657,7 @@ class DataManager {
data: null,
});
let currentParcels = this.activeTopicConfig().parcels || Object.keys(this.config.parcels)[0];
console.log('currentParcels:', currentParcels);
// console.log('currentParcels:', currentParcels);
// this.store.commit('setActiveParcelLayer', 'pwd');
this.store.commit('setActiveParcelLayer', currentParcels);
}
Expand Down
1 change: 1 addition & 0 deletions vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const Visualizer = require('webpack-visualizer-plugin');
// const path = require('path');

module.exports = {
// mode: 'production',
configureWebpack: {
plugins: [
new Visualizer({ filename: './statistics.html' }),
Expand Down

0 comments on commit e4c18fb

Please sign in to comment.