Skip to content

Commit

Permalink
PMM-12253 Removed Actions column along with api call (#676)
Browse files Browse the repository at this point in the history
* Removed Actions column along with api call

* Fixed eslint

---------

Co-authored-by: Artem Gavrilov <[email protected]>
  • Loading branch information
doracretu3pillar and artemgavrilov authored Sep 4, 2023
1 parent 3737244 commit 493e60d
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 42 deletions.
11 changes: 0 additions & 11 deletions public/app/percona/check/Check.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,6 @@ export const CheckService = {
.sort((a, b) => order[a.severity] - order[b.severity]),
};
},
async silenceAlert(alertId: string, silence: boolean, token?: CancelToken) {
return api.post<void, any>(
`${BASE_URL}/ToggleCheckAlert`,
{
alert_id: alertId,
silence,
},
false,
token
);
},
runDbChecks(checkNames: string[], token?: CancelToken): Promise<void | {}> {
return api.post<{}, {}>(
'/v1/management/SecurityChecks/Start',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
export const Messages = {
noChecks: 'No checks found.',
readMore: 'Read More',
activate: 'Activate',
silence: 'Silence',
pageTitle: (serviceName: string) => `Failed Checks for service "${serviceName}"`,
};
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ export const getStyles = ({ v1: { colors: v1Colors, spacing }, colors }: Grafana
${labelStyles}
}
`,
actions: css`
display: flex;
align-items: center;
justify-content: center;
`,
disabledRow: css`
background-color: ${colors.action.disabledBackground} !important;
opacity: ${colors.action.disabledOpacity};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { GrafanaRouteComponentProps } from 'app/core/navigation/types';
import { Severity } from 'app/percona/integrated-alerting/components/Severity';
import { Chip } from 'app/percona/shared/components/Elements/Chip';
import { ExpandableCell } from 'app/percona/shared/components/Elements/ExpandableCell';
import { SilenceBell } from 'app/percona/shared/components/Elements/SilenceBell';
import { ExtendedColumn, Table } from 'app/percona/shared/components/Elements/Table';
import { useStoredTablePageSize } from 'app/percona/shared/components/Elements/Table/Pagination';
import { useCancelToken } from 'app/percona/shared/components/hooks/cancelToken.hook';
Expand Down Expand Up @@ -63,14 +62,6 @@ export const ServiceChecks: FC<GrafanaRouteComponentProps<{ service: string }>>
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [pageIndex, pageSize, serviceId]);

const onSilenceClick = useCallback(
async (alertId: string, silenced: boolean) => {
await CheckService.silenceAlert(alertId, !silenced);
fetchChecks();
},
[fetchChecks]
);

const columns = useMemo(
(): Array<ExtendedColumn<ServiceFailedCheck>> => [
{
Expand Down Expand Up @@ -104,22 +95,8 @@ export const ServiceChecks: FC<GrafanaRouteComponentProps<{ service: string }>>
</a>
) : null,
},
{
Header: 'Actions',
accessor: 'silenced',
width: '30px',
Cell: ({ value, row }) => (
<span className={styles.actions}>
<SilenceBell
tooltip={value ? Messages.activate : Messages.silence}
silenced={value}
onClick={() => onSilenceClick(row.original.alertId, row.original.silenced)}
/>
</span>
),
},
],
[styles.link, styles.actions, onSilenceClick]
[styles.link]
);

const onPaginationChanged = useCallback(
Expand Down

0 comments on commit 493e60d

Please sign in to comment.