-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
28 changed files
with
931 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { GetResponse, SearchGridFilters } from "../../@types/app_espaceco"; | ||
import { Grids } from "../../@types/espaceco"; | ||
import { jsonFetch } from "../../modules/jsonFetch"; | ||
import SymfonyRouting from "../../modules/Routing"; | ||
|
||
const search = (text: string, filters: SearchGridFilters, otherOptions: RequestInit = {}) => { | ||
const queryParams = { text: `${text}%` }; | ||
["searchBy", "fields"].forEach((p) => { | ||
if (filters[p] !== undefined) { | ||
queryParams[p] = filters[p].join(","); | ||
} | ||
}); | ||
if (filters.adm !== undefined) { | ||
queryParams["adm"] = new Boolean(filters.adm).toString(); | ||
} | ||
|
||
const url = SymfonyRouting.generate("cartesgouvfr_api_espaceco_grid_search", queryParams); | ||
return jsonFetch<GetResponse<Grids>>(url, { | ||
...otherOptions, | ||
}); | ||
}; | ||
|
||
const grid = { search }; | ||
|
||
export default grid; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
import community from "./community"; | ||
import grid from "./grid"; | ||
|
||
const api = { | ||
community, | ||
grid, | ||
}; | ||
|
||
export default api; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { declareComponentKeys } from "i18nifty"; | ||
import { Translations } from "../../../../i18n/i18n"; | ||
|
||
// traductions | ||
export const { i18n } = declareComponentKeys<"no_results" | "loading">()("Search"); | ||
|
||
export const SearchFrTranslations: Translations<"fr">["Search"] = { | ||
no_results: "Aucun résultat", | ||
loading: "Recherche en cours ...", | ||
}; | ||
|
||
export const SearchEnTranslations: Translations<"en">["Search"] = { | ||
no_results: "No results", | ||
loading: "Searching ...", | ||
}; |
Oops, something went wrong.