Skip to content

Commit b356e1d

Browse files
committed
[qa] Reformatted code with prettier v3.6.2
1 parent 52fa8e2 commit b356e1d

File tree

14 files changed

+864
-857
lines changed

14 files changed

+864
-857
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ name: Bug report
33
about: Open a bug report
44
title: "[bug] "
55
labels: bug
6-
assignees: ''
7-
6+
assignees: ""
87
---
98

109
**Describe the bug**
1110
A clear and concise description of the bug or unexpected behavior.
1211

1312
**Steps To Reproduce**
1413
Steps to reproduce the behavior:
14+
1515
1. Go to '...'
1616
2. Click on '....'
1717
3. Scroll down to '....'
@@ -24,7 +24,8 @@ A clear and concise description of what you expected to happen.
2424
If applicable, add screenshots to help explain your problem.
2525

2626
**System Informatioon:**
27-
- OS: [e.g. Ubuntu 24.04 LTS]
28-
- Python Version: [e.g. Python 3.11.2]
29-
- Django Version: [e.g. Django 4.2.5]
30-
- Browser and Browser Version (if applicable): [e.g. Chromium v126.0.6478.126]
27+
28+
- OS: [e.g. Ubuntu 24.04 LTS]
29+
- Python Version: [e.g. Python 3.11.2]
30+
- Django Version: [e.g. Django 4.2.5]
31+
- Browser and Browser Version (if applicable): [e.g. Chromium v126.0.6478.126]

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ name: Feature request
33
about: Suggest an idea for this project
44
title: "[feature] "
55
labels: enhancement
6-
assignees: ''
7-
6+
assignees: ""
87
---
98

109
**Is your feature request related to a problem? Please describe.**

.github/ISSUE_TEMPLATE/question.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ name: Question
33
about: Please use the Discussion Forum to ask questions
44
title: "[question] "
55
labels: question
6-
assignees: ''
7-
6+
assignees: ""
87
---
98

