DBCDK / biblo-admin

Admin application for biblo
0 stars 3 forks source link

biblo.dk Administration

Biblo.dk lukkede den 31. december 2019

This is the administration interface for biblo.dk based on Drupal 8.

The project structure is based on drupal-composer/drupal-project.

Development dependencies

Installation instructions

  1. Clone this repository
  2. From the root of the cloned repository:
    1. Run composer install
    2. Run docker-compose build
    3. Run docker-compose up
    4. Run docker-compose run web drush cim -y
  3. Profit!

Optional installation instructions

Maintenance

Maintaining third party code

Third party dependencies are maintained using Composer and declared in composer.json. This includes Drupal Core, modules and themes from drupal.org as well as third party libraries.

Updating dependencies

To update dependencies do the following;

  1. Run composer update. This will check for updates to all direct and indirect dependencies within the boundaries defined in composer.json and apply them to the local project.
  2. Commit and push the resulting changes to the composer.lock file. This will ensure that the updated versions are used on external environments when running composer.install.
  3. Deploy the changes.

To only update a specific dependency then go through steps 1-3 but run composer update [dependency]. Example: To update Drupal Core run composer update drupal/core.

Applying a patch

To apply a patch to a dependency do the following:

  1. Add the patch to composer.json under extra.patches.[dependency-name]
  2. Run composer update --lock
  3. Commit and push the changes to composer.json and composer.lock files
  4. Deploy the changes

Webservice client generation

This project includes a PHP webservice client for accessing the community service.

To update this client do the following:

  1. Update your Docker image for the community service docker-compose build --no-cache service
  2. Update the client code using swagger-codegen composer docker-swagger-generate
  3. Change file permissions in lib/client to ensure that new files are owned by the current user.

If you do not want to run the community client locally using Docker and you have access to a running version of the community service then you can replace steps 1 and 2 with the following command:

docker-compose run swagger generate -i http://[community-service-host:port]/explorer/swagger.json -l php -o /var/usr/client -c /var/usr/swagger/config.json

Creating widgets

This is a checklist of steps for creating new widgets

  1. Enable field_ui docker-compose run web drush en field_ui
  2. create paragraph at /admin/structure/paragraphs_type
  3. Add the specified fields to the new paragraph
  4. Add the paragraph to the specified content types (content_type > Manage fields > field_content > edit). In general paragraphs are added to fields of type Entity reference revisions
  5. Create Widget Normalizer /web/modules/custom/dbc_community_content/src/Mormalizer/Widget (Use an exisiting widgetNormalizer as template, remember to change className, bundle name and Widget name)
  6. Add fields that needs to be exported as json to getWidgetConfig method (Only fields not defined in DefaultWidgetNormalizer)
  7. add new widget to dbcdk_community_content.services.yml
  8. Export config docker-compose run web drush cex -y (You will need to cherry pick the config chances specific to the widget)

Continuous Integration