Skip to content

Commit

Permalink
[Fixes: #5000] Update Frontend section
Browse files Browse the repository at this point in the history
  • Loading branch information
t-book committed Oct 7, 2019
1 parent d0c951f commit b802e36
Showing 1 changed file with 20 additions and 21 deletions.
41 changes: 20 additions & 21 deletions docs/contribute/frontend-development/index.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
Frontend development
====================

The GeoNode frontend dependencies can be found in geonode / static. To

Knowledge of handling node/npm is required.

The GeoNode frontend dependencies can be found in ./geonode/static. To
manage dependencies, we recommend the use of yarn package manager (https://yarnpkg.com/lang/en).


First steps:
------------

Expand All @@ -13,8 +17,8 @@ Installs the required libraries to ./node_modules

``yarn install <package>@version [--dev]``

Installs a paket with a defined version. Using ``–dev`` installs a
dependency that is only available for the build process.
Installs a package with a defined version. Using ``–dev`` installs a
dependency that is only available for the build process (see: package.json devDependencies).

``yarn remove <package>``

Expand All @@ -30,7 +34,7 @@ Get information on why this package was installed.

**For further information on how to install or use please visit the official yarn documentation.**

File(Folder overview:
File/Folder overview:
----------------

``./static_dependencies.json``
Expand Down Expand Up @@ -60,32 +64,27 @@ This folder can be deleted as it will be
fully generated by use of grunt ``development|production``





Example 1 – Change styling:
^^^^^^^^^^^^^^^^^^^^^^^^^^^

1. we start the development server with ``paver start``.
2. we use ``grunt watch`` to watch all less files for change.
3. we change styling in geonode / less
4. If our changes are ok we create a new build with
1. In your settings set ``DEBU_STATIC=True``. This will load unminified assets in your template.
2. Start the development server with ``paver start``.
3. Use ``grunt watch`` to watch all less files for change.
4. Change styling in ./geonode/static/geonode/less
5. If our changes are as expected create a new build with
``grunt development`` (files are not minimized) or
``grunt production`` (files are minimized)

Example 2 – add/update a new library:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1. yarn add angular@1.7
2. ``vim static_dependencies.json`` Edit the file and add your dependency to its fitting
1. In your settings set ``DEBU_STATIC=True``. This will load unminified assets in your template.
2. yarn add angular@1.7
3. ``vim static_dependencies.json`` Edit the file and add your dependency to its fitting
destination. For example, assets.min.js
3. Check if some Django template (for example, base.html) includes the file by use of ``DEBUG_STATIC=True``
and add it or adjust the version
4. use `grunt production` to build the package
4. Check if some Django template (for example, base.html) includes the file and add it or adjust the version
5. use `grunt production` to build the package

**For further tasks have a look at gruntfile.js or ask for help in the
development mailing list**
**For further tasks have a look at gruntfile.js or ask for help in the development mailing list**

Attention: Please make maintainers work easier and add a message to
your commit why a library has been added. (For example, commit -m
'select2 added for permissions form on layer detail page')
.. note:: Please make maintainers work easier and add a message to your commit why a library has been added. (For example, commit -m 'select2 added for permissions form on layer detail page')

0 comments on commit b802e36

Please sign in to comment.