RocketChat / Apps.Notion

Integrating Notion with Rocket.Chat
https://github.com/Nabhag8848/Google-Summer-Of-Code
10 stars 18 forks source link

[Feat]: To add a script to automatically close the window after either a successful or failed workspace connection. #50

Closed Spiral-Memory closed 6 months ago

Spiral-Memory commented 8 months ago

What do we need?

Currently, after connecting to the workspace, whether it succeeds or fails, it returns an AuthPageTemplate. However, the user has to manually close the window, which is not an expected behavior and is not user friendly. This window should automatically close after the timer runs out. So, I propose adding a script to close this page after 5 seconds.

Acceptance Criteria

Relevant ScreenShots

https://github.com/RocketChat/Apps.Notion/assets/78961432/65f9c39f-a9ec-4931-9774-3f445f40f495

Further Comments

No response

Nabhag8848 commented 8 months ago
Spiral-Memory commented 8 months ago

@Nabhag8848 , Thank you so much for the appreciation. I will certainly research and inform you if there is a possibility to fix the CSP issue. Yes, even if we want to close immediately after showing the success or error page, window.close() has to be called, and again it will involve running the script. I will look into it and let you know.

Spiral-Memory commented 8 months ago

@Nabhag8848 , the issue has been fixed, and now the closing script will run even after the CSP is enabled. We just need to set a custom header while sending the response in the GET request. Thanks to Abhinav sir for guiding me through. I am also attaching a video demo for the same.

https://github.com/RocketChat/Apps.Notion/assets/78961432/932ceed5-62b6-44e1-a83e-8e429af05d34