Closed Bug 671514 Opened 13 years ago Closed 13 years ago

Fix the mapping to aom categories - Extension pane

Categories

(Mozilla QA Graveyard :: Mozmill Tests, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: AlexLakatos, Assigned: whimboo)

References

Details

The Extension pane of the Addons Manager has changed it's ID in Firefox 6. It is now "extension" and it was "extensions" in Firefox 5 and earlier.
Because of this, there is the need to make different patches for different branches. We should resolve this in addons.js

Code Sample
+  addonsManager.setCategory({category: addonsManager.getCategoryById({id: "extension"})}); - Firefox 6
+  addonsManager.setCategory({category: addonsManager.getCategoryById({id: "extensions"})}); - Firefox 5
Alex, can you indicate what bugs this blocks?
Blocks: 671315, 669286
A Pivotal Tracker story has been created for this Bug: https://www.pivotaltracker.com/story/show/15883109
Assignee: nobody → hskupin
Blocks: 659487
So implement this we have to create a mapping between our own category names and the internal category names. Further we have to be open to also allow unknown names and map those 1-1 to the internal names. That's necessary for additionally categories added by add-ons. The mapping will be handled by new methods which accept our own category names, so it will become a lot easier to use.
I don't think you need a full map to cover category names, just constants declared by the addonsManager class like:

addonsManager = function() {
  blah blah constructor blah blah
}

addonsManager.EXTENSIONS = "extensions";

That gives a lot of flexibility and keeps you from having to rewrite all the methods. 

If you do it that way you don't have to have an addonsManager object to use them (though you can use it against an object instance too if you'd like).

Alternately, declare them as constants exported by the module, so you get addons.EXTENSIONS. Either works.

As I said in bug 658365, though, I'd like to also add:

addonsManager.setCategoryById(string), where the string in question is expected to be one of those constants.

addonsManager.setCategoryById = function(categoryId) {
  this.setCategory({
    category: addonsManager.getCategoryById({id: "extension"})
  });
}
er, of course, you'd use categoryId instead of "extension" in that sample implementation.
Blocks: 674220
Blocks: 674221
Henrik Skupin deleted the linked story in Pivotal Tracker
This has now completely propagated across all rapid release branches. For now there is no other change planned in Firefox core. So I would say lets mark this bug as wontfix and keep care of it in the API refactoring project. If you disagree please reopen the bug.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → WONTFIX
Product: Mozilla QA → Mozilla QA Graveyard
You need to log in before you can comment on or make changes to this bug.