Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added re-usable Link widget and JSON endpoint #229

Merged
merged 94 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from 88 commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
bcec5e4
feat: endpoint for urls, link widget
fsbraun Oct 25, 2024
a95a658
Update test action
fsbraun Oct 25, 2024
f7f2fa2
Fix linting issues
fsbraun Oct 25, 2024
f3c56e8
More liniting
fsbraun Oct 25, 2024
c8882ed
fix: v3 compatibility
fsbraun Oct 25, 2024
efc6fd1
Add two step select2 internal link widget
fsbraun Oct 25, 2024
fcfbcdf
Fix linting issues
fsbraun Oct 25, 2024
bbc3004
Fix tests and dependencies
fsbraun Oct 25, 2024
e8aa4dc
Fix migration and link_is_optional
fsbraun Oct 26, 2024
26eb9ff
Remove unused blank parameter
fsbraun Oct 26, 2024
65d2957
Update changelog
fsbraun Oct 26, 2024
ed6fe60
feat: autodetect linkable models through their admin
fsbraun Oct 26, 2024
f3c2b13
Fix v3 compat with GrouperModelAdmin
fsbraun Oct 26, 2024
9f1cc7b
Add tests for endpoint
fsbraun Oct 26, 2024
0943e23
Fix for v3
fsbraun Oct 26, 2024
3a6e214
Try again
fsbraun Oct 26, 2024
63728a6
Update codecov action
fsbraun Oct 26, 2024
c452218
Fix test.yml syntax error
fsbraun Oct 26, 2024
aa8d960
Update tests
fsbraun Oct 26, 2024
4aeb631
Test template tags
fsbraun Oct 26, 2024
991b369
Update validator tests
fsbraun Oct 26, 2024
80d8cd4
Update tag tests
fsbraun Oct 26, 2024
3da1aef
Fix migration
fsbraun Oct 26, 2024
a534cb5
Fix migration test and add tests for Django 5.1
fsbraun Oct 27, 2024
e5794b0
Update migration test for v3
fsbraun Oct 27, 2024
1790799
Remove test with Django 5.1 and django CMS 3.11 (since they are not c…
fsbraun Oct 27, 2024
3d538e3
Add test for migration of anchor-only link.
fsbraun Oct 27, 2024
cbe4266
Add tests for third-party app endpoints
fsbraun Oct 27, 2024
49531b8
Update translations
fsbraun Oct 27, 2024
9f27a4c
Add tests for link widget and compiled translations
fsbraun Oct 27, 2024
0b6e979
Mark untestable lines
fsbraun Oct 27, 2024
c3a3c1f
Simplified manager retrieval
fsbraun Oct 27, 2024
106f4ac
Improved endpoint tests
fsbraun Oct 27, 2024
393d2cb
Allow simplified setting ``DJANGOCMS_LINK_LINKABLE_MODELS``.
fsbraun Oct 27, 2024
efbdf51
Recover django 4.2 compat
fsbraun Oct 27, 2024
1be3cea
Update readme
fsbraun Oct 27, 2024
2252643
Small simplification
fsbraun Oct 27, 2024
3895f46
Add a nocover for current tests
fsbraun Oct 27, 2024
0d3e335
Update readme
fsbraun Oct 27, 2024
a909b0f
Update classifiers
fsbraun Oct 27, 2024
5228814
Add `to_link` template tag
fsbraun Oct 27, 2024
3da1fd8
Set correct default for empty link
fsbraun Oct 27, 2024
c7c31fb
Add ``DJANGOCMS_LINK_ALLOWED_LINK_TYPES`` config
fsbraun Oct 28, 2024
ea83926
feat: Allow for `get_link_queryset` method in model admin
fsbraun Oct 28, 2024
80335b5
Add `DJANGOCMS_LINK_MINIMUM_INPUT_LENGTH` setting
fsbraun Oct 28, 2024
f8e8e5a
Update tests
fsbraun Oct 28, 2024
605c44d
Simplify site detection
fsbraun Oct 28, 2024
35a874e
Update README
fsbraun Oct 28, 2024
9ef96d6
remove legacy code
fsbraun Oct 28, 2024
5c8e79f
Remove more legacy code
fsbraun Oct 28, 2024
edfd76b
Add some type annotations
fsbraun Oct 28, 2024
e89dc2e
Add no cover for an unreachable line in tests
fsbraun Oct 28, 2024
7d9b0e8
Update README.rst
fsbraun Oct 29, 2024
0bf66e2
Update README.rst
fsbraun Oct 29, 2024
84c8e69
Add link icon to plugin (for djangocms_text dropdown)
fsbraun Oct 29, 2024
dbd46f0
fix tests
fsbraun Oct 29, 2024
d360e8c
fix: Empty model list not added to URL endpoint result
fsbraun Oct 30, 2024
6e5ef6f
fix tests
fsbraun Oct 30, 2024
b656183
Add `DJANGOCMS_LINK_PAGINATE_BY` setting
fsbraun Oct 30, 2024
afdb591
fix: LinkField defaulted to `blank=True`
fsbraun Oct 30, 2024
583bb36
Add static files to `MANIFEST.in`
fsbraun Nov 1, 2024
e56d0a6
Remove tests from installation
fsbraun Nov 1, 2024
e30fcec
Optimize `Page` queryset
fsbraun Nov 1, 2024
00c121f
Fix: restore v3 compatibility
fsbraun Nov 1, 2024
049fd87
fix: Update GitHub action versions
fsbraun Nov 4, 2024
929fc88
fix: Run migration test
fsbraun Nov 4, 2024
9c7d0de
fix: Do not initialize `REGISTERED_ADMINS` with model setting
fsbraun Nov 4, 2024
7b7c0ab
Update django-cms dependency
fsbraun Nov 4, 2024
7b636a9
Avoid skipping the migration test
fsbraun Nov 4, 2024
5365009
feat: LinkDict (syntactic sugar)
fsbraun Nov 7, 2024
aae0fac
More detailed link types
fsbraun Nov 7, 2024
6145fe4
feat: improve test coverage and use pytest
fsbraun Nov 8, 2024
7d41f6a
Update checkout action
fsbraun Nov 8, 2024
4255f7b
Remove django-app-helper from dependencies
fsbraun Nov 8, 2024
62eb210
Move to pyproject.toml
fsbraun Nov 8, 2024
95a4d14
fix license description in pyproject.toml
fsbraun Nov 8, 2024
e215635
Update workflows
fsbraun Nov 8, 2024
4ebd75a
Fix flake8 action
fsbraun Nov 8, 2024
152ee99
Fix precommit flake8
fsbraun Nov 8, 2024
73a90ad
fix: Setuptools in py39
fsbraun Nov 8, 2024
7f6340e
Update README
fsbraun Nov 8, 2024
deac3a4
Remove test debug code
fsbraun Nov 8, 2024
fc3c0f7
add __str__ to LinkDict
fsbraun Nov 10, 2024
8c1ab72
Fix pyproject.toml, typo in Changelog
fsbraun Nov 10, 2024
cd98fb8
Fix README.rst
fsbraun Nov 10, 2024
77839bb
Update readme
fsbraun Nov 10, 2024
612573b
Some clarifications in the README
fsbraun Nov 10, 2024
a465770
One more readme clarification
fsbraun Nov 10, 2024
539ca5c
Update pyproject.toml and tox.ini
fsbraun Nov 10, 2024
b25eddb
Update .github/workflows/test.yml
fsbraun Nov 10, 2024
8ad5af0
Move coverage config to pyproject.toml
fsbraun Nov 10, 2024
ba4cae5
Merge branch 'feat/url-mngr' of github.com:django-cms/djangocms-link …
fsbraun Nov 10, 2024
8267ad0
Better slicing of endpoint querysets
fsbraun Nov 11, 2024
221201b
Fix update tests
fsbraun Nov 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
with:
python-version: 3.9
- name: Install flake8
run: pip install --upgrade flake8
run: pip install --upgrade flake8 flake8-pyproject
- name: Run flake8
uses: liskin/gh-problem-matcher-wrap@v1
with:
Expand Down
25 changes: 19 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,45 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ "3.10", "3.11", "3.12"] # latest release minus two
python-version: [ "3.9", "3.10", "3.11", "3.12"] # latest release minus two
fsbraun marked this conversation as resolved.
Show resolved Hide resolved
requirements-file: [
dj42_cms311.txt,
dj42_cms41.txt,
dj50_cms311.txt,
dj50_cms41.txt,
dj51_cms41.txt,
]
os: [
ubuntu-20.04,
]
exclude:
- requirements-file: dj50_cms311.txt
python-version: 3.9
- requirements-file: dj50_cms41.txt
python-version: 3.9
- requirements-file: dj51_cms311.txt
python-version: 3.9
- requirements-file: dj51_cms41.txt
python-version: 3.9

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}

uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -U setuptools
pip install -r tests/requirements/${{ matrix.requirements-file }}
python setup.py install

- name: Run coverage
run: coverage run setup.py test
- name: Run test coverage
run: coverage run -m pytest

- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }} # required
13 changes: 13 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ repos:
rev: 7.1.0
hooks:
- id: flake8
fsbraun marked this conversation as resolved.
Show resolved Hide resolved
additional_dependencies: [Flake8-pyproject]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
Expand All @@ -35,3 +36,15 @@ repos:
rev: 5.13.2
hooks:
- id: isort

- repo: https://github.com/tox-dev/pyproject-fmt
rev: v2.5.0
hooks:
- id: pyproject-fmt
- repo: https://github.com/rstcheck/rstcheck
rev: v6.2.4
hooks:
- id: rstcheck
additional_dependencies:
- sphinx==6.1.3
- tomli==2.0.1
13 changes: 8 additions & 5 deletions .tx/config
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
[main]
host = https://www.transifex.com

[djangocms-link.djangocms_link]
file_filter = djangocms_link/locale/<lang>/LC_MESSAGES/django.po
source_file = djangocms_link/locale/en/LC_MESSAGES/django.po
source_lang = en
type = PO
[o:divio:p:djangocms-link:r:djangocms_link]
file_filter = djangocms_link/locale/<lang>/LC_MESSAGES/django.po
source_file = djangocms_link/locale/en/LC_MESSAGES/django.po
source_lang = en
type = PO
replace_edited_strings = false
keep_translations = false

14 changes: 13 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,20 @@
Changelog
=========

5.0.0 (unreleased)
==================

* Major refactor
* New re-usable LinkWidget, LinkFormField, and LinkField
* New re-usable JSON endpoint for internal links
* New template tags (``get_url`` tag and ``to_url`` filter) to convert link
fields into URLs. This allows multiple LinkFields per model
* Fixed cross-site linking which reduces the number situations of the hostname
needing to be part of a link
* Dropped django-select2 dependency in favor of django admin's autocomplete

4.0.0 (2024-07-22)
================
==================

* Added support for django CMS 4.1
* Added support for python 3.10 to 3.12
Expand Down
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ include LICENSE
include README.rst
recursive-include djangocms_link/locale *
recursive-include djangocms_link/templates *
recursive-include djangocms_link/static *
recursive-exclude * *.py[co]
recursive-exclude tests *
Loading
Loading