forked from PnX-SI/gn_module_monitoring
-
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.
* feat(front): wip sites_groups component and svc * WIP feat(front): DataTable sites_groups - Table with specific data value (OK) - Table with sort column (OK) - Datatable , select row event and change color (wip). Reviewed-by: andriac [Refs ticket]: #4 * feat(front): Datatable format and selected row - Get and display data from group_site database (OK) - Selecting row and get id of row table (OK) Improve : - improve assign colname table outside the component (maybe into the class folder ?) Todo/next: - Filtering table - Add action column to table - refactor code by creating component for the ngx-datable in order to reuse component for other data Reviewed-by: andriac [Refs ticket]: #4 * feat(front): Filtering table (OK) Function filtering is working on each column Button filtering hide/display filter inputs (OK) TODO: - check for "help" icon and description for each column if description present - Check if multiple rows and pages if it's working Reviewed-by: andriac [Refs ticket]: #4 * feat(front): wip server pagination & filtering * feat(front): add sorting capability and fixes Fix: keep filters (sort and filters) on when changing pages Feat: remove useless id column Feat: add sorting * fix(db): change trigger to constraint (migrations) Delete the trigger and create check constraint on id_nomenclature column Reviewed-by: andriacap [Refs ticket]: #3 * refactor: Custom type Geojson and group properties Create custom type geojson and build properties into marshmallow schema according to this type of Geojson [Refs ticket]: #3 * refactor: site component with site-service add function to site.services.ts [Refs ticket]: #4 * refactor: create datatable component and service Separate of concern for all about table (service and component) and all about sites (service and component) reviewed_by: andriacap [Refs ticket]: #3 * fix: change offset to page change offset name to page for paginated Reviewed-by: andriacap [Refs ticket]: #4 * merge: merge interface and type merge site_group.service.ts delete site.service.ts add interfaces re arrange code from branch front-site-interface Reviewed-by: andriacap [Refs ticket]: #4 * feat: details properties sites groups Create properties components to display properties of sites_groups Adding route with id according to the site group selected Reviewed-by: andriacap [Refs ticket]: #4 * feat: display groups sites's child Display group site child into table and uder properties Use routing and id params to display property of groups site Create service site Add logic to check routing and child route to display reactive component properties and table Reviewed-by: andriacap [Refs ticket]: #4 * refactor(front): rename interfaces, remove classes Better types * feat(front): get all geometries For sites and sites_groups * feat(front): WIP: geojson service to create layers And features groups since geojson component accumulated layers without cleaning them... * feat(front): implemented select capability Need to refact a lot! * feat(api): add route to get one site_group by id * fix(front): too much / * feat(front): add get sites_group from id * fix(front): add possibility to provide Geometry To setMapData * refactor(front): sites and sites_groups component To extend a base component to gather the same methods at one place To use route children and router-outlet properly To add some rxjs operators To move some common interfaces/functions * fix(front): fix filters by adding baseFilters * feat: edit sitegroups Create edit-service Create observable to update object to edit according to form component Adapt function service of monitoring object to sites and sitesgroups WIP: - adapt remaining function of monitoring object inside form-component-g - create an object which inherit of patch/post/delete method with - think about object with ObjectType of sites_group , sites, observation ? , visit ? - reload properties or update data of properties table after update data Reviewed-by:andriacap [Refs_ticket]: #4 * feat: edit sitegroups Improving route 'patch' Adding reload properties when sitegroups is updated Refactoring EditService for more readability Reviewed-by: andriacap [Ref_ticket]: #4 * feat: improve edit Add method to define objectType according to service used (site or gpsite) Rewied-by: andriacap [Refs_ticket]: #4 * feat: improve rendering front "edit" and "add" Adding global object service to set object type and variable "add" or "edit" button Reviewed-by: andriacap [Refs_ticket]: #4 * feat: improving patch method object Adding service to share request patch,get in order to to re-use the service in form component according to the type pass inside the formcomponent Adding decorator errorhandler for blueprint routes Reviewed-by:andriacap [Refs_ticket]: #4 * feat: create site group method with form Route create with form component Using location pacakage to choose between edit form or init sitegroup (see to improve that) Rewiewed-by: andriacap [Refs ticket]: #4 * feat: delete site_group component Add route back Add site_group from front form component Reviewed-by:andriac [Refs_ticket]: #4 * chore(api): removed unused code * style(config): apply formatter * chore(front): removed unused code & console.log * feat(front): removed display map button As it was ugly * refactor(front): remove Object for keys As there is an Angular pipe to get keys and values Also removed console.log Removed unused code * style(front): reformat routes * refactor(front): add create component To isolate functionnalities * chore(front): remove unused services * chore(front): removed usused code * chore(api): remove string package And fix if that cannot be reached * chore(api): removed unused comment * chore(front): removed console.log and comments * chore(api): removed unused code and log --------- Co-authored-by: Andria Capai <[email protected]>
- Loading branch information
Showing
55 changed files
with
2,397 additions
and
60 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
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
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 |
---|---|---|
@@ -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.