Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
Frontend V2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Contributor analytics
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
GraphPolaris
Frontend V2
Commits
54a4d985
Verified
Commit
54a4d985
authored
4 months ago
by
Leonardo
Committed by
Dennis Collaris
4 months ago
Browse files
Options
Downloads
Patches
Plain Diff
chore: remove webpage alerts
parent
ecdc4998
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libs/shared/lib/insight-sharing/alerting/AlertingForm.tsx
+10
-29
10 additions, 29 deletions
libs/shared/lib/insight-sharing/alerting/AlertingForm.tsx
libs/shared/lib/insight-sharing/reporting/ReportingForm.tsx
+9
-28
9 additions, 28 deletions
libs/shared/lib/insight-sharing/reporting/ReportingForm.tsx
with
19 additions
and
57 deletions
libs/shared/lib/insight-sharing/alerting/AlertingForm.tsx
+
10
−
29
View file @
54a4d985
...
...
@@ -7,6 +7,7 @@ import { Button, Input, LoadingSpinner } from '../../components';
import
{
EditorState
}
from
'
lexical
'
;
import
{
MonitorType
}
from
'
../components/Sidebar
'
;
import
{
wsUpdateInsight
,
wsCreateInsight
,
wsDeleteInsight
}
from
'
../../data-access/broker/wsInsightSharing
'
;
import
{
addError
}
from
'
../../data-access/store/configSlice
'
;
type
Props
=
{
insight
:
InsightResponse
;
...
...
@@ -45,30 +46,22 @@ export function AlertingForm(props: Props) {
const
handleSave
=
async
()
=>
{
if
(
!
name
||
name
.
trim
()
===
''
)
{
alert
(
'
Please enter a name for the alert.
'
);
return
;
}
if
(
!
description
||
description
.
trim
()
===
''
)
{
alert
(
'
Please enter a description for the alert.
'
);
return
;
}
if
(
!
editorState
)
{
alert
(
'
Please enter content in the text editor before saving.
'
);
dispatch
(
addError
(
'
Name is required
'
));
return
;
}
const
alertData
:
InsightRequest
=
{
const
alertData
:
InsightRequest
=
{
name
,
description
,
recipients
,
template
:
JSON
.
stringify
(
editorState
),
saveStateId
:
session
.
currentSaveState
||
''
,
type
:
'
alert
'
as const
,
frequency
:
''
frequency
:
''
,
};
setLoading
(
true
);
if
(
props
.
insight
.
id
)
{
wsUpdateInsight
(
props
.
insight
.
id
,
alertData
,
(
data
:
any
,
status
:
string
)
=>
{
setLoading
(
false
);
...
...
@@ -124,20 +117,8 @@ export function AlertingForm(props: Props) {
return
(
<
div
>
<
span
className
=
"text-lg text-secondary-600 font-bold mb-4"
>
Alert ID:
{
props
.
insight
.
id
}
</
span
>
<
Input
label
=
"Name"
type
=
"text"
value
=
{
name
}
onChange
=
{
setName
}
className
=
"mb-4"
/>
<
Input
label
=
"Description"
type
=
"text"
value
=
{
description
}
onChange
=
{
setDescription
}
className
=
"mb-4"
/>
<
Input
label
=
"Name"
type
=
"text"
value
=
{
name
}
onChange
=
{
setName
}
className
=
"mb-4"
/>
<
Input
label
=
"Description"
type
=
"text"
value
=
{
description
}
onChange
=
{
setDescription
}
className
=
"mb-4"
/>
<
Accordion
defaultOpenAll
=
{
true
}
className
=
"border-t divide-y"
>
<
AccordionItem
className
=
"pt-2 pb-4"
>
<
AccordionHead
showArrow
=
{
false
}
>
...
...
@@ -152,8 +133,8 @@ export function AlertingForm(props: Props) {
setRecipientInput
(
String
(
value
));
const
recipientList
=
String
(
value
)
.
split
(
/
[
,
]
/
)
.
map
(
r
=>
r
.
trim
())
.
filter
(
r
=>
r
.
length
>
0
);
.
map
(
(
r
)
=>
r
.
trim
())
.
filter
(
(
r
)
=>
r
.
length
>
0
);
setRecipients
(
recipientList
);
}
}
placeholder
=
"Enter recipient(s)"
...
...
@@ -183,4 +164,4 @@ export function AlertingForm(props: Props) {
</
div
>
</
div
>
);
}
\ No newline at end of file
}
This diff is collapsed.
Click to expand it.
libs/shared/lib/insight-sharing/reporting/ReportingForm.tsx
+
9
−
28
View file @
54a4d985
...
...
@@ -7,6 +7,7 @@ import { useAppDispatch, useSessionCache } from '../../data-access';
import
{
MonitorType
}
from
'
../components/Sidebar
'
;
import
{
EditorState
}
from
'
lexical
'
;
import
{
wsCreateInsight
,
wsDeleteInsight
,
wsUpdateInsight
}
from
'
../../data-access/broker/wsInsightSharing
'
;
import
{
addError
}
from
'
../../data-access/store/configSlice
'
;
type
Props
=
{
insight
:
InsightResponse
;
...
...
@@ -59,15 +60,7 @@ export function ReportingForm(props: Props) {
const
handleSave
=
async
()
=>
{
if
(
!
name
||
name
.
trim
()
===
''
)
{
alert
(
'
Please enter a name for the report.
'
);
return
;
}
if
(
!
description
||
description
.
trim
()
===
''
)
{
alert
(
'
Please enter a description for the report.
'
);
return
;
}
if
(
!
editorState
)
{
alert
(
'
Please enter content in the text editor before saving.
'
);
dispatch
(
addError
(
'
Please enter a name for the report.
'
));
return
;
}
...
...
@@ -77,7 +70,7 @@ export function ReportingForm(props: Props) {
recipients
,
frequency
,
template
:
JSON
.
stringify
(
editorState
),
saveStateId
:
session
.
currentSaveState
||
""
,
saveStateId
:
session
.
currentSaveState
||
''
,
type
:
'
report
'
as const
,
};
...
...
@@ -107,7 +100,7 @@ export function ReportingForm(props: Props) {
alert
(
'
Failed to create report.
'
);
}
});
}
}
};
const
handleDelete
=
async
()
=>
{
...
...
@@ -136,20 +129,8 @@ export function ReportingForm(props: Props) {
)
:
(
<
div
>
<
span
className
=
"text-lg text-secondary-600 font-bold mb-4"
>
Report ID:
{
props
.
insight
.
id
}
</
span
>
<
Input
label
=
"Name"
type
=
"text"
value
=
{
name
}
onChange
=
{
handleSetName
}
className
=
"mb-4"
/>
<
Input
label
=
"Description"
type
=
"text"
value
=
{
description
}
onChange
=
{
handleSetDescription
}
className
=
"mb-4"
/>
<
Input
label
=
"Name"
type
=
"text"
value
=
{
name
}
onChange
=
{
handleSetName
}
className
=
"mb-4"
/>
<
Input
label
=
"Description"
type
=
"text"
value
=
{
description
}
onChange
=
{
handleSetDescription
}
className
=
"mb-4"
/>
<
Accordion
defaultOpenAll
=
{
true
}
className
=
"border-t divide-y"
>
<
AccordionItem
className
=
"pt-2 pb-4"
>
<
AccordionHead
showArrow
=
{
false
}
>
...
...
@@ -164,8 +145,8 @@ export function ReportingForm(props: Props) {
setRecipientInput
(
String
(
value
));
const
recipientList
=
String
(
value
)
.
split
(
/
[
,
]
/
)
.
map
(
r
=>
r
.
trim
())
.
filter
(
r
=>
r
.
length
>
0
);
.
map
(
(
r
)
=>
r
.
trim
())
.
filter
(
(
r
)
=>
r
.
length
>
0
);
setRecipients
(
recipientList
);
}
}
placeholder
=
"Enter recipient(s)"
...
...
@@ -210,4 +191,4 @@ export function ReportingForm(props: Props) {
</
div
>
</
div
>
);
}
\ No newline at end of file
}
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