Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update showdown.js #334

Merged
merged 4 commits into from
Apr 12, 2024
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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"react-router-dom": "^5.3.0",
"react-toast-notifications": "^2.4.0",
"set-interval-async": "1.0.33",
"showdown": "^1.9.1",
"showdown": "^2.1.0",
"tesseract.js": "^4.0.2"
},
"devDependencies": {
Expand All @@ -53,7 +53,7 @@
"@types/react-dom": "^16.9.8",
"@types/react-test-renderer": "^18.0.0",
"@types/set-interval-async": "^1.0.0",
"@types/showdown": "^1.9.3",
"@types/showdown": "^2.0.6",
"babel-jest": "^27.5.1",
"cypress": "^13.6.0",
"elastic-builder": "^2.7.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,19 @@
} from '@elastic/eui';
import { ReportSettings } from '../report_settings';
import { generateReportFromDefinitionId } from '../../main/main_utils';
import { converter } from '../utils';
import {
permissionsMissingToast,
permissionsMissingActions,
} from '../../utils/utils';
import { definitionInputValidation } from '../utils/utils';

interface reportParamsType {

Check failure on line 26 in public/components/report_definitions/create/create_report_definition.tsx

View workflow job for this annotation

GitHub Actions / Lint

Interface name `reportParamsType` must match one of the following formats: PascalCase, UPPER_CASE
report_name: string;
report_source: string;
description: string;
core_params: visualReportParams | dataReportParams;
}
interface visualReportParams {

Check failure on line 32 in public/components/report_definitions/create/create_report_definition.tsx

View workflow job for this annotation

GitHub Actions / Lint

Interface name `visualReportParams` must match one of the following formats: PascalCase, UPPER_CASE
base_url: string;
report_format: string;
header: string;
Expand All @@ -38,19 +37,19 @@
time_duration: string;
}

interface dataReportParams {

Check failure on line 40 in public/components/report_definitions/create/create_report_definition.tsx

View workflow job for this annotation

GitHub Actions / Lint

Interface name `dataReportParams` must match one of the following formats: PascalCase, UPPER_CASE
saved_search_id: number;
base_url: string;
report_format: string;
time_duration: string;
}
interface triggerType {

Check failure on line 46 in public/components/report_definitions/create/create_report_definition.tsx

View workflow job for this annotation

GitHub Actions / Lint

Interface name `triggerType` must match one of the following formats: PascalCase, UPPER_CASE
trigger_type: string;
trigger_params?: any;

Check warning on line 48 in public/components/report_definitions/create/create_report_definition.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
}

interface deliveryType {

Check failure on line 51 in public/components/report_definitions/create/create_report_definition.tsx

View workflow job for this annotation

GitHub Actions / Lint

Interface name `deliveryType` must match one of the following formats: PascalCase, UPPER_CASE
configIds: Array<string>;

Check failure on line 52 in public/components/report_definitions/create/create_report_definition.tsx

View workflow job for this annotation

GitHub Actions / Lint

Array type using 'Array<string>' is forbidden for simple types. Use 'string[]' instead
title: string;
textDescription: string;
htmlDescription: string;
Expand Down Expand Up @@ -78,18 +77,18 @@
};
}

export interface reportDefinitionParams {

Check failure on line 80 in public/components/report_definitions/create/create_report_definition.tsx

View workflow job for this annotation

GitHub Actions / Lint

Interface name `reportDefinitionParams` must match one of the following formats: PascalCase, UPPER_CASE
report_params: reportParamsType;
delivery: deliveryType;
trigger: triggerType;
}

export interface timeRangeParams {

Check failure on line 86 in public/components/report_definitions/create/create_report_definition.tsx

View workflow job for this annotation

GitHub Actions / Lint

Interface name `timeRangeParams` must match one of the following formats: PascalCase, UPPER_CASE
timeFrom: Date;
timeTo: Date;
}

export function CreateReport(props: { [x: string]: any; setBreadcrumbs?: any; httpClient?: any; }) {

Check failure on line 91 in public/components/report_definitions/create/create_report_definition.tsx

View workflow job for this annotation

GitHub Actions / Lint

Replace `·[x:·string]:·any;·setBreadcrumbs?:·any;·httpClient?:·any;·` with `⏎··[x:·string]:·any;⏎··setBreadcrumbs?:·any;⏎··httpClient?:·any;⏎`

Check warning on line 91 in public/components/report_definitions/create/create_report_definition.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type

Check warning on line 91 in public/components/report_definitions/create/create_report_definition.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type

Check warning on line 91 in public/components/report_definitions/create/create_report_definition.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
let createReportDefinitionRequest: reportDefinitionParams = {
report_params: {
report_name: '',
Expand All @@ -105,7 +104,7 @@
configIds: [],
title: '',
textDescription: '',
htmlDescription: ''

Check failure on line 107 in public/components/report_definitions/create/create_report_definition.tsx

View workflow job for this annotation

GitHub Actions / Lint

Insert `,`
},
trigger: {
trigger_type: '',
Expand Down Expand Up @@ -209,7 +208,7 @@
};

const removeToast = (removedToast: { id: string; }) => {
setToasts(toasts.filter((toast: any) => toast.id !== removedToast.id));

Check warning on line 211 in public/components/report_definitions/create/create_report_definition.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
};

let timeRange = {
Expand Down Expand Up @@ -295,7 +294,7 @@
href: '#/create',
},
]);
}, []);

Check warning on line 297 in public/components/report_definitions/create/create_report_definition.tsx

View workflow job for this annotation

GitHub Actions / Lint

React Hook useEffect has a missing dependency: 'props'. Either include it or remove the dependency array. However, 'props' will change when *any* prop changes, so the preferred fix is to destructure the 'props' object outside of the useEffect call and refer to those specific props inside useEffect

return (
<div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ import {
EuiPageContent,
EuiPageContentBody,
EuiHorizontalRule,
EuiText,
EuiSpacer,
EuiRadioGroup,
EuiSelect,
EuiTextArea,
EuiCheckboxGroup,
EuiComboBox,
Expand All @@ -30,7 +28,6 @@ import {
REPORT_SOURCE_TYPES,
SAVED_SEARCH_FORMAT_OPTIONS,
} from './report_settings_constants';
import Showdown from 'showdown';
import ReactMde from 'react-mde';
import 'react-mde/lib/styles/css/react-mde-all.css';
import {
Expand Down
1 change: 0 additions & 1 deletion server/routes/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
*/

import { CountersType } from './types';
import Showdown from 'showdown';

export enum FORMAT {
pdf = 'pdf',
Expand Down
Loading
Loading