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.
refactor(front): rename interfaces, remove classes
Better types
- Loading branch information
Maxime Vergez
committed
Jan 23, 2023
1 parent
dfd39fd
commit 5baaaa6
Showing
11 changed files
with
57 additions
and
167 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,67 +1,13 @@ | ||
import { ISite, JsonData } from "../interfaces/geom"; | ||
import { GeoJSON } from "geojson"; | ||
|
||
export enum columnNameSite{ | ||
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" | ||
altitude_min = "Alt.min", | ||
} | ||
|
||
export const extendedDetailsSite= { | ||
export const extendedDetailsSite = { | ||
...columnNameSite, | ||
base_site_description: "Description", | ||
}; | ||
export class MonitoringSite implements ISite { | ||
altitude_max: number; | ||
altitude_min: number; | ||
base_site_code: string; | ||
base_site_description?: string; | ||
base_site_name: string; | ||
data: JsonData; | ||
first_use_date: string; | ||
geometry: GeoJSON.FeatureCollection; | ||
id_base_site: number; | ||
id_nomenclature_type_site?: number; | ||
last_visit?: Date; | ||
meta_create_date: Date; | ||
meta_update_date: Date; | ||
nb_visits: number; | ||
uuid_base_site: string; | ||
|
||
constructor( | ||
altitude_max: number, | ||
altitude_min: number, | ||
base_site_code: string, | ||
base_site_description: string, | ||
base_site_name: string, | ||
data: JsonData, | ||
geometry: GeoJSON.FeatureCollection, | ||
first_use_date: string, | ||
id_base_site: number, | ||
id_nomenclature_type_site: number, | ||
last_visit: Date, | ||
meta_create_date: Date, | ||
meta_update_date: Date, | ||
nb_visits: number, | ||
uuid_base_site: string | ||
) { | ||
this.altitude_max = altitude_max; | ||
this.altitude_min = altitude_min; | ||
this.base_site_code = base_site_code; | ||
this.base_site_description = base_site_description; | ||
this.base_site_name = base_site_name; | ||
this.data = data; | ||
this.first_use_date = first_use_date; | ||
this.geometry = geometry; | ||
this.id_base_site = id_base_site; | ||
this.id_nomenclature_type_site = id_nomenclature_type_site; | ||
this.last_visit = last_visit; | ||
this.meta_create_date = meta_create_date; | ||
this.meta_update_date = meta_update_date; | ||
this.nb_visits = nb_visits; | ||
this.uuid_base_site = uuid_base_site; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export interface Column { | ||
export interface IColumn { | ||
name: string; | ||
prop: string; | ||
description?: string; | ||
|
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
export interface Page { | ||
export interface IPage { | ||
count: number; | ||
limit: number; | ||
page: number; | ||
} | ||
|
||
export interface Paginated<T> extends Page { | ||
export interface IPaginated<T> extends IPage { | ||
items: T[]; | ||
} |
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 @@ | ||
export type JsonData = { [key: string]: any }; |