Skip to content
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

Feature/implement error boundary hoc #3367

Merged
merged 25 commits into from Jun 15, 2021

Conversation

pablomarga
Copy link
Contributor

@pablomarga pablomarga commented Jun 14, 2021

Hi team this PR add the ErrorBoundary hoc to react components.

Closes #3263

Machi3mfl and others added 18 commits June 7, 2021 16:23
* feat(errorBoundary): Added ErrorBoundary HOC and component and added loglevel dependency

* feature(errorBoundary): Moved with the others HOCs.

* feature(errorBoundary): Typo refactor.

* First attempt LoggerService

* Merged error boundary, integrated loggerService.

* changed logger name, create logger-service test file

* Updated CHANGELOG

* Moved to react-services, changed name, traslates comments

* feat(errorBoundary): Removed old integration

* refactor(loggerService): Changed class for function methods.

* test(logger-service): Added basic unit test to logger-service

* refactor(logger-service): Applied new implementation of error-orchestrator service.

* feature(logger-service): PR comments and some refactors.

Co-authored-by: gabiwassan <gabriel.wassan@wazuh.com>
Co-authored-by: Ibarra Maximiliano <maximiliano.ibarra@wazuh.com>
* feat(errorBoundary): Added ErrorBoundary HOC and component and added loglevel dependency

* feature(errorBoundary): Moved with the others HOCs.

* feature(errorBoundary): Typo refactor.

* feature(errorBoundary): Some refactors

* feat(errorBoundary): PR comments and rollback agent-preview

* doc(changelog): Update changelog

* feat(errorBoundary): Rollback

* feat(errorBoundary): Rollback

* feat(errorBoundary): Rollback

* feat(errorBoundary): Rollback

* feat(errorBoundary): Refactor props, pr comments.

* feat(errorBoundary): Added unit test for error boundary.

* feat(errorBoundary): Separated error boundary component of hoc

* doc(error-boundary): Fixed and added licenses blocks.
* Add endpoint

* Create new backend service

* Add changelog

* Renamed constants

* Added interfaces, created new controller and renamed

* Created ui-logged, to prevent logger superclass

* Added types, fixed responses types

* Added new route file to ui-logs, changed method put to post, added in index,ts

* Added test files, we must create all unit tests to those new features

* Fixed if condition

* Rename tests files, created endpoints test

* Changed controller name ui-logs, removed duplicated export

* Fixed file comments

* Applied prettier formater

* Added new base class base-logger

* Remove wrong constants and fix errors

* test(ui-logger-controller): Added simple unit test.

* test(ui-logs-controller): Fix params.

* Added test to ui-logs controller

* Renamed test files

* test(logs-controller): Added mock to function checkFileExist + prettier.

* Solve comments

* Add copyright and remove unused import

Co-authored-by: Ibarra Maximiliano <maximiliano.ibarra@wazuh.com>
Co-authored-by: gabiwassan <gabriel.wassan@wazuh.com>
@pablomarga pablomarga self-assigned this Jun 14, 2021
@pablomarga pablomarga changed the base branch from 4.3-7.10 to feature/3262-client-side-logging June 14, 2021 08:47
@pablomarga pablomarga changed the base branch from feature/3262-client-side-logging to 4.3-7.10 June 14, 2021 08:47
@pablomarga pablomarga linked an issue Jun 14, 2021 that may be closed by this pull request
7 tasks
pablomarga and others added 5 commits June 14, 2021 15:33
* feat(errorBoundary): Added ErrorBoundary HOC and component and added loglevel dependency

* feature(errorBoundary): Moved with the others HOCs.

* feature(errorBoundary): Typo refactor.

* First attempt LoggerService

* Merged error boundary, integrated loggerService.

* changed logger name, create logger-service test file

* Updated CHANGELOG

* Moved to react-services, changed name, traslates comments

* feat(errorBoundary): Removed old integration

* refactor(loggerService): Changed class for function methods.

* test(logger-service): Added basic unit test to logger-service

* refactor(logger-service): Applied new implementation of error-orchestrator service.

* feature(logger-service): PR comments and some refactors.

Co-authored-by: gabiwassan <gabriel.wassan@wazuh.com>
Co-authored-by: Ibarra Maximiliano <maximiliano.ibarra@wazuh.com>
Copy link
Contributor

@gabiwassan gabiwassan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job!
Just some comments.
And check to apply prettier on all your changes. 💪🏼

render() {
return (<SyscollectorInventory agent={this.props.agent}></SyscollectorInventory> )
}
function MainSyscollectorClass(props) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be better like arrow functions
const MainSyscollectorClass = (props) => {


export class MainModule extends Component {
export const MainModule = compose (withErrorBoundary,withReduxProvider) (class MainModule extends Component {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check prettier here

@@ -329,7 +327,7 @@ export class AgentsWelcome extends Component {
</EuiFlexGroup>
</EuiFlexItem>
</EuiFlexGroup>
);
);withErrorBoundary
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe type error?

</div>
);
}
function KibanaVisClass(props) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here change for arrow functions

@pablomarga pablomarga marked this pull request as ready for review June 15, 2021 11:26
Copy link
Contributor

@frankeros frankeros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Member

@Machi3mfl Machi3mfl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

@gabiwassan gabiwassan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ! 🚀

@gabiwassan gabiwassan merged commit 2a52655 into 4.3-7.10 Jun 15, 2021
@gabiwassan gabiwassan deleted the feature/implement-error-boundary-hoc branch June 15, 2021 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement error handling HOC in each main react-component (pre-migration)
4 participants