Merged dev
This commit is contained in:
@@ -14,7 +14,7 @@ jobs:
|
|||||||
# ...I merged a PR or pushed on the dev branch, thus deploy to the test env (dev)
|
# ...I merged a PR or pushed on the dev branch, thus deploy to the test env (dev)
|
||||||
if: |
|
if: |
|
||||||
(github.event_name == 'workflow_dispatch' && github.ref_name == 'main') ||
|
(github.event_name == 'workflow_dispatch' && github.ref_name == 'main') ||
|
||||||
((github.event.pull_request.merged == true || github.event.push == true) && github.ref_name == 'dev')
|
((github.event_name == 'pull_request' || github.event_name == 'push') && github.ref_name == 'dev')
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
environment: ${{ github.ref_name }}
|
environment: ${{ github.ref_name }}
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
+12
-12
@@ -21,18 +21,18 @@ app.index_string = """
|
|||||||
{%renderer%}
|
{%renderer%}
|
||||||
</footer>
|
</footer>
|
||||||
<script type="application/javascript">
|
<script type="application/javascript">
|
||||||
console.log("Matomo")
|
console.log("Matomo");
|
||||||
var _paq = window._paq = window._paq || [];
|
var _paq = window._paq = window._paq || [];
|
||||||
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
|
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
|
||||||
_paq.push(['trackPageView']);
|
_paq.push(['trackPageView']);
|
||||||
_paq.push(['enableLinkTracking']);
|
_paq.push(['enableLinkTracking']);
|
||||||
(function() {
|
(function() {
|
||||||
var u="//analytics.maudry.com/";
|
var u="//analytics.maudry.com/";
|
||||||
_paq.push(['setTrackerUrl', u+'matomo.php']);
|
_paq.push(['setTrackerUrl', u+'matomo.php']);
|
||||||
_paq.push(['setSiteId', '14']);
|
_paq.push(['setSiteId', '14']);
|
||||||
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
|
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
|
||||||
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
|
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
+22
-2
@@ -1,4 +1,4 @@
|
|||||||
from dash import register_page, html
|
from dash import register_page, html, dcc
|
||||||
|
|
||||||
title = "À propos"
|
title = "À propos"
|
||||||
|
|
||||||
@@ -6,4 +6,24 @@ register_page(
|
|||||||
__name__, path="/a-propos", title=f"decp.info - {title}", name=title, order=3
|
__name__, path="/a-propos", title=f"decp.info - {title}", name=title, order=3
|
||||||
)
|
)
|
||||||
|
|
||||||
layout = [html.H2(title)]
|
layout = [
|
||||||
|
html.Div(
|
||||||
|
className="container",
|
||||||
|
children=[
|
||||||
|
html.H2(title),
|
||||||
|
dcc.Markdown(
|
||||||
|
"""Outil développé par Colin Maudry, sous licence GPL v3 (libre et gratuit).
|
||||||
|
|
||||||
|
- [wiki du projet](https://github.com/ColinMaudry/decp-processing/wiki)
|
||||||
|
- [code source de decp.info](https://github.com/ColinMaudry/decp.info)
|
||||||
|
- [code source du traitement de données](https://github.com/ColinMaudry/decp-processing)
|
||||||
|
|
||||||
|
Contact :
|
||||||
|
- [colin+decp@maudry.com](mailto:colin+decp@maudry.com)
|
||||||
|
- BlueSky : [@col1m.bsky.social](https://bsky.app/profile/col1m.bsky.social)
|
||||||
|
- Mastodon : [col1m@mamot.fr](https://mamot.fr/@col1m)
|
||||||
|
"""
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
]
|
||||||
|
|||||||
+10
-3
@@ -2,11 +2,14 @@ from dash import html, dcc, dash_table, register_page, Input, Output, State, cal
|
|||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
import os
|
import os
|
||||||
import polars as pl
|
import polars as pl
|
||||||
from src.utils import split_filter_part
|
from src.utils import split_filter_part, add_annuaire_link
|
||||||
|
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
|
|
||||||
df = pl.scan_parquet(os.getenv("DATA_FILE_PARQUET_PATH"))
|
df: pl.LazyFrame = pl.scan_parquet(os.getenv("DATA_FILE_PARQUET_PATH"))
|
||||||
|
|
||||||
|
# Ajout des liens vers l'annuaire
|
||||||
|
df = add_annuaire_link(df)
|
||||||
|
|
||||||
title = "Tableau"
|
title = "Tableau"
|
||||||
register_page(__name__, path="/", title=f"decp.info - {title}", name=title, order=1)
|
register_page(__name__, path="/", title=f"decp.info - {title}", name=title, order=1)
|
||||||
@@ -19,7 +22,10 @@ datatable = dash_table.DataTable(
|
|||||||
page_action="custom",
|
page_action="custom",
|
||||||
filter_action="custom",
|
filter_action="custom",
|
||||||
filter_options={"case": "insensitive", "placeholder_text": "Filtrer..."},
|
filter_options={"case": "insensitive", "placeholder_text": "Filtrer..."},
|
||||||
columns=[{"name": i, "id": i} for i in df.collect_schema().names()],
|
columns=[
|
||||||
|
{"name": i, "id": i, "presentation": "markdown"}
|
||||||
|
for i in df.collect_schema().names()
|
||||||
|
],
|
||||||
selected_columns=[],
|
selected_columns=[],
|
||||||
selected_rows=[],
|
selected_rows=[],
|
||||||
# sort_action="native",
|
# sort_action="native",
|
||||||
@@ -38,6 +44,7 @@ datatable = dash_table.DataTable(
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
data_timestamp=0,
|
data_timestamp=0,
|
||||||
|
markdown_options={"html": True},
|
||||||
)
|
)
|
||||||
|
|
||||||
layout = [
|
layout = [
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import polars as pl
|
||||||
|
|
||||||
operators = [
|
operators = [
|
||||||
["s<", "<"],
|
["s<", "<"],
|
||||||
["s>", ">"],
|
["s>", ">"],
|
||||||
@@ -17,3 +19,26 @@ def split_filter_part(filter_part):
|
|||||||
return name, operator_group[1], value
|
return name, operator_group[1], value
|
||||||
|
|
||||||
return [None] * 3
|
return [None] * 3
|
||||||
|
|
||||||
|
|
||||||
|
def add_annuaire_link(df: pl.LazyFrame):
|
||||||
|
df = df.with_columns(
|
||||||
|
pl.when(pl.col("titulaire_typeIdentifiant") == "SIRET")
|
||||||
|
.then(
|
||||||
|
pl.col("titulaire_id")
|
||||||
|
+ f' <a href="https://annuaire-entreprises.data.gouv.fr/etablissement/'
|
||||||
|
+ pl.col("titulaire_id")
|
||||||
|
+ '" target="_blank">📑</a>'
|
||||||
|
)
|
||||||
|
.otherwise(pl.col("titulaire_id"))
|
||||||
|
.alias("titulaire_id")
|
||||||
|
)
|
||||||
|
df = df.with_columns(
|
||||||
|
(
|
||||||
|
pl.col("acheteur_id")
|
||||||
|
+ f' <a href="https://annuaire-entreprises.data.gouv.fr/etablissement/'
|
||||||
|
+ pl.col("acheteur_id")
|
||||||
|
+ '" target="_blank">📑</a>'
|
||||||
|
).alias("acheteur_id")
|
||||||
|
)
|
||||||
|
return df
|
||||||
|
|||||||
Reference in New Issue
Block a user