-
Notifications
You must be signed in to change notification settings - Fork 102
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/home/display latest discussions #3154
Merged
jacquesfize
merged 37 commits into
PnX-SI:develop
from
naturalsolutions:feat/home/display-latest-discussions
Oct 4, 2024
Merged
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
ffae686
feat(wip): discussion on page home
andriacap aea50e1
feat(wip): column responsibility changed + orderby
andriacap 7e30aa8
feat(back): add test for route list_reports
andriacap fe879b6
fix: sort dir / orderby and pages
andriacap 32aaa8d
feat: add config for LATEST_DISCUSSIONS
andriacap 6eaa269
feat(front): add column mode force
andriacap cf3cf24
style(backend): apply linter black
andriacap 783b9d9
style(frontend): apply prettier
andriacap 17f6284
refactor: change checkbox to mat-slide-toggle
andriacap d0205c0
refactor: split code in components
andriacap ccbafc4
refact(frontend): remove generic table
andriacap 48ca4f6
refactor(frontend): use standalone
andriacap 2e2537d
refactor(frontend): make selected row works
andriacap eb04139
refactor(frontend): add condition to display/hide
andriacap 2da923f
refactor: move config LATEST_DISCUSSION sample
andriacap de66c74
feat(frontend): use same css from other datatable
andriacap a79b282
refactore: set default True for LATEST_DISCUSSION
andriacap a111dd8
fix(frontend): undefined pageChanged Method
andriacap 97cdc93
feat(frontend): add information icon and click evt
andriacap 8a0d65a
style: remove console.log
andriacap ce49260
style(frontend): apply prettier
andriacap 515a769
feat: add filtered count result to route /reports
andriacap 50cc23e
styl(frontend): apply linter prettier
andriacap b9e6d01
fix: style and comment
andriacap e04c8e8
fix: orderby, joinedload, split routes
andriacap b84a0e9
fix(test): wip - split test related reports routes
andriacap 18ee0ad
fix: change way to read permission synthese
andriacap d38eea7
feat: add missing test for pin case in list_reports
edelclaux edfec67
feat: add missing test for unknow type in list_reports
edelclaux 9575545
test: dummy commit to trigger ci pipeline
edelclaux 7333851
test: add undefined test in lsit_all_reports
edelclaux efd9d4e
test: adjust phrasing
edelclaux 7d768a9
test: add nortigjtuser scenario in list_reports
edelclaux 4803996
feat(routes, report) : translate to sqla2.0
jacquesfize 8346915
fix(test) : sorted does not work exactly like psql sort
jacquesfize 0306bf0
fix(blueprint,report): change query to feat flasksqlalchemy paginate(…
jacquesfize 8c2b874
fix(latest_discussions): fix number of page
jacquesfize File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C'est une bonne pratique ça de faire la pagination à la mano ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dans GeoNature, c'est flask-sqlalchemy qui fait la pagination. Le soucis, c'est qu'ils utilisent la méthode
scalars()
lors de l'exécution d'une requête construite avec un objetSelect
(remplace Query dans SQLA 2.0) (https://github.com/pallets-eco/flask-sqlalchemy/blob/main/src/flask_sqlalchemy/pagination.py#L328-L364). Ici, c'est pas ce que l'on souhaite. SI on veut que la pagination flask-sqlalchemy fonctionne ici, il faudrait passer par une requête construite avec un objectQuery
mais qui n'est plus recommandé dans SQLA 2.0 😕Du coup, je propose de faire la pagination "à la main" en s'appuyant sur quasi le même fonctionnement de flask-sqlalchemy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On peut aussi modifier la requête, récupérer le nom_complet de l'utilisateur dans un joinedload et repasser sur la pagination flask-sqlalchemy, ça devrait marcher 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c'est fait :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Top, merci !