File tree 3 files changed +34
-4
lines changed
3 files changed +34
-4
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ /*
6
+ * This file is part of the CleverAge/UiProcessBundle package.
7
+ *
8
+ * Copyright (c) Clever-Age
9
+ *
10
+ * For the full copyright and license information, please view the LICENSE
11
+ * file that was distributed with this source code.
12
+ */
13
+
14
+ namespace CleverAge \UiProcessBundle \Admin \Field ;
15
+
16
+ use EasyCorp \Bundle \EasyAdminBundle \Contracts \Field \FieldInterface ;
17
+ use EasyCorp \Bundle \EasyAdminBundle \Field \FieldTrait ;
18
+
19
+ class ContextField implements FieldInterface
20
+ {
21
+ use FieldTrait;
22
+
23
+ public static function new (string $ propertyName , ?string $ label = null ): self
24
+ {
25
+ return (new self ())
26
+ ->setProperty ($ propertyName )
27
+ ->setLabel ($ label )
28
+ ->setTemplatePath ('@CleverAgeUiProcess/admin/field/array.html.twig ' );
29
+ }
30
+ }
Original file line number Diff line number Diff line change 14
14
namespace CleverAge \UiProcessBundle \Controller \Admin ;
15
15
16
16
use CleverAge \ProcessBundle \Configuration \ProcessConfiguration ;
17
+ use CleverAge \UiProcessBundle \Admin \Field \ContextField ;
17
18
use CleverAge \UiProcessBundle \Admin \Field \LogLevelField ;
18
19
use CleverAge \UiProcessBundle \Admin \Filter \LogProcessFilter ;
19
20
use CleverAge \UiProcessBundle \Entity \LogRecord ;
23
24
use EasyCorp \Bundle \EasyAdminBundle \Config \Crud ;
24
25
use EasyCorp \Bundle \EasyAdminBundle \Config \Filters ;
25
26
use EasyCorp \Bundle \EasyAdminBundle \Controller \AbstractCrudController ;
26
- use EasyCorp \Bundle \EasyAdminBundle \Field \ArrayField ;
27
27
use EasyCorp \Bundle \EasyAdminBundle \Field \BooleanField ;
28
28
use EasyCorp \Bundle \EasyAdminBundle \Field \DateTimeField ;
29
29
use EasyCorp \Bundle \EasyAdminBundle \Field \TextField ;
@@ -52,8 +52,7 @@ public function configureFields(string $pageName): iterable
52
52
LogLevelField::new ('level ' ),
53
53
TextField::new ('message ' )->setMaxLength (512 ),
54
54
DateTimeField::new ('createdAt ' )->setFormat ('Y/M/dd H:mm:ss ' ),
55
- ArrayField::new ('context ' )
56
- ->setTemplatePath ('@CleverAgeUiProcess/admin/field/array.html.twig ' )
55
+ ContextField::new ('context ' )
57
56
->onlyOnDetail (),
58
57
BooleanField::new ('contextIsEmpty ' , 'Has context info ? ' )
59
58
->onlyOnIndex ()
Original file line number Diff line number Diff line change 13
13
14
14
namespace CleverAge \UiProcessBundle \Controller \Admin ;
15
15
16
+ use CleverAge \UiProcessBundle \Admin \Field \ContextField ;
16
17
use CleverAge \UiProcessBundle \Admin \Field \EnumField ;
17
18
use CleverAge \UiProcessBundle \Entity \ProcessExecution ;
18
19
use CleverAge \UiProcessBundle \Repository \ProcessExecutionRepository ;
@@ -58,7 +59,7 @@ public function configureFields(string $pageName): iterable
58
59
return $ entity ->duration (); // returned format can be changed here
59
60
}),
60
61
ArrayField::new ('report ' )->setTemplatePath ('@CleverAgeUiProcess/admin/field/report.html.twig ' ),
61
- ArrayField ::new ('context ' )-> setTemplatePath ( ' @CleverAgeUiProcess/admin/field/report.html.twig ' ),
62
+ ContextField ::new ('context ' ),
62
63
];
63
64
}
64
65
You can’t perform that action at this time.
0 commit comments