noi-techpark / it.bz.noi.community

NOI Community App for the Web
GNU General Public License v3.0
0 stars 1 forks source link

NEWS FEED | As a user of the app I want to get all the relevant information and news regarding NOI. #20

Open MarE1991 opened 2 years ago

MarE1991 commented 2 years ago

As a member of the NOI-Community and user of the app, I want to get all the relevant information and news regarding NOI. This could be announcements about new rules, community initiatives, upcoming or past events, and more. I want to visualize pictures, links, and files and get a push notification if there is a piece of important news not to be missed out. Each news is composed of:

RudiThoeni commented 2 years ago

Hi all

The api call to get the news is: https://tourism.api.opendatahub.bz.it/v1/Article?articletype=newsfeednoi

If we want to filter from now on and order by Startdate https://tourism.api.opendatahub.bz.it/v1/Article?articletype=newsfeednoi&startdate=2022-03-15&rawsort=-ArticleDate&odhactive=true

The startdate-enddate filter works this way News can have a startdate and an optional expirationdate startdate=2022-03-15 When a stardate is passed only News that are valid on this startdate are shown rawsort=-ArticleDate Sort by newest Article first odhactive=true Show only News marked as active

We reused our Opendatahub Article Endpoint so there are a lot of not used fields:

The fields for your interest are

{
    Id: "52402198-0C97-E378-8E63-E1A15FC121BA",
    Self: "https://tourism.api.opendatahub.bz.it/v1/Article/52402198-0C97-E378-8E63-E1A15FC121BA",
    Type: "newsfeednoi",
    _Meta: {
        Id: "52402198-0C97-E378-8E63-E1A15FC121BA",
        Type: "article",
        Source: "noi",
        Reduced: false,
        LastUpdate: "2022-03-15T10:48:40.5979606+00:00"
    },
    Active: false,
    Detail: {
        de: {
            Title: "News Noi April",
            BaseText: "<p>April April</p>",
            AdditionalText: "additionaltext"
        },
        en: {
            Title: "news noi april",
            BaseText: "<p>april april</p><p><br/></p>",
            AdditionalText: "additional text en"
        },
        it: {
            Title: "news noi aprile",
            BaseText: "<p>aprile aprile</p><p><br/></p>",
            AdditionalText: "additional text it"        
    }
    },
    Source: "noi",
    OdhActive: true,
    LastChange: "2022-03-15T10:48:40.5979606+00:00",
    ArticleDate: "2022-03-31T00:00:00",
    ArticleDateTo: "9999-12-31T23:59:59.9999999",
    FirstImport: "2022-03-15T10:48:40.598195+00:00",
    HasLanguage: [
        "de",
        "it",
        "en"
    ],
    LicenseInfo: {
        Author: "",
        License: "CC0",
        ClosedData: false,
        LicenseHolder: "https://noi.bz.it"
    },
    ContactInfos: {
        de: {
            Url: "https://noi.bz.it",
            Email: "community@noi.bz.it",
            LogoUrl: "http://databrowser.opendatahub.bz.it/icons/NOI.png",
            CompanyName: "NOI Techpark",
    },
        en: {
            Url: "https://noi.bz.it",
            Email: "community@noi.bz.it",
            LogoUrl: "http://databrowser.opendatahub.bz.it/icons/NOI.png",
            CompanyName: "NOI Techpark",
    },
        it: {
            Url: "https://noi.bz.it",
            Email: "community@noi.bz.it",
            LogoUrl: "http://databrowser.opendatahub.bz.it/icons/NOI.png",
            CompanyName: "NOI Techpark",
    }
    },
    ImageGallery: [
        {
            ImageUrl: "https://tourism.images.opendatahub.bz.it/api/Image/GetImage?imageurl=64947f45-42ba-41aa-9b9d-47d9fa55ba71.png",
            CopyRight: null,            
            ListPosition: 0,
        }
    ]
}
RudiThoeni commented 2 years ago

@sseppi please add the contactperson of Dimension for this issue currently i am the only one assigned

RudiThoeni commented 2 years ago

Field mapping is the current

a title (max 5-8 words) --> Detail.lang.Title a text corps whose length can variate from short texts to longer ones with bullet points or different paragraphs --> Detail.lang.BaseText the possibility to add a picture or graphic --> ImageGallery.ImageUrl the possibility to add a link --> ContactInfos.lang.Url

There are also ContactInfos.lang.CompanyName --> Publisher ContactInfos.lang.Logo --> Logo of the Publisher ContactInfos.lang.Email --> Email to contact

chiaraDimension commented 2 years ago

Field mapping is the current

