@@ -43,21 +43,22 @@ Licensed under the Elastic License 2.0. */
4343 const triggerData: Trigger = dialogRef .value .data ?.triggerData ;
4444 const groupStates: MoreTableChoice [] =
4545 dialogRef .value .data ?.groupStates || [];
46- const observationGroupStates: MoreTableChoice [] = observationGroupStore .observationGroups .map (
47- (observationGroup ) =>
48- ({
49- label: observationGroup .title ,
50- value: observationGroup .observationGroupId ?.toString (),
51- }) as MoreTableChoice ,
52- );
46+ const observationGroupStates: MoreTableChoice [] =
47+ observationGroupStore .observationGroups .map (
48+ (observationGroup ) =>
49+ ({
50+ label: observationGroup .title ,
51+ value: observationGroup .observationGroupId ?.toString (),
52+ }) as MoreTableChoice ,
53+ );
5354 const groupPlaceholder =
5455 dialogRef .value .data ?.groupPlaceholder ||
5556 t (' global.placeholder.entireStudy' );
5657 const actionFactories = dialogRef .value .data ?.actionFactories ;
5758 const triggerFactories = dialogRef .value .data ?.triggerFactories ;
5859 const selectedObservationGroups = ref (
59- intervention .observationGroupIds ?.map ((id : number ) => id .toString ()) ?? []
60- )
60+ intervention .observationGroupIds ?.map ((id : number ) => id .toString ()) ?? [],
61+ );
6162
6263 let propInputError: string = ' ' ;
6364
@@ -244,7 +245,11 @@ Licensed under the Elastic License 2.0. */
244245 trigger: {},
245246 actions: [],
246247 studyGroupId: studyGroupId .value ,
247- observationGroupIds: selectedObservationGroups .value ?.length ? selectedObservationGroups .value .map ((id : string ) => parseInt (id )) : [],
248+ observationGroupIds: selectedObservationGroups .value ?.length
249+ ? selectedObservationGroups .value .map ((id : string ) =>
250+ parseInt (id ),
251+ )
252+ : [],
248253 schedule: intervention .schedule ,
249254 } as Intervention ;
250255
@@ -394,7 +399,7 @@ Licensed under the Elastic License 2.0. */
394399 :class =" { 'gap-y-2': !editable }"
395400 @submit.prevent =" save()"
396401 >
397- <div class =" col-start-0 col-span-8 mt-2" :class =" { 'pb-4': !editable }" >
402+ <div class =" col-span-8 col-start-0 mt-2" :class =" { 'pb-4': !editable }" >
398403 <h5 >{{ $t('intervention.dialog.label.interventionTitle') }}*</h5 >
399404 <div v-if =" getError('title')" class =" error error-label col-span-8 mb-2" >
400405 {{ getError('title') }}
@@ -409,7 +414,7 @@ Licensed under the Elastic License 2.0. */
409414 ></InputText >
410415 </div >
411416
412- <div class =" col-start-0 col-span-8 " >
417+ <div class =" col-span-8 col-start-0 " >
413418 <h5 class =" mb-2" >{{ $t('study.props.purpose') }}</h5 >
414419 <Textarea
415420 v-model =" purpose "
@@ -420,7 +425,7 @@ Licensed under the Elastic License 2.0. */
420425 ></Textarea >
421426 </div >
422427 <div
423- class =" section-group col-start-0 col-span-8 mt-4 grid grid-cols-2 items-end lg:grid-cols-3"
428+ class =" section-group col-span-8 col-start-0 mt-4 grid grid-cols-2 items-end lg:grid-cols-3"
424429 >
425430 <h5 class =" col-span-2" >{{ $t('intervention.props.trigger') }}*</h5 >
426431 <div class =" col-span-3 col-start-3" :class =" { 'text-end': !editable }" >
@@ -467,7 +472,7 @@ Licensed under the Elastic License 2.0. */
467472 >
468473 {{ getTriggerTypeDescription(triggerType) }}
469474 </div >
470- <div class =" col-start-0 col-span-3 " >
475+ <div class =" col-span-3 col-start-0 " >
471476 <div v-if =" triggerJsonError && editable" class =" error mb-4" >
472477 {{ triggerJsonError }}
473478 </div >
@@ -488,7 +493,7 @@ Licensed under the Elastic License 2.0. */
488493 </div >
489494 </div >
490495
491- <div class =" section-group col-start-0 col-span-8 mt-8 grid grid-cols-9" >
496+ <div class =" section-group col-span-8 col-start-0 mt-8 grid grid-cols-9" >
492497 <div class =" col-span-9 grid grid-cols-2 items-end lg:grid-cols-3" >
493498 <h5 class =" lg:col-span-2" >{{ $t('intervention.props.action') }}*</h5 >
494499 <Button
@@ -528,7 +533,7 @@ Licensed under the Elastic License 2.0. */
528533 <div
529534 v-for =" (action, index) in actionsArray"
530535 :key =" index"
531- class =" col-start-0 js-action col-span-9"
536+ class =" js-action col-span-9 col-start-0 "
532537 :class =" { 'mb-4': index < actionsArray.length - 1 }"
533538 >
534539 <hr v-if =" index !== 0" class =" my-4" />
@@ -570,38 +575,46 @@ Licensed under the Elastic License 2.0. */
570575 </div >
571576 </div >
572577
573- <div class =" col-start-0 col-span-8 " >
578+ <div class =" col-span-8 col-start-0 " >
574579 <h5 v-if =" editable" class =" pb-2 font-bold" >
575- {{ editable ? $t('study.dialog.label.chooseGroups') : $t('study.props.groups') }}
580+ {{
581+ editable
582+ ? $t('study.dialog.label.chooseGroups')
583+ : $t('study.props.groups')
584+ }}
576585 </h5 >
577586 <div v-if =" editable" class =" mb-2" >
578- {{ $t('study.dialog.description.howToCreateGroups', {for: $t('intervention.plural')}) }}
587+ {{
588+ $t('study.dialog.description.howToCreateGroups', {
589+ for: $t('intervention.plural'),
590+ })
591+ }}
579592 </div >
580593 <div class =" flex gap-5" >
581- <div >
582- <div class =" mb-1" >{{ $t('studyGroup.plural')}}</div >
594+ <div >
595+ <div class =" mb-1" >{{ $t('studyGroup.plural') }}</div >
583596 <Dropdown
584- v-model =" studyGroupId "
585- :options =" groupStates "
586- option-label="label"
587- option-value="value"
588- :disabled =" ! editable "
589- class="w-fit"
590- :class =" { ' dropdown-has-value' : studyGroupId } "
591- :placeholder ="
592- studyGroupId
593- ? getLabelForChoiceValue (studyGroupId as number , groupStates )
594- : groupPlaceholder
595- ? (groupPlaceholder as string )
596- : $t (' global.placeholder.entireStudy' )
597- "
598- >
599- <template #option =" optionProps " >
600- <div class =" p-select-car-option" >
601- <span >{{ optionProps.option.label }}</span >
602- </div >
603- </template >
604- </Dropdown >
597+ v-model =" studyGroupId "
598+ :options =" groupStates "
599+ option-label="label"
600+ option-value="value"
601+ :disabled =" ! editable "
602+ class="w-fit"
603+ :class =" { ' dropdown-has-value' : studyGroupId } "
604+ :placeholder ="
605+ studyGroupId
606+ ? getLabelForChoiceValue (studyGroupId as number , groupStates )
607+ : groupPlaceholder
608+ ? (groupPlaceholder as string )
609+ : $t (' global.placeholder.entireStudy' )
610+ "
611+ >
612+ <template #option =" optionProps " >
613+ <div class =" p-select-car-option" >
614+ <span >{{ optionProps.option.label }}</span >
615+ </div >
616+ </template >
617+ </Dropdown >
605618 </div >
606619 <div >
607620 <div class =" mb-1" >{{ $t('observationGroup.plural') }}</div >
@@ -611,27 +624,35 @@ Licensed under the Elastic License 2.0. */
611624 :disabled =" ! editable "
612625 option-label="label"
613626 option-value="value"
614- :placeholder =" $t (' global.placeholder.chooseDropdownOptionDefault' )"
627+ :placeholder ="
628+ $t (' global.placeholder.chooseDropdownOptionDefault' )
629+ "
615630 :show-toggle-all =" false "
616631 class="z-top custom-multiselect-root"
617632 :panel-class =" ' custom-multiselect-panel' "
618633 >
619634 <template #value =" { value } " >
620- <span v-if =" value?.length > 0" >{{ value.map((item: string) => observationGroupStates.find(
621- (group: MoreTableChoice) => group.value === item
622- )?.label).join(', ') }}</span >
635+ <span v-if =" value?.length > 0" >{{
636+ value
637+ .map(
638+ (item: string) =>
639+ observationGroupStates.find(
640+ (group: MoreTableChoice) => group.value === item,
641+ )?.label,
642+ )
643+ .join(', ')
644+ }}</span >
623645 <span v-else class =" text-gray-400" >
624- {{ $t('global.placeholder.chooseDropdownOptionDefault') }}
625- </span >
646+ {{ $t('global.placeholder.chooseDropdownOptionDefault') }}
647+ </span >
626648 </template >
627-
628649 </MultiSelect >
629650 </div >
630651 </div >
631652 </div >
632653
633654 <div
634- class =" col-start-0 buttons col-span-8 mt-1 flex flex-row items-center justify-end text-right"
655+ class =" buttons col-span-8 col-start-0 mt-1 flex flex-row items-center justify-end text-right"
635656 >
636657 <Button class="btn-gray" @click =" cancel ()" >
637658 <span v-if =" editable" >{{ $t('global.labels.cancel') }}</span >
@@ -650,22 +671,22 @@ Licensed under the Elastic License 2.0. */
650671</template >
651672
652673<style scoped>
653- @import ' ../../styles/components/moreTable-dialogs.css' ;
674+ @import ' ../../styles/components/moreTable-dialogs.css' ;
654675
655- :deep(.dropdown-btn .p-select-label ) {
656- color : white !important ;
657- }
676+ :deep(.dropdown-btn .p-select-label ) {
677+ color : white !important ;
678+ }
658679
659- .dropdown-btn {
660- background-color : var (--primary-color );
661- color : white ;
662- :deep(.p-select-label),
663- :deep(.p-select-trigger-icon) {
680+ .dropdown-btn {
681+ background-color : var (--primary-color );
664682 color : white ;
683+ :deep(.p-select-label),
684+ :deep(.p-select-trigger-icon) {
685+ color : white ;
686+ }
665687 }
666- }
667688
668- .dialog #interventionDialogForm .section-group .section-content {
669- border : 1px solid var (--bluegray-50 );
670- }
689+ .dialog #interventionDialogForm .section-group .section-content {
690+ border : 1px solid var (--bluegray-50 );
691+ }
671692 </style >
0 commit comments