Skip to content

Commit 9e12ab9

Browse files
authored
Merge pull request #1940 from OpenEnergyPlatform/fix-1939-sectors-and-technology-tab-breaks-app
Fix sectors and technology tab breaks app & extend documentation
2 parents 7602997 + 4a86104 commit 9e12ab9

File tree

3 files changed

+29
-2
lines changed

3 files changed

+29
-2
lines changed

api/views.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,24 @@ def put(self, request, schema, table):
449449
"""
450450
Creates a new table: physical table first, then metadata row.
451451
Applies embargo and permissions, and sets metadata if provided.
452+
453+
REST-API endpoint used to create a new table in the database.
454+
The table is created with the columns and constraints specified in the
455+
request body. The request body must contain a JSON object with the following
456+
keys: 'columns', 'constraints' and 'metadata'.
457+
The payload must be a groped in a 'query' key.
458+
459+
For authentication, the request must contain a valid token in the
460+
Authentication header.
461+
462+
Args:
463+
request: The request object
464+
schema: The schema in which the table should be created
465+
table: The name of the table to be created
466+
467+
Returns:
468+
JsonResponse: A JSON response with the status code 201 CREATED
469+
452470
"""
453471
# 1) Basic schema checks
454472
if schema not in PLAYGROUNDS and schema not in UNVERSIONED_SCHEMAS:

docs/installation/guides/development-setup.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,18 @@ You can run your own local copy of the OEP website server with
6969

7070
python manage.py runserver
7171

72-
By default, you should be able to connect to this copy by visiting [localhost:8000](http://localhost:8000) in your web browser.
72+
By default, you should be able to connect to this copy by visiting [127.0.0.1:8000](http://127.0.0.1:8000) in your web browser.
7373
This way you can insert your changes without worrying about breaking anything in the production system.
7474

75+
### Deploy react app´s locally
76+
77+
!!! Note
78+
This solution is not the best developer experience and needs optimization
79+
80+
As some Apps of the Oeplatform integrate React apps they need to be build using npm locally. We offer build scripts that can be triggered using django management commands. For example to build the scenario bundles react app and deploy it in the django app factsheet you can run the command `python manage.py build_factsheet_app`. Once done you can access the scenario bundles app via your locally deployed django instance (see above).
81+
82+
Keep in mind that you now use a bundled version of the react app and all changes you might want to add to the React jsx components will only show up once you build the app again. For development this might be a bit clunky but since the app is deployed inside the django app this enables the React app to use the django authentication. An alternative that will not be able to use the django user authentication currently is to deploy the React app alongside the locally deployed django instance. You can use npm start while being inside the `factsheet/frontend/` directory in the terminal. To make this work you will have to change the config.json inside the same directory. In this file you find the key `"toep": "/"` you'll have to change this `/` value to `http://127.0.0.1:8000` to point to the django instance currently deployed locally. If your react test server is still running (`npm start`) you can now access it at `http://127.0.0.1:3000/scenario-bundles/main`. All changes made to the React jsx components will now be reflected instantly using live reloading.
83+
7584
## User Management - Setup a test user
7685

7786
To create a dummy user for functionality testing purposes

docs/installation/guides/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Below we describe the manual installation of the oeplatform code and infrastruct
88

99
We provide 2 [docker container images](https://docs.docker.com/get-started/#what-is-a-container-image) (OEP-website and OEP-database). The images are updated & published with each release. They can be pulled from [GitHub packages](https://github.com/OpenEnergyPlatform/oeplatform/pkgs/container/oeplatform).
1010

11-
[Here you can find instructions on how to install the docker images.](https://github.com/OpenEnergyPlatform/oeplatform/blob/develop/docker/USAGE.md)
11+
[Here you can find instructions on how to install the docker images.](https://github.com/OpenEnergyPlatform/oeplatform/tree/develop/docker)
1212

1313
!!! danger
1414
Currently the docker based installation does not cover the installation of the additional database `jenna-fuseki` a triple store that stores graph data used in some of our features.

0 commit comments

Comments
 (0)