Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
minerva
frontend
Commits
15bef3eb
Commit
15bef3eb
authored
10 months ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
introduce ONE_THOUSAND const
parent
3222f344
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!223
reset the pin numbers before search results are fetch (so the results will be...
,
!199
Resolve "[MIN-321] form for reporting errors in minerva"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/constants/common.ts
+1
-0
1 addition, 0 deletions
src/constants/common.ts
src/utils/error-report/errorReporting.ts
+3
-5
3 additions, 5 deletions
src/utils/error-report/errorReporting.ts
with
4 additions
and
5 deletions
src/constants/common.ts
+
1
−
0
View file @
15bef3eb
...
...
@@ -16,6 +16,7 @@ export const NOOP = (): void => {};
export
const
ONE_DECIMAL
=
0.1
;
export
const
ONE_HUNDRED
=
100
;
export
const
ONE_THOUSAND
=
1000
;
export
const
EMPTY_ARRAY_STRING
=
'
[]
'
;
export
const
ZOOM_FACTOR
=
2.0
;
// Zoom factor indicating doubling the distance for each zoom level
...
...
This diff is collapsed.
Click to expand it.
src/utils/error-report/errorReporting.ts
+
3
−
5
View file @
15bef3eb
/* eslint-disable no-console */
import
{
ErrorData
}
from
'
@/utils/error-report/ErrorData
'
;
import
{
SerializedError
}
from
'
@reduxjs/toolkit
'
;
// eslint-disable-next-line import/no-cycle
import
{
store
}
from
'
@/redux/store
'
;
import
{
ONE_THOUSAND
}
from
'
@/constants/common
'
;
export
const
createErrorData
=
(
error
:
Error
|
SerializedError
|
undefined
):
ErrorData
=>
{
let
stacktrace
=
''
;
...
...
@@ -15,7 +15,7 @@ export const createErrorData = (error: Error | SerializedError | undefined): Err
login
=
'
anonymous
'
;
}
const
errorData
:
ErrorData
=
{
return
{
url
:
window
.
location
.
href
,
login
,
browser
:
navigator
.
userAgent
,
...
...
@@ -23,11 +23,9 @@ export const createErrorData = (error: Error | SerializedError | undefined): Err
email
:
null
,
// TODO
javaStacktrace
:
null
,
// TODO
stacktrace
,
// eslint-disable-next-line no-magic-numbers
timestamp
:
Math
.
floor
(
+
new
Date
()
/
1000
),
timestamp
:
Math
.
floor
(
+
new
Date
()
/
ONE_THOUSAND
),
version
:
null
,
// TODO
};
return
errorData
;
};
export
const
handleError
=
(
error
:
Error
|
SerializedError
|
undefined
):
void
=>
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment