Skip to content
Snippets Groups Projects
Commit 4c165f95 authored by Liam Morland's avatar Liam Morland
Browse files

Coding standards

parent 0e9d23bf
No related branches found
No related tags found
7 merge requests!433ISTWCMS-6296 Create test for all event dates test cases,!136Istwcms 4725 ebremner config sync,!63Feature/istwcms 4512 l26yan add first last name fields to users,!48Feature/istwcms 4465 l26yan remove paragraphs edit from base profile,!9Feature/istwcms 4139 l26yan update leaflet,!8Feature/istwcms 4156 l26yan set up catalogs terms,!2Feature/istwcms 4137 ebremner use linkit
......@@ -14,10 +14,14 @@ Built from [Drupal 8 core](https://drupal.org) and [Gesso](https://www.drupal.or
## Notes on theming
UW has taken the approach to use a component based design and has chosen [Forum One's](https://www.forumone.com/) pattern-lab instance of [Gesso](https://www.drupal.org/project/gesso) from the [git hub repository](https://github.com/forumone/gesso).
When installing the base profile for the FIRST time you must install both the profile and gesso. On subsequent installs you may chose to bypass installing gesso, however, if there are updates to gesso, those will be missed.
When installing the base profile for the FIRST time you must install both the
profile and gesso. On subsequent installs you may chose to bypass installing
gesso, however, if there are updates to gesso, those will be missed.
## Installing the profile and/or gesso
UW FDSU responsive theme comes with a script that will handling building the theme and/or gesso.
UW FDSU responsive theme comes with a script that will handling building the
theme and/or gesso.
## Rebuild script
./rebuild.sh will accept the following switches:
......@@ -43,8 +47,10 @@ UW FDSU responsive theme comes with a script that will handling building the the
./rebuild.sh 2 --gesso-branch-tag=8.x-3.x
## Usage without parameters
If you simply use ./rebuild.sh then interactivity will begin and ask questions about the build options and gesso branch/tag. If you use at least one switch then there is no interactivity.
Example with interactivity
If you simply use ./rebuild.sh then interactivity will begin and ask questions
about the build options and gesso branch/tag. If you use at least one switch
then there is no interactivity. Example with interactivity:
What would you like to do?
1 = Rebuild profile only.
......@@ -58,12 +64,14 @@ Example with interactivity
## Using Pattern-Lab
Once the rebuild is completed, you can visit pattern-lab at: https://<site-name>/profiles/uw_base_profile/themes/uw_fdsu_theme_resp/uw_wcms_gesso/gesso/pattern-lab.
Once the rebuild is completed, you can visit pattern-lab at:
https://<site-name>/profiles/uw_base_profile/themes/uw_fdsu_theme_resp/uw_wcms_gesso/gesso/pattern-lab.
EXAMPLE:
https://d8alt/fdsu1/profiles/uw_base_profile/themes/uw_fdsu_theme_resp/uw_wcms_gesso/gesso/pattern-lab
If you are doing development, simply navigate in a terminal <drupal-core-path>/profiles/uw_fdsu_theme_resp/uw_wcms_gesso/gesso and run gulp
If you are doing development, simply navigate in a terminal
<drupal-core-path>/profiles/uw_fdsu_theme_resp/uw_wcms_gesso/gesso and run gulp
EXAMPLE:
cd /var/www/drupal8/profiles/uw_fdsu_theme_resp/uw_wcms_gesso/gesso
......@@ -78,7 +86,8 @@ https://www.drupal.org/node/1802534#comment-12246133
components 8.x-2.0-beta1-uw_wcms1
- Base: 8.x-2.0-beta1
- Patch 3761f753: Fix core requirements. https://www.drupal.org/project/components/issues/3100006#comment-13385658
- Patch 3761f753: Fix core requirements.
https://www.drupal.org/project/components/issues/3100006#comment-13385658
eck 8.x-1.0-alpha5-uw_wcms1
- Base: 8.x-1.0-alpha5
......@@ -86,7 +95,8 @@ eck 8.x-1.0-alpha5-uw_wcms1
samlauth 8.x-3.0-alpha1-uw_wcms3
- Base: 8.x-3.0-alpha1
- Patch 4a4b894d: fixing event subscribers. https://www.drupal.org/project/samlauth/issues/2925171#comment-12351528
- Patch 4a4b894d: fixing event subscribers.
https://www.drupal.org/project/samlauth/issues/2925171#comment-12351528
webform 8.x-5.6-uw_wcms2
- Base: 8.x-5.6
......@@ -94,15 +104,18 @@ webform 8.x-5.6-uw_wcms2
- cc6728b1: fix version numbers
## Testing
To prepare a Drupal install for testing with PHPUnit, copy DRUPAL_ROOT/core/phpunit.xml.dist to DRUPAL_ROOT/core/phpunit.xml and in that file set:
To prepare a Drupal install for testing with PHPUnit, copy
DRUPAL_ROOT/core/phpunit.xml.dist to DRUPAL_ROOT/core/phpunit.xml and in that
file set:
SIMPLETEST_BASE_URL to the BASE_URL for your site.
SIMPLETEST_DB to the database URL following the pattern in the file.
SYMFONY_DEPRECATIONS_HELPER to "weak".
Tests can be run from the Drupal UI. To run tests from the command line, run this in the DRUPAL_ROOT:
Tests can be run from the Drupal UI. To run tests from the command line, run
this in the DRUPAL_ROOT:
sudo --user www-data vendor/bin/phpunit -c core
sudo --user www-data vendor/bin/phpunit -c core
Where is like: profiles/uw_base_profile/tests/src/Functional/UwWcmsBasicTest.php
......
composer.json 100755 → 100644
File mode changed from 100755 to 100644
<?php
$config = array(
'admin' => array(
/**
* @file
* Configuration of authentication sources for saml_config.
*/
$config = [
'admin' => [
'core:AdminPassword',
),
'uwaterloo-sp' => array(
'saml:SP',
],
'uwaterloo-sp' => [
0 => 'saml:SP',
// You can get this from ADFS Federation file
// Contact your ADFS administrator
// to obtain this information.
'entityID' => 'urn:drupal:adfs-saml',
'idp' => 'http://adfstest.uwaterloo.ca/adfs/services/trust',
//'NameIDPolicy' => null,
'NameIDPolicy' => 'urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified',
'redirect.sign' => true,
'assertion.encryption' => true,
'sign.logout' => true,
// You can get this from ADFS Federation file
// Contact your ADFS administrator
// to obtain this information.
'entityID' => 'urn:drupal:adfs-saml',
'idp' => 'http://adfstest.uwaterloo.ca/adfs/services/trust',
// 'NameIDPolicy' => null,
'NameIDPolicy' => 'urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified',
'redirect.sign' => TRUE,
'assertion.encryption' => TRUE,
'sign.logout' => TRUE,
// Generate using openssl, @see example above.
// These are the certs from `/cert` directory.
'privatekey' => 'saml.pem',
'certificate' => 'saml.crt',
// Defaults to SHA1 (http://www.w3.org/2000/09/xmldsig#rsa-sha1)
'signature.algorithm' => 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256',
),
);
// Generate using openssl, @see example above.
// These are the certs from `/cert` directory.
'privatekey' => 'saml.pem',
'certificate' => 'saml.crt',
// Defaults to SHA1 (http://www.w3.org/2000/09/xmldsig#rsa-sha1)
'signature.algorithm' => 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256',
],
];
<?php
$metadata['http://adfstest.uwaterloo.ca/adfs/services/trust'] = array (
/**
* @file
* Configuration for saml_config.
*/
$metadata['http://adfstest.uwaterloo.ca/adfs/services/trust'] = [
'entityid' => 'http://adfstest.uwaterloo.ca/adfs/services/trust',
'contacts' =>
array (
0 =>
array (
'contacts' => [
[
'contactType' => 'support',
'emailAddress' =>
array (
0 => 'noreply@uwaterloo.ca',
),
'telephoneNumber' =>
array (
0 => '519-888-4567',
),
),
),
'emailAddress' => [
'noreply@uwaterloo.ca',
],
'telephoneNumber' => [
'519-888-4567',
],
],
],
'metadata-set' => 'saml20-idp-remote',
'SingleSignOnService' =>
array (
0 =>
array (
'SingleSignOnService' => [
[
'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect',
'Location' => 'https://adfstest.uwaterloo.ca/adfs/ls/',
),
1 =>
array (
],
[
'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST',
'Location' => 'https://adfstest.uwaterloo.ca/adfs/ls/',
),
),
'SingleLogoutService' =>
array (
0 =>
array (
],
],
'SingleLogoutService' => [
[
'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect',
'Location' => 'https://adfstest.uwaterloo.ca/adfs/ls/',
),
1 =>
array (
],
[
'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST',
'Location' => 'https://adfstest.uwaterloo.ca/adfs/ls/',
),
),
'ArtifactResolutionService' =>
array (
),
'NameIDFormats' =>
array (
0 => 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress',
1 => 'urn:oasis:names:tc:SAML:2.0:nameid-format:persistent',
2 => 'urn:oasis:names:tc:SAML:2.0:nameid-format:transient',
),
'keys' =>
array (
0 =>
array (
'encryption' => true,
'signing' => false,
],
],
'ArtifactResolutionService' => [],
'NameIDFormats' => [
'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress',
'urn:oasis:names:tc:SAML:2.0:nameid-format:persistent',
'urn:oasis:names:tc:SAML:2.0:nameid-format:transient',
],
'keys' => [
[
'encryption' => TRUE,
'signing' => FALSE,
'type' => 'X509Certificate',
'X509Certificate' => 'MIIC7DCCAdSgAwIBAgIQabPppzSyAKFGbXTJwyxgtjANBgkqhkiG9w0BAQsFADAyMTAwLgYDVQQDEydBREZTIEVuY3J5cHRpb24gLSBhZGZzdGVzdC51d2F0ZXJsb28uY2EwHhcNMTgwODE3MTk1ODIxWhcNMjEwODE2MTk1ODIxWjAyMTAwLgYDVQQDEydBREZTIEVuY3J5cHRpb24gLSBhZGZzdGVzdC51d2F0ZXJsb28uY2EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCwrzcRIEo0/J/Sb9Sjg5WHS0EwvrkWiGTLThe+rXgAgxKQ+c3DGqfy22eOXlLn2dWftRnr9Uc2eJc9opZxoatfrSQwXOr3R1P0gZ64XHFbUeOvQmBVCMeo1/b5tDARPVn8DQEAtCddfxIAiSADj6pCOoD7ULL6C+38dJ/OeHvd/ksOD3FlVsdLuq/WtHO4Wd+/257ObtTOcaPvvfxULKVvV0AMoTLr8XYdYDRcRZ7KYI+y1R1cR1c9UjzAbKoGo3ggAK4F6X26nYVMbShCGPsSZQZTqVOQA01hyfWoH7AFXZDBqcipm1lND4BCOTTpfo7COyropUBpS7vctZsYtNs9AgMBAAEwDQYJKoZIhvcNAQELBQADggEBACRs+EwV2xib2jhO3lim3BaSwxnF08NHSouoGBxbvvnqWemBNNVPjw4giUXpQl0S2nySEdYCRWmfSIkISWwUvWGkr9PgfT9NRp0XT2NWe7ebGucG9ZSbAtr+WFcZWw3W7Cg+eUYa7DNJzISXHYVMED0QdGSKPYsjHK60Bpegmd8CzRbHymiBqBlqCQxjqpDWvfWe/HsG4Rsd4YbdOIHBnWl7ezneaTIAFzd1A6gZdrIWFB0vHXOZwcI18KGiNZn1ToL8WISdEaYF+iX/NwHnTf61Z3THCtGDqkeXFyHR4UEfDK5Vdbep8UNx7/0jCFG0gb4RId6E1U6OT379QCaXF8o=',
),
1 =>
array (
'encryption' => false,
'signing' => true,
],
[
'encryption' => FALSE,
'signing' => TRUE,
'type' => 'X509Certificate',
'X509Certificate' => 'MIIC5jCCAc6gAwIBAgIQJ0Z/g10RYJhI50XIRoJ4FTANBgkqhkiG9w0BAQsFADAvMS0wKwYDVQQDEyRBREZTIFNpZ25pbmcgLSBhZGZzdGVzdC51d2F0ZXJsb28uY2EwHhcNMTgwODE3MTk1ODI3WhcNMjEwODE2MTk1ODI3WjAvMS0wKwYDVQQDEyRBREZTIFNpZ25pbmcgLSBhZGZzdGVzdC51d2F0ZXJsb28uY2EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC/1OpIRlqWp6cX0PkhpvKr/o0uuYPIm1NHuh2JO3ott1OgSvz+T7+S1lT5EAoD8ZUjCTstOppE0jTI/JRyvtETCqpjW8Lzv++KOLpqB/Qp7G83cjzb2j1bz117VEisdBXLnRF1G1TAD/gk1+HJ4R0U+59GEgFsL8cF+2ZwWVjexZsD+d+9luUsU8kgdvkGp/jcj0dmKsbwGspZkRz7mF2wcToD73bneCyw8PzQ/+02uN0qtX6m5lFpRLt9d/FOIOTpHEshkrlJLrGo3+0JWj5A5vzHgYvZ8xqNx1x/hWuFf2MJdSnl58v2yCaxDfT+S+JYBuvOngP/Sfwk5qdZnqv5AgMBAAEwDQYJKoZIhvcNAQELBQADggEBAKAVGOCbHr/FIjgjCkpEVpPsQT1+ChJl0AOjdsNGOfgciVvigDV7SZIHL199RAV8IQgpiHFpBkREWhKGFM0D8eqmovfXkj+gRele0TlDi0PrfbwmLZ/uwMol09FvmZseuKLppwPnbrX9f/wpiXImy/P4GfKBfLQY/BxjxRTyrYXM9oYVzK6I8XWWRFYl10d0MWIQeIKSuZZHVwjVX1KLiUVRczBAzCdUsRoeq5TtlCQCklVWx/G4gO07A62rVC15ik4X2PjMhR1IHLwsTjhklv58PCl+oammYgxGaMsRGjdZHYk55znPeNhk0Xs+UbyF2P0D1LM9i8GZmX0IegCpx90=',
),
),
);
],
],
];
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment