Skip to content

Commit

Permalink
Updated config form notes.
Browse files Browse the repository at this point in the history
  • Loading branch information
shinde-rahul committed Feb 18, 2023
1 parent 02381c5 commit fbd6541
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 23 deletions.
16 changes: 2 additions & 14 deletions app/bundles/IntegrationsBundle/Controller/ConfigController.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,17 +212,7 @@ private function showForm(Form $form)
$integrationObject->getRedirectUri()
: false;

$authorizationNote = $integrationObject instanceof ConfigFormNotesInterface ?
$integrationObject->getAuthorizationNote()
: null;

$featuresNote = $integrationObject instanceof ConfigFormNotesInterface ?
$integrationObject->getFeaturesNote()
: null;

$fieldMappingNote = $integrationObject instanceof ConfigFormNotesInterface ?
$integrationObject->getFieldMappingNote()
: null;
$useConfigFormNotes = $integrationObject instanceof ConfigFormNotesInterface;

return $this->delegateView(
[
Expand All @@ -237,9 +227,7 @@ private function showForm(Form $form)
'useFeatureSettings' => $useFeatureSettings,
'useAuthorizationUrl' => $useAuthorizationUrl,
'callbackUrl' => $callbackUrl,
'authorizationNote' => $authorizationNote,
'featuresNote' => $featuresNote,
'fieldMappingNote' => $fieldMappingNote,
'useConfigFormNotes' => $useConfigFormNotes,
],
'contentTemplate' => $integrationObject->getConfigFormContentTemplate()
?: 'IntegrationsBundle:Config:form.html.twig',
Expand Down
18 changes: 9 additions & 9 deletions app/bundles/IntegrationsBundle/Views/Config/form.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@
<div class="tab-content pa-md bg-white">
<!-- Enabled\Auth -->
<div class="tab-pane fade <?php if ('details-container' == $activeTab): echo 'in active'; endif; ?> bdr-w-0" id="details-container">
<?php if ($authorizationNote instanceof \Mautic\IntegrationsBundle\DTO\Note): ?>
<div class="alert alert-<?php echo $authorizationNote->getType(); ?>">
<?php echo $view['translator']->trans($authorizationNote->getNote()); ?>
<?php if ($useConfigFormNotes && $integrationObject->getAuthorizationNote() instanceof \Mautic\IntegrationsBundle\DTO\Note): ?>
<div class="alert alert-<?php echo $integrationObject->getAuthorizationNote()->getType(); ?>">
<?php echo $view['translator']->trans($integrationObject->getAuthorizationNote()->getNote()); ?>
</div>
<?php endif; ?>

Expand Down Expand Up @@ -102,9 +102,9 @@
<!-- Features -->
<?php if ($showFeaturesTab): ?>
<div class="tab-pane fade <?php if ('features-container' == $activeTab): echo 'in active'; endif; ?> bdr-w-0" id="features-container">
<?php if ($featuresNote instanceof \Mautic\IntegrationsBundle\DTO\Note): ?>
<div class="alert alert-<?php echo $featuresNote->getType(); ?>">
<?php echo $view['translator']->trans($featuresNote->getNote()); ?>
<?php if ($useConfigFormNotes && $integrationObject->getFeaturesNote() instanceof \Mautic\IntegrationsBundle\DTO\Note): ?>
<div class="alert alert-<?php echo $integrationObject->getFeaturesNote()->getType(); ?>">
<?php echo $view['translator']->trans($integrationObject->getFeaturesNote()->getNote()); ?>
</div>
<?php endif; ?>
<?php
Expand Down Expand Up @@ -143,9 +143,9 @@
<div class="has-error">
<?php echo $view['form']->errors($objectFieldMapping); ?>
</div>
<?php if ($fieldMappingNote instanceof \Mautic\IntegrationsBundle\DTO\Note): ?>
<div class="alert alert-<?php echo $fieldMappingNote->getType(); ?>">
<?php echo $view['translator']->trans($fieldMappingNote->getNote()); ?>
<?php if ($useConfigFormNotes && $integrationObject->getFieldMappingNote() instanceof \Mautic\IntegrationsBundle\DTO\Note): ?>
<div class="alert alert-<?php echo $integrationObject->getFieldMappingNote()->getType(); ?>">
<?php echo $view['translator']->trans($integrationObject->getFieldMappingNote()->getNote()); ?>
</div>
<?php endif; ?>
<?php echo $view['form']->row($objectFieldMapping['filter-keyword']); ?>
Expand Down

0 comments on commit fbd6541

Please sign in to comment.