Closed sseppi closed 6 months ago
@mrabans @RudiThoeni I've created this issue and we need to start defining how should be the generic solution. Are there other open questions that should be taken into consideration for this issue?
@sseppi probably we have to discuss this in detail to come up with a future proof solution.
We discussed about the push functionality and the idea was to have one generic Push Endpoint where this informations has to be passed:
On Publisher Level the Push Functionality has to be activated. We thought about activating it on Dataset type.
The information (Timestap when, PushId etc...) has to ba saved on data level and displayed to the user somewhere, so he knows that a push was already sent etc....
We had a discussion where we defined:
{fieldname}
example {_Meta.Type}
Some UX questions emerged
@RudiThoeni what do you mean with
What if more Push buttons are there (Button with Dropdown)
Could you pls specify the usecase?
Hi @pkritzinger
in case we have two different "publishers" that allows to send push notification at two different apps (e.g. NOI App and suedtirol.info), we need to allow the user to choose where he wants to push the notification.
We thought that one possible way would be to have a dropdown menu or a checkbox that allows the user to select the applications he wants to send the push to.
Did I clarified better what we ment?
@RudiThoeni what do you mean with
What if more Push buttons are there (Button with Dropdown)
Could you pls specify the usecase?
@sseppi now it's crystal clear, thanks :)
Hi @gappc @sseppi I worked on the requested changes. Api Side: (https://github.com/noi-techpark/odh-api-core/pull/420)
Databrowser Side: (https://github.com/noi-techpark/it.bz.opendatahub.databrowser/pull/553)
When bot of this tasks are completed everything is ready to add the implementation for the push button
Hey @RudiThoeni, I saw your PR. Although I didn't look into the details, it looks already very nice :+1:
From the screenshot I think I know where you got stuck: pathparam
;)
Lets schedule a meeting and maybe do some pair programming, so we can exchange ideas and possible solutions.
@gappc
As you can see from the previous comment of Rudi, he prepared everything is needed to implement the "Push" button. He has only one question, he would like to discuss with you.
From my point of view, the next steps are:
As agreed during the meeting, since the backend isn't still ready now, we implement only the logic to send the push, not the one to program it. I will create a dedicated issue to the Program Push functionality (#554 ).
Hi @sseppi With the great help from @gappc now it is possible to add multiple push information to each publisher in the section "PublishConfig"
on test i added now for the publishers idm-marketplace [https://api.tourism.testingmachine.eu/v1/PushData/{Id}/{_Meta.Type}/idm-marketplace] noi-communityapp [https://api.tourism.testingmachine.eu/v1/PushData/{Id}/{_Meta.Type}/noi-communityapp] (At the moment lets not use this call because it sends a push to all app users of the community app ;) This is a POST Endpoint
To perform the push the User must have the right permissions otherwise 403 is returned
If all goes well the api call returns a http 200 with a Dictionary<string, PushResponse>
public class PushResponse
{
public string Id { get; set; }
public string Publisher { get; set; }
public DateTime Date { get; set; }
public dynamic Result { get; set; }
}
To be discussed: What we display when the push is done I will add some test cases where no effective push is created.... I noticed also a small bug (on a already configured PublisherConfig/PathParam deleting a PublisherConfig/PathParam inside the table only works if first i add a new one....) (write it down here for me so i don't forget it)
Will write here when everything is ready
Hi @RudiThoeni and @gappc ,
thank you for the great work!
To be discussed: What we display when the push is done
If we have it, I think that ID and timestamp of the push could be useful, to easily debug in case of problems.
What do you think? Best Stefano
I created a Table where all push infos are stored.... and an api where all pushinfo can be retrieved.... A push info has as fixed Values an Id, Timestamp, Publisher, Result.Success If we provide the Id and the Success it should be enough, every additional info could be retrieved with the Push Api Info (which could be displayed via databrowser) --> cool we see that all begins working together )
@gappc now everything is ready to implement the button As mentioned before on idm-marketplace, noi-communityapp there are pushconfigs defined.
The endpoint the button should finally reach is POST https://api.tourism.testingmachine.eu/v1/PushData/{Id}/{Type}/{Publisher}
I added some mocks to the endpoint so we can test, it does provide this responses If all is working i will activate the effective pushes :)
{
"idm-marketplace": {
"Id": "f8c691e7-ac2b-4c92-8ed6-9e5c9036fde7",
"Publisher": "idm-marketplace",
"Date": "2024-04-05T14:18:19.5313719+02:00",
"Result": {
"Response": "This is a mockup response",
"HttpStatusCode": "OK",
"Service": "idm-marketplace",
"Success": true
},
"PushObject": {
"Id": "smgpoifad01289740e1d2f58dc1aa29288bb33",
"Type": "odhactivitypoi"
}
}
}
{
"noi-communityapp": {
"Id": "69bad1f0-d9de-4b25-be5c-9484441e5021",
"Publisher": "noi-communityapp",
"Date": "2024-04-05T14:12:53.5357176+02:00",
"Result": {
"Messages": 1,
"Success": true,
"Response": "This is a mockup response",
"Error": ""
},
"PushObject": {
"Id": "smgpoifad01289740e1d2f58dc1aa29288bb33",
"Type": "odhactivitypoi"
}
}
}
The Button should show only if the push was done (Result.Success true/false) and maybe provide the (Id) so that if something went wrong it could all be looked into the PushResults Api (i still have to create the view in the databrowser for this api).
@sseppi can we close this issue?
@gappc I will test the feature together with the client and, in case of positive feedback, close it.
In the old Data Browser there was the possibility to send push notification about specific contents.
The first real use case we have is the Push of notification about NOI News to the NOI App.
In this issue we should define and implement a generic solution, to allows us to activate this push functionality without the need to riprogramm it every time there is a new app or content that should be pushd or notified.
Open Questions
published on
attribute?