Skip to content

Commit

Permalink
first comment appearance of app.config.ts + delete command associated…
Browse files Browse the repository at this point in the history
… with it
  • Loading branch information
jacquesfize committed Oct 11, 2023
1 parent 212ec61 commit 7dcaede
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 38 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ jobs:
./install/05_install_frontend.sh --ci
env:
GEONATURE_CONFIG_FILE: "${{ github.workspace }}/config/test_config.toml"
- name: Show generated frontend config
run: |
cat ./frontend/src/conf/app.config.ts
# - name: Show generated frontend config
# run: |
# cat ./frontend/src/conf/app.config.ts
- name: Install core modules
run: |
geonature install-gn-module contrib/occtax OCCTAX --build=false
Expand Down
38 changes: 19 additions & 19 deletions backend/geonature/core/command/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,25 +61,25 @@ def dev_back(ctx, host, port):
ctx.invoke(run_command, host=host, port=port)


@main.command()
@click.option(
"--input",
"input_file",
type=click.File("r"),
)
@click.option(
"--output",
"output_file",
type=click.File("w"),
)
def generate_frontend_config(input_file, output_file):
"""
Génération des fichiers de configurations pour javascript
"""
create_frontend_config(input_file, output_file)
click.echo(
"Configuration générée. Pensez à rebuilder le frontend pour la production.", err=True
)
# @main.command()
# @click.option(
# "--input",
# "input_file",
# type=click.File("r"),
# )
# @click.option(
# "--output",
# "output_file",
# type=click.File("w"),
# )
# def generate_frontend_config(input_file, output_file):
# """
# Génération des fichiers de configurations pour javascript
# """
# create_frontend_config(input_file, output_file)
# click.echo(
# "Configuration générée. Pensez à rebuilder le frontend pour la production.", err=True
# )


@main.command()
Expand Down
30 changes: 15 additions & 15 deletions backend/geonature/utils/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,23 @@
from geonature.utils.module import get_dist_from_code, get_module_config


def create_frontend_config(input_file=None, output_file=None):
if input_file is None:
input_file = (FRONTEND_DIR / "src/conf/app.config.ts.sample").open("r")
else:
input_file = nullcontext(input_file)
with input_file as f:
template = Template(f.read())
# def create_frontend_config(input_file=None, output_file=None):
# if input_file is None:
# input_file = (FRONTEND_DIR / "src/conf/app.config.ts.sample").open("r")
# else:
# input_file = nullcontext(input_file)
# with input_file as f:
# template = Template(f.read())

parameters = json.dumps(config_frontend, indent=True)
app_config_template = template.render(parameters=parameters)
# parameters = json.dumps(config_frontend, indent=True)
# app_config_template = template.render(parameters=parameters)

if output_file is None:
output_file = (FRONTEND_DIR / "src/conf/app.config.ts").open("w")
else:
output_file = nullcontext(output_file)
with output_file as f:
f.write(app_config_template)
# if output_file is None:
# output_file = (FRONTEND_DIR / "src/conf/app.config.ts").open("w")
# else:
# output_file = nullcontext(output_file)
# with output_file as f:
# f.write(app_config_template)


def create_frontend_module_config(module_code, output_file=None):
Expand Down
2 changes: 1 addition & 1 deletion install/05_install_frontend.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ cat src/assets/config.json

echo "Création de la configuration du frontend depuis 'config/geonature_config.toml'..."
# Generate the app.config.ts
geonature generate-frontend-config
# geonature generate-frontend-config

echo "Désactivation du venv..."
deactivate
Expand Down

0 comments on commit 7dcaede

Please sign in to comment.