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

SAK-49287 Notifications. Improved push permissions workflow #11947

Merged
merged 12 commits into from
Mar 29, 2024

Conversation

adrianfish
Copy link
Contributor

@adrianfish
Copy link
Contributor Author

Screenshot 2023-09-27 at 12 39 02 Screenshot 2023-09-27 at 12 36 49 Screenshot 2023-09-27 at 12 36 17

@csev
Copy link
Contributor

csev commented Sep 27, 2023

Tasty - I was wondering how we were going to handle this. Folks say 'no' to the "accept notifications" for all sites - so for an LMS they need a second chance. We will need to see if browsers kind of beat us up - they probably have some trick to keep sites from asking over and over.


<name>Sakai Root</name>
<groupId>org.sakaiproject</groupId>
<artifactId>ROOT</artifactId>
Copy link
Contributor

Choose a reason for hiding this comment

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

Adrian can you explain this artifact ROOT? do we have a better name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So the war file is called ROOT.war and is deployed to the tomcat root, that's all.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you think I can change the artifact id while still creating ROOT.war to deploy to tomcat?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the reason we have this sakai-root thing is that we need to deploy a single service worker to the top level of our hierarchy so it can control all of Sakai's paths. It's crucial.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the artifact is now "serviceworker" and I've used deployId to deploy to tomcat as the ROOT war.

ern
ern previously requested changes Sep 27, 2023
Copy link
Contributor

@ern ern left a comment

Choose a reason for hiding this comment

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

Not particularly a fan of the path names maybe we can discuss that?

@adrianfish
Copy link
Contributor Author

which path names in particular?

@adrianfish adrianfish force-pushed the SAK-49287 branch 2 times, most recently from f2f1c35 to 7706cfc Compare December 6, 2023 08:12
@adrianfish
Copy link
Contributor Author

Screenshot 2024-01-31 at 18 14 56

@adrianfish
Copy link
Contributor Author

I've updated this to change the ROOT sakai maven module to just be called "root" and not "sakai-root". Also, I've added a button in the notifications window to make it explicit that the user is opting into Sakai notifications.

@adrianfish adrianfish requested a review from ern March 5, 2024 17:25
@adrianfish adrianfish force-pushed the SAK-49287 branch 3 times, most recently from 5d77766 to 1b2f73e Compare March 14, 2024 18:08
@adrianfish
Copy link
Contributor Author

I've now updated this maven module to be called "serviceworker". No more root.

@stetsche
Copy link
Contributor

@adrianfish I think I can take a look at the PR sometime next week, if it's still needed. But just to get some context, when the user does not accept the push notifications, there will be no notifications within the portal neither?

@adrianfish
Copy link
Contributor Author

@stetsche Exactly that. Our challenge is inform the user that Sakai notifications are good. Push is so powerful and it is a shame that companies have abused it so heavily.

@stetsche
Copy link
Contributor

stetsche commented Mar 15, 2024

@adrianfish, okay I understand what the PR is for. But when I enable push notifications, will notifications display only in the portal, or like other push notifications as OS notifications (What a lot of websites are abusing)?

@adrianfish
Copy link
Contributor Author

Depending on the browser, both. Chrome and firefox will popup a OS notification as well as adding a notification to the portal area.

@stetsche
Copy link
Contributor

Okay, and if you want to have only portal notifications you need to enable them in the browser and block browser notifications on the OS level?

@adrianfish
Copy link
Contributor Author

I suppose so. Or we could just disable them in the js. They are explicitly triggered, the os notifications.

@adrianfish adrianfish force-pushed the SAK-49287 branch 2 times, most recently from 7cabc84 to 8a9d022 Compare March 19, 2024 12:54
@adrianfish adrianfish force-pushed the SAK-49287 branch 2 times, most recently from 7d4b3b6 to 1fe1cd2 Compare March 21, 2024 10:13
serviceworker/pom.xml Outdated Show resolved Hide resolved
@adrianfish adrianfish force-pushed the SAK-49287 branch 2 times, most recently from 3e7136d to cdfb529 Compare March 21, 2024 14:04
@adrianfish
Copy link
Contributor Author

Done with this now. I've removed sakai-message-broker.js. Most of the logic moved nicely into sakai-push.utils.js and the remainder I just tacked onto portal.init.js.

@ottenhoff
Copy link
Contributor

This seems to consistently break Cypress tests. I saw lots of errors in my console around theme switching. Maybe theme switcher was depending on something that got moved?

Copy link
Contributor

@stetsche stetsche left a comment

Choose a reason for hiding this comment

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

@adrianfish I can take a closer look at next week

Copy link
Contributor

@stetsche stetsche left a comment

Choose a reason for hiding this comment

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

The PR looks good to me now. Well done @adrianfish! I only found a console.log to remove, but I'll mark this as approved already, so I don't have to come back to the PR

@adrianfish
Copy link
Contributor Author

Thanks a ton @stetsche, for the review. And anybody else who reviewed this PR. Much appreciated :)

@adrianfish adrianfish dismissed ern’s stale review March 29, 2024 10:13

Made changes to the artefact name and sakai code module name

@adrianfish adrianfish merged commit 3cbd7d2 into sakaiproject:master Mar 29, 2024
5 checks passed
@adrianfish adrianfish deleted the SAK-49287 branch March 29, 2024 10:13
@bgarciaentornos
Copy link
Contributor

I think the husky command is failing for windows

ern pushed a commit that referenced this pull request Apr 19, 2024
Co-authored-by: stetsche <[email protected]>
(cherry picked from commit 3cbd7d2)

 Conflicts:
	portal/portal-impl/impl/src/java/org/sakaiproject/portal/charon/SkinnableCharonPortal.java
	portal/portal-render-engine-impl/impl/src/webapp/vm/morpheus/includeStandardHead.vm
	webcomponents/tool/src/main/frontend/packages/sakai-notifications/src/SakaiNotifications.js
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.

7 participants