ymcatwincities / openy_gated_content

Virtual YMCA
https://openy.org
GNU General Public License v3.0
5 stars 28 forks source link

Virtual Y

Virtual Y is a package for Open Y and consists of features, needed to organize gated content for Y clients.

Active development is currently happening at YUSA fork. Pull requests should be submitted there. They will be pulled into this repo as they are reviewed and released.

Server requirements

In order to work Virtual Y requires HTTP server to allow

Submodules

  1. Authentication system - pluginable system for different authentication types.
  2. Demo - set of migrations that installs Demo content at the initial step of your Virtual Y
  3. Storage - set of entities, needed for Virtual Y
  4. Log Features for tracking activities of your Virtual Y users.
  5. Shared content - module that give's you ability to download content from shared network.
  6. Shared content server - module for shared.openy.org server.

Installation

See also the video version of these instructions. This assumes you've already built an Open Y site and have it running.

Upgrade path

Known issues

If you facing with

 [error]  Configuration <em class="placeholder">user.role.anonymous</em> depends on configuration (<em class="placeholder">rest.resource.openy_gc_auth_custom, rest.resource.openy_gc_auth_custom_confirm</em>) that will not exist after import.

It’s looks like that previous updates were failed. If you don't use Custom auth provider - disable that module, and it should help. If you use it - try manually delete that config and try again

drush cdel rest.resource.openy_gc_auth_custom_confirm

Another one

Drupal\Component\Plugin\Exception\PluginNotFoundException while adding Views handlers for field Parts of day on index Default: The "" plugin does not exist. Valid plugin IDs for Drupal\search_api\DataType\DataTypePluginManager are: boolean, date, integer, decimal, string, text in

This error was because one of the service lived in a custom folder. Try to analyse what service is broken and fix it.

Development

In development purposes, you might want a set of modules to be enabled. Use openy_gc_demo module for such purposes. Specify modules that you want to be enabled as dependencies of this module. The CI configuration automatially enables this modules, and all its dependencies.

Coding standards

PHPCS

Please find the PHPCS configuration in .phpcs.xml.

In order to use the configuration just run phpcs within the module directory.

You can add this script to .git/hooks/pre-commit to run phpcs and phpcbf on git commit

PROJECT=`php -r "echo dirname(dirname(dirname(realpath('$0'))));"`
cd $PROJECT
echo "Running phpcs and phpcbf..."
phpcs .
if [ $? != 0 ]
then
    phpcbf .
    exit 1
fi

eslint

Please find the esling configuration in js/gated-content/.eslintrc.js

To run the check execute npm install && npm lint-no-fix. See js/gated-content/package.json for details.

Automatic code fixing is available with npm lint.

With docksal for openy

The docksal configuration https://github.com/fivejars/docksal-for-openy/tree/openy-gc-builds is used to for building the PR builds.

In order to use it you have to install Docksal.

Follow the instruction below to get the working local environment that provides 4 local websites (1 for each base theme and not yet installed Open Y):

mkdir vymca
cd vymca
git clone --branch openy-gc-builds \
  git@github.com:fivejars/docksal-for-openy.git .docksal
git clone git@github.com:fivejars/openy_gated_content.git
mkdir -p docroot/libraries docroot/sites/default/config/staging
wget -N https://raw.githubusercontent.com/fivejars/openy-project/8.2.x-gated-content-ci/composer.json
docker volume create --name=composer_cache
fin init

Vimeo private videos

For videos, protected from embed by "Specific domains" you can have an issue with thumbnails download to drupal media. In this case - apply a patch for drupal core:

JSON API patch required for Drupal 8.7

{
  "extra": {
    "patches": {
      "drupal/core": {
        "JSONAPI wont install (8.7-specific)": "https://www.drupal.org/files/issues/2019-05-23/jsonapi_2996114.patch"
      }
    }
  }
}

Migration notes

If you have error:

TypeError: Argument 6 passed to __construct() must be an instance of EntityTypeManagerInterface

apply patch to composer.json:

{
  "extra": {
    "patches": {
      "drupal/paragraphs": {
        "3079627": "https://www.drupal.org/files/issues/2019-09-06/3079627-4.paragraphs.Argument-6-passed-to-construct.patch"
      }
    }
  }
}