Skip to content

Instantly share code, notes, and snippets.

@balsama
balsama / behat.partial.yml
Last active February 12, 2018 17:39
Example partial configuration file to be used with Lightning's configure:behat command.
default:
suites:
default:
paths:
- '%paths.base%/features'
@balsama
balsama / lightning-user-stories-workflow.md
Created January 11, 2018 15:14
Lightning Workflow User Stories

Workflow

  1. When I build a site I want to be able to create any number or type of workflow states so that the workflow process conforms to the real needs of the organization not a rigid pre-defined scheme.
  2. When I create or edit content I want to flag it as needs review, needs translation etc. or save it as published, not published, etc. so that anyone involved knows what to do with it next.
  3. When I edit content I want to visually compare revisions so I can easily make decisions about which version to use - for example, while reverting to an earlier version.
  4. When I edit content I want to track revisions, and their meta-data, so if in the future I’m asked to produce records for compliance, I can easily do that.
  5. When I edit content I want to schedule a group of articles to be published on a future date so I won’t have to publish each one individually and I can preview them together.
@balsama
balsama / lightning_sub_profile.info.yml
Last active November 13, 2018 15:32
Sample Lightning sub-profile info file.
name: 'Lightning sub-profile'
type: profile
version: 8.x-dev
description: 'Sub-profile of Lightning'
core: '8.x'
themes:
- bartik
- seven
@balsama
balsama / composer-enable-asset-packagist.sh
Created September 20, 2017 13:29
Update your root composer.json file to support Asset Packagist
#!/usr/bin/env bash
# Place this script in your project root and invoke it with "bash scriptname"
# Alternatively, you can just switch into the directory that contains Lightning
# and run "composer run enable-asset-packagist".
cd ./docroot/profiles/contrib/lightning; # Your path to Lightning might differ.
composer run enable-asset-packagist;
@balsama
balsama / lightningInteractions.php
Last active June 15, 2017 20:00
Processor to format raw table data into format suitable for google sheets charts.
<?php
/**
* Formats data generated by Sumo into a Google Sheets charts-friendly format.
*
* Add to or change the data in the data array at the bottom (formatted as such
* so that you can just copy/paste data out of a table). The constructor will
* process and format all of the data for you. Then you can spit it out using
* the process() method.
*/

Lightning URL Patterns

Summary

  • \/admin\/panels_ipe\/variant\/panelizer_default\/\*node:\d:.*:.*
  • \/admin\/structure\/(panelizer\/edit|panels\/panelizer\.wizard).*
  • \/entity-browser\/(modal|iframe)\/(image_browser|media_browser).*
  • \/media\/add.*
  • \/admin\/structure\/workbench-moderation\/.*
  • \/admin\/content\/(scheduled-update|scheduled_update).*
@balsama
balsama / subprofile.feature
Last active May 4, 2017 15:53
Tests for Lightning Project SUBPROFILE env.
@api @subprofile
Feature: Subprofiles
Scenario: Sub-profile name should be listed and installed profile
Given I am logged in as a user with the administrator role
When I visit "/admin/reports/status"
Then I should see "Lightning Extender"
Scenario: Base profile extensions that are excluded by the sub-profile should not be enabled
Given I am logged in as a user with the administrator role
@balsama
balsama / views.view.content.yml
Created April 18, 2017 14:22
Improved /admin/content View for Lightning that shows the published/unpublished state in the moderation field if moderation is not enabled for that content type.
uuid: 6c756d3f-2456-44aa-8c01-f39fdb550213
langcode: en
status: true
dependencies:
module:
- lightning_workflow
- node
- user
_core:
default_config_hash: tS8PbpJX90aRFC3-UTgXzdqkq7_2frk2pz4TMijEebM
@balsama
balsama / lightning.extend.yml
Created February 24, 2017 16:19
Defines additional tasks for Lightning to perform during and after site installation.
# Defines additional tasks for Lightning to perform during and after site
# installation. Place this file in your Site Path (e.g. /sites/default or
# /sites/SITENAME) or /sites/all directory for it to take effect.
# List of lightning Extensions enabled when Lightning is installed. The presence
# of this key will disable the Lightning Select Extensions form. If you want to
# allow users to choose which Lightning Extensions should be enabled during
# installation, comment out the following lines.
lightning_extensions:
- lightning_workflow
@javascript
Scenario: Change the layout of an existing Panelizer Wizard.
Given I am logged in as a user with the "administrator" role
When I go to "/admin/structure/panelizer/edit/node__landing_page__full__default/layout"
And I select "Two column" from "Layout"
And I press "Change Layout"
Then I should be on "/admin/structure/panelizer/edit/node__landing_page__full__default/regions"
And I should see "Old Layout"
And I should see "New Layout"
And I press "Cancel"