Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 40 additions & 59 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
"globals": "^17.7.0",
"i18next-cli": "^1.65.0",
"jsdom": "^26.1.0",
"prettier": "^3.8.4",
"prettier": "^3.9.4",
"typescript": "^6.0.3",
"typescript-eslint": "^8.63.0",
"vite": "^8.1.3",
Expand Down
3 changes: 1 addition & 2 deletions src/gmp/commands/__tests__/policy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ import {
import {YES_VALUE, NO_VALUE, type YesNo} from 'gmp/parser';

type ScanConfigTrend =
| typeof SCANCONFIG_TREND_DYNAMIC
| typeof SCANCONFIG_TREND_STATIC;
typeof SCANCONFIG_TREND_DYNAMIC | typeof SCANCONFIG_TREND_STATIC;

describe('PolicyCommand tests', () => {
test('should create new policy', async () => {
Expand Down
3 changes: 1 addition & 2 deletions src/gmp/commands/dashboards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ class DashboardCommand extends HttpCommand {
const {value, name} = setting;
try {
const config = JSON.parse(value as string) as
| DashboardSetting
| DashboardSettings;
DashboardSetting | DashboardSettings;
return response.setData(convertLoadedSettings(config, name));
} catch {
log.warn('Could not parse dashboard setting', id, value);
Expand Down
5 changes: 1 addition & 4 deletions src/gmp/commands/report-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ import {parseYesNo} from 'gmp/parser';
import {isArray} from 'gmp/utils/identity';

type ReportConfigParamValue =
| string
| number
| boolean
| Array<string | number | boolean>;
string | number | boolean | Array<string | number | boolean>;

interface ReportConfigCreateArgs {
comment?: string;
Expand Down
3 changes: 1 addition & 2 deletions src/gmp/models/alert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,7 @@ class Alert extends Model {
if (isDefined(ret.method?.data?.report_formats)) {
// @ts-expect-error
const methodDataReportFormat = ret.method?.data?.report_formats?.value as
| string
| undefined;
string | undefined;

ret.method.data.report_formats = map(
methodDataReportFormat?.split(','),
Expand Down
3 changes: 1 addition & 2 deletions src/gmp/models/credential.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ export type CertificateStatus =
| typeof CERTIFICATE_STATUS_UNKNOWN;

export type SNMPAuthAlgorithmType =
| typeof SNMP_AUTH_ALGORITHM_MD5
| typeof SNMP_AUTH_ALGORITHM_SHA1;
typeof SNMP_AUTH_ALGORITHM_MD5 | typeof SNMP_AUTH_ALGORITHM_SHA1;

export type SNMPPrivacyAlgorithmType =
| typeof SNMP_PRIVACY_ALGORITHM_NONE
Expand Down
6 changes: 1 addition & 5 deletions src/gmp/models/report-format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,7 @@ interface ParamLabels {
[key: string]: string | undefined;
}
type ParamType =
| 'report_format_list'
| 'multi_selection'
| 'integer'
| 'boolean'
| 'text';
'report_format_list' | 'multi_selection' | 'integer' | 'boolean' | 'text';

interface ReportFormatElement extends ModelElement {
alerts?: {
Expand Down
3 changes: 1 addition & 2 deletions src/gmp/models/scan-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ import {isDefined} from 'gmp/utils/identity';
import {isEmpty} from 'gmp/utils/string';

export type ScanConfigTrend =
| typeof SCANCONFIG_TREND_DYNAMIC
| typeof SCANCONFIG_TREND_STATIC;
typeof SCANCONFIG_TREND_DYNAMIC | typeof SCANCONFIG_TREND_STATIC;

export type ScanConfigUsageType = 'policy' | 'scan';

Expand Down
3 changes: 1 addition & 2 deletions src/gmp/models/task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -458,8 +458,7 @@ class Task extends Model {
const copy = super.parseElement(element) as TaskProperties;

const usageType = (element.usage_type ?? USAGE_TYPE.scan) as
| typeof USAGE_TYPE.scan
| typeof USAGE_TYPE.audit;
typeof USAGE_TYPE.scan | typeof USAGE_TYPE.audit;

if (!Object.values(USAGE_TYPE).includes(usageType)) {
throw new Error("Task.parseElement: usage_type must be 'scan'");
Expand Down
3 changes: 1 addition & 2 deletions src/gmp/utils/severity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ export const SEVERITY_RATING_CVSS_3 = 'CVSSv3';
export const DEFAULT_SEVERITY_RATING = SEVERITY_RATING_CVSS_3;

export type SeverityRating =
| typeof SEVERITY_RATING_CVSS_2
| typeof SEVERITY_RATING_CVSS_3;
typeof SEVERITY_RATING_CVSS_2 | typeof SEVERITY_RATING_CVSS_3;
10 changes: 5 additions & 5 deletions src/web/components/snackbar/Snackbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ const SnackbarContainer = styled.div`
color: ${Theme.white};
font-family: ${Theme.Font.dialog};
animation: ${keyframes({
'0%': {bottom: '-110px'},
'20%': {bottom: '10px'},
'80%': {bottom: '10px'},
'100%': {bottom: '-110px'},
})}
'0%': {bottom: '-110px'},
'20%': {bottom: '10px'},
'80%': {bottom: '10px'},
'100%': {bottom: '-110px'},
})}
5s ease-in-out;
`;

Expand Down
3 changes: 1 addition & 2 deletions src/web/entities/EntitiesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,7 @@ const mapStateToProps = (

const filterSelector = selector(state);
const filters = filterSelector.getAllEntities(filtersFilter) as
| Filter[]
| undefined;
Filter[] | undefined;

return {
filters: hasValue(filters) ? filters : [],
Expand Down
4 changes: 1 addition & 3 deletions src/web/hooks/use-query/results.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ import useGetEntities, {
interface UseGetResultsParams {
filter?: FilterType;
refetchInterval?:
| number
| false
| RefetchIntervalFn<UseGetEntitiesReturn<Result>>;
number | false | RefetchIntervalFn<UseGetEntitiesReturn<Result>>;
}

/**
Expand Down
5 changes: 1 addition & 4 deletions src/web/pages/agents/AgentTableFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ import useTranslation from 'web/hooks/useTranslation';
import type {SelectionTypeType} from 'web/utils/SelectionType';

type AgentBulkAction =
| 'authorize'
| 'revoke'
| 'enableUpdateToLatest'
| 'disableUpdateToLatest';
'authorize' | 'revoke' | 'enableUpdateToLatest' | 'disableUpdateToLatest';

interface DialogConfig {
title: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,7 @@ const Row = ({
links,
onTlsCertificateDownloadClick,
onToggleDetailsClick: onToggleDetailsClick as
| ((entity: ReportTLSCertificate, id?: string) => void)
| undefined,
((entity: ReportTLSCertificate, id?: string) => void) | undefined,
});

return (
Expand Down
3 changes: 1 addition & 2 deletions src/web/pages/schedules/ScheduleDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,7 @@ const ScheduleDialog = ({
? initialWeekdays
: new WeekDays().setWeekDayFromDate(initialStartDate);
const currentMonthlyDay = currentWeekdays.getSelectedWeekDay() as
| WeekDay
| undefined;
WeekDay | undefined;
const currentMonthlyNth = currentMonthlyDay
? currentWeekdays.get(currentMonthlyDay)
: undefined;
Expand Down
3 changes: 1 addition & 2 deletions src/web/pages/tasks/icons/__tests__/NewIconMenu.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ describe('NewIconMenu tests', () => {
describe.each([
[
'ENABLE_CONTAINER_SCANNING' as
| 'ENABLE_CONTAINER_SCANNING'
| 'ENABLE_AGENTS',
'ENABLE_CONTAINER_SCANNING' | 'ENABLE_AGENTS',
'new-container-image-menu',
'onNewContainerImageTaskClick',
],
Expand Down
4 changes: 1 addition & 3 deletions src/web/queries/useGetEntities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ interface UseGetEntitiesParams<
filter?: FilterType;
enabled?: boolean;
refetchInterval?:
| number
| false
| RefetchIntervalFn<UseGetEntitiesReturn<TModel>>;
number | false | RefetchIntervalFn<UseGetEntitiesReturn<TModel>>;
keepPreviousData?: boolean;
}

Expand Down
4 changes: 1 addition & 3 deletions src/web/utils/Render.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,7 @@ export const renderNvtName = (

export const renderComponent = <TProps extends {}>(
Component:
| React.FunctionComponent<TProps>
| React.ComponentClass<TProps>
| string,
React.FunctionComponent<TProps> | React.ComponentClass<TProps> | string,
props: TProps = {} as TProps,
) => (Component ? <Component {...props} /> : null);

Expand Down
Loading