daml/navigator/frontend
Bernhard Elsner cda93db944
Daml case and logo (#8433)
* Replace many occurrences of DAML with Daml

* Update docs logo

* A few more CLI occurrences

CHANGELOG_BEGIN
- Change DAML capitalization and docs logo
CHANGELOG_END

* Fix some over-eager replacements

* A few mor occurrences in md files

* Address comments in *.proto files

* Change case in comments and strings in .ts files

* Revert changes to frozen proto files

* Also revert LF 1.11

* Update get-daml.sh

* Update windows installer

* Include .py files

* Include comments in .daml files

* More instances in the assistant CLI

* some more help texts
2021-01-08 12:50:15 +00:00
..
src Daml case and logo (#8433) 2021-01-08 12:50:15 +00:00
.editorconfig open-sourcing daml 2019-04-04 09:33:38 +01:00
.eslintrc.js update copyright notices for 2021 (#8257) 2021-01-01 19:49:51 +01:00
.gitignore open-sourcing daml 2019-04-04 09:33:38 +01:00
.modernizrrc open-sourcing daml 2019-04-04 09:33:38 +01:00
apollo.config.js update copyright notices for 2021 (#8257) 2021-01-01 19:49:51 +01:00
BUILD.bazel update copyright notices for 2021 (#8257) 2021-01-01 19:49:51 +01:00
declarations.d.ts update copyright notices for 2021 (#8257) 2021-01-01 19:49:51 +01:00
karma.conf.js update copyright notices for 2021 (#8257) 2021-01-01 19:49:51 +01:00
LICENSE open-sourcing daml 2019-04-04 09:33:38 +01:00
Makefile Expose signatories and observers throughout the platform (#1814) 2019-06-26 14:02:59 +00:00
package.json Migrate Navigator from TSLint to ESLint (#8172) 2020-12-04 17:02:13 +01:00
README.md refresh navigator dependencies (#1621) 2019-06-13 14:19:38 +02:00
tsconfig.json Upgrade apollo libraries in Navigator (#8124) 2020-12-02 12:47:30 +01:00
webpack.config.js update copyright notices for 2021 (#8257) 2021-01-01 19:49:51 +01:00
webpack.ui-core.js update copyright notices for 2021 (#8257) 2021-01-01 19:49:51 +01:00
yarn.lock Migrate Navigator from TSLint to ESLint (#8172) 2020-12-04 17:02:13 +01:00

Navigator Frontend

The Navigator frontend is based on the ui-core library.

Developing Navigator Frontend

To build the bundled frontend files, use Bazel:

bazel build //navigator/frontend:frontend.jar

To test the frontend during development, start the backend at port 4000 (defined in webpack.config.js), run the following command, and open a web browser at the address indicated in the command output:

make start

This will start an interactive build using webpack-dev-server. Every time you save a file, the frontend assets will be rebuilt, and a push notification will be sent to the browser, prompting it to reload the page.

See the ui-core README for information about the design of some of the core components of Navigator.

Configurable table views

Configurable table views are a rapid prototyping feature, where developers can write a script that returns a list of custom table views for a given user.

Architecture

  • The configsource applet is responsible for loading the config file.
    • The config file source is loaded from the backend /api/config endpoint.
    • The config file source is stored in the state of the applet.
  • The config file is parsed and evaluated in the app UI component.
    • The evaluated config is stored in the component state, and only re-evaluated if either the current user or the config file source has changed.
    • The evaluated config is passed as a property to child components.
  • The customview applet implements the rendering of custom views.
    • This applet forwards all functionality to either the Contracts, Templates, or TemplateContracts applets.
    • The route for custom views only contains its ID. Therefore, the state of the applet initially only holds the ID of the custom view.
    • When the applet UI component is rendered for the first time, it initializes the state of the child applet (it now has access to the evaluated config, passed as props from the app UI component).
  • Config file parsing and loading is implemented in the config module.
    • The config file is first preprocessed using Babel (to support JSX tags and ES6 code).
    • Import statements are implemented using a custom require function, that only provides modules already bundled with the Navigator.
    • The parsed config file is checked for its version.
    • There is generally little run time validation.