Skip to content

Commit

Permalink
chore: address remarks
Browse files Browse the repository at this point in the history
  • Loading branch information
WitoDelnat committed Sep 12, 2023
1 parent acaf5ac commit 72d3abf
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ const ProblemRenderer: React.FC<IProps> = props => {
[selectedProblem, node.problem, groupByFilterValue]
);

const absent = useMemo(() => node.problem.baselineState === 'absent', [node]);
const hasFix = useMemo(() => node.problem.fixes && node.problem.fixes.length > 0, [node]);
const absent = node.problem.baselineState === 'absent';
const hasFix = node.problem.fixes && node.problem.fixes.length > 0;

const isUnderReview = useMemo(() => {
return Boolean(
Expand Down Expand Up @@ -122,8 +122,12 @@ const ProblemRenderer: React.FC<IProps> = props => {

<ActionsContainer onClick={e => e.stopPropagation()}>
{onAutofixHandler && hasFix && !absent ? (
<Tooltip mouseEnterDelay={TOOLTIP_DELAY} title="Autofix">
<Icon name="magic-wand" onClick={() => onAutofixHandler(node.problem)} />
<Tooltip mouseEnterDelay={TOOLTIP_DELAY} title="Autofix">
<Icon
style={{color: isSelected ? Colors.blackPure : Colors.blue7}}
name="magic-wand"
onClick={() => onAutofixHandler(node.problem)}
/>
</Tooltip>
) : null}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
getFileLocation,
getResourceLocation,
getRuleForResultV2,
isPendingSuppression,
isSuppressed,
ValidationResponse,
ValidationResult,
Expand Down Expand Up @@ -119,10 +120,12 @@ export const filterProblems = (
);

if (filters.showSuppressed && !filters.showUnsuppressed) {
filteredValidationResults = filteredValidationResults.filter(p => isSuppressed(p));
filteredValidationResults = filteredValidationResults.filter(p => isSuppressed(p) || isPendingSuppression(p));
}
if (!filters.showSuppressed && filters.showUnsuppressed) {
filteredValidationResults = filteredValidationResults.filter(p => !isSuppressed(p));
filteredValidationResults = filteredValidationResults.filter(
p => !isSuppressed(p) && !isPendingSuppression(p)
);
}
if (!filters.showSuppressed && !filters.showUnsuppressed) {
return [];
Expand Down
2 changes: 1 addition & 1 deletion packages/validation/src/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export * from './config/index.node.js';
export * from './config/read.node.js';
export * from './validators/open-policy-agent/wasmLoader/RemoteWasmLoader.node.js';

export function createDefaultNodeMonokleValidator() {
export function createDefaultMonokleValidator() {
return new MonokleValidator(
{
loader: new RemotePluginLoader(requireFromStringCustomPluginLoader),
Expand Down

0 comments on commit 72d3abf

Please sign in to comment.