')
- .addClass('submissions-disabled-error')
- .text(gettext('Add-on uploads are temporarily unavailable.'));
- const tooltip = $('
')
- .addClass('tip tooltip')
- .attr('title', reason);
- reason && error.append(tooltip);
- submissionsDisabled && $('.addon-submission-field').append(error);
+
+ // $('.submission-buttons .button').toggleClass('disabled', submissionsDisabled);
// Add-on uploader
var $uploadAddon = $('#upload-addon');
From 9308a8604694b32c6f94530e7465f29689b578ae Mon Sep 17 00:00:00 2001
From: Christina Lin <44586776+chrstinalin@users.noreply.github.com>
Date: Tue, 29 Oct 2024 15:48:37 -0400
Subject: [PATCH 09/16] variable, button toggle
---
static/js/common/upload-addon.js | 4 ++--
static/js/zamboni/devhub.js | 3 +--
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/static/js/common/upload-addon.js b/static/js/common/upload-addon.js
index c3701e1c0d6e..c4c9a6d65f7d 100644
--- a/static/js/common/upload-addon.js
+++ b/static/js/common/upload-addon.js
@@ -80,8 +80,8 @@
text: gettext('Your add-on should end with .zip, .xpi or .crx'),
});
- ui_link.toggleClass('disabled', submissionsDisabled);
- $upload_field.prop('disabled', submissionsDisabled);
+ ui_link.toggleClass('disabled', settings.submissionsDisabled);
+ $upload_field.prop('disabled', settings.submissionsDisabled);
$upload_field.wrap(ui_parent);
$upload_field.before(ui_link);
diff --git a/static/js/zamboni/devhub.js b/static/js/zamboni/devhub.js
index 501b4cb88a89..7ed3b08557a2 100644
--- a/static/js/zamboni/devhub.js
+++ b/static/js/zamboni/devhub.js
@@ -51,8 +51,7 @@ $(document).ready(function () {
const submissionField = $('#submissions');
const submissionsDisabled =
submissionField && !submissionField.data('submissions-enabled');
-
- // $('.submission-buttons .button').toggleClass('disabled', submissionsDisabled);
+ $('.submission-buttons .button').toggleClass('disabled', submissionsDisabled);
// Add-on uploader
var $uploadAddon = $('#upload-addon');
From 9935b92b4baa7d559c039c711a2e942e1ba31d5d Mon Sep 17 00:00:00 2001
From: Christina Lin <44586776+chrstinalin@users.noreply.github.com>
Date: Tue, 29 Oct 2024 15:52:01 -0400
Subject: [PATCH 10/16] update name
---
src/olympia/devhub/templates/devhub/addons/submit/upload.html | 2 +-
src/olympia/devhub/templates/devhub/addons/submit/wizard.html | 2 +-
static/js/zamboni/devhub.js | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/olympia/devhub/templates/devhub/addons/submit/upload.html b/src/olympia/devhub/templates/devhub/addons/submit/upload.html
index 9fec9fa32a4c..f9e1b4f5cdc4 100644
--- a/src/olympia/devhub/templates/devhub/addons/submit/upload.html
+++ b/src/olympia/devhub/templates/devhub/addons/submit/upload.html
@@ -94,7 +94,7 @@
+
diff --git a/src/olympia/devhub/tests/test_views_submit.py b/src/olympia/devhub/tests/test_views_submit.py
index 37897cb93a80..1fa710151d3c 100644
--- a/src/olympia/devhub/tests/test_views_submit.py
+++ b/src/olympia/devhub/tests/test_views_submit.py
@@ -3016,24 +3016,27 @@ def setUp(self):
addon = self.get_addon()
self.version = version_factory(addon=addon)
- def _test_submissions_disabled(self, viewname, assertStatus=True, args=None):
+ def _test_submissions_disabled(self, viewname, *, assert_status=True, args=None):
args = args or []
self.create_flag('enable-submissions', note=':-(', everyone=False)
url = reverse(viewname, args=args)
response = self.client.post(url)
- assert not assertStatus or response.status_code == 503
+ if assert_status:
+ assert response.status_code == 503
doc = pq(response.content)
- assert 'Add-on uploads are temporarily unavailable.' in doc.text()
+ assert 'Add-on uploads are temporarily unavailable' in doc.text()
assert ':-(' in doc.html()
def _test_submissions_disabled_by_list_type(
- self, viewname, assertStatus=True, args=None
+ self, viewname, assert_status=True, args=None
):
args = args or []
- self._test_submissions_disabled(viewname, assertStatus, args=args + ['listed'])
- self._test_submissions_disabled(
- viewname, assertStatus, args=args + ['unlisted']
- )
+ self._test_submissions_disabled(
+ viewname, assert_status=assert_status, args=args + ['listed']
+ )
+ self._test_submissions_disabled(
+ viewname, assert_status=assert_status, args=args + ['unlisted']
+ )
def test_submissions_disabled_submit_details(self):
self._test_submissions_disabled('devhub.submit.details', args=['a3615'])
@@ -3053,10 +3056,10 @@ def test_submissions_disabled_version_finish(self):
def test_submissions_disabled_upload(self):
self._test_submissions_disabled_by_list_type(
- 'devhub.submit.upload', assertStatus=False
+ 'devhub.submit.upload', assert_status=False
)
def test_submissions_disabled_wizard(self):
self._test_submissions_disabled_by_list_type(
- 'devhub.submit.wizard', assertStatus=False
+ 'devhub.submit.wizard', assert_status=False
)
diff --git a/src/olympia/devhub/views.py b/src/olympia/devhub/views.py
index afc0c1391ce6..7e1b05e8ffb3 100644
--- a/src/olympia/devhub/views.py
+++ b/src/olympia/devhub/views.py
@@ -1574,7 +1574,19 @@ def _submit_upload(
if existing_properties
else []
)
- submit_notification_warning = get_config('submit_notification_warning')
+
+ flag = waffle.get_waffle_flag_model().get('enable-submissions')
+ warning = (
+ 'Add-on uploads are temporarily unavailable' + ': ' + flag.note
+ if hasattr(flag, 'note')
+ else '.'
+ )
+
+ submit_notification_warning = (
+ warning
+ if not flag.is_active(request)
+ else get_config('submit_notification_warning')
+ )
if not submit_notification_warning and addon:
# If we're not showing the generic submit notification warning, show
# one specific to pre review if the developer would be affected because
@@ -1594,7 +1606,7 @@ def _submit_upload(
wizard_url = reverse('devhub.submit.wizard', args=[channel_text])
else:
wizard_url = None
- flag = waffle.get_waffle_flag_model().get('enable-submissions')
+
return TemplateResponse(
request,
template,
@@ -1614,7 +1626,6 @@ def _submit_upload(
'wizard_url': wizard_url,
'max_upload_size': settings.MAX_UPLOAD_SIZE,
'submissions_enabled': flag.is_active(request),
- 'reason': flag.note if hasattr(flag, 'note') else None,
},
)
diff --git a/static/css/zamboni/developers.css b/static/css/zamboni/developers.css
index 6998d722c0f1..f4704fa7612d 100644
--- a/static/css/zamboni/developers.css
+++ b/static/css/zamboni/developers.css
@@ -427,10 +427,6 @@ form .char-count b {
margin-bottom: 1em;
}
-div.addon-submission-field .submissions-disabled-error {
- padding: 1em 0em;
-}
-
.clear-info-request label {
font-weight: normal;
}
From ad93bc2c38947700ea0068bc2df31bdb253fed8d Mon Sep 17 00:00:00 2001
From: Christina Lin <44586776+chrstinalin@users.noreply.github.com>
Date: Wed, 30 Oct 2024 10:36:05 -0400
Subject: [PATCH 14/16] removed extra spaces
---
src/olympia/devhub/views.py | 3 ---
1 file changed, 3 deletions(-)
diff --git a/src/olympia/devhub/views.py b/src/olympia/devhub/views.py
index 7e1b05e8ffb3..1106ad15baf6 100644
--- a/src/olympia/devhub/views.py
+++ b/src/olympia/devhub/views.py
@@ -1574,14 +1574,12 @@ def _submit_upload(
if existing_properties
else []
)
-
flag = waffle.get_waffle_flag_model().get('enable-submissions')
warning = (
'Add-on uploads are temporarily unavailable' + ': ' + flag.note
if hasattr(flag, 'note')
else '.'
)
-
submit_notification_warning = (
warning
if not flag.is_active(request)
@@ -1606,7 +1604,6 @@ def _submit_upload(
wizard_url = reverse('devhub.submit.wizard', args=[channel_text])
else:
wizard_url = None
-
return TemplateResponse(
request,
template,
From 1d7913d01e00f46988aec7d3243a478088cadbf6 Mon Sep 17 00:00:00 2001
From: Christina Lin <44586776+chrstinalin@users.noreply.github.com>
Date: Wed, 30 Oct 2024 10:45:24 -0400
Subject: [PATCH 15/16] lint
---
src/olympia/devhub/tests/test_views_submit.py | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/olympia/devhub/tests/test_views_submit.py b/src/olympia/devhub/tests/test_views_submit.py
index 1fa710151d3c..71cdbc7a16ce 100644
--- a/src/olympia/devhub/tests/test_views_submit.py
+++ b/src/olympia/devhub/tests/test_views_submit.py
@@ -3021,8 +3021,8 @@ def _test_submissions_disabled(self, viewname, *, assert_status=True, args=None)
self.create_flag('enable-submissions', note=':-(', everyone=False)
url = reverse(viewname, args=args)
response = self.client.post(url)
- if assert_status:
- assert response.status_code == 503
+ if assert_status:
+ assert response.status_code == 503
doc = pq(response.content)
assert 'Add-on uploads are temporarily unavailable' in doc.text()
assert ':-(' in doc.html()
@@ -3031,12 +3031,12 @@ def _test_submissions_disabled_by_list_type(
self, viewname, assert_status=True, args=None
):
args = args or []
- self._test_submissions_disabled(
- viewname, assert_status=assert_status, args=args + ['listed']
- )
- self._test_submissions_disabled(
- viewname, assert_status=assert_status, args=args + ['unlisted']
- )
+ self._test_submissions_disabled(
+ viewname, assert_status=assert_status, args=args + ['listed']
+ )
+ self._test_submissions_disabled(
+ viewname, assert_status=assert_status, args=args + ['unlisted']
+ )
def test_submissions_disabled_submit_details(self):
self._test_submissions_disabled('devhub.submit.details', args=['a3615'])
From 338eca6d3c6941ad467452c5fa5458526b326e7b Mon Sep 17 00:00:00 2001
From: Christina Lin <44586776+chrstinalin@users.noreply.github.com>
Date: Thu, 31 Oct 2024 09:27:51 -0400
Subject: [PATCH 16/16] test
---
src/olympia/devhub/tests/test_views_submit.py | 11 ++++++++++-
src/olympia/devhub/views.py | 6 ++----
2 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/src/olympia/devhub/tests/test_views_submit.py b/src/olympia/devhub/tests/test_views_submit.py
index 71cdbc7a16ce..8d9fa658b0b2 100644
--- a/src/olympia/devhub/tests/test_views_submit.py
+++ b/src/olympia/devhub/tests/test_views_submit.py
@@ -3018,8 +3018,9 @@ def setUp(self):
def _test_submissions_disabled(self, viewname, *, assert_status=True, args=None):
args = args or []
- self.create_flag('enable-submissions', note=':-(', everyone=False)
url = reverse(viewname, args=args)
+
+ self.create_flag('enable-submissions', note=':-(', everyone=False)
response = self.client.post(url)
if assert_status:
assert response.status_code == 503
@@ -3027,6 +3028,14 @@ def _test_submissions_disabled(self, viewname, *, assert_status=True, args=None)
assert 'Add-on uploads are temporarily unavailable' in doc.text()
assert ':-(' in doc.html()
+ self.create_flag('enable-submissions', note='', everyone=False)
+ response = self.client.post(url)
+ if assert_status:
+ assert response.status_code == 503
+ doc = pq(response.content)
+ assert 'Add-on uploads are temporarily unavailable.' in doc.text()
+ assert ':-(' not in doc.html()
+
def _test_submissions_disabled_by_list_type(
self, viewname, assert_status=True, args=None
):
diff --git a/src/olympia/devhub/views.py b/src/olympia/devhub/views.py
index 1106ad15baf6..3f017f77b051 100644
--- a/src/olympia/devhub/views.py
+++ b/src/olympia/devhub/views.py
@@ -1575,10 +1575,8 @@ def _submit_upload(
else []
)
flag = waffle.get_waffle_flag_model().get('enable-submissions')
- warning = (
- 'Add-on uploads are temporarily unavailable' + ': ' + flag.note
- if hasattr(flag, 'note')
- else '.'
+ warning = gettext('Add-on uploads are temporarily unavailable') + (
+ ': ' + flag.note if getattr(flag, 'note', None) else '.'
)
submit_notification_warning = (
warning