forked from PnX-SI/gn_module_monitoring
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/crud/gp sites components #38
Merged
Merged
Changes from all commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
a093d9a
feat(front): wip sites_groups component and svc
ce64039
WIP feat(front): DataTable sites_groups
andriacap 3ee07bc
feat(front): Datatable format and selected row
andriacap 1ec9c79
feat(front): Filtering table (OK)
andriacap 673c180
feat(front): wip server pagination & filtering
c3194cc
feat(front): add sorting capability and fixes
4e0d1ad
fix(db): change trigger to constraint (migrations)
andriacap 15a7a10
refactor: Custom type Geojson and group properties
andriacap f10e201
refactor: site component with site-service
andriacap acf9ff2
refactor: create datatable component and service
andriacap 868348c
fix: change offset to page
andriacap 7b6340a
merge: merge interface and type
andriacap 49a9bd5
feat: details properties sites groups
andriacap 8a4e434
feat: display groups sites's child
andriacap f965a6a
refactor(front): rename interfaces, remove classes
c5e1917
feat(front): get all geometries
7580095
feat(front): WIP: geojson service to create layers
d203a11
feat(front): implemented select capability
dc09191
feat(api): add route to get one site_group by id
f6489ad
fix(front): too much /
314584a
feat(front): add get sites_group from id
73a6153
fix(front): add possibility to provide Geometry
8127226
refactor(front): sites and sites_groups component
409d81f
fix(front): fix filters by adding baseFilters
2748431
feat: edit sitegroups
andriacap 6efe45f
feat: edit sitegroups
andriacap 36e9434
feat: improve edit
andriacap de2118a
feat: improve rendering front "edit" and "add"
andriacap e72ee0a
feat: improving patch method object
andriacap 2b3632a
feat: create site group method with form
andriacap d234330
feat: delete site_group component
andriacap c4a82bf
chore(api): removed unused code
47c825c
style(config): apply formatter
601cb2c
chore(front): removed unused code & console.log
1fc5dfc
feat(front): removed display map button
36ba4e3
refactor(front): remove Object for keys
05e3fb0
style(front): reformat routes
6d1ebb7
refactor(front): add create component
ce30a88
chore(front): remove unused services
3c04ec6
chore(front): removed usused code
fca2f5a
chore(api): remove string package
7456009
chore(api): removed unused comment
c3b5b7b
chore(front): removed console.log and comments
fb0c29a
chore(api): removed unused code and log
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Empty file.
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,19 @@ | ||
from geonature.utils.errors import GeonatureApiError | ||
|
||
|
||
class InvalidUsage(GeonatureApiError): | ||
status_code = 400 | ||
|
||
def __init__(self, message, status_code=None, payload=None): | ||
GeonatureApiError.__init__(self, message, status_code) | ||
self.message = message | ||
if status_code is not None: | ||
self.status_code = status_code | ||
self.payload = payload | ||
|
||
def to_dict(self): | ||
rv = {} | ||
rv["payload"] = self.payload | ||
rv["message"] = self.message | ||
rv["status_code"] = self.status_code | ||
return (rv, self.status_code) |
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,25 +1,27 @@ | ||
{ | ||
"tree": { | ||
"module": { | ||
"site": { | ||
"visit": { | ||
"observation": null | ||
"sites_group": { | ||
"site": { | ||
"visit": { | ||
"observation": null | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"synthese" : "__MODULE.B_SYNTHESE", | ||
"synthese": "__MODULE.B_SYNTHESE", | ||
"default_display_field_names": { | ||
"user": "nom_complet", | ||
"nomenclature": "label_fr", | ||
"dataset": "dataset_name", | ||
"observer_list": "nom_liste", | ||
"taxonomy" : "__MODULE.TAXONOMY_DISPLAY_FIELD_NAME", | ||
"taxonomy": "__MODULE.TAXONOMY_DISPLAY_FIELD_NAME", | ||
"taxonomy_list": "nom_liste", | ||
"sites_group": "sites_group_name", | ||
"habitat": "lb_hab_fr", | ||
"area": "area_name", | ||
"municipality": "nom_com_dept", | ||
"site": "base_site_name" | ||
} | ||
} | ||
} |
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,30 @@ | ||
import { PageInfo } from "../interfaces/page"; | ||
import { JsonData } from "../types/jsondata"; | ||
|
||
const LIMIT = 10; | ||
|
||
type callbackFunction = (pageNumber: number, filters: JsonData) => void; | ||
|
||
export class MonitoringGeomComponent { | ||
protected getAllItemsCallback: callbackFunction; | ||
protected limit = LIMIT; | ||
public filters = {}; | ||
public baseFilters = {}; | ||
|
||
constructor() {} | ||
|
||
setPage(page: PageInfo) { | ||
this.getAllItemsCallback(page.offset + 1, this.filters); | ||
} | ||
|
||
setSort(filters: JsonData) { | ||
this.filters = { ...this.baseFilters, ...filters }; | ||
const pageNumber = 1; | ||
this.getAllItemsCallback(pageNumber, this.filters); | ||
} | ||
|
||
setFilter(filters) { | ||
this.filters = { ...this.baseFilters, ...filters }; | ||
this.getAllItemsCallback(1, this.filters); | ||
} | ||
} |
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,13 @@ | ||
export enum columnNameSite { | ||
base_site_name = "Nom", | ||
last_visit = "Dernière visite", | ||
nb_visits = "Nb. visites", | ||
base_site_code = "Code", | ||
altitude_max = "Alt.max", | ||
altitude_min = "Alt.min", | ||
} | ||
|
||
export const extendedDetailsSite = { | ||
...columnNameSite, | ||
base_site_description: "Description", | ||
}; |
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,12 @@ | ||
export enum columnNameSiteGroup { | ||
sites_group_name = "Nom", | ||
nb_sites = "Nb. sites", | ||
nb_visits = "Nb. visites", | ||
sites_group_code = "Code", | ||
} | ||
|
||
export const extendedDetailsSiteGroup = { | ||
...columnNameSiteGroup, | ||
comments: "Commentaires", | ||
sites_group_description: "Description", | ||
}; |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mettre
MA.SQLAlchemyAutoSchema
partout ?