Addons-frontend: Add related categories to "More Info" section on add-on details

Created on 12 Jul 2017  路  18Comments  路  Source: mozilla/addons-frontend

Add related categories to "More Info" section on add-on details. Need to double-check if this has UX mocks, I don't recall them...

welcome p4 amo

All 18 comments

Currently the data only has the slug. Filed https://github.com/mozilla/addons-server/issues/6422

mozilla/addons-server#6422 was wont-fixed so we will be needing to make an additional call to get the categories for the add-on.

@pwalm it doesn't look like add-on categories are currently represented in the more information panel

Ignore me - I didn't see them for looking. They are here:

amo_desktop_-_master_sketch

@muffinresearch is it still something we want to implement?

Yes, we still want categories to be linked from the listing.

@willdurand @jvillalobos Can I take up this issue for adding related categories in More Information section of add-ons ?

@willdurand @jvillalobos Can I take up this issue for adding related categories in More Information section of add-ons ?

Yep

@willdurand Just want to ask few doubts:
For example: Categories for DuckDuckGo Plus looks like:

categories: {
       android: [
            'feeds-news-blogging',
            'security-privacy'
       ],
       firefox: [
            'privacy-security',
            'search-tools'
       ]
},

Just want to confirm that I have to first check the clientApp whether it is firefox or android and then list categories accordingly ?
And only category slug is coming in the object, name is not there ?
For UI, I am thinking to show categories as same as in the extension section. Any comments ?

Just want to confirm that I have to first check the clientApp whether it is firefox or android and then list categories accordingly ?

Yes.

For UI, I am thinking to show categories as same as in the extension section. Any comments ?

See the mockup in this comment for how it should look.

categories: {
       android: [
            'feeds-news-blogging',
            'security-privacy'
       ],
       firefox: [
            'privacy-security',
            'search-tools'
       ]
},

And only category slug is coming in the object, name is not there ?

Any suggestion on this?

@willdurand @jvillalobos I have created a draft PR becuase currently category name is not coming with the object. Please review the current changes and how should we further proceed on this ?

@willdurand @jvillalobos I have created a draft PR becuase currently category name is not coming with the object. Please review the current changes and how should we further proceed on this ?

Yeah, we'll have to look into the categories reducer to see if we have the categories loaded (and fetch them otherwise). This is going to be complex :)

@willdurand Can we fetch a category details individually using its slug? or Can we fetch all categories related to a addon separately?
For solving this issue I gone through the backend and there are no api for fetching individual category or addon related category. I am really stuck at this moment, what should I do?

@muskangupta-iitr so we can't fetch one category but we can fetch all the categories (once!) and then use them. This is how we do it for category pages: https://github.com/xlisachan/addons-frontend/blob/4c604542c6f8d785bfe7586df3d677f0355584fd/src/amo/components/Categories/index.js#L87

We will have to make sure that we only fetch the categories if we need to. There is a categories reducer that stores the categories by appName (so firefox or android) and then by addonType (extension, theme, etc.).

Ohk @willdurand I will update the PR with the suitable changes. Thanks :+1:
But why can't we add a API for fetching a single category as it might be used in future or we can serialize the addon category with whole category serializer?

@willdurand For now I pushed a commit in which I am fetching categories in AddonMoreInfo component and it's working fine. But I am facing problems in writing its tests for categories.

@muskangupta-iitr I can help you with this. I'll take a look at the PR later and we can discuss it there.

@bobsilverberg Thanks! I will let you know if I get stuck anywhere.

Was this page helpful?
0 / 5 - 0 ratings