Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
logging-scratch-gui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
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
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
David Goessmann
logging-scratch-gui
Commits
c0e843f3
Commit
c0e843f3
authored
6 years ago
by
Evelyn Eastmond
Browse files
Options
Downloads
Patches
Plain Diff
Hook up modal connection dispatch to reconnect button with dummy extension id.
parent
cc367061
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/components/alerts/alerts.jsx
+2
-6
2 additions, 6 deletions
src/components/alerts/alerts.jsx
src/containers/alert.jsx
+11
-7
11 additions, 7 deletions
src/containers/alert.jsx
src/containers/alerts.jsx
+2
-6
2 additions, 6 deletions
src/containers/alerts.jsx
with
15 additions
and
19 deletions
src/components/alerts/alerts.jsx
+
2
−
6
View file @
c0e843f3
...
...
@@ -3,13 +3,11 @@ import PropTypes from 'prop-types';
import
Box
from
'
../box/box.jsx
'
;
import
Alert
from
'
../../containers/alert.jsx
'
;
import
VM
from
'
scratch-vm
'
;
const
AlertsComponent
=
({
alertsList
,
className
,
onCloseAlert
,
vm
onCloseAlert
})
=>
(
<
Box
bounds
=
"parent"
...
...
@@ -21,7 +19,6 @@ const AlertsComponent = ({
index
=
{
index
}
key
=
{
index
}
message
=
{
a
.
message
}
vm
=
{
vm
}
onCloseAlert
=
{
onCloseAlert
}
/>
))
}
...
...
@@ -31,8 +28,7 @@ const AlertsComponent = ({
AlertsComponent
.
propTypes
=
{
alertsList
:
PropTypes
.
arrayOf
(
PropTypes
.
object
),
className
:
PropTypes
.
string
,
onCloseAlert
:
PropTypes
.
func
,
vm
:
PropTypes
.
instanceOf
(
VM
).
isRequired
onCloseAlert
:
PropTypes
.
func
};
export
default
AlertsComponent
;
This diff is collapsed.
Click to expand it.
src/containers/alert.jsx
+
11
−
7
View file @
c0e843f3
...
...
@@ -2,7 +2,6 @@ import React from 'react';
import
bindAll
from
'
lodash.bindall
'
;
import
PropTypes
from
'
prop-types
'
;
import
{
connect
}
from
'
react-redux
'
;
import
VM
from
'
scratch-vm
'
;
import
AlertComponent
from
'
../components/alerts/alert.jsx
'
;
import
{
openConnectionModal
}
from
'
../reducers/modals
'
;
...
...
@@ -12,15 +11,16 @@ class Alert extends React.Component {
constructor
(
props
)
{
super
(
props
);
bindAll
(
this
,
[
'
handleOnCloseAlert
'
'
handleOnCloseAlert
'
,
'
handleOnReconnect
'
]);
}
handleOnCloseAlert
()
{
this
.
props
.
onCloseAlert
(
this
.
props
.
index
);
}
handleOnReconnect
()
{
//
this.props.
vm.emit('
')
console
.
log
(
'
h
ello
'
);
this
.
props
.
onOpenConnectionModal
(
'
ev3
'
)
console
.
log
(
'
h
andleOnReconnect
'
);
}
render
()
{
const
{
...
...
@@ -39,6 +39,10 @@ class Alert extends React.Component {
}
}
const
mapStateToProps
=
state
=>
({
state
:
state
});
const
mapDispatchToProps
=
dispatch
=>
({
onOpenConnectionModal
:
id
=>
{
dispatch
(
setConnectionModalExtensionId
(
id
));
...
...
@@ -51,10 +55,10 @@ Alert.propTypes = {
index
:
PropTypes
.
number
,
message
:
PropTypes
.
string
,
onCloseAlert
:
PropTypes
.
func
.
isRequired
,
onOpenConnectionModal
:
PropTypes
.
func
,
vm
:
PropTypes
.
instanceOf
(
VM
).
isRequired
onOpenConnectionModal
:
PropTypes
.
func
};
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
Alert
s
);
)(
Alert
);
This diff is collapsed.
Click to expand it.
src/containers/alerts.jsx
+
2
−
6
View file @
c0e843f3
import
React
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
import
{
connect
}
from
'
react-redux
'
;
import
VM
from
'
scratch-vm
'
;
import
{
closeAlert
...
...
@@ -12,13 +11,11 @@ import AlertsComponent from '../components/alerts/alerts.jsx';
const
Alerts
=
({
alertsList
,
className
,
onCloseAlert
,
vm
onCloseAlert
})
=>
(
<
AlertsComponent
alertsList
=
{
alertsList
}
className
=
{
className
}
vm
=
{
vm
}
onCloseAlert
=
{
onCloseAlert
}
/>
);
...
...
@@ -26,8 +23,7 @@ const Alerts = ({
Alerts
.
propTypes
=
{
alertsList
:
PropTypes
.
arrayOf
(
PropTypes
.
object
),
className
:
PropTypes
.
string
,
onCloseAlert
:
PropTypes
.
func
,
vm
:
PropTypes
.
instanceOf
(
VM
).
isRequired
onCloseAlert
:
PropTypes
.
func
};
const
mapStateToProps
=
state
=>
({
...
...
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