a title (max 5-8 words) --> Detail.lang.Title a text corps whose length can variate from short texts to longer ones with bullet points or different paragraphs --> Detail.lang.BaseText the possibility to add a picture or graphic --> ImageGallery.ImageUrl the possibility to add a link --> ContactInfos.lang.Url

There are also ContactInfos.lang.CompanyName --> Publisher ContactInfos.lang.Logo --> Logo of the Publisher ContactInfos.lang.Email --> Email to contact

Hi @RudiThoeni, we need to know to other fields mapping:

  1. abstract of the news (a short text to show in the news list and in the first part of the news detail)
  2. flag "IMPORTANT" (to show IMPORTANT label in the news list)
Screenshot 2022-04-05 at 09 32 59
chiaraDimension commented 2 years ago

@MarE1991 how many news do we have to show in news page? In events page, we always show at most 20 events. Do we keep the same number?

And how do we set startDate parameter?

RudiThoeni commented 2 years ago

@sseppi @MarE1991 For the abstract of the news: field Detail.lang.AdditionalText (cannot remember what we wanted to do with this field? maybe it was for this purpose?) We have also other fields like field Detail.lang.Header or field Detail.lang.IntroText we could use....

For the label important we could use the field Highlight But here the question is when there are more labels to come.... to be more scalable then it would be easier to use a generic list at example the field ODHTags if it contains ODHTags.Id = important the label should be displayed?

MarE1991 commented 2 years ago

@MarE1991 how many news do we have to show in news page? In events page, we always show at most 20 events. Do we keep the same number?

And how do we set startDate parameter?

@chiaraDimension for the news section we didn't set a limit. Users should be able to find also old news when scrolling down. Is that possible or do you need a fixed maximum number? @RudiThoeni Can you anser the question on how to set the "startdate" parameter? thx

RudiThoeni commented 2 years ago

@RudiThoeni Can you anser the question on how to set the "startdate" parameter? thx

As explained above i think i would set the startdate always to today's date?

chiaraDimension commented 2 years ago

@MarE1991 how many news do we have to show in news page? In events page, we always show at most 20 events. Do we keep the same number? And how do we set startDate parameter?

@chiaraDimension for the news section we didn't set a limit. Users should be able to find also old news when scrolling down. Is that possible or do you need a fixed maximum number? @RudiThoeni Can you anser the question on how to set the "startdate" parameter? thx

Yes, it is possible, but we have to paginate the results, for example loading 10 news items at a time. Could be fine?

MarE1991 commented 2 years ago

@MarE1991 how many news do we have to show in news page? In events page, we always show at most 20 events. Do we keep the same number? And how do we set startDate parameter?

@chiaraDimension for the news section we didn't set a limit. Users should be able to find also old news when scrolling down. Is that possible or do you need a fixed maximum number? @RudiThoeni Can you anser the question on how to set the "startdate" parameter? thx

Yes, it is possible, but we have to paginate the results, for example loading 10 news items at a time. Could be fine?

@chiaraDimension ok, got it. That should be fine. This means, 10 news are loading when I open the page and then I have the possibility to scroll down further or click on load more and the next 10 news appear, right?

chiaraDimension commented 2 years ago

@MarE1991 how many news do we have to show in news page? In events page, we always show at most 20 events. Do we keep the same number? And how do we set startDate parameter?

@chiaraDimension for the news section we didn't set a limit. Users should be able to find also old news when scrolling down. Is that possible or do you need a fixed maximum number? @RudiThoeni Can you anser the question on how to set the "startdate" parameter? thx

Yes, it is possible, but we have to paginate the results, for example loading 10 news items at a time. Could be fine?

@chiaraDimension ok, got it. That should be fine. This means, 10 news are loading when I open the page and then I have the possibility to scroll down further or click on load more and the next 10 news appear, right?

Exactly, scrolling down further the next 10 news appear (without load more button).

Then we should only need this information in order to proceed with the implementation: https://github.com/noi-techpark/it.bz.noi.community/issues/20#issuecomment-1088456197

MarE1991 commented 2 years ago

@MarE1991 how many news do we have to show in news page? In events page, we always show at most 20 events. Do we keep the same number? And how do we set startDate parameter?

@chiaraDimension for the news section we didn't set a limit. Users should be able to find also old news when scrolling down. Is that possible or do you need a fixed maximum number? @RudiThoeni Can you anser the question on how to set the "startdate" parameter? thx

Yes, it is possible, but we have to paginate the results, for example loading 10 news items at a time. Could be fine?

@chiaraDimension ok, got it. That should be fine. This means, 10 news are loading when I open the page and then I have the possibility to scroll down further or click on load more and the next 10 news appear, right?

Exactly, scrolling down further the next 10 news appear (without load more button).

Then we should only need this information in order to proceed with the implementation: #20 (comment)

