mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
Merge branch 'issue494_activity_field_visibility' into 'master'
Activity display fields based on ActivityType + show error message See merge request Chill-Projet/chill-bundles!376
This commit is contained in:
commit
f04474c82f
@ -11,6 +11,8 @@ and this project adheres to
|
|||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
<!-- write down unreleased development here -->
|
<!-- write down unreleased development here -->
|
||||||
|
* [activity] display error messages above the form in creating a new location (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/481)
|
||||||
|
* [activity] show required field in activity edit/new by an asterix in the vuejs fields (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/494)
|
||||||
* [ACL] fix allow to see the course, event if the scope'course does not contains the scope's user
|
* [ACL] fix allow to see the course, event if the scope'course does not contains the scope's user
|
||||||
* [search] enforce limit of results for fetching rsults by search api https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/576
|
* [search] enforce limit of results for fetching rsults by search api https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/576
|
||||||
* [activity] Fix delete button for document (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/554)
|
* [activity] Fix delete button for document (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/554)
|
||||||
|
@ -125,7 +125,9 @@ class ActivityType extends AbstractType
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($activityType->isVisible('socialIssues') && $accompanyingPeriod) {
|
if ($activityType->isVisible('socialIssues') && $accompanyingPeriod) {
|
||||||
$builder->add('socialIssues', HiddenType::class);
|
$builder->add('socialIssues', HiddenType::class, [
|
||||||
|
'required' => $activityType->getSocialIssuesVisible() === 2
|
||||||
|
]);
|
||||||
$builder->get('socialIssues')
|
$builder->get('socialIssues')
|
||||||
->addModelTransformer(new CallbackTransformer(
|
->addModelTransformer(new CallbackTransformer(
|
||||||
static function (iterable $socialIssuesAsIterable): string {
|
static function (iterable $socialIssuesAsIterable): string {
|
||||||
@ -151,7 +153,9 @@ class ActivityType extends AbstractType
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($activityType->isVisible('socialActions') && $accompanyingPeriod) {
|
if ($activityType->isVisible('socialActions') && $accompanyingPeriod) {
|
||||||
$builder->add('socialActions', HiddenType::class);
|
$builder->add('socialActions', HiddenType::class, [
|
||||||
|
'required' => $activityType->getSocialActionsVisible() === 2
|
||||||
|
]);
|
||||||
$builder->get('socialActions')
|
$builder->get('socialActions')
|
||||||
->addModelTransformer(new CallbackTransformer(
|
->addModelTransformer(new CallbackTransformer(
|
||||||
static function (iterable $socialActionsAsIterable): string {
|
static function (iterable $socialActionsAsIterable): string {
|
||||||
@ -339,7 +343,9 @@ class ActivityType extends AbstractType
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($activityType->isVisible('location')) {
|
if ($activityType->isVisible('location')) {
|
||||||
$builder->add('location', HiddenType::class)
|
$builder->add('location', HiddenType::class, [
|
||||||
|
'required' => $activityType->getLocationVisible() === 2
|
||||||
|
])
|
||||||
->get('location')
|
->get('location')
|
||||||
->addModelTransformer(new CallbackTransformer(
|
->addModelTransformer(new CallbackTransformer(
|
||||||
static function (?Location $location): string {
|
static function (?Location $location): string {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<teleport to="#location">
|
<teleport to="#location">
|
||||||
<div class="mb-3 row">
|
<div class="mb-3 row">
|
||||||
<label class="col-form-label col-sm-4">
|
<label :class="locationClassList">
|
||||||
{{ $t("activity.location") }}
|
{{ $t("activity.location") }}
|
||||||
</label>
|
</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
@ -41,6 +41,12 @@ export default {
|
|||||||
NewLocation,
|
NewLocation,
|
||||||
VueMultiselect,
|
VueMultiselect,
|
||||||
},
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
locationClassList:
|
||||||
|
`col-form-label col-sm-4 ${document.querySelector('input#chill_activitybundle_activity_location').getAttribute('required') ? 'required' : ''}`,
|
||||||
|
}
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(["activity", "availableLocations"]),
|
...mapState(["activity", "availableLocations"]),
|
||||||
...mapGetters(["suggestedEntities"]),
|
...mapGetters(["suggestedEntities"]),
|
||||||
|
@ -18,6 +18,12 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-slot:body>
|
<template v-slot:body>
|
||||||
<form>
|
<form>
|
||||||
|
<div class="alert alert-warning" v-if="errors.length">
|
||||||
|
<ul>
|
||||||
|
<li v-for="(e, i) in errors" :key="i">{{ e }}</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-floating mb-3">
|
<div class="form-floating mb-3">
|
||||||
<select class="form-select form-select-lg" id="type" required v-model="selectType">
|
<select class="form-select form-select-lg" id="type" required v-model="selectType">
|
||||||
<option selected disabled value="">{{ $t('activity.choose_location_type') }}</option>
|
<option selected disabled value="">{{ $t('activity.choose_location_type') }}</option>
|
||||||
@ -54,11 +60,6 @@
|
|||||||
<label for="email">{{ $t('activity.location_fields.email') }}</label>
|
<label for="email">{{ $t('activity.location_fields.email') }}</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="alert alert-warning" v-if="errors.length">
|
|
||||||
<ul>
|
|
||||||
<li v-for="(e, i) in errors" :key="i">{{ e }}</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</form>
|
</form>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:footer>
|
<template v-slot:footer>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
<div class="mb-3 row">
|
<div class="mb-3 row">
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
<label class="col-form-label">{{ $t('activity.social_issues') }}</label>
|
<label :class="socialIssuesClassList">{{ $t('activity.social_issues') }}</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-8">
|
<div class="col-8">
|
||||||
|
|
||||||
@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
<div class="mb-3 row">
|
<div class="mb-3 row">
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
<label class="col-form-label">{{ $t('activity.social_actions') }}</label>
|
<label :class="socialActionsClassList">{{ $t('activity.social_actions') }}</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-8">
|
<div class="col-8">
|
||||||
|
|
||||||
@ -94,6 +94,10 @@ export default {
|
|||||||
issueIsLoading: false,
|
issueIsLoading: false,
|
||||||
actionIsLoading: false,
|
actionIsLoading: false,
|
||||||
actionAreLoaded: false,
|
actionAreLoaded: false,
|
||||||
|
socialIssuesClassList:
|
||||||
|
`col-form-label ${document.querySelector('input#chill_activitybundle_activity_socialIssues').getAttribute('required') ? 'required' : ''}`,
|
||||||
|
socialActionsClassList:
|
||||||
|
`col-form-label ${document.querySelector('input#chill_activitybundle_activity_socialActions').getAttribute('required') ? 'required' : ''}`,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
{{ form_row(edit_form.socialActions) }}
|
{{ form_row(edit_form.socialActions) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{%- if edit_form.socialIssues is defined or edit_form.socialIssues is defined -%}
|
{%- if edit_form.socialIssues is defined or edit_form.socialActions is defined -%}
|
||||||
<div id="social-issues-acc"></div>
|
<div id="social-issues-acc"></div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
{{ form_row(form.socialActions) }}
|
{{ form_row(form.socialActions) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{%- if form.socialIssues is defined or form.socialIssues is defined -%}
|
{%- if form.socialIssues is defined or form.socialActions is defined -%}
|
||||||
<div id="social-issues-acc"></div>
|
<div id="social-issues-acc"></div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user