Skip to content

Commit

Permalink
Merge pull request #432 from PnX-SI/develop
Browse files Browse the repository at this point in the history
Develop >> Master / MAJ doc
  • Loading branch information
camillemonchicourt authored Sep 23, 2018
2 parents 1fc4411 + fd17f35 commit 626e7b6
Show file tree
Hide file tree
Showing 9 changed files with 176 additions and 137 deletions.
70 changes: 35 additions & 35 deletions contrib/occtax/config/conf_gn_module.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,46 @@

# Allow to hide or display some fields. If hidden, database default value is used
[form_fields]
[form_fields.releve]
date_min = true
date_max = true
hour_min = true
hour_max = true
altitude_min = true
altitude_max = true
obs_technique = true
group_type = true
comment = true
[form_fields.occurrence]
obs_method = true
bio_condition = true
bio_status = true
naturalness = true
exist_proof = true
observation_status = true
diffusion_level = false
blurring = false
determiner = true
determination_method = true
sample_number_proof = true
digital_proof = true
non_digital_proof = true
source_status = false
comment = true
[form_fields.counting]
life_stage = true
sex = true
obj_count = true
type_count = true
count_min = true
count_max = true
validation_status = false
date_min = true
date_max = true
hour_min = true
hour_max = true
altitude_min = true
altitude_max = true
obs_technique = true
group_type = true
comment_releve = true
obs_method = true
bio_condition = true
bio_status = true
naturalness = true
exist_proof = true
observation_status = true
diffusion_level = false
blurring = false
determiner = true
determination_method = true
sample_number_proof = true
digital_proof = true
non_digital_proof = true
source_status = false
comment_occ = true
life_stage = true
sex = true
obj_count = true
type_count = true
count_min = true
count_max = true
validation_status = false

# Switch the form input in free text input (true) or in select input (false)
observers_txt = false

# id of the observator list -- utilisateurs.t_menus
id_observers_list = 1

# id of the taxon list -- taxonomie.bib_listes. Use for the taxonomy search in the occtax forml
id_taxon_list = 500
id_taxon_list = 100

# Add a validation rule between Proof fields. If true, fulfil at least one proof in the form
digital_proof_validator = true
Expand Down
56 changes: 24 additions & 32 deletions contrib/occtax/config/conf_schema_toml.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class MapListConfig(Schema):



class ReleveFormConfig(Schema):
class FormConfig(Schema):
date_min = fields.Boolean(missing=True)
date_max = fields.Boolean(missing=True)
hour_min = fields.Boolean(missing=True)
Expand All @@ -18,38 +18,30 @@ class ReleveFormConfig(Schema):
altitude_max = fields.Boolean(missing=True)
obs_technique = fields.Boolean(missing=False)
group_type = fields.Boolean(missing=False)
comment = fields.Boolean(missing=True)

class OccurrenceFormConfig(Schema):
obs_method = fields.Boolean(missing=True)
bio_condition = fields.Boolean(missing=True)
bio_status = fields.Boolean(missing=True)
naturalness = fields.Boolean(missing=True)
exist_proof = fields.Boolean(missing=True)
observation_status = fields.Boolean(missing=True)
diffusion_level = fields.Boolean(missing=False)
blurring = fields.Boolean(missing=False)
determiner = fields.Boolean(missing=True)
determination_method = fields.Boolean(missing=True)
sample_number_proof = fields.Boolean(missing=True)
digital_proof = fields.Boolean(missing=True)
non_digital_proof = fields.Boolean(missing=True)
source_status = fields.Boolean(missing=False)
comment = fields.Boolean(missing=True)

class CountingFormConfig(Schema):
life_stage = fields.Boolean(missing=True)
sex = fields.Boolean(missing=True)
obj_count = fields.Boolean(missing=True)
type_count = fields.Boolean(missing=True)
count_min = fields.Boolean(missing=True)
count_max = fields.Boolean(missing=True)
validation_status = fields.Boolean(missing=False)
comment_releve = fields.Boolean(missing=True)
obs_method = fields.Boolean(missing=True)
bio_condition = fields.Boolean(missing=True)
bio_status = fields.Boolean(missing=True)
naturalness = fields.Boolean(missing=True)
exist_proof = fields.Boolean(missing=True)
observation_status = fields.Boolean(missing=True)
diffusion_level = fields.Boolean(missing=False)
blurring = fields.Boolean(missing=False)
determiner = fields.Boolean(missing=True)
determination_method = fields.Boolean(missing=True)
sample_number_proof = fields.Boolean(missing=True)
digital_proof = fields.Boolean(missing=True)
non_digital_proof = fields.Boolean(missing=True)
source_status = fields.Boolean(missing=False)
comment_occ = fields.Boolean(missing=True)
life_stage = fields.Boolean(missing=True)
sex = fields.Boolean(missing=True)
obj_count = fields.Boolean(missing=True)
type_count = fields.Boolean(missing=True)
count_min = fields.Boolean(missing=True)
count_max = fields.Boolean(missing=True)
validation_status = fields.Boolean(missing=False)

