Skip to content

Commit

Permalink
fixed merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
emre2038 committed Dec 14, 2023
2 parents 04cae97 + 229bde7 commit e1e2fd8
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 15 deletions.
4 changes: 2 additions & 2 deletions __tests__/gui/common_cy_functions/general.js
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ export function confirmNoChoroplethFilterSelected() {
cy.get(`${mapBottomItems} .map-options .map-options__filter-row:visible`).should('have.length', 1);
cy.get(`${mapBottomItems} .map-options .map-options__filter-row:visible .mapping-options__filter`)
.eq(0)
.find('div.MuiSelect-select em')
.find('div.MuiSelect-select')
.should('have.text', 'Select an attribute');
cy.get(`${mapBottomItems} .map-options .map-options__filter-row:visible .mapping-options__filter`).eq(1).should('have.class', 'disabled');
}
Expand All @@ -463,7 +463,7 @@ export function confirmNoChartFilterSelected() {
cy.get('.rich-data-content .profile-indicator__filter-row:visible').should('have.length', 1);
cy.get('.rich-data-content .profile-indicator__filter-row:visible .profile-indicator__filter')
.eq(0)
.find('div.MuiSelect-select em')
.find('div.MuiSelect-select')
.should('have.text', 'Select an attribute');
cy.get('.rich-data-content .profile-indicator__filter-row:visible .profile-indicator__filter').eq(1).should('have.class', 'disabled');
}
Expand Down
2 changes: 1 addition & 1 deletion __tests__/gui/sharing_2/sharing.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Then(/^I confirm that the chart is not filtered$/, function () {
// cy.get('.rich-data-content .profile-indicator__filter-row:visible:eq(0)').should('have.length', 1);
cy.get('.rich-data-content .profile-indicator__filter-row:visible:eq(0) .profile-indicator__filter')
.eq(0)
.find('div.MuiSelect-select em')
.find('div.MuiSelect-select')
.should('have.text', 'Select an attribute');
cy.get('.rich-data-content .profile-indicator__filter-row:visible:eq(0) .profile-indicator__filter').eq(1).should('have.class', 'disabled');
});
Expand Down
Binary file added cypress/downloads/map.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions src/js/configurations/geography_sa.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ export class Config {
return false;
}

get pointSearchEnabled(){
if(this.config["point_search_enabled"] != undefined)
return this.config["point_search_enabled"];
return true;
}

get siteWideFiltersEnabled() {
if (this.config["site_wide_filters_enabled"] != undefined)
return this.config["site_wide_filters_enabled"];
Expand Down
27 changes: 16 additions & 11 deletions src/js/elements/header/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,14 @@ export class Search extends Component {
* constructor of the class
* sets the default values, calls init function(this.setSearchInput)
* */
constructor(parent, api, profileId, minChars) {
constructor(parent, api, profileId, minChars, config) {
super(parent);

minLength = minChars;
this.api = api;
this.profileId = profileId;
this.plate = null;
this.config = config;

this.prepareDomElements();
this.setSearchInput();
Expand All @@ -60,9 +61,11 @@ export class Search extends Component {

this.updateGeoSearchHeader(titleRow);
this.updateGeoSearch();
this.appendSearchSeparator();
this.appendPointsTitle(titleRow);
this.appendPointsNoData();
if (this.config.pointSearchEnabled) {
this.appendSearchSeparator();
this.appendPointsTitle(titleRow);
this.appendPointsNoData();
}
}

updateGeoSearchHeader(titleRow) {
Expand Down Expand Up @@ -282,13 +285,15 @@ export class Search extends Component {
response(data);
})

const mapCenter = self.getMapCenter();
self.api.searchPointsByDistance(self.profileId, searchTerm, mapCenter.lat, mapCenter.lng).then(data => {
self.removePointsNoData();
self.appendPointsHeaderRow();
self.appendPointsTable(searchTerm, data);
self.updatePointsHeaderSummary(data);
})
if (self.config.pointSearchEnabled) {
const mapCenter = self.getMapCenter();
self.api.searchPointsByDistance(self.profileId, searchTerm, mapCenter.lat, mapCenter.lng).then(data => {
self.removePointsNoData();
self.appendPointsHeaderRow();
self.appendPointsTable(searchTerm, data);
self.updatePointsHeaderSummary(data);
})
}
}, 0)
}
})
Expand Down
2 changes: 1 addition & 1 deletion src/js/load.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ class Application extends Component {
const pointData = new PointData(this, api, mapcontrol.map, profileId, config);
const pointDataTray = new PointDataTray(this, api, profileId, config.watermarkEnabled, config.ccLicenseEnabled);
const mapchip = new MapChip(this, config.choropleth, config.siteWideFiltersEnabled, config.restrictValues, config.defaultFilters);
const search = new Search(this, api, profileId, 2);
const profileLoader = new ProfileLoader(this, formattingConfig, api, profileId, config.config, config.watermarkEnabled, config.siteWideFiltersEnabled, config.restrictValues, config.defaultFilters, config.chartColorRange, config.ccLicenseEnabled);
const search = new Search(this, api, profileId, 2, config);
const locationInfoBox = new LocationInfoBox(this, formattingConfig);
const zoomToggle = new ZoomToggle(this);
const preferredChildToggle = new PreferredChildToggle(this);
Expand Down

0 comments on commit e1e2fd8

Please sign in to comment.