Skip to content

Commit

Permalink
Took into account the case where, in synthese, we can export less tha…
Browse files Browse the repository at this point in the history
…n we can observe.
  • Loading branch information
Christophe-Ramet committed Jan 29, 2025
1 parent 7ee12c8 commit 0023abe
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Téléchargement
</h5>
<h5
*ngIf="tooManyObs"
*ngIf="tooManyObs && !tooManyObsForExport"
class="modal-title"
id="modalLabel"
>
Expand Down Expand Up @@ -46,7 +46,7 @@
</div>

<div
*ngIf="syntheseConfig.NB_MAX_OBS_EXPORT > syntheseConfig.NB_MAX_OBS_MAP"
*ngIf="!tooManyObsForExport"
class="alert alert-warning"
role="alert"
>
Expand All @@ -56,7 +56,19 @@
</div>
</div>

<div *ngIf="!tooManyObs || syntheseConfig.NB_MAX_OBS_EXPORT > syntheseConfig.NB_MAX_OBS_MAP">
<div *ngIf="tooManyObsForExport">
<div
class="alert alert-danger"
role="alert"
>
<b>Export impossible !</b>
<p>Trop d'observations à exporter.</p>
<p>Un export depuis le modèle de synthèse ne peux dépasser {{ syntheseConfig.NB_MAX_OBS_EXPORT }} observations.
Merci de passer par le module d'export.
</div>

</div>
<div *ngIf="!tooManyObsForExport">
<div class="my-3 pt-2">
<h5 class="second-color">Télécharger les observations</h5>
<button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class SyntheseModalDownloadComponent {
public syntheseConfig = null;

@Input() tooManyObs = false;

@Input() tooManyObsForExport = false;
constructor(
public activeModal: NgbActiveModal,
public _dataService: SyntheseDataService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { CruvedStoreService } from '@geonature_common/service/cruved-store.servi
import { SyntheseInfoObsComponent } from '@geonature/shared/syntheseSharedModule/synthese-info-obs/synthese-info-obs.component';
import { ConfigService } from '@geonature/services/config.service';
import { FormArray, FormControl } from '@angular/forms';
import {SyntheseStoreService} from "@geonature/syntheseModule/services/store.service";
@Component({
selector: 'pnx-synthese-list',
templateUrl: 'synthese-list.component.html',
Expand Down Expand Up @@ -53,7 +54,8 @@ export class SyntheseListComponent implements OnInit, OnChanges, AfterContentChe
public sanitizer: DomSanitizer,
public ref: ChangeDetectorRef,
public _cruvedStore: CruvedStoreService,
public config: ConfigService
public config: ConfigService,
private _syntheseStore: SyntheseStoreService
) {
this.SYNTHESE_CONFIG = this.config.SYNTHESE;
}
Expand Down Expand Up @@ -167,9 +169,10 @@ export class SyntheseListComponent implements OnInit, OnChanges, AfterContentChe
}

openDownloadModal() {
this.ngbModal.open(SyntheseModalDownloadComponent, {
const modalRef = this.ngbModal.open(SyntheseModalDownloadComponent, {
size: 'lg',
});
modalRef.componentInstance.tooManyObsForExport = (this._syntheseStore.idSyntheseList.length > this.config.SYNTHESE.NB_MAX_OBS_EXPORT)
}

getRowClass() {
Expand Down
1 change: 1 addition & 0 deletions frontend/src/app/syntheseModule/synthese.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export class SyntheseComponent implements OnInit {
});
modalRef.componentInstance.queryString = this.searchService.buildQueryUrl(formParams);
modalRef.componentInstance.tooManyObs = true;
modalRef.componentInstance.tooManyObsForExport = (this._syntheseStore.idSyntheseList.length > this.config.SYNTHESE.NB_MAX_OBS_EXPORT)
}

// Store geojson
Expand Down

0 comments on commit 0023abe

Please sign in to comment.