class FormConfig(Schema):
releve = fields.Nested(ReleveFormConfig, missing=dict())
occurrence = fields.Nested(OccurrenceFormConfig, missing=dict())
counting = fields.Nested(CountingFormConfig, missing=dict())

default_map_list_conf = [
{ "prop": "taxons", "name": "Taxon" },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="row row-0 row-counting">
<div *ngIf="occtaxConfig.form_fields.counting.life_stage" class="col-xs-12 col-sm-12 col-md-12 col-lg-4 col-counting padding-sm">
<div *ngIf="occtaxConfig.form_fields.life_stage" class="col-xs-12 col-sm-12 col-md-12 col-lg-4 col-counting padding-sm">
<pnx-nomenclature
label="{{ 'Counting.LifeStage' | translate }}"
[parentFormControl]="formArray.controls[index].controls.id_nomenclature_life_stage"
Expand All @@ -8,7 +8,7 @@
[group2Inpn]="fs.currentTaxon.group2_inpn">
</pnx-nomenclature>
</div>
<div *ngIf="occtaxConfig.form_fields.counting.sex" class="col-xs-12 col-sm-12 col-md-12 col-lg-3 col-counting padding-sm">
<div *ngIf="occtaxConfig.form_fields.sex" class="col-xs-12 col-sm-12 col-md-12 col-lg-3 col-counting padding-sm">
<pnx-nomenclature
label="{{ 'Counting.Sex' | translate }}"
[parentFormControl]="formArray.controls[index].controls.id_nomenclature_sex"
Expand All @@ -17,7 +17,7 @@
[group2Inpn]="fs.currentTaxon.group2_inpn">
</pnx-nomenclature>
</div>
<div *ngIf="occtaxConfig.form_fields.counting.obj_count" class="col-xs-12 col-sm-12 col-md-12 col-lg-5 col-counting padding-sm">
<div *ngIf="occtaxConfig.form_fields.obj_count" class="col-xs-12 col-sm-12 col-md-12 col-lg-5 col-counting padding-sm">
<pnx-nomenclature
label="{{ 'Counting.CountingObject' | translate }}"
[parentFormControl]="formArray.controls[index].controls.id_nomenclature_obj_count"
Expand All @@ -29,7 +29,7 @@

</div>
<div class="form-group row row-0">
<div *ngIf="occtaxConfig.form_fields.counting.type_count" class="col-xs-12 col-sm-12 col-md-12 col-lg-5 col-counting padding-sm">
<div *ngIf="occtaxConfig.form_fields.type_count" class="col-xs-12 col-sm-12 col-md-12 col-lg-5 col-counting padding-sm">
<pnx-nomenclature
#typeDenombrement
label="{{ 'Counting.CountingType' | translate }}"
Expand All @@ -39,14 +39,14 @@
[group2Inpn]="fs.currentTaxon.group2_inpn">
</pnx-nomenclature>
</div>
<div *ngIf="occtaxConfig.form_fields.counting.count_min" class="col-xs-12 col-sm-12 col-md-12 col-lg-3 col-counting padding-sm">
<div *ngIf="occtaxConfig.form_fields.count_min" class="col-xs-12 col-sm-12 col-md-12 col-lg-3 col-counting padding-sm">
<div class="form-group" >
<small> {{ 'Counting.NumberMin' | translate }} </small>
<input [ngClass]="{'is-invalid' : formArray.controls[index].errors?.invalidCount}" class="form-control form-control-sm" type="number" min="0"
[formControl]="formArray.controls[index].controls.count_min">
</div>
</div>
<div *ngIf="occtaxConfig.form_fields.counting.count_max" class="col-xs-12 col-sm-12 col-md-12 col-lg-3 col-counting padding-sm">
<div *ngIf="occtaxConfig.form_fields.count_max" class="col-xs-12 col-sm-12 col-md-12 col-lg-3 col-counting padding-sm">
<div class="form-group">
<small> {{ 'Counting.NumberMax' | translate }} </small>
<input [ngClass]="{'is-invalid' : formArray.controls[index].errors?.invalidCount}" class="form-control form-control-sm" type="number" min="0"
Expand All @@ -66,7 +66,7 @@
</small>
</div>
<div class="form-group row row-0">
<div *ngIf="occtaxConfig.form_fields.counting.validation_status" class="col-xs-12 col-sm-12 col-md-12 col-lg-5 col-counting padding-sm">
<div *ngIf="occtaxConfig.form_fields.validation_status" class="col-xs-12 col-sm-12 col-md-12 col-lg-5 col-counting padding-sm">
<pnx-nomenclature
#typeDenombrement
label="{{ 'Counting.ValidationStatus' | translate }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ export class OcctaxFormComponent implements OnInit {
finalForm.properties.date_max
);
// set hour_min/hour_max to null
if (finalForm.properties.hour_min.length == 0) {
if (finalForm.properties.hour_min && finalForm.properties.hour_min.length == 0) {
finalForm.properties.hour_min = null;
};
if (finalForm.properties.hour_max.length == 0) {
if (finalForm.properties.hour_max && finalForm.properties.hour_max.length == 0) {
finalForm.properties.hour_max = null;
};
// format nom_cite, update date, set id_releve_occtax and id_occurrence_occtax
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
</div>
</div>
<div class="row row-0">
<div *ngIf="occtaxConfig.form_fields.occurrence.observation_status" class="col-xs-12 col-sm-12 col-md-12 col-lg-4 padding-sm">
<div *ngIf="occtaxConfig.form_fields.observation_status" class="col-xs-12 col-sm-12 col-md-12 col-lg-4 padding-sm">
<pnx-nomenclature
label="{{ 'Taxon.ObservationStatus' | translate }}"
[parentFormControl]="occurrenceForm.controls.id_nomenclature_observation_status"
codeNomenclatureType="STATUT_OBS"
>
</pnx-nomenclature>
</div>
<div *ngIf="occtaxConfig.form_fields.occurrence.obs_method" class="col-xs-12 col-sm-12 col-md-12 col-lg-4 padding-sm">
<div *ngIf="occtaxConfig.form_fields.obs_method" class="col-xs-12 col-sm-12 col-md-12 col-lg-4 padding-sm">
<pnx-nomenclature
label="{{ 'Taxon.ObsMethod' | translate }}"
[parentFormControl]="occurrenceForm.controls.id_nomenclature_obs_meth"
Expand All @@ -32,7 +32,7 @@
>
</pnx-nomenclature>
</div>
<div *ngIf="occtaxConfig.form_fields.occurrence.bio_condition" class="col-xs-12 col-sm-12 col-md-12 col-lg-4 padding-sm">
<div *ngIf="occtaxConfig.form_fields.bio_condition" class="col-xs-12 col-sm-12 col-md-12 col-lg-4 padding-sm">
<pnx-nomenclature
label="{{ 'Taxon.BiologicalCondition' | translate }}"
[parentFormControl]="occurrenceForm.controls.id_nomenclature_bio_condition"
Expand All @@ -55,7 +55,7 @@

<div class="collapse" id="collapseAvance">
<div class="row row-0">
<div *ngIf="occtaxConfig.form_fields.occurrence.determination_method" class="col-xs-12 col-sm-12 col-md-12 col-lg-4 padding-sm">
<div *ngIf="occtaxConfig.form_fields.determination_method" class="col-xs-12 col-sm-12 col-md-12 col-lg-4 padding-sm">
<pnx-nomenclature
label="{{ 'Taxon.DeterminationMethod' | translate }}"
[parentFormControl]="occurrenceForm.controls.id_nomenclature_determination_method"
Expand All @@ -65,7 +65,7 @@
>
</pnx-nomenclature>
</div>
<div *ngIf="occtaxConfig.form_fields.occurrence.bio_status" class="col-xs-12 col-sm-12 col-md-12 col-lg-4 padding-sm">
<div *ngIf="occtaxConfig.form_fields.bio_status" class="col-xs-12 col-sm-12 col-md-12 col-lg-4 padding-sm">
<pnx-nomenclature
label="{{ 'Taxon.BiologicalStatus' | translate }}"
[parentFormControl]="occurrenceForm.controls.id_nomenclature_bio_status"
Expand All @@ -75,7 +75,7 @@
>
</pnx-nomenclature>
</div>
<div *ngIf="occtaxConfig.form_fields.occurrence.naturalness" class="col-xs-12 col-sm-12 col-md-12 col-lg-4 padding-sm">
<div *ngIf="occtaxConfig.form_fields.naturalness" class="col-xs-12 col-sm-12 col-md-12 col-lg-4 padding-sm">
<pnx-nomenclature
label="{{ 'Taxon.Naturalness' | translate }}"
[parentFormControl]="occurrenceForm.controls.id_nomenclature_naturalness"
Expand All @@ -88,15 +88,15 @@
</div>

<div class="row row-0">
<div *ngIf="occtaxConfig.form_fields.occurrence.determiner" class="col-xs-4 col-sm-4 col-md-4 col-lg-4 padding-sm">
<div *ngIf="occtaxConfig.form_fields.determiner" class="col-xs-4 col-sm-4 col-md-4 col-lg-4 padding-sm">
<small> {{ 'Taxon.Determiner' | translate }} </small>
<input class="form-control form-control-sm" [formControl]="occurrenceForm.controls.determiner"
type="text">
</div>
</div>

<div class="row row-0">
<div *ngIf="occtaxConfig.form_fields.occurrence.exist_proof" class="col-xs-12 col-sm-12 col-md-12 col-lg-4 padding-sm">
<div *ngIf="occtaxConfig.form_fields.exist_proof" class="col-xs-12 col-sm-12 col-md-12 col-lg-4 padding-sm">
<pnx-nomenclature
label="{{ 'Taxon.ExistProof' | translate }}"
[parentFormControl]="occurrenceForm.controls.id_nomenclature_exist_proof"
Expand All @@ -108,7 +108,7 @@
>
</pnx-nomenclature>
</div>
<div *ngIf="occtaxConfig.form_fields.occurrence.digital_proof" class="col-xs-12 col-sm-12 col-md-12 col-lg-4 padding-sm">
<div *ngIf="occtaxConfig.form_fields.digital_proof" class="col-xs-12 col-sm-12 col-md-12 col-lg-4 padding-sm">
<div class="form-group">
<small> {{ 'Taxon.DigitalProof' | translate }} </small>
<input [ngClass]="{'is-invalid' : occurrenceForm.controls.digital_proof.invalid}" class="form-control form-control-sm" [formControl]="occurrenceForm.controls.digital_proof"
Expand All @@ -119,7 +119,7 @@
{{ 'Taxon.ExistProofValidation' | translate }}
</small>
</div>
<div *ngIf="occtaxConfig.form_fields.occurrence.non_digital_proof" class="col-xs-12 col-sm-12 col-md-12 col-lg-4 padding-sm">
<div *ngIf="occtaxConfig.form_fields.non_digital_proof" class="col-xs-12 col-sm-12 col-md-12 col-lg-4 padding-sm">
<div class="form-group" >
<small> {{ 'Taxon.NonDigitalProof' | translate }} </small>
<input [ngClass]="{'is-invalid' : occurrenceForm.controls.non_digital_proof.invalid}" class="form-control form-control-sm" [formControl]="occurrenceForm.controls.non_digital_proof"
Expand All @@ -128,23 +128,23 @@
</div>
</div>
<div class="row row-0">
<div *ngIf="occtaxConfig.form_fields.occurrence.diffusion_level" class="col-xs-12 col-sm-12 col-md-12 col-lg-4 padding-sm">
<div *ngIf="occtaxConfig.form_fields.diffusion_level" class="col-xs-12 col-sm-12 col-md-12 col-lg-4 padding-sm">
<pnx-nomenclature
label="{{ 'Taxon.DiffusionLevel' | translate }}"
[parentFormControl]="occurrenceForm.controls.id_nomenclature_diffusion_level"
codeNomenclatureType="NIV_PRECIS"
>
</pnx-nomenclature>
</div>
<div *ngIf="occtaxConfig.form_fields.occurrence.blurring" class="col-xs-12 col-sm-12 col-md-12 col-lg-4 padding-sm">
<div *ngIf="occtaxConfig.form_fields.blurring" class="col-xs-12 col-sm-12 col-md-12 col-lg-4 padding-sm">
<pnx-nomenclature
label="{{ 'Taxon.Blurring' | translate }}"
[parentFormControl]="occurrenceForm.controls.id_nomenclature_blurring"
codeNomenclatureType="DEE_FLOU"
>
</pnx-nomenclature>
</div>
<div *ngIf="occtaxConfig.form_fields.occurrence.source_status" class="col-xs-12 col-sm-12 col-md-12 col-lg-4 padding-sm">
<div *ngIf="occtaxConfig.form_fields.source_status" class="col-xs-12 col-sm-12 col-md-12 col-lg-4 padding-sm">
<pnx-nomenclature
label="{{ 'Taxon.StatusSource' | translate }}"
[parentFormControl]="occurrenceForm.controls.id_nomenclature_source_status"
Expand All @@ -154,7 +154,7 @@
</div>
</div>
<div class="row row-0" id="row-commentaire">
<div *ngIf="occtaxConfig.form_fields.occurrence.comment" class="col-xs-12 col-sm-12 col-md-12 col-lg-6 padding-sm">
<div *ngIf="occtaxConfig.form_fields.comment_occ" class="col-xs-12 col-sm-12 col-md-12 col-lg-6 padding-sm">
<textarea placeholder="{{ 'Releve.Comment' | translate }}" class="form-control" [formControl]="occurrenceForm.controls.comment"
rows="2" id="commentaire">
</textarea>
Expand Down
Loading

0 comments on commit 626e7b6

Please sign in to comment.