Skip to content

Commit

Permalink
Next Release - v1.16.0 (#75)
Browse files Browse the repository at this point in the history
* [MISC] Minor changes in changlog (Grammar and such)

* [CHANGE] RGB notations in CSS files modernised

* [CHANGE] Bottom border color for payout colomn on rejected SRP requests

* [FEATURE] Comment field for accepting SRP requests

Mandatory only when accepting SRP request that have been rejected before

* [CHANGE] Modal information gathering

* [ADDED] Request history (comments) to request details modal window

* [ADDED] Test for template tags

* [MISC] Bit of JavaScript formatting

* [CHANGE] CSS modernized

* [MISC] Changelog updated

* [MISC] setup.cfg updated

* [REMOVED] Unused JavaScript

* [ADDED] Date and time to SRP request comments/history

* [FIX] Some model errors

* [CHANGED] No longer testing for beta version

* [REMOVED] Deprecated `type` attribute from `script` tags

* [REMOVED] Deprecated `type` attribute from `style` tags

* [CHANGE] JS and CSS moved to bundled HTML templates

* [MISC] Minimum requirements updated

* [MISC] setuptools package discovery updated

* [MISC] setuptools classifier updated

* [MISC] Version set to v1.16.0
  • Loading branch information
ppfeufer authored Aug 4, 2022
1 parent 9336812 commit 99eb201
Show file tree
Hide file tree
Showing 55 changed files with 1,503 additions and 810 deletions.
106 changes: 53 additions & 53 deletions .github/workflows/automated-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
# Don't forget to change the Python version for [upload-coverage] as well
python-version: [ '3.8', '3.9', '3.10', '3.11-dev' ]
# Don't forget to change the Django version for [upload-coverage] as well
django-version: [ '3.2' ]
django-version: [ '4.0' ]

continue-on-error: ${{ matrix.python-version == '3.11-dev' }}

Expand Down Expand Up @@ -114,57 +114,57 @@ jobs:
path: coverage.xml
if-no-files-found: ignore

test-coverage-aa-dev:
needs: [ codacy-security-scan ]
name: Test Coverage (AA Alpha/Beta, Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }})
runs-on: ubuntu-latest

strategy:
# Set Python and Django version to test for the alpha/beta release of AllianceAuth
matrix:
python-version: [ '3.8', '3.9', '3.10', '3.11-dev' ]
django-version: [ '4.0' ]

continue-on-error: ${{ matrix.python-version == '3.11-dev' }}

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install redis
run: sudo apt-get install -y redis-tools redis-server

- name: Verify that redis is up
run: redis-cli ping

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install Tox and any other packages
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade tox tox-gh-actions
- name: Run Tox
# Run tox using the version of Python in `PATH`
run: tox -v
env:
DJANGO: ${{ matrix.django-version }}
ALLIANCEAUTH: testing

- name: Upload Coverage Artifacts
uses: actions/upload-artifact@v2
with:
name: coverage-aa-dev-python-${{ matrix.python-version }}-django-${{ matrix.django-version }}
path: coverage.xml
if-no-files-found: ignore
# test-coverage-aa-dev:
# needs: [ codacy-security-scan ]
# name: Test Coverage (AA Alpha/Beta, Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }})
# runs-on: ubuntu-latest
#
# strategy:
# # Set Python and Django version to test for the alpha/beta release of AllianceAuth
# matrix:
# python-version: [ '3.8', '3.9', '3.10', '3.11-dev' ]
# django-version: [ '4.0' ]
#
# continue-on-error: ${{ matrix.python-version == '3.11-dev' }}
#
# steps:
# - name: Checkout
# uses: actions/checkout@v2
#
# - name: Install redis
# run: sudo apt-get install -y redis-tools redis-server
#
# - name: Verify that redis is up
# run: redis-cli ping
#
# - name: Setup Python ${{ matrix.python-version }}
# uses: actions/setup-python@v2
# with:
# python-version: ${{ matrix.python-version }}
#
# - name: Install Tox and any other packages
# run: |
# python -m pip install --upgrade pip
# python -m pip install --upgrade tox tox-gh-actions
#
# - name: Run Tox
# # Run tox using the version of Python in `PATH`
# run: tox -v
# env:
# DJANGO: ${{ matrix.django-version }}
# ALLIANCEAUTH: testing
#
# - name: Upload Coverage Artifacts
# uses: actions/upload-artifact@v2
# with:
# name: coverage-aa-dev-python-${{ matrix.python-version }}-django-${{ matrix.django-version }}
# path: coverage.xml
# if-no-files-found: ignore

# Coverage upload to Codecov and Codacy
upload-coverage:
# needs: [ test-coverage-aa-stable ]
needs: [ test-coverage-aa-stable, test-coverage-aa-dev ]
needs: [ test-coverage-aa-stable ]
# needs: [ test-coverage-aa-stable, test-coverage-aa-dev ]
name: Upload Coverage
runs-on: ubuntu-latest

