thoth-station / jupyterlab-requirements

JupyterLab Extension for dependency management and optimization
GNU General Public License v3.0
16 stars 9 forks source link

added message handler #631

Closed Gkrumbach07 closed 2 years ago

Gkrumbach07 commented 2 years ago

Related Issues and Dependencies

https://github.com/thoth-station/jupyterlab-requirements/issues/630

This introduces a breaking change

This Pull Request implements

I added a js function that handles duplicate notifications for the index.js file.

Description

The tool takes in an empty object and stores notification IDs local to the function it was called in. Many of these notifications were not in react components, so I chose to do it locally like this. I could have used global variables but that gets messy.

The tool checks if the notification's text is in the local function store and if it is it resets the time for it to auto close.

A garbage collector is triggered after some time to clean up any unused notifications in the store as there is no callback for when a notification auto-closes.

The default auto-close is 5 seconds.

sesheta commented 2 years ago

@Gkrumbach07: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
aicoe-ci/prow/mypy dee17f3516999175518875141bfc4f1166c01d6b link true /test thoth-mypy-py38

Full PR test history. Your PR dashboard. Please help us and open an issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
harshad16 commented 2 years ago

@Gkrumbach07 did you test this ?

Gkrumbach07 commented 2 years ago

@harshad16 I did test it, however I dont know what to changes to fix that mypy error.

sesheta commented 2 years ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: harshad16 To complete the pull request process, please assign sesheta after the PR has been reviewed. You can assign the PR to them by writing /assign @sesheta in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files: - **[OWNERS](https://github.com/thoth-station/jupyterlab-requirements/blob/master/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment