Skip to content

Commit

Permalink
Add the improvement for required inputs the form new opportunity on t…
Browse files Browse the repository at this point in the history
…he opportunities page
  • Loading branch information
Akellymourab committed Feb 29, 2024
1 parent e9397d9 commit 596f636
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
16 changes: 11 additions & 5 deletions src/modules/Entities/components/create-opportunity/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@
?>
<mc-modal :title="modalTitle" classes="create-modal create-opportunity-modal" button-label="<?php i::_e('Criar Oportunidade')?>" @open="createEntity()" @close="destroyEntity()">
<template v-if="entity && !entity.id" #default="modal">
<label><?php i::_e('Crie uma oportunidade com informações básicas') ?><br><?php i::_e('e de forma rápida') ?></label>
<label><?php i::_e('Crie uma oportunidade com informações básicas') ?><br><?php i::_e('e de forma rápida.') ?><br><br></label>
<label style="color: red"><?php i::_e('os campos com * são obrigatórios.') ?></label>
<form @submit.prevent="handleSubmit" class="create-modal__fields">
<entity-field :entity="entity" hide-required :editable="true" label="<?php i::esc_attr_e("Selecione o tipo da oportunidade") ?>" prop="type"></entity-field>
<entity-field :entity="entity" hide-required label=<?php i::esc_attr_e("Título") ?> prop="name"></entity-field>
<entity-field :entity="entity" hide-required label prop="name"><?php i::esc_attr_e("Título")?><span style="color: red;"> <?php i::_e('*') ?></span></entity-field>

<div class="create-modal__fields">
<entity-terms :entity="entity" hide-required :editable="true" title="<?php i::_e('Área de Interesse')?>" taxonomy="area"></entity-terms>
</div>

<div class="create-modal__fields">
<entity-terms :entity="entity" hide-required :editable="true" title="<?php i::_e('Área de Interesse') ?>" taxonomy="area"></entity-terms>
</div>

<div v-if="!entity.ownerEntity" class="select-list">
<label class="select-list__label"><?php i::_e('Vincule a oportunidade a uma entidade: ') ?><br></label>
Expand All @@ -34,6 +36,7 @@
<span class="itemLabel">
<input v-model="entityTypeSelected" @click="toggle()" type="radio" name="inputName" value="project" />
<span><?php i::_e('Projeto') ?> </span>
<span v-if="!entity.ownerEntity || entityTypeSelected === ''" style="color: red;"><?php i::_e('*') ?></span>
</span>

<a :class="{'disabled': entityTypeSelected!='project'}" class="selectButton"><?php i::_e('Selecionar') ?> </a>
Expand All @@ -48,6 +51,7 @@
<span class="itemLabel">
<input v-model="entityTypeSelected" @click="toggle()" type="radio" name="inputName" value="event" />
<span><?php i::_e('Evento') ?> </span>
<span v-if="!entity.ownerEntity || entityTypeSelected === ''" style="color: red;"><?php i::_e('*') ?></span>
</span>

<a :class="{'disabled': entityTypeSelected!='event'}" class="selectButton"><?php i::_e('Selecionar') ?> </a>
Expand All @@ -62,6 +66,7 @@
<span class="itemLabel">
<input v-model="entityTypeSelected" @click="toggle()" type="radio" name="inputName" value="space" />
<span><?php i::_e('Espaço') ?> </span>
<span v-if="!entity.ownerEntity || entityTypeSelected === ''" style="color: red;"><?php i::_e('*') ?></span>
</span>

<a :class="{'disabled': entityTypeSelected!='space'}" class="selectButton"><?php i::_e('Selecionar') ?> </a>
Expand All @@ -76,6 +81,7 @@
<span class="itemLabel">
<input v-model="entityTypeSelected" @click="toggle()" type="radio" name="inputName" value="agent" />
<span><?php i::_e('Agente') ?> </span>
<span v-if="!entity.ownerEntity || entityTypeSelected === ''" style="color: red;"><?php i::_e('*') ?></span>
</span>

<a :class="{'disabled': entityTypeSelected!='agent'}" class="selectButton"><?php i::_e('Selecionar') ?> </a>
Expand Down
2 changes: 1 addition & 1 deletion src/modules/Entities/components/entity-terms/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<div v-if="taxomyExists() && (editable || entity.terms?.[taxonomy].length > 0)" :class="['entity-terms', classes, error]">
<div class="entity-terms__header">
<mc-title tag="h4" :short-length="0" size="medium" class="bold">{{title ?? taxonomy}}</mc-title>
<span v-if="required && !hideRequired" class="entity-terms__required">*<?=i::__('obrigatório');?></span>
<span class="entity-terms__required" style="color: red">*</span>
</div>

<mc-popover v-if="allowInsert && editable" openside="down-right" @open="loadTerms()" :title="popoverTitle">
Expand Down

0 comments on commit 596f636

Please sign in to comment.