Expand All @@ -185,7 +185,7 @@ jobs:
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
files: artifacts/coverage-aa-stable-python-3.10-django-3.2/coverage.xml # optional
files: artifacts/coverage-aa-stable-python-3.10-django-4.0/coverage.xml # optional
# flags: unittests # optional
# name: codecov-umbrella # optional
# fail_ci_if_error: true # optional (default = false)
Expand All @@ -195,12 +195,12 @@ jobs:
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: artifacts/coverage-aa-stable-python-3.10-django-3.2/coverage.xml
coverage-reports: artifacts/coverage-aa-stable-python-3.10-django-4.0/coverage.xml

# Pypi Build Test
pypi-build-test:
# needs: [ test-coverage-aa-stable ]
needs: [ test-coverage-aa-stable, test-coverage-aa-dev ]
needs: [ test-coverage-aa-stable ]
# needs: [ test-coverage-aa-stable, test-coverage-aa-dev ]
name: PyPi Build Test
runs-on: ubuntu-latest

Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ repos:
rev: 1.7.0
hooks:
- id: django-upgrade
args: [ --target-version=3.2 ]
args: [ --target-version=4.0 ]

- repo: https://github.com/asottile/pyupgrade
rev: v2.37.0
rev: v2.37.3
hooks:
- id: pyupgrade
args: [ --py38-plus ]
Expand All @@ -59,7 +59,7 @@ repos:
- id: flake8

- repo: https://github.com/asottile/yesqa
rev: v1.3.0
rev: v1.4.0
hooks:
- id: yesqa

Expand All @@ -82,6 +82,6 @@ repos:
args: [ --target-version=py38 ]