109
Please use the [Discussion Forum](https://github.com/orgs/openwisp/discussions) to ask questions.

.github/workflows/build.yml

Lines changed: 55 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ on:
1111
- dev
1212

1313
jobs:
14-
1514
build:
1615
name: Python==${{ matrix.python-version }} | ${{ matrix.django-version }}
1716
runs-on: ubuntu-24.04
@@ -51,69 +50,69 @@ jobs:
5150
django-version: django~=5.0.0
5251

5352
steps:
54-
- uses: actions/checkout@v4
55-
with:
56-
ref: ${{ github.event.pull_request.head.sha }}
53+
- uses: actions/checkout@v4
54+
with:
55+
ref: ${{ github.event.pull_request.head.sha }}
5756

58-
- name: Cache APT packages
59-
uses: actions/cache@v4
60-
with:
61-
path: /var/cache/apt/archives
62-
key: apt-${{ runner.os }}-${{ hashFiles('.github/workflows/ci.yml') }}
63-
restore-keys: |
64-
apt-${{ runner.os }}-
57+
- name: Cache APT packages
58+
uses: actions/cache@v4
59+
with:
60+
path: /var/cache/apt/archives
61+
key: apt-${{ runner.os }}-${{ hashFiles('.github/workflows/ci.yml') }}
62+
restore-keys: |
63+
apt-${{ runner.os }}-
6564
66-
- name: Disable man page auto-update
67-
run: |
68-
echo 'set man-db/auto-update false' | sudo debconf-communicate >/dev/null
69-
sudo dpkg-reconfigure man-db
65+
- name: Disable man page auto-update
66+
run: |
67+
echo 'set man-db/auto-update false' | sudo debconf-communicate >/dev/null
68+
sudo dpkg-reconfigure man-db
7069
71-
- name: Set up Python ${{ matrix.python-version }}
72-
uses: actions/setup-python@v5
73-
with:
74-
python-version: ${{ matrix.python-version }}
75-
cache: 'pip'
76-
cache-dependency-path: |
77-
**/requirements*.txt
70+
- name: Set up Python ${{ matrix.python-version }}
71+
uses: actions/setup-python@v5
72+
with:
73+
python-version: ${{ matrix.python-version }}
74+
cache: "pip"
75+
cache-dependency-path: |
76+
**/requirements*.txt
7877
79-
- name: Install Dependencies
80-
id: deps
81-
run: |
82-
sudo apt -qq update
83-
sudo apt -qq -y install sqlite3 gdal-bin
84-
pip install -U pip wheel setuptools
85-
pip install -U -r requirements-test.txt
86-
pip install -U -e .
87-
pip install ${{ matrix.django-version }}
88-
sudo npm install -g prettier
78+
- name: Install Dependencies
79+
id: deps
80+
run: |
81+
sudo apt -qq update
82+
sudo apt -qq -y install sqlite3 gdal-bin
83+
pip install -U pip wheel setuptools
84+
pip install -U -r requirements-test.txt
85+
pip install -U -e .
86+
pip install ${{ matrix.django-version }}
87+
sudo npm install -g prettier
8988
90-
- name: QA checks
91-
run: |
92-
./run-qa-checks
89+
- name: QA checks
90+
run: |
91+
./run-qa-checks
9392
94-
- name: Tests
95-
if: ${{ !cancelled() && steps.deps.conclusion == 'success' }}
96-
run: |
97-
SAMPLE_APP=1 coverage run ./runtests.py --parallel --exclude-tag=selenium_tests
98-
coverage run runtests.py --parallel
99-
coverage combine
100-
coverage xml
101-
env:
102-
SELENIUM_HEADLESS: 1
103-
GECKO_LOG: 1
93+
- name: Tests
94+
if: ${{ !cancelled() && steps.deps.conclusion == 'success' }}
95+
run: |
96+
SAMPLE_APP=1 coverage run ./runtests.py --parallel --exclude-tag=selenium_tests
97+
coverage run runtests.py --parallel
98+
coverage combine
99+
coverage xml
100+
env:
101+
SELENIUM_HEADLESS: 1
102+
GECKO_LOG: 1
104103

105-
- name: Show gecko web driver log on failures
106-
if: ${{ failure() }}
107-
run: cat geckodriver.log
104+
- name: Show gecko web driver log on failures
105+
if: ${{ failure() }}
106+
run: cat geckodriver.log
108107

109-
- name: Upload Coverage
110-
if: ${{ success() }}
111-
uses: coverallsapp/github-action@v2
112-
with:
113-
parallel: true
114-
format: cobertura
115-
flag-name: python-${{ matrix.env.env }}
116-
github-token: ${{ secrets.GITHUB_TOKEN }}
108+
- name: Upload Coverage
109+
if: ${{ success() }}
110+
uses: coverallsapp/github-action@v2
111+
with:
112+
parallel: true
113+
format: cobertura
114+
flag-name: python-${{ matrix.env.env }}
115+
github-token: ${{ secrets.GITHUB_TOKEN }}
117116

118117
coveralls:
119118
needs: build

.github/workflows/pypi.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ jobs:
1717
permissions:
1818
id-token: write
1919
steps:
20-
- uses: actions/checkout@v4
21-
- name: Set up Python
22-
uses: actions/setup-python@v5
23-
with:
24-
python-version: '3.10'
25-
- name: Install dependencies
26-
run: |
27-
pip install -U pip
28-
pip install build
29-
- name: Build package
30-
run: python -m build
31-
- name: Publish package distributions to PyPI
32-
uses: pypa/[email protected]
20+
- uses: actions/checkout@v4
21+
- name: Set up Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: "3.10"
25+
- name: Install dependencies
26+
run: |
27+
pip install -U pip
28+
pip install build
29+
- name: Build package
30+
run: python -m build
31+
- name: Publish package distributions to PyPI
32+
uses: pypa/[email protected]

openwisp_notifications/base/models.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,6 @@ class AbstractOrganizationNotificationSettings(models.Model):
539539
),
540540
verbose_name=_("Web notifications enabled"),
541541
)
542-
543542
email = FallbackBooleanChoiceField(
544543
fallback=app_settings.EMAIL_ENABLED,
545544
help_text=_(

openwisp_notifications/static/openwisp-notifications/css/loader.css

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,7 @@
88
border-radius: 50%;
99
background: #464646;
1010
background: -moz-linear-gradient(left, #464646 10%, rgba(70, 70, 70, 0) 42%);
11-
background: -webkit-linear-gradient(
12-
left,
13-
#464646 10%,
14-
rgba(70, 70, 70, 0) 42%
15-
);
11+
background: -webkit-linear-gradient(left, #464646 10%, rgba(70, 70, 70, 0) 42%);
1612
background: -o-linear-gradient(left, #464646 10%, rgba(70, 70, 70, 0) 42%);
1713
background: -ms-linear-gradient(left, #464646 10%, rgba(70, 70, 70, 0) 42%);
1814
background: linear-gradient(to right, #464646 10%, rgba(70, 70, 70, 0) 42%);

openwisp_notifications/static/openwisp-notifications/css/notifications.css

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@
121121
filter: invert(30%) sepia(3%);
122122
}
123123
.ow-notification-toast.warning .icon {
124-
filter: invert(20%) sepia(90%) saturate(5000%) hue-rotate(366deg)
125-
brightness(92%) contrast(96%);
124+
filter: invert(20%) sepia(90%) saturate(5000%) hue-rotate(366deg) brightness(92%)
125+
contrast(96%);
126126
}
127127
.ow-notification-toast.error .icon,
128128
.ow-notification-toast.success .icon {
@@ -266,21 +266,21 @@
266266
min-height: 15px;
267267
min-width: 15px;
268268
background-repeat: no-repeat;
269-
filter: invert(46%) sepia(4%) saturate(139%) hue-rotate(317deg)
270-
brightness(99%) contrast(85%);
269+
filter: invert(46%) sepia(4%) saturate(139%) hue-rotate(317deg) brightness(99%)
270+
contrast(85%);
271271
margin: -1px 1px 0 0;
272272
}
273273
.ow-notification-elem:hover .icon {
274-
filter: invert(20%) sepia(1%) saturate(139%) hue-rotate(317deg)
275-
brightness(99%) contrast(85%);
274+
filter: invert(20%) sepia(1%) saturate(139%) hue-rotate(317deg) brightness(99%)
275+
contrast(85%);
276276
}
277277
.ow-notification-elem.unread .icon {
278-
filter: invert(95%) sepia(1%) saturate(139%) hue-rotate(317deg)
279-
brightness(99%) contrast(85%);
278+
filter: invert(95%) sepia(1%) saturate(139%) hue-rotate(317deg) brightness(99%)
279+
contrast(85%);
280280
}
281281
.ow-notification-elem.unread:hover .icon {
282-
filter: invert(100%) sepia(0%) saturate(139%) hue-rotate(317deg)
283-
brightness(100%) contrast(85%);
282+
filter: invert(100%) sepia(0%) saturate(139%) hue-rotate(317deg) brightness(100%)
283+
contrast(85%);
284284
}
285285
.ow-notify-info {
286286
background-image: url("../../openwisp-notifications/images/icons/icon-info.svg");

openwisp_notifications/static/openwisp-notifications/css/preferences.css

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@
119119
no-repeat;
120120
}
121121
.icon-email {
122-
background: url("../../openwisp-notifications/images/icons/icon-email.svg") 0
123-
0 no-repeat;
122+
background: url("../../openwisp-notifications/images/icons/icon-email.svg") 0 0
123+
no-repeat;
124124
position: relative;
125125
bottom: -3px;
126126
}
@@ -258,12 +258,12 @@ tr.org-header {
258258
}
259259

260260
.ow-notify-success {
261-
filter: invert(48%) sepia(98%) saturate(546%) hue-rotate(95deg)
262-
brightness(95%) contrast(90%);
261+
filter: invert(48%) sepia(98%) saturate(546%) hue-rotate(95deg) brightness(95%)
262+
contrast(90%);
263263
}
264264
.ow-notify-error {
265-
filter: invert(18%) sepia(99%) saturate(5461%) hue-rotate(-10deg)
266-
brightness(85%) contrast(120%);
265+
filter: invert(18%) sepia(99%) saturate(5461%) hue-rotate(-10deg) brightness(85%)
266+
contrast(120%);
267267
}
268268

269269
/* Toggle Icon */

openwisp_notifications/static/openwisp-notifications/js/notifications.js

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,7 @@ function notificationWidget($) {
158158
}
159159

160160
function appendPage() {
161-
$("#ow-notifications-loader").before(
162-
pageContainer(fetchedPages[lastRenderedPage]),
163-
);
161+
$("#ow-notifications-loader").before(pageContainer(fetchedPages[lastRenderedPage]));
164162
if (lastRenderedPage >= renderedPages) {
165163
$(".ow-notification-wrapper div:first").remove();
166164
}
@@ -185,10 +183,7 @@ function notificationWidget($) {
185183
},
186184
success: function (res) {
187185
nextPageUrl = res.next;
188-
if (
189-
res.count === 0 ||
190-
(res.results.length === 0 && nextPageUrl === null)
191-
) {
186+
if (res.count === 0 || (res.results.length === 0 && nextPageUrl === null)) {
192187
// If response does not have any notification, show no-notifications message.
193188
$(".ow-no-notifications").removeClass("ow-hide");
194189
$("#ow-mark-all-read").addClass("disabled");
@@ -228,9 +223,7 @@ function notificationWidget($) {
228223
busy = true;
229224
if (lastRenderedPage > renderedPages) {
230225
$(".ow-notification-wrapper div.page:last").remove();
231-
var addedDiv = pageContainer(
232-
fetchedPages[lastRenderedPage - renderedPages - 1],
233-
);
226+
var addedDiv = pageContainer(fetchedPages[lastRenderedPage - renderedPages - 1]);
234227
$(".ow-notification-wrapper").prepend(addedDiv);
235228
lastRenderedPage -= 1;
236229
}
@@ -252,9 +245,7 @@ function notificationWidget($) {
252245

253246
function notificationListItem(elem) {
254247
let klass;
255-
const datetime = dateTimeStampToDateTimeLocaleString(
256-
new Date(elem.timestamp),
257-
);
248+
const datetime = dateTimeStampToDateTimeLocaleString(new Date(elem.timestamp));
258249

259250
if (!notificationReadStatus.has(elem.id)) {
260251
if (elem.unread) {
@@ -415,9 +406,7 @@ function markNotificationRead(elem) {
415406
function notificationHandler($, elem) {
416407
var notification = fetchedPages
417408
.flat()
418-
.find(
419-
(notification) => notification.id == elem.get(0).id.replace("ow-", ""),
420-
),
409+
.find((notification) => notification.id == elem.get(0).id.replace("ow-", "")),
421410
targetUrl = elem.data("location");
422411

423412
// If notification is unread then send read request
@@ -442,9 +431,7 @@ function notificationHandler($, elem) {
442431
</div>
443432
<div class="ow-notification-date">${datetime}</div>
444433
`);
445-
$(".ow-message-title").html(
446-
convertMessageWithRelativeURL(notification.message),
447-
);
434+
$(".ow-message-title").html(convertMessageWithRelativeURL(notification.message));
448435
$(".ow-message-description").html(notification.description);
449436
$(".ow-overlay-notification").removeClass("ow-hide");
450437

@@ -484,8 +471,7 @@ function initWebSockets($) {
484471
}
485472
// Check whether to display notification toast
486473
if (data.notification) {
487-
let toast =
488-
$(`<div class="ow-notification-toast ${data.notification.level}"
474+
let toast = $(`<div class="ow-notification-toast ${data.notification.level}"
489475
data-location="${convertAbsoluteURLToRelativeURL(data.notification.target_url)}"
490476
id="ow-${data.notification.id}">
491477
<div class="icon ow-notify-close btn" role="button" tabindex="1"></div>

0 commit comments

Comments
 (0)