@chiaraDimension ok, perfect! @RudiThoeni fo 20 (comment) do you need any decision from me odr is it fine?

chiaraDimension commented 2 years ago

Hi @RudiThoeni, I'm trying to load news in Android app. I found problems showing logos, maybe because the urls are in http instead of https? Could you please verify?

Are these logos the same that will be use in production environment? Studiohug gave us the relative icons, but I think that we should load logos by urls that we obtain from API, isn't it?

RudiThoeni commented 2 years ago

Hi chiara I switched to https for the logourl, afaik these are the logos that will be used in prod, i got them from Marion...... i think also it is better to get them from api because then we can always change/add logos easily

chiaraDimension commented 2 years ago

@MarE1991 could you please produce some fake news to use for testing? They should be a sufficient number to test incremental loading when scrolling down. Moreover there should be of different types: with long text/only abstract, with 0,1 or more images, with/without external link...

chiaraDimension commented 2 years ago

@sseppi @MarE1991 For the abstract of the news: field Detail.lang.AdditionalText (cannot remember what we wanted to do with this field? maybe it was for this purpose?) We have also other fields like field Detail.lang.Header or field Detail.lang.IntroText we could use....

For the label important we could use the field Highlight But here the question is when there are more labels to come.... to be more scalable then it would be easier to use a generic list at example the field ODHTags if it contains ODHTags.Id = important the label should be displayed?

@RudiThoeni is this confirmed?

?

RudiThoeni commented 2 years ago

I confirm lets use this two fields...

MarE1991 commented 2 years ago

@chiaraDimension you find now some fake news in the back end to test it. Let me know if you need more or other ones.

chiaraDimension commented 2 years ago

@chiaraDimension you find now some fake news in the back end to test it. Let me know if you need more or other ones.

Thanks for these examples. It would be even better to have

MarE1991 commented 2 years ago

@chiaraDimension you find now some fake news in the back end to test it. Let me know if you need more or other ones.

Thanks for these examples. It would be even better to have

  • at least one news with several images
  • more than 10 news, in order to test results pagination (ie to load other news while scrolling).

@chiaraDimension finally I made it to insert more news. I tried to insert two with more images, but it didn't work out. Maybe @RudiThoeni can help us here. Is it not possible to load up more images. I remember that we said we would rarely need more pics, but it could be a thins with some news... THX

RudiThoeni commented 2 years ago

@MarE1991 sorry never tested with 2 images, resolved works now to upload more images ;)

MarE1991 commented 2 years ago

Thanks, @RudiThoeni , now everything should be ready to be tested @chiaraDimension

chiaraDimension commented 2 years ago

@MarE1991 are there some news flagged as important?

RudiThoeni commented 2 years ago

i flagged two events as importand (CC9ED1C4-7ED4-99A8-638D-1BA3C38317BD, 505B62F2-353F-DF9D-99BF-97F9177B1377)

matax87 commented 2 years ago

@RudiThoeni I'd like to test deeply our pagination logic and performances. Is it possible to have about a hundred of "dummy" articles with different ids? Thank you!

RudiThoeni commented 2 years ago

@matax87 done please test https://tourism.api.opendatahub.bz.it/v1/Article?articletype=newsfeednoi

RudiThoeni commented 2 years ago

sorry @matax87 my daily cleanup script removed the generated news ;) i fixed and regenerated now you can test!

chiaraDimension commented 2 years ago

@RudiThoeni During the tests, we found some issues regarding the Article API.

  1. The parameter startDate doesn't work correctly: if startDate=2022-05-24 we expect to obtain news with ArticleDate until 2022-05-24, instead the first news is the one of 2022-05-23:

API call: https://tourism.opendatahub.bz.it/v1/Article?pagenumber=1&pagesize=10&startdate=2022-05-24&articletype=newsfeednoi&rawsort=-ArticleDate&odhactive=true&language=it&fields=Id,Detail,ArticleDate,ContactInfos,ImageGallery,ODHTags

