-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add events to application pages #602
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good!
Currently, there is not error handling. @kschiffer how should it look like?
This still needs to be discussed and decided here. We can then create some actionable issues from there.
A couple of overall remarks:
- I think it would be good if clicking anywhere on the widget will take you to the data view
- Can you add a small bottom margin in the
application-data
view? The event component now touches the footer. - I'm still not very fond of the level of abstraction in our store logic, which has now increased even more. It became quite hard (for me) to review as it is uncommented and has a partly quite misleading variable naming. Should be discussed in a backlog issue.
pkg/webui/components/events/index.js
Outdated
return true | ||
} | ||
|
||
// do not rerender component on new events if it in the `paused` state |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// do not rerender component on new events if it in the `paused` state | |
// do not rerender component on new events if it is in the `paused` state |
limit, | ||
} = this.props | ||
|
||
if ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if we do ourselves a favor with this if statement. We would need to update this for every prop/state structure change we do. Wouldn't it be better to assume rerenders by default and only rule out cases (like below with the paused state)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We would need to update this for every prop/state structure change we do
If anyone changes the internals of the component then the person should also check the shouldComponentUpdate
logic. This does influence the api of the component only the logic within the component.
) | ||
|
||
export const createGetEventMessageFailureActionType = name => ( | ||
`GET_${name}_EVENT_MESSAGE_SUCCESS` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`GET_${name}_EVENT_MESSAGE_SUCCESS` | |
`GET_${name}_EVENT_MESSAGE_FAILURE` |
) | ||
|
||
export const createStartEventsStreamFailureActionType = name => ( | ||
`START_${name}_EVENT_STREAM_SUCCESS` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`START_${name}_EVENT_STREAM_SUCCESS` | |
`START_${name}_EVENT_STREAM_FAILURE` |
const START_EVENTS_FAILURE = createStartEventsStreamFailureActionType(name) | ||
const STOP_EVENTS = createStopEventsStreamActionType(name) | ||
const startEventsSuccess = startEventsStreamSuccess(name) | ||
const startEventsFailrue = startEventsStreamFailure(name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const startEventsFailrue = startEventsStreamFailure(name) | |
const startEventsFailure = startEventsStreamFailure(name) |
channel.on('error', error => dispatch(getEventFailure(id, error))) | ||
channel.on('close', () => dispatch(stopEvents(id))) | ||
} catch (error) { | ||
dispatch(startEventsFailrue(error)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dispatch(startEventsFailrue(error)) | |
dispatch(startEventsFailure(error)) |
createClearEventsActionType, | ||
} from '../actions/events' | ||
|
||
const defualtState = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const defualtState = { | |
const defaultState = { |
const GET_EVENT_FAILURE = createGetEventMessageFailureActionType(reducerName) | ||
const CLEAR_EVENTS = createClearEventsActionType(reducerName) | ||
|
||
return function (state = defualtState, action) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return function (state = defualtState, action) { | |
return function (state = defaultState, action) { |
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
const storeSelector = (state, props) => state[props.id] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It really took me a while to figure out what these are. selectors
clashes with our term for selectors
in the JS SDK. I would really prefer the name mappers
, which is more in line with their usage in mapStateToProps()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, a selector is a well known term in the redux world, not a mapper.
render () { | ||
const { appId } = this.props.match.params | ||
|
||
return ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a <ReactHelmet />
entry for the view. In general, a lot of application pages still lack these. Can you follow up with an issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never mind, I'll create an issue for this.
What is the purpose of the |
To give a visual clue towards the data view with the full event component. |
reducers/middleware/action creators are just functions, so we can write tests for them |
cc45c90
to
9bcd6e4
Compare
Summary
This PR adds events to the application management pages.
References: #28
Changes
<EventsSubscriptions />
component<ApplicationEvents />
container component<Events.Widget />
to the Application Overview Page<Events />
componentpaused
state handling to the<Events />
componentNotes for Reviewers
paused
state in the<Events />
component seems to be a better option than outsourcing it redux. Mainly, because we want to pause events only in the full component, but not in the widget.Release Notes