- repo: https://github.com/asottile/setup-cfg-fmt
rev: v1.20.1
rev: v2.0.0
hooks:
- id: setup-cfg-fmt
36 changes: 33 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,48 @@ and this project adheres to [Semantic Versioning](http://semver.org/)
## [In Development] - Unreleased


## [1.16.0] - 2022-08-04

### Added

- Comment field for accepting SRP requests. This is optional when pending requests
are accepted, but mandatory when formerly rejected requests are accepted to
state a reason.
- Request history to request information window

### Changed

- RGB notations in CSS files modernised
- Bottom border colour for changeable payout value for SRP requests that have been
rejected. Now it's not that prominent anymore and doesn't look like a pending SRP
request
- Modal window handling improved
- JS and CSS moved to bundled HTML templates
- Minumum requirements
- allianceauth>=2.15.1
- allianceauth-app-utils>=1.14.0
- django-eveuniverse>=0.16.3

### Removed

- Unused JavaScript
- Deprecated `type` attribute from `script` tags
- Deprecated `type` attribute from `style` tags
- Tests for non-stable version of Alliance Auth


## [1.15.2] - 2022-07-21

### Added

- Tooltip to make it a bit more obvious that SRP payout values can be changed (#72)
- Tooltip to make it a bit more obvious that SRP payout values can be changed ([#72](https://github.com/ppfeufer/aa-srp/issues/72))

![Tooltip: Change SRP Payout Amount](aasrp//images/tooltip-change-srp-payout-amount.png "Tooltip: Change SRP Payout Amount")
![Tooltip: Change SRP Payout Amount](aasrp/images/tooltip-change-srp-payout-amount.png "Tooltip: Change SRP Payout Amount")

### Changed

- Moved SRP recalculation to its own function
- Highlight color for SRP amount changed
- Highlight colour for SRP amount changed


## [1.15.1] - 2022-07-11
Expand Down
2 changes: 1 addition & 1 deletion aasrp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
A couple of variable to use throughout the app
"""

__version__ = "1.15.2"
__version__ = "1.16.0"
__title__ = "Ship Replacement"
29 changes: 29 additions & 0 deletions aasrp/form.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,35 @@ class AaSrpRequestRejectForm(forms.Form):
)


class AaSrpRequestAcceptForm(forms.Form):
"""
SRP request reject form
"""

reviser_comment = forms.CharField(
widget=forms.Textarea(attrs={"rows": 10, "cols": 20, "input_type": "textarea"}),
required=False,
label=_("Comment (Optional)"),
help_text=_("Leave a comment for the requestor"),
)


class AaSrpRequestAcceptRejectedForm(forms.Form):
"""
SRP request reject form
"""

reviser_comment = forms.CharField(
widget=forms.Textarea(attrs={"rows": 10, "cols": 20, "input_type": "textarea"}),
required=True,
label=get_mandatory_form_label_text(_("Comment")),
help_text=_(
"Please provide the reason why this former rejected SRP request is now "
"accepted."
),
)


class AaSrpUserSettingsForm(ModelForm):
"""
User settings form
Expand Down
45 changes: 8 additions & 37 deletions aasrp/helper/icons.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ def get_srp_request_status_icon(request: WSGIRequest, srp_request: AaSrpRequest)
'<i class="fas fa-clock"></i>'
"</button>"
)

if srp_request.request_status == AaSrpRequest.Status.APPROVED:
btn_classes = "btn btn-success btn-sm btn-icon-aasrp btn-icon-aasrp-status"
request_status_icon_title = _("SRP Request Approved")
Expand Down Expand Up @@ -174,14 +175,11 @@ def get_srp_request_details_icon(
)

title = _("SRP Request Details")
modal_button_confirm = _("Close")

srp_request_details_icon = (
f'<button data-link="{button_request_details_url}" '
'data-toggle="modal" '
'data-target="#srp-request-details" '
f'data-modal-title="{title}" '
f'data-modal-button-confirm="{modal_button_confirm}" '
'class="btn btn-primary btn-sm btn-icon-aasrp" '
f'title="{title}"><i class="fas fa-info-circle"></i></button>'
)
Expand Down Expand Up @@ -210,24 +208,19 @@ def get_srp_request_accept_icon(
if srp_request.request_status == AaSrpRequest.Status.APPROVED:
button_request_accept_state = ' disabled="disabled"'

fa_icon_confirm = "<i class='fas fa-check'></i>"
fa_icon_cancel = "<i class='far fa-hand-paper'></i>"
modal_target = (
"#srp-request-accept-rejected"
if srp_request.request_status == AaSrpRequest.Status.REJECTED
else "#srp-request-accept"
)

icon = '<i class="fas fa-check"></i>'
title = _("Accept SRP Request")
modal_body = _("Are you sure you want to accept this SRP request?")
modal_button_cancel = _(f"{fa_icon_cancel} Cancel")
modal_button_confirm = _(f"{fa_icon_confirm} Accept SRP Request")
modal_button_confirm_classes = "btn btn-success btn-sm"

srp_request_accept_icon = (
f'<button data-link="{button_request_accept_url}" '
'data-toggle="modal" '
'data-target="#srp-request-accept" '
f'data-modal-title="{title}" '
f'data-modal-body="{modal_body}" '
f'data-modal-button-cancel="{modal_button_cancel}" '
f'data-modal-button-confirm="{modal_button_confirm}" '
f'data-modal-button-confirm-classes="{modal_button_confirm_classes}" '
f'data-target="{modal_target}" '
'class="btn btn-success btn-sm btn-icon-aasrp" '
f'title="{title}"{button_request_accept_state}>{icon}</button>'
)
Expand Down Expand Up @@ -256,24 +249,13 @@ def get_srp_request_reject_icon(
if srp_request.request_status == AaSrpRequest.Status.REJECTED:
button_request_reject_state = ' disabled="disabled"'

fa_icon_confirm = "<i class='fas fa-ban'></i>"
fa_icon_cancel = "<i class='far fa-hand-paper'></i>"
icon = '<i class="fas fa-ban"></i>'
title = _("Reject SRP Request")
modal_body = _("Are you sure you want to reject this SRP request?")
modal_button_cancel = _(f"{fa_icon_cancel} Cancel")
modal_button_confirm = _(f"{fa_icon_confirm} Reject SRP Request")
modal_button_confirm_classes = "btn btn-warning btn-sm"

srp_request_reject_icon = (
f'<button data-link="{button_request_reject_url}" '
'data-toggle="modal" '
'data-target="#srp-request-reject" '
f'data-modal-title="{title}" '
f'data-modal-body="{modal_body}" '
f'data-modal-button-cancel="{modal_button_cancel}" '
f'data-modal-button-confirm="{modal_button_confirm}" '
f'data-modal-button-confirm-classes="{modal_button_confirm_classes}" '
'class="btn btn-warning btn-sm btn-icon-aasrp" '
f'title="{title}"{button_request_reject_state}>{icon}</button>'
)
Expand All @@ -298,24 +280,13 @@ def get_srp_request_delete_icon(
args=[srp_link.srp_code, srp_request.request_code],
)

fa_icon_confirm = "<i class='fas fa-trash-alt'></i>"
fa_icon_cancel = "<i class='far fa-hand-paper'></i>"
icon = '<i class="fas fa-trash-alt"></i>'
title = _("Remove SRP Request")
modal_body = _("Are you sure you want to remove this SRP request?")
modal_button_cancel = _(f"{fa_icon_cancel} Cancel")
modal_button_confirm = _(f"{fa_icon_confirm} Remove SRP Request")
modal_button_confirm_classes = "btn btn-danger btn-sm"

srp_request_delete_icon = (
f'<button data-link="{button_request_delete_url}" '
'data-toggle="modal" '
'data-target="#srp-request-remove" '
f'data-modal-title="{title}" '
f'data-modal-body="{modal_body}" '
f'data-modal-button-cancel="{modal_button_cancel}" '
f'data-modal-button-confirm="{modal_button_confirm}" '
f'data-modal-button-confirm-classes="{modal_button_confirm_classes}" '
'class="btn btn-danger btn-sm btn-icon-aasrp" '
f'title="{title}">{icon}</button>'
)
Expand Down
Loading

0 comments on commit 99eb201

Please sign in to comment.