Results: { "TotalResults": 18, "TotalPages": 2, "CurrentPage": 1, "PreviousPage": null, "NextPage": "https://tourism.opendatahub.bz.it/v1/Article?pagenumber=2&pagesize=10&startdate=2022-05-24&articletype=newsfeednoi&rawsort=-ArticleDate&odhactive=true&language=it&fields=Id,Detail,ArticleDate,ContactInfos,ImageGallery,ODHTags", "Seed": null, "Items": [ { "Id": "ada394f2-ecca-4fad-8eb5-a463db703b4b", "Detail": { "it": { "Title": "TesttitleIT4", "Header": null, "BaseText": "testtextIT 4", "Keywords": null, "Language": "it", "MetaDesc": null, "AuthorTip": null, "IntroText": null, "MetaTitle": null, "SubHeader": null, "SafetyInfo": null, "ParkingInfo": null, "GetThereText": null, "EquipmentInfo": null, "AdditionalText": "additionaltextit4", "PublicTransportationInfo": null } }, "ArticleDate": "2022-05-23T09:12:55.395887+00:00", "ContactInfos": { "it": { "Tax": null, "Url": null, "Vat": null, "City": null, "Email": "community@noi.bz.it", "Address": null, "LogoUrl": "https://databrowser.opendatahub.bz.it/icons/NOI.png", "Surname": null, "ZipCode": null, "Language": "it", "Faxnumber": null, "Givenname": null, "NamePrefix": null, "CompanyName": "NOI Techpark", "CountryCode": null, "CountryName": null, "Phonenumber": null } }, "ImageGallery": null, "ODHTags": [] }, ...

To obtain the news relative to 2022-05-24 we have to set startDate=2022-05-25:

API call: https://tourism.opendatahub.bz.it/v1/Article?pagenumber=1&pagesize=10&startdate=2022-05-25&articletype=newsfeednoi&rawsort=-ArticleDate&odhactive=true&language=it&fields=Id,Detail,ArticleDate,ContactInfos,ImageGallery,ODHTags

Results: { "TotalResults": 19, "TotalPages": 2, "CurrentPage": 1, "PreviousPage": null, "NextPage": "https://tourism.opendatahub.bz.it/v1/Article?pagenumber=2&pagesize=10&startdate=2022-05-25&articletype=newsfeednoi&rawsort=-ArticleDate&odhactive=true&language=it&fields=Id,Detail,ArticleDate,ContactInfos,ImageGallery,ODHTags", "Seed": null, "Items": [ { "Id": "e212dcea-0d43-435b-8d7c-1fc41dd730cb", "Detail": { "it": { "Title": "TesttitleIT5", "Header": null, "BaseText": "testtextIT 5", "Keywords": null, "Language": "it", "MetaDesc": null, "AuthorTip": null, "IntroText": null, "MetaTitle": null, "SubHeader": null, "SafetyInfo": null, "ParkingInfo": null, "GetThereText": null, "EquipmentInfo": null, "AdditionalText": "additionaltextit5", "PublicTransportationInfo": null } }, "ArticleDate": "2022-05-24T09:12:55.3988272+00:00", "ContactInfos": { "it": { "Tax": null, "Url": null, "Vat": null, "City": null, "Email": "community@noi.bz.it", "Address": null, "LogoUrl": "https://databrowser.opendatahub.bz.it/icons/NOI.png", "Surname": null, "ZipCode": null, "Language": "it", "Faxnumber": null, "Givenname": null, "NamePrefix": null, "CompanyName": "NOI Techpark", "CountryCode": null, "CountryName": null, "Phonenumber": null } }, "ImageGallery": null, "ODHTags": [] }, ...

  1. Using parameter startDate, we have only few news (not all the "dummy" articles that you generated)

  2. The API for news detail returns status 404 (Not found) for some news (maybe only for the "dummy" articles that you generated). Can you have a look?

Example: https://tourism.opendatahub.bz.it/v1/Article/ada394f2-ecca-4fad-8eb5-a463db703b4b?language=it&fields=Id,Detail,ArticleDate,ContactInfos,ImageGallery,ODHTags

Response: { "type": "https://tools.ietf.org/html/rfc7231#section-6.5.4", "title": "Not Found", "status": 404, "traceId": "00-bbe5cc799c1745c15173d6588213cfb3-fa3e2d3b8cecea83-00" }

RudiThoeni commented 2 years ago

Hi Chiara

point 3 is resolved. I had to recreate the the dummy objects to fix, maybe i resolved also some datetime filter issues because i saw there was a time set (probably the reason for 1) ......

for 1,2 i want to understand the date filter behaviour first.... i was not sure how to implement it.....

Every news has a ArticleDate and an ArticleDateTo. The ArticleDateTo is not mandatory so if not filled i set a DatetTime Max value.

For what i understood Marion wants to have a sort of News List with all "valid" news inside..... means -the most actual news listed first -All news from the "future" not listed -all news with ArticleDateTo minor to the startdate filter should not be displayed

The query on DB is where DBEnddate >= Passedstartdate AND DBBeginDate <= PassedBegindate

so now when i filter https://tourism.opendatahub.bz.it/v1/Article?pagenumber=1&pagesize=10&startdate=2022-05-27&articletype=newsfeednoi&rawsort=-ArticleDate&odhactive=true&language=it&fields=Id,Detail.it.Title,ArticleDate should be ok, let's discuss in our meeting today