Commit 105b17ae authored by Savas Vedova's avatar Savas Vedova

Remove duplicate constant definitions

parent 13851f12
import { s__ } from '~/locale'; import { s__ } from '~/locale';
export const SEVERITY_LEVELS = {
critical: s__('severity|Critical'),
high: s__('severity|High'),
medium: s__('severity|Medium'),
low: s__('severity|Low'),
unknown: s__('severity|Unknown'),
info: s__('severity|Info'),
undefined: s__('severity|Undefined'),
};
export const REPORT_TYPES = {
container_scanning: s__('ciReport|Container Scanning'),
dast: s__('ciReport|DAST'),
dependency_scanning: s__('ciReport|Dependency Scanning'),
sast: s__('ciReport|SAST'),
};
export const ALL = 'all'; export const ALL = 'all';
export const BASE_FILTERS = { export const BASE_FILTERS = {
severity: { severity: {
name: s__('ciReport|All severities'), name: s__('ciReport|All severities'),
......
import { SEVERITY_LEVELS, REPORT_TYPES, BASE_FILTERS } from './constants'; import { BASE_FILTERS } from './constants';
import { SEVERITY_LEVELS, REPORT_TYPES } from '../../constants';
import { s__ } from '~/locale'; import { s__ } from '~/locale';
const optionsObjectToArray = obj => Object.entries(obj).map(([id, name]) => ({ id, name })); const optionsObjectToArray = obj => Object.entries(obj).map(([id, name]) => ({ id, name }));
const severityLevelsWithoutNone = { ...SEVERITY_LEVELS };
delete severityLevelsWithoutNone.none;
export default () => ({ export default () => ({
filters: [ filters: [
{ {
name: s__('SecurityDashboard|Severity'), name: s__('SecurityDashboard|Severity'),
id: 'severity', id: 'severity',
options: [BASE_FILTERS.severity, ...optionsObjectToArray(SEVERITY_LEVELS)], options: [BASE_FILTERS.severity, ...optionsObjectToArray(severityLevelsWithoutNone)],
hidden: false, hidden: false,
selection: new Set([BASE_FILTERS.severity.id]), selection: new Set([BASE_FILTERS.severity.id]),
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment