зеркало из https://github.com/mozilla/FlightDeck.git
Merge branch 'bug-600422-oauth_upload'
This commit is contained in:
Коммит
acb0cb8a13
|
@ -159,13 +159,10 @@ class PackageRevision(BaseModel):
|
|||
##################
|
||||
# AMO Integration
|
||||
|
||||
def upload_to_amo(self, hashtag, amo_id=None):
|
||||
def upload_to_amo(self, hashtag):
|
||||
"""Uploads Package to AMO, updates or creates as a new Addon
|
||||
|
||||
:attr: hashtag (string)
|
||||
:attr: amo_id (int) Add-on's id on AMO. Used if this is the
|
||||
first upload from Builder of an already existing Add-on on
|
||||
AMO
|
||||
"""
|
||||
# open XPI File
|
||||
xpi_path = os.path.join(settings.XPI_TARGETDIR,
|
||||
|
@ -187,8 +184,6 @@ class PackageRevision(BaseModel):
|
|||
consumer_secret=settings.AMOOAUTH_CONSUMERSECRET)
|
||||
error = None
|
||||
if self.package.amo_id:
|
||||
amo_id = self.package.amo_id
|
||||
if amo_id:
|
||||
# update addon on AMO
|
||||
log.info('AMOOAUTHAPI: updating addon from %s' % self)
|
||||
log.debug(data)
|
||||
|
|
|
@ -45,6 +45,8 @@
|
|||
{% block app_settings %}
|
||||
edit_package_info_template: '{% escape_template "_edit_package_info.html" %}',
|
||||
library_autocomplete_url: '{% url jp_library_autocomplete %}',
|
||||
amooauth_domain: '{{ settings.AMOOAUTH_DOMAIN }}',
|
||||
amooauth_protocol: '{{ settings.AMOOAUTH_PROTOCOL }}',
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
Syncing Packages
|
||||
================
|
||||
|
||||
.. warning:: This features are under development
|
||||
|
||||
|
||||
Identification
|
||||
##############
|
||||
|
@ -15,24 +13,46 @@ store id of the related Package on the AMO. During the synchronization
|
|||
process program_id is updated, so all generated ``XPI`` are properly
|
||||
identified by AMO.
|
||||
|
||||
For validation purposes :class:`~jetpack.models.PackageRevision` has the
|
||||
fields ``amo_status`` and ``amo_version_name``.
|
||||
|
||||
Synchronizing an Addon existing on AMO
|
||||
######################################
|
||||
Scenarios:
|
||||
##########
|
||||
|
||||
User has an ability to display a list of his Addons on AMO and choose
|
||||
which one relies to the currently displayed Package.
|
||||
All of these scenarios are run by the author of the add-on and on the
|
||||
:ref:`edit_package-page`.
|
||||
|
||||
|
||||
Create new Package
|
||||
##################
|
||||
Create new add-on
|
||||
-----------------
|
||||
|
||||
Package created in the Builder can be exported to AMO. This action
|
||||
involves creating a new Addon on the AMO, uploading all necessary meta
|
||||
data and a ``XPI`` build on the Builder.
|
||||
|
||||
.. _amo-syncing_packages-update:
|
||||
|
||||
Update an existing Package
|
||||
##########################
|
||||
Update an existing add-on
|
||||
-------------------------
|
||||
|
||||
If a Package is already synchronized, new version might be uploaded to AMO.
|
||||
This requires version name to be changed.
|
||||
|
||||
|
||||
Synchronizing an add-on existing on AMO
|
||||
---------------------------------------
|
||||
|
||||
.. warning:: This features is under development
|
||||
|
||||
It might happen, that a user will move add-on development to the Builder. To
|
||||
upload a new version of the add-on one needs to link an AMO add-on with the
|
||||
Builder one.
|
||||
|
||||
User has an ability to display a list of his add-ons on AMO and choose
|
||||
which one should be linked to the currently displayed add-on.
|
||||
|
||||
Attributes :attr:`jetpack.models.Package.amo_id` and
|
||||
:attr:`jetpack.models.Package.jid` are saved in the separate view. If this
|
||||
was called as a part of uploading an add-on scenario, after the response is
|
||||
received :ref:`amo-syncing_packages-update` is called.
|
||||
|
||||
|
|
|
@ -170,6 +170,10 @@ form.UI_Editor_Menu_Descendant {
|
|||
background-position: -34px 0;
|
||||
}
|
||||
|
||||
.UI_Editor_Menu_Button.Icon_upload a span {
|
||||
background-position: -212px 0;
|
||||
}
|
||||
|
||||
.UI_Editor_Menu_Button.Icon_setAsBase a span {
|
||||
background-position: -51px 0;
|
||||
}
|
||||
|
|
Двоичные данные
media/jetpack/img/editor-buttons.png
Двоичные данные
media/jetpack/img/editor-buttons.png
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 10 KiB После Ширина: | Высота: | Размер: 11 KiB |
|
@ -145,9 +145,12 @@ var Package = new Class({
|
|||
maskBorder: false
|
||||
},
|
||||
onSuccess: function(response) {
|
||||
fd.message.alert('Uploading to AMO (addons.mozilla.org)',
|
||||
fd.message.alert('Uploading to AMO (' + settings.amooauth_domain +')',
|
||||
'We\'ve scheduled the Add-on to upload<br/>' +
|
||||
'There is no need to wait for confirmation.');
|
||||
'Check the upload status and complete the process on your ' +
|
||||
'<a href="' + settings.amooauth_protocol +
|
||||
'://' + settings.amooauth_domain +
|
||||
'/en-US/developers/addons" target="amo_dashboard">AMO dashboard</a>');
|
||||
}
|
||||
}).send();
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче