Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
aggrid
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
aggrid
Commits
72f1ca39
"README.md" did not exist on "29155fdb8196ccdd4097806177525053e12515ca"
Commit
72f1ca39
authored
4 years ago
by
Mike Feranda
Committed by
Mike Feranda
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3161356
by mferanda: Suppression - Add ability to automatically suppress other cells
parent
cb891e04
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Plugin/Field/FieldFormatter/HtmlFormatterType.php
+12
-15
12 additions, 15 deletions
src/Plugin/Field/FieldFormatter/HtmlFormatterType.php
with
12 additions
and
15 deletions
src/Plugin/Field/FieldFormatter/HtmlFormatterType.php
+
12
−
15
View file @
72f1ca39
...
@@ -124,11 +124,6 @@ class HtmlFormatterType extends FormatterBase {
...
@@ -124,11 +124,6 @@ class HtmlFormatterType extends FormatterBase {
if
(
is_array
(
$rowData
))
{
if
(
is_array
(
$rowData
))
{
for
(
$i
=
0
;
$i
<
count
(
$rowData
);
$i
++
)
{
for
(
$i
=
0
;
$i
<
count
(
$rowData
);
$i
++
)
{
// Each row... then each cell in each row.
// Add row to suppCell if doesn't exist
if
(
!
isset
(
$suppCell
[
$i
]))
{
$suppCell
[
$i
]
=
[];
}
foreach
(
$headers
as
$field
)
{
foreach
(
$headers
as
$field
)
{
// Check if suppression is enabled for cell or if the cell is already marked for suppression
// Check if suppression is enabled for cell or if the cell is already marked for suppression
$suppCellProcess
=
(
isset
(
$rowData
[
$i
]
->
$field
)
$suppCellProcess
=
(
isset
(
$rowData
[
$i
]
->
$field
)
...
@@ -139,14 +134,13 @@ class HtmlFormatterType extends FormatterBase {
...
@@ -139,14 +134,13 @@ class HtmlFormatterType extends FormatterBase {
||
isset
(
$rowSettings
[
$i
][
$field
][
'valueSuppression'
][
'any'
])
&&
$rowSettings
[
$i
][
$field
][
'valueSuppression'
][
'any'
]))
||
isset
(
$rowSettings
[
$i
][
$field
][
'valueSuppression'
][
'any'
])
&&
$rowSettings
[
$i
][
$field
][
'valueSuppression'
][
'any'
]))
&&
(
isset
(
$rowSettings
[
$i
][
$field
][
'valueSuppression'
][
'role'
])
&&
!
empty
(
array_intersect
(
$rowSettings
[
$i
][
$field
][
'valueSuppression'
][
'role'
],
$roles
))
&&
(
isset
(
$rowSettings
[
$i
][
$field
][
'valueSuppression'
][
'role'
])
&&
!
empty
(
array_intersect
(
$rowSettings
[
$i
][
$field
][
'valueSuppression'
][
'role'
],
$roles
))
||
!
isset
(
$rowSettings
[
$i
][
$field
][
'valueSuppression'
][
'role'
]))
||
!
isset
(
$rowSettings
[
$i
][
$field
][
'valueSuppression'
][
'role'
]))
||
in_array
(
$field
,
$suppCell
[
$i
]));
||
isset
(
$suppCell
[
$i
])
&&
in_array
(
$field
,
$suppCell
[
$i
]));
// Check if suppression and for role. If suppressed, add it to suppression list.
// Check if suppression and for role. If suppressed, add it to suppression list.
if
(
$suppCellProcess
)
{
if
(
$suppCellProcess
)
{
// Add the current cell to the suppression
// Add the current cell to the suppression
if
(
!
in_array
(
$field
,
$suppCell
[
$i
]))
{
$suppCell
[
$i
][]
=
$field
;
array_push
(
$suppCell
,
[
$i
=>
$field
]);
}
// Additional Suppression
// Additional Suppression
if
(
isset
(
$rowSettings
[
$i
][
$field
][
'valueSuppression'
][
'otherRowCol'
]))
{
if
(
isset
(
$rowSettings
[
$i
][
$field
][
'valueSuppression'
][
'otherRowCol'
]))
{
// Set the other Row/Col from setting
// Set the other Row/Col from setting
...
@@ -154,13 +148,16 @@ class HtmlFormatterType extends FormatterBase {
...
@@ -154,13 +148,16 @@ class HtmlFormatterType extends FormatterBase {
// Loop through other Row/Column and set
// Loop through other Row/Column and set
foreach
(
$otherRowCol
as
$otherRow
=>
$value
)
{
foreach
(
$otherRowCol
as
$otherRow
=>
$value
)
{
foreach
(
$value
as
$key
=>
$otherField
)
{
foreach
(
$value
as
$key
=>
$otherField
)
{
if
(
!
in_array
(
$otherField
,
$suppCell
[
$otherRow
]))
{
if
(
is_numeric
(
$otherRow
)
&&
!
in_array
(
$otherField
,
$suppCell
[
$otherRow
]))
{
array_push
(
$suppCell
,
[
$otherRow
=>
$otherField
]);
// Add for other row/column
$suppCell
[
$otherRow
][]
=
$otherField
;
}
elseif
(
$otherRow
==
'current'
&&
!
in_array
(
$i
,
$suppCell
[
$i
]))
{
// Add for other columns in current row
$suppCell
[
$i
][]
=
$otherField
;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
...
@@ -168,8 +165,8 @@ class HtmlFormatterType extends FormatterBase {
...
@@ -168,8 +165,8 @@ class HtmlFormatterType extends FormatterBase {
// Process actual suppressions
// Process actual suppressions
if
(
!
$suppOverride
)
{
if
(
!
$suppOverride
)
{
foreach
(
$suppCell
as
$
key
=>
$value
)
{
foreach
(
$suppCell
as
$
row
=>
$value
)
{
foreach
(
$value
as
$
row
=>
$field
)
{
foreach
(
$value
as
$
key
=>
$field
)
{
$rowData
[
$row
]
->
$field
=
'+'
;
$rowData
[
$row
]
->
$field
=
'+'
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment