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

Flask admin et suppression table bib_noms #377

Merged
merged 25 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
5443c3e
Feat taxhub v2 : modélisation suppression de la table bib_noms
amandine-sahl Nov 22, 2022
901cbd3
Feat taxhub v2 : Interface graphique flask-admin
amandine-sahl Nov 22, 2022
3a832d9
Feat taxhub v2 : Change taxref migration procedure (without bib_noms)
amandine-sahl Nov 22, 2022
ccc2efe
drop warning + fix rebase
jacquesfize Aug 6, 2024
f56043a
Config in toml file (#517)
amandine-sahl Aug 6, 2024
355aa68
change model -> drop v_regne + v_group2inpn + tests (#514)
TheoLechemia Aug 6, 2024
8a0f5c4
feat(taxhubv2): remove docker image generation
jacquesfize Aug 7, 2024
58a9b3b
Taxref v17 migrate tests commands + improve reporting (#515)
amandine-sahl Aug 7, 2024
f9e22ae
feat(taxref,detail) : fix taxon hierarchy display
jacquesfize Aug 7, 2024
3bce895
Add region parameters for taxref import migrate (#521)
amandine-sahl Aug 7, 2024
a184795
Ajout de la fonctionnalité import média inpn sous la forme d'une comm…
amandine-sahl Sep 8, 2023
7f78083
Gestion Erreur création de thumbnail : retourne 404
amandine-sahl Aug 7, 2024
d861103
update config toml with available variables (#524)
jacquesfize Aug 7, 2024
62ae08d
Recompile requirements + bump dependencies (#523)
jacquesfize Aug 7, 2024
5d6e6f9
enable git lfs
jacquesfize Aug 7, 2024
31cbe80
set /api as default prefix in parameter
TheoLechemia Aug 7, 2024
6bb5573
Update UsersHub-authentification-module (#525)
jacquesfize Aug 8, 2024
018109b
Rename taxhub config section
amandine-sahl Aug 8, 2024
deac404
fix(bib_attributs) : bug with list_attribut with value type different…
jacquesfize Aug 8, 2024
34510a8
Config
amandine-sahl Aug 8, 2024
a9b3556
fix parameter is_list in taxref route + test (#529)
TheoLechemia Aug 8, 2024
364813a
remove TAXHUB_CONF section in conf
TheoLechemia Aug 8, 2024
a3a03c6
fixes #332 nom vern list in vm autocomplete
Sep 6, 2023
8b415f4
Use get_current_app_id
amandine-sahl Aug 8, 2024
224af4f
changelog
TheoLechemia Aug 8, 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: 0 additions & 2 deletions .dockerignore

This file was deleted.

3 changes: 1 addition & 2 deletions .flaskenv
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
FLASK_APP=apptax.app:create_app
FLASK_ENV=development
FLASK_DEBUG=1
TAXHUB_SETTINGS=config.py
FLASK_DEBUG=1
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
docs/images/*.gif filter=lfs diff=lfs merge=lfs -text
docs/images/*.jpg filter=lfs diff=lfs merge=lfs -text
docs/images/*.png filter=lfs diff=lfs merge=lfs -text
49 changes: 0 additions & 49 deletions .github/workflows/docker.yml

This file was deleted.

10 changes: 5 additions & 5 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
branches:
- master
- hotfixes
- develop
- develop

jobs:
build:
Expand Down Expand Up @@ -84,22 +84,22 @@ jobs:
- name: Install database
run: |
flask db upgrade taxhub@head -x local-srid=2154
flask db upgrade taxhub-admin@head
flask db upgrade taxhub-standalone@head
flask db upgrade ref_geo_fr_departments@head
flask db autoupgrade
flask db status
env:
TAXHUB_SETTINGS: test_config.py
TAXHUB_CONFIG_FILE: config/test_config.toml
- name: Install taxref
run: |
flask taxref import-v17
env:
TAXHUB_SETTINGS: test_config.py
TAXHUB_CONFIG_FILE: config/test_config.toml
- name: Test with pytest
run: |
pytest -v --cov --cov-report xml
env:
TAXHUB_SETTINGS: test_config.py
TAXHUB_CONFIG_FILE: config/test_config.toml
- name: Upload coverage to Codecov
if: ${{ matrix.name == '11' && matrix.sqlalchemy-version == '1.4' }}
uses: codecov/codecov-action@v3
Expand Down
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
*~

static/medias/*

node_modules
#taxhub app
settings.ini
venv
config.py
venv
.vscode

# Byte-compiled / optimized / DLL files
Expand Down Expand Up @@ -78,4 +80,4 @@ target/

/docs/changelog.html

/apptax/*_config.py
config/*_config.toml
96 changes: 0 additions & 96 deletions Dockerfile

This file was deleted.

6 changes: 2 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,8 @@ Elle est centralisée dans l'application `UsersHub <https://github.com/PnX-SI/Us

Niveaux de droits :

* 2 = Gestion des médias uniquement
* 3 = Idem 2 + Gestion des attributs de `GeoNature-atlas <https://github.com/PnEcrins/GeoNature-atlas>`_
* 4 = Idem 3 + Possibilité d'ajouter des taxons dans ``bib_noms``, de les mettre dans des listes et de renseigner tous leurs attributs (notamment ceux utilisés par `GeoNature <https://github.com/PnX-SI/GeoNature>`_)
* 6 = Administrateurs
* 2 = Gestion des taxons (ajout/modification/suppression des attributs, liste et médias sur les taxons)
* 6 = Administrateurs: création de liste, attributs et thême

Auteurs
-------
Expand Down
8 changes: 8 additions & 0 deletions apptax/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
taxhub_api_routes = [
("apptax.taxonomie.routesbibnoms:adresses", "/bibnoms"),
("apptax.taxonomie.routestaxref:adresses", "/taxref"),
("apptax.taxonomie.routesbibattributs:adresses", "/bibattributs"),
("apptax.taxonomie.routesbiblistes:adresses", "/biblistes"),
("apptax.taxonomie.routestmedias:adresses", "/tmedias"),
("apptax.taxonomie.routesbdcstatuts:adresses", "/bdc_statuts"),
]
Empty file added apptax/admin/__init__.py
Empty file.
89 changes: 89 additions & 0 deletions apptax/admin/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
import os

from flask import redirect, url_for, Blueprint
from flask_admin import Admin, AdminIndexView, expose
from werkzeug.exceptions import Unauthorized

from apptax.database import db
from apptax.taxonomie.models import Taxref, BibListes, TMedias, BibAttributs, BibThemes


# Create blueprint for template and static
adresses = Blueprint("apptax-admin", __name__, template_folder="templates")
adresses.static_folder = os.path.join(adresses.root_path, "static")


class TaxhubView(AdminIndexView):
def is_visible(self):
# This view won't appear in the menu structure
return False

@expose("/")
def index(self):
return redirect(url_for("taxons.index_view"))


taxhub_admin = Admin(
template_mode="bootstrap4", name="Administration Taxhub", index_view=TaxhubView(url="/")
)


def taxhub_admin_addview(app, admin, category=None):
with app.app_context():
from apptax.admin.admin_view import (
TaxrefView,
BibListesView,
TMediasView,
BibAttributsView,
LoginView,
BibThemesView,
)

static_folder = os.path.join(adresses.root_path, "static")
admin.add_view(
LoginView(
name="Login", endpoint="loginview", category=category, static_folder=static_folder
)
)
admin.add_view(
TaxrefView(
Taxref,
db.session,
name="Taxref",
endpoint="taxons",
category=category,
static_folder=static_folder,
)
)
admin.add_view(
BibListesView(
BibListes,
db.session,
name="Listes",
category=category,
static_folder=static_folder,
)
)
admin.add_view(
TMediasView(
TMedias, db.session, name="Médias", category=category, static_folder=static_folder
)
)
admin.add_view(
BibAttributsView(
BibAttributs,
db.session,
name="Attributs",
category=category,
static_folder=static_folder,
)
)
admin.add_view(
BibThemesView(
BibThemes,
db.session,
name="Thèmes",
category=category,
static_folder=static_folder,
)
)
Loading
Loading