Skip to main content

components

SALTISE-components is a simple Django app to build and test a collection of front-end components for myDALITE built with preact and Material UI.

Quick start

  1. Add the Components app to your requirements, then pip install:

    pip install SALTISE-components
  2. Add “components” to your INSTALLED_APPS setting like this:

    INSTALLED_APPS = [
        ...
        'components',
        ...
    ]
  3. Import minified script to access component library (you can override default styles using global css names):

    <script src="{% static 'component/js/app.min.js' %}" defer="true"></script>
  4. Inject components into the DOM, customizing props as needed. Assuming django-csp is installed, the Navigation components is injected via:

    <script nonce="{{ request.csp_nonce }}">
        window.addEventListener("load", function () {
            const nav = () => {
                return components.h(components.Navigation, {
                    nonce: "{{ request.csp_nonce }}",
                });
            };
            components.render(
                nav(),
                document.getElementById("navigation-app")
            );
        });
    </script>

Quick start dev

  1. Install node modules:

    npm install
  2. Create python 3.8+ virtualenv and nstall pip-tools:

    python -m pip install --upgrade pip
    pip install pip-tools
  3. Install requirements:

    pip-sync requirements/requirements.txt
  4. Install pre-commit:

    pre-commit install
  5. Start the server:

    python components.py runserver
  6. Navigate to ‘localhost:8000/’, to see components in action.

  7. Build when you make edits to app.js:

    npx gulp scripts
  8. To create translations:

    npx gulp scripts
    python components.py makemessages -d djangojs -l fr -i=node_modules/* -i=venv*
    python components.py compilemessages -l fr -i=venv*
  1. If you wish, remake the package:

    tox --recreate
  2. To publish, e.g.:

    twine upload .tox/dist/SALTISE_components-0.1.zip --verbose

To do in myDALITE

  1. Align question difficulty serializer

  2. Define assignment difficulty in serializer

Metadata

Release files for SALTISE-components 0.2.15

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for SALTISE-components 0.2.15
File Size Uploaded Provenance Actions
SALTISE_components-0.2.15.tar.gz 6.7 MB Without provenance Details for SALTISE_components-0.2.15.tar.gz

Release files / SALTISE_components-0.2.15.tar.gz

Download URL SALTISE_components-0.2.15.tar.gz
Size 6.7 MB
Tags Source
SHA-256 checksum
How to use checksums
fc7aed871fe983deab269fea9b3e321a725f3392e2130cd9cce6e454f76adad8
BLAKE2b-256 checksum
How to use checksums
5ff56db0ba5341df9e04cc4db69ab0eae579c3da6f71aadf2ccb621473ae190f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.5

Security for SALTISE-components 0.2.15

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page