Skip to content

Commit

Permalink
fix naming conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
CollinBeczak committed Dec 3, 2024
1 parent d6ded09 commit 4f49a99
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/components/ChallengePane/ChallengePane.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ const ShowChallengeListTogglesInternal = (props) => {
<input
type="checkbox"
className="mr-checkbox-toggle mr-mr-1 mr-mb-6 mr-ml-4"
checked={props.filteringGlobal}
checked={props.showingGlobal}
onChange={() => {
props.setSearchFilters({ filterGlobal: !props.filteringGlobal })
props.setSearchFilters({ global: !props.showingGlobal })
}}

Check warning on line 52 in src/components/ChallengePane/ChallengePane.jsx

View check run for this annotation

Codecov / codecov/patch

src/components/ChallengePane/ChallengePane.jsx#L51-L52

Added lines #L51 - L52 were not covered by tests
/>
<div className="mr-text-sm mr-mx-1"><FormattedMessage {...messages.showGlobalLabel} /></div>
Expand Down Expand Up @@ -127,7 +127,7 @@ export class ChallengePane extends Component {

render() {
const showingArchived = this.props.history.location.search.includes("archived=true");
const filteringGlobal = this.props.history.location.search.includes("filterGlobal=true")
const showingGlobal = this.props.history.location.search.includes("global=true")
const challengeStatus = [ChallengeStatus.ready,
ChallengeStatus.partiallyLoaded,
ChallengeStatus.none,
Expand Down Expand Up @@ -166,7 +166,7 @@ export class ChallengePane extends Component {
<div className="mr-p-6 lg:mr-flex mr-cards-inverse">
<div className="mr-flex-0">
<LocationFilter {...this.props} />
<ShowChallengeListToggles showingArchived={showingArchived} filteringGlobal={filteringGlobal} {...this.props} />
<ShowChallengeListToggles showingArchived={showingArchived} showingGlobal={showingGlobal} {...this.props} />
<ChallengeResults {...this.props} />
</div>
<div className="mr-flex-1">
Expand Down
2 changes: 1 addition & 1 deletion src/components/HOCs/WithSearchRoute/WithSearchRoute.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const WithSearchRoute = function(WrappedComponent, searchGroup) {
query: param => this.props.setSearch(param),
challengeSearch: param => this.props.setChallengeSearchMapBounds(toLatLngBounds(param), true),
archived: param => this.props.setSearchFilters({ archived: param === "true" }),
filterGlobal: param => this.props.setSearchFilters({ filterGlobal: param === "true" })
global: param => this.props.setSearchFilters({ global: param === "true" })
}

state = {
Expand Down
4 changes: 2 additions & 2 deletions src/services/Challenge/Challenge.js
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,8 @@ export const extendedFind = function (criteria, limit = RESULTS_PER_PAGE, admin
queryParams.ca = filters.archived;
}

if (filters.filterGlobal) {
queryParams.fg = filters.filterGlobal;
if (filters.global) {
queryParams.cg = filters.global;
}

Check warning on line 449 in src/services/Challenge/Challenge.js

View check run for this annotation

Codecov / codecov/patch

src/services/Challenge/Challenge.js#L446-L449

Added lines #L446 - L449 were not covered by tests
// Keywords/tags can come from both the the query and the filter, so we need to
Expand Down
2 changes: 1 addition & 1 deletion src/services/Challenge/ChallengeGlobal/ChallengeGlobal.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const challengePassesGlobalFilter = function(filter, challenge) {
if (filter.filterGlobal) {
if (filter.global) {
return challenge.isGlobal === false
}

Expand Down
6 changes: 3 additions & 3 deletions src/services/Search/Search.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export const PARAMS_MAP = {
tags: 'tt',
excludeTasks: 'tExcl',
archived: "ca",
filterGlobal: "fg"
global: "cg"
}


Expand Down Expand Up @@ -159,8 +159,8 @@ export const generateSearchParametersString = (filters, boundingBox, savedChalle
if (filters.archived) {
searchParameters[PARAMS_MAP.archived] = filters.archived;
}
if (filters.filterGlobal) {
searchParameters[PARAMS_MAP.filterGlobal] = filters.filterGlobal;
if (filters.global) {
searchParameters[PARAMS_MAP.global] = filters.global;
}

Check warning on line 164 in src/services/Search/Search.js

View check run for this annotation

Codecov / codecov/patch

src/services/Search/Search.js#L162-L164

Added lines #L162 - L164 were not covered by tests
if (filters.reviewRequestedBy) {
searchParameters[PARAMS_MAP.reviewRequestedBy] = filters.reviewRequestedBy
Expand Down

0 comments on commit 4f49a99

Please sign in to comment.