Skip to content

Commit

Permalink
Merge branch 'master' into greenkeeper-punchcard-content-types-6.1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
scottnath committed Dec 12, 2016
2 parents b3d6abc + d376959 commit c369ff7
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 8,278 deletions.
18 changes: 1 addition & 17 deletions .travis.yml
Expand Up @@ -11,28 +11,12 @@ sudo: true
cache:
directories:
- node_modules
- $HOME/.yarn-cache
services:
- postgresql

#########################
## Install Yarn
##
## From https://yarnpkg.com/en/docs/install-ci#travis-tab
#########################
before_install:
# Repo for Yarn
- sudo apt-key adv --fetch-keys http://dl.yarnpkg.com/debian/pubkey.gpg
- echo "deb http://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
- sudo apt-get update -qq
- sudo apt-get install -y -qq yarn

install: yarn

before_script:
- psql -c 'create database travis_ci_test;' -U postgres

script: yarn test
- npm prune

after_success:
- npm run coverage
Expand Down
1 change: 1 addition & 0 deletions lib/routes/content.js
Expand Up @@ -220,6 +220,7 @@ const routes = application => {
type: ct,
step,
config: config.content,
storage: config.storage,
});
});
}).catch(e => {
Expand Down
4 changes: 4 additions & 0 deletions lib/routes/data/styles.js
Expand Up @@ -63,4 +63,8 @@ module.exports = {
],
],
},
alertData: {
for: '00eef724-7cbd-47f5-a735-630510f39711',
value: 'Oops! The email or password you entered is incorrect. Please try again.',
},
};
5 changes: 3 additions & 2 deletions lib/storage/put.js
Expand Up @@ -107,7 +107,7 @@ const fileDJ = file => {
f.field = file.fieldName;
f.type = file.type;
f.path = `/${f.uuid}${path.extname(file.originalFilename)}`;
f.rel = `${f.uuid}${path.extname(file.originalFilename)}`;
f.rel = `/${f.uuid}${path.extname(file.originalFilename)}`;
f.original = file.originalFilename;

res(f);
Expand All @@ -124,9 +124,10 @@ const fileDJ = file => {
*/
const value = file => {
const storable = {};

storable.type = _.get(file, 'type', '');
storable.original = _.get(file, 'original', '');
storable.relative = _.get(file, 'path', '');
storable.relative = _.get(file, 'rel', '');

return storable;
};
Expand Down
3 changes: 2 additions & 1 deletion tests/storage.js
Expand Up @@ -2,6 +2,7 @@ import test from 'ava';
import del from 'del';
import _ from 'lodash';
import fs from 'fs';
import path from 'path';
import storage from '../lib/storage';
import fixtures from './fixtures/files';

Expand All @@ -26,7 +27,7 @@ test('Storage - Default', t => {
t.true(result.hasOwnProperty('relative'), 'Has a relative path');
t.is(result.type, expected.type, 'Have the same type');

const output = fs.readFileSync(result.relative);
const output = fs.readFileSync(path.join(__dirname, 'public/files', result.relative));
const original = fs.readFileSync(expected.path);

t.is(output.toString(), original.toString(), 'Output and original are the same file');
Expand Down
4 changes: 2 additions & 2 deletions views/components/alert.html
@@ -1,3 +1,3 @@
{% macro alert(for, type, value) %}
<p class="alert--{{type | upper}}" role="alert" for="{{for}}">{{value}}</p>
{% macro alert(data) %}
<p class="form--alert" role="alert" for="{{data.for}}">{{data.value}}</p>
{% endmacro %}
6 changes: 6 additions & 0 deletions views/styles.html
Expand Up @@ -328,6 +328,12 @@ <h1 class="base--h2">Form elements</h1>
</form>
</section>

<section class="_style-guide--group">
<h2 class="_style-guide--title">Alerts</h2>
{% from "components/alert.html" import alert %}
{{alert(alertData)}}
</section>

<section class="_style-guide--group">
<h2 class="_style-guide--title">Tabular Data</h2>
{% from "components/table.html" import table %}
Expand Down

0 comments on commit c369ff7

Please sign in to comment.