Skip to content

Commit

Permalink
Merge branch 'opensight-ui' into rebase-opensight-ui
Browse files Browse the repository at this point in the history
  • Loading branch information
daniele-mng committed Aug 20, 2024
2 parents 7ee4347 + 3fb6c23 commit c086a17
Show file tree
Hide file tree
Showing 96 changed files with 356 additions and 463 deletions.
137 changes: 21 additions & 116 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"d3-scale": "^4.0.2",
"d3-shape": "^3.2.0",
"downshift": "^9.0.7",
"eslint-plugin-header": "^3.1.1",
"fast-deep-equal": "^3.1.3",
"fast-xml-parser": "^4.4.1",
"history": "^4.10.1",
Expand Down
1 change: 0 additions & 1 deletion src/__tests__/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


import {describe, test, expect} from '@gsa/testing';

import {RELEASE_VERSION} from '../version';
Expand Down
1 change: 0 additions & 1 deletion src/gmp/cancel.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


/*
* The CancelToken class is based on the cancelable-promises tc39 proposal
*
Expand Down
1 change: 0 additions & 1 deletion src/gmp/collection/collectioncounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


import {isDefined} from '../utils/identity';

import {parseInt} from '../parser.js';
Expand Down
5 changes: 2 additions & 3 deletions src/gmp/commands/nvtfamilies.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ export class NvtFamiliesCommand extends GmpCommand {
get(params, options) {
return this.httpGet(params, options).then(response => {
const {data} = response;
const {
family: families,
} = data.get_nvt_families.get_nvt_families_response.families;
const {family: families} =
data.get_nvt_families.get_nvt_families_response.families;
return response.set(
map(families, family => ({
name: family.name,
Expand Down
1 change: 0 additions & 1 deletion src/gmp/gmp.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


import {isDefined} from 'gmp/utils/identity';
import {isEmpty} from 'gmp/utils/string';

Expand Down
1 change: 0 additions & 1 deletion src/gmp/gmpsettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


import {isDefined} from './utils/identity';

export const DEFAULT_RELOAD_INTERVAL = 15 * 1000; // fifteen seconds
Expand Down
34 changes: 18 additions & 16 deletions src/gmp/http/transform/xml.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,24 @@ import {isDefined} from 'gmp/utils/identity';

import Rejection from 'gmp/http//rejection';

export const success = transform => (response, options = {}) => {
try {
return transform(response);
} catch (error) {
throw new Rejection(
response.xhr,
Rejection.REASON_ERROR,
_(
'An error occurred while converting gmp response to js for ' +
'url {{- url}}',
{url: options.url},
),
error,
);
}
};
export const success =
transform =>
(response, options = {}) => {
try {
return transform(response);
} catch (error) {
throw new Rejection(
response.xhr,
Rejection.REASON_ERROR,
_(
'An error occurred while converting gmp response to js for ' +
'url {{- url}}',
{url: options.url},
),
error,
);
}
};

export const rejection = transform => (rej, options) => {
if (rej.isError && rej.isError()) {
Expand Down
5 changes: 2 additions & 3 deletions src/gmp/locale/languages.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


export const BROWSER_LANGUAGE = 'Browser Language';

export const getLanguageCodes = () => Object.keys(Languages);
Expand All @@ -17,8 +16,8 @@ const Languages = {
name: 'English',
native_name: 'English',
},
zh_TW: {
name: 'Traditional Chinese',
zh_TW: {
name: 'Traditional Chinese',
native_name: '繁體中文',
},
};
Expand Down
1 change: 0 additions & 1 deletion src/gmp/log.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


import {isDefined, isString} from 'gmp/utils/identity';

export const DEFAULT_LOG_LEVEL = 'error';
Expand Down
1 change: 0 additions & 1 deletion src/gmp/models/__tests__/alert.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


import {describe, test, expect} from '@gsa/testing';

import Model from 'gmp/model';
Expand Down
1 change: 0 additions & 1 deletion src/gmp/models/__tests__/asset.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


import Asset from 'gmp/models/asset';
import {testModel} from 'gmp/models/testing';

Expand Down
1 change: 0 additions & 1 deletion src/gmp/models/__tests__/certbund.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


import {describe, test, expect} from '@gsa/testing';

import CertBundAdv from 'gmp/models/certbund';
Expand Down
1 change: 0 additions & 1 deletion src/gmp/models/__tests__/cpe.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


import {describe, test, expect} from '@gsa/testing';

import Cpe from 'gmp/models/cpe';
Expand Down
1 change: 0 additions & 1 deletion src/gmp/models/__tests__/credential.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


import {describe, test, expect} from '@gsa/testing';

import {setLocale} from 'gmp/locale/lang';
Expand Down
1 change: 0 additions & 1 deletion src/gmp/models/__tests__/cve.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


import {describe, test, expect} from '@gsa/testing';

import Cve from 'gmp/models/cve';
Expand Down
1 change: 0 additions & 1 deletion src/gmp/models/__tests__/dfncert.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


import {describe, test, expect} from '@gsa/testing';

import DfnCertAdv from 'gmp/models/dfncert';
Expand Down
1 change: 0 additions & 1 deletion src/gmp/models/__tests__/info.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


import Info from 'gmp/models/info';
import {testModel} from 'gmp/models/testing';

Expand Down
1 change: 0 additions & 1 deletion src/gmp/models/__tests__/license.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


import {describe, test, expect} from '@gsa/testing';

import {parseDate} from 'gmp/parser';
Expand Down
1 change: 0 additions & 1 deletion src/gmp/models/__tests__/nvt.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


import {describe, test, expect} from '@gsa/testing';

import Nvt, {getRefs, hasRefType, getFilteredRefIds} from 'gmp/models/nvt';
Expand Down
1 change: 0 additions & 1 deletion src/gmp/models/__tests__/policy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


import {describe, test, expect} from '@gsa/testing';

import Model from 'gmp/model';
Expand Down
1 change: 0 additions & 1 deletion src/gmp/models/__tests__/reportconfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


import {describe, test, expect} from '@gsa/testing';

import ReportConfig from 'gmp/models/reportconfig';
Expand Down
1 change: 0 additions & 1 deletion src/gmp/models/__tests__/reportformat.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


import {describe, test, expect} from '@gsa/testing';

import Model from 'gmp/model';
Expand Down
1 change: 0 additions & 1 deletion src/gmp/models/__tests__/resourcename.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


import {describe, test, expect} from '@gsa/testing';

import {ResourceName} from '../resourcename';
Expand Down
1 change: 0 additions & 1 deletion src/gmp/models/__tests__/result.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


import {describe, test, expect} from '@gsa/testing';

import Model from 'gmp/model';
Expand Down
1 change: 0 additions & 1 deletion src/gmp/models/__tests__/role.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


import {describe, test, expect} from '@gsa/testing';

import Role from '../role';
Expand Down
1 change: 0 additions & 1 deletion src/gmp/models/__tests__/scanconfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


import {describe, test, expect} from '@gsa/testing';

import Model from 'gmp/model';
Expand Down
1 change: 0 additions & 1 deletion src/gmp/models/__tests__/scanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


import {describe, test, expect} from '@gsa/testing';

import Model from 'gmp/model';
Expand Down
1 change: 0 additions & 1 deletion src/gmp/models/__tests__/schedule.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


import {describe, test, expect, testing} from '@gsa/testing';

import Model from 'gmp/model';
Expand Down
1 change: 0 additions & 1 deletion src/gmp/models/__tests__/vulnerability.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


import Vulnerability from 'gmp/models/vulnerability';
import {testModel} from 'gmp/models/testing';

Expand Down
1 change: 0 additions & 1 deletion src/gmp/models/filter/convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


import {isDefined, isNumberOrNumberString} from '../../utils/identity';
import {isEmpty} from '../../utils/string';

Expand Down
1 change: 0 additions & 1 deletion src/gmp/models/filter/filterterm.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


import {isDefined} from '../../utils/identity';

import convert from './convert.js';
Expand Down
1 change: 0 additions & 1 deletion src/gmp/models/filter/keywords.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


export const EXTRA_KEYWORDS = [
'apply_overrides',
'delta_states',
Expand Down
1 change: 0 additions & 1 deletion src/gmp/models/filter/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


import {isDefined} from '../../utils/identity';

export const filter_string = filter =>
Expand Down
1 change: 0 additions & 1 deletion src/gmp/models/report/host.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


import {isArray, isDefined} from 'gmp/utils/identity';
import {isEmpty} from 'gmp/utils/string';

Expand Down
11 changes: 2 additions & 9 deletions src/gmp/models/report/report.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,8 @@ class ReportReport extends Model {
static parseElement(element) {
const copy = super.parseElement(element);

const {
delta,
severity,
scan_start,
scan_end,
task,
scan,
timestamp,
} = element;
const {delta, severity, scan_start, scan_end, task, scan, timestamp} =
element;

const filter = parseFilter(element);

Expand Down
1 change: 0 additions & 1 deletion src/gmp/timezones.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


const timezones = [
{name: 'Africa/Abidjan'},
{name: 'Africa/Accra'},
Expand Down
1 change: 0 additions & 1 deletion src/gmp/utils/array.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


import {hasValue, isDefined, isArray} from './identity';

export const forEach = (array, func) => {
Expand Down
2 changes: 1 addition & 1 deletion src/gmp/utils/event.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const KeyCode = {
*/
export const debounce = (func, wait, immediate = false) => {
let timeout;
return function(...args) {
return function (...args) {
const context = this;
const later = () => {
timeout = undefined;
Expand Down
1 change: 0 additions & 1 deletion src/gmp/utils/identity.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


export const {isArray} = global.Array;

export const isDefined = value => value !== undefined;
Expand Down
1 change: 0 additions & 1 deletion src/gmp/utils/object.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


export const exclude = (object, func) =>
Object.keys(object)
.filter(key => !func(key))
Expand Down
1 change: 0 additions & 1 deletion src/gmp/utils/trace.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


/** Return the current stack trace a string */
export const trace = () => {
try {
Expand Down
Loading

0 comments on commit c086a17

Please sign in to comment.