Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update example YAML structure #37

Merged
merged 4 commits into from Aug 25, 2017
Merged

Update example YAML structure #37

merged 4 commits into from Aug 25, 2017

Conversation

@fofr
Copy link
Contributor

@fofr fofr commented Aug 23, 2017

I recommend commit-by-commit reviewing

  • Rename fixtures to examples
  • Nest data sent to examples in a data: block
  • Be more flexible in the YAML considered acceptable
  • Add a context block to example
    • Create a right to left context

https://trello.com/c/fgKpFA3n/152-rename-fixtures-to-examples-and-add-documentation
https://trello.com/c/bNIshDP7/104-2-improve-component-guide-to-show-a-component-can-be-used-in-context

Example of right to left fixture in government-frontend:
https://github.com/alphagov/government-frontend/compare/updated-gem-examples?expand=1&w=1#diff-e338db5dae1464505d72461e7cd9784f

screen shot 2017-08-23 at 18 17 19

fofr added 4 commits Aug 23, 2017
We found in user research with developers that “fixtures” wasn’t clear.
 Use plain english – examples is more obvious.

“What do fixtures mean”?
“What is a default fixture”?
Allow a separation between data being passed in and parameters that can
be used for features related to examples (eg an example within a
certain context, or a description field)
Not all components will have parameters.

Be flexible in what YAML is accepted.

eg:
example:
  data:

example:
  data: {}

example:
* Use the `direction-rtl` class and styling used by government-frontend
* Implies that the app will have set the text direction further up the
DOM tree
* Shows how a component would respond to the change
@fofr fofr force-pushed the rename-fixtures branch from 98a1671 to 8c64f5b Aug 25, 2017
@fofr fofr merged commit 0681fce into master Aug 25, 2017
1 check passed
1 check passed
continuous-integration/jenkins/branch This commit looks good
Details
@fofr fofr deleted the rename-fixtures branch Aug 25, 2017
fofr added a commit that referenced this pull request Aug 25, 2017
All documentation will need updating when upgrading (see PR #37):

* Rename fixtures to examples in YAML documentation
* Nest example data within a named block to give examples more features
@fofr fofr mentioned this pull request Aug 25, 2017
fofr added a commit to alphagov/government-frontend that referenced this pull request Aug 25, 2017
v1 of govuk_publishing_components changed “fixtures” to examples and
specified data in examples using a new block.

alphagov/govuk_publishing_components#37
fofr added a commit to alphagov/government-frontend that referenced this pull request Aug 29, 2017
v1 of govuk_publishing_components changed “fixtures” to examples and
specified data in examples using a new block.

alphagov/govuk_publishing_components#37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.