humhub / app

22 stars 8 forks source link

Add Warning Dialog when HumHub doesn't support push #188

Closed luke- closed 2 months ago

luke- commented 5 months ago

The app should display a warning dialogue if the selected HumHub installation does not have a configured push module installed.

The status can be queried via: https://github.com/humhub/fcm-push/issues/37

Warn text could be, for example:

‘No push notifications are available for the selected HumHub installation. Contact the administrator for more information.’

@Semir1212 can you check the text please?

Semir1212 commented 5 months ago

@luke-

"Push notifications are not supported by this installation."

luke- commented 5 months ago

Route is /fcm-push/status

PrimozRatej commented 3 months ago

Hey @luke-,

There is a minor issue here. The community page exposes ${manifest.baseUrl}/fcm-push/status to the public, allowing data access without authentication. For private instances like sometestproject12345 and Omrade, which require authentication, the status is inaccessible without logging in.

We use the dio package for communication with the REST API, which is not authenticated because authentication occurs inside the webview, where the user state is managed. The webview does not support advanced web client functionalities. It is possible to parse the returned HTML and extract JSON, but I would like to avoid that.

I would use JS message method, similar to how we did for registering the FCM token.

marc-farre commented 3 months ago

@luke- @PrimozRatej Why not displaying this warning to logged admins only? I think the most important is to inform them their HumHub instance is not well configured for the mobile app and how to do it.

It might even be better not displaying the warning to non-admins, because maybe some communities will want to use the app without push feature.

What do you think?

ArchBlood commented 3 months ago

@luke- @PrimozRatej Why not displaying this warning to logged admins only? I think the most important is to inform them their HumHub instance is not well configured for the mobile app and how to do it.

It might even be better not displaying the warning to non-admins, because maybe some communities will want to use the app without push feature.

What do you think?

I believe this would also work better when https://github.com/humhub/fcm-push/issues/24 is implemented, I've also contributed a modified version of the P/R within this issue to implement the grant statuses with @luke-'s points in mind and can say overall it works rather well, but it could be updated to also handle this issue.

luke- commented 3 months ago

@luke- @PrimozRatej Why not displaying this warning to logged admins only? I think the most important is to inform them their HumHub instance is not well configured for the mobile app and how to do it.

It might even be better not displaying the warning to non-admins, because maybe some communities will want to use the app without push feature.

What do you think?

We can also do it that way.

But if we only want to implement a warning for admins, we should implement this on the HumHub module side in the fcm-push module.

marc-farre commented 3 months ago

on the HumHub module side

Maybe we could use the HumHub-Mobile user agent marker to detect when we're viewing HumHub from the mobile app: https://github.com/humhub/app/issues/182#issuecomment-2179376171

We could take this opportunity to create:

Then, we could add the warning to the IncompleteSetupWarning widget?

luke- commented 3 months ago

@marc-farre We already have some helper here: https://github.com/humhub/fcm-push/blob/master/helpers/MobileAppHelper.php#L58

Maybe we could copy that, for now somewhere into the core.

At some point we should think about integrating at least some app parts of the fcm-push module directly into the core.

marc-farre commented 3 months ago

@luke- done:

marc-farre commented 3 months ago

@luke- Do you want me to add the warning to the IncompleteSetupWarning widget using the new DeviceDetectorHelper?

luke- commented 3 months ago

@marc-farre Yes, that would be fine! Thanks!

marc-farre commented 3 months ago

@luke- PR https://github.com/humhub/humhub/pull/7166

What do you think about this view? image

I had to rework the "Open documentation" button, because it's not the same link for the push notification configuration. I didn't find a better solution than display twice the same button for the 2 cron job warning.

luke- commented 3 months ago

@marc-farre Thanks, the PR looks good!

@Eladnarlea Can you please check the buttons?

Eladnarlea commented 3 months ago

@luke- I would suggest to do it in the style of the alert/prerequisites design.

In case you do not wish to implement it yet, we could only implement the icon-button help-link first, but also add one icon-button view documentation to the bottom of the window

Screenshot 2024-08-13 at 1 22 40 PM

EDIT: in terms of layout and sizes I am unsure how your suggestion would look like, implemented, @marc-farre. I find it difficult to evaluate your design & button positions for this reason. Could you please provide the whole screen for mobile and desktop, @marc-farre ? :)

luke- commented 3 months ago

@Eladnarlea Thanks, unfortunately I don't have time for the Requirement Redesign topic at the moment. But I would like to take a closer look at the design here before implement.

So I would suggest that we first add buttons (or a simple link) and not change the design at all. Later in the requirement redesign we can also consider this sidebar element.

@marc-farre Can you please add a simple plain link regarding the app for now. We'll hopefully redesign this soon.

marc-farre commented 3 months ago

@luke- @Eladnarlea commit https://github.com/humhub/humhub/pull/7166/commits/b452871b144007144f40e40aa1c6baa2681b6d22

image

Or did you want to keep the existent "Documentation" button for cron jobs and add a warning about the mobile app bellow?

luke- commented 3 months ago

The help buttons looks a bit strange vor me. Maybe just? image

marc-farre commented 3 months ago

@luke- Commit https://github.com/humhub/humhub/pull/7166/commits/77aedf1ef8cc3fca7ac0ba53f4a180329b86494b

image

Eladnarlea commented 3 months ago

@luke- in order to unify the software, could we please try to use the unified version like in the prerequisites used, already? Meaning using the [icon] Help "ghost button?

I think, what you didn't like about the help button was not the button itself, rather the styling of the link-icon- If @marc-farre could just make it the same font-size as the help font size itself, as well as using capitalisation "H"elp AND for now maybe using fnot-weight: 500 for Help? I think that would do the job. @luke- what do you reckon?

luke- commented 3 months ago

@Eladnarlea I haven't had a closer look at the new Prereq design yet... so I don't want to already start implementing it in this unrelated task.

marc-farre commented 3 months ago

@luke- Is my PR fine, or you want changes on it?

luke- commented 3 months ago

@marc-farre Thanks, it's fine. But there will be UI changes as soon we refactoring the PreReq page :-)

marc-farre commented 2 months ago

@luke- I close this issue. We can open a new one about UI refactoring.