Skip to content

Commit

Permalink
Merge pull request #297 from RedeMapas/47-oportunidade-no-permitir-o-…
Browse files Browse the repository at this point in the history
…cadastro-de-uma-oportunidade-com-inscries-j-encerradas

FIX - não permitir cadastros de inscrições já encerradas
  • Loading branch information
lpirola authored Aug 28, 2024
2 parents c31ca9e + 00f37e8 commit c0423db
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ app.component('opportunity-basic-info' , {
lastPhase () {
const phase = this.phases.find(item => item.isLastPhase);
return phase;
}
},
today() {
return new Date();
},
registrationToMinDate() {
return this.entity.registrationFrom?._date &&
this.entity.registrationFrom?._date > this.today
? this.entity.registrationFrom?._date
: this.today;
},
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
<?php $this->applyTemplateHook('opportunity-basic-info','before')?>
<div class="grid-12">
<?php $this->applyTemplateHook('opportunity-basic-info','begin')?>
<entity-field :entity="entity" prop="registrationFrom" :max="entity.registrationTo?._date" :autosave="3000" classes="col-6 sm:col-12"></entity-field>
<entity-field :entity="entity" prop="registrationTo" :min="entity.registrationFrom?._date" :autosave="3000" classes="col-6 sm:col-12"></entity-field>
<entity-field :entity="entity" prop="registrationFrom" :min="today" :max="entity.registrationTo?._date" :autosave="3000" classes="col-6 sm:col-12"></entity-field>
<entity-field :entity="entity" prop="registrationTo" :min="registrationToMinDate" :autosave="3000" classes="col-6 sm:col-12"></entity-field>

<entity-field v-if="lastPhase" :entity="lastPhase" prop="publishTimestamp" :autosave="3000" classes="col-6">
<entity-field v-if="lastPhase" :entity="lastPhase" prop="publishTimestamp" :min="this.entity.registrationTo?._date || today" :autosave="3000" classes="col-6">
<label><?= i::__("Publicação final de resultados (data e hora)") ?></label>
</entity-field>
<?php $this->applyTemplateHook('opportunity-basic-info','after')?>
Expand Down

0 comments on commit c0423db

Please sign in to comment.