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

fix csp violations #122

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions addon/components/ember-collection-cell/component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import Ember from 'ember';
import layout from './template';
import CspStyleMixin from 'ember-cli-csp-style/mixins/csp-style';

export default Ember.Component.extend(CspStyleMixin, {
layout,
cell: null,
classNames: ['cell'],
styleBindings: ['style']
});
1 change: 1 addition & 0 deletions addon/components/ember-collection-cell/template.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{yield}}
4 changes: 3 additions & 1 deletion addon/components/ember-collection/template.hbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{{#ember-native-scrollable content-size=_contentSize scroll-left=_scrollLeft scroll-top=_scrollTop scrollChange=(action "scrollChange") clientSizeChange=(action "clientSizeChange")}}
<div>
{{~#each _cells as |cell|~}}
<div style={{{cell.style}}}>{{yield cell.item cell.index }}</div>
{{#ember-collection-cell style=cell.style}}
{{yield cell.item cell.index }}
{{/ember-collection-cell}}
{{~/each~}}
</div>
{{/ember-native-scrollable}}
1 change: 1 addition & 0 deletions app/components/ember-collection-cell.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from 'ember-collection/components/ember-collection-cell/component';
1 change: 1 addition & 0 deletions app/components/ember-collection-cell/component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from 'ember-collection/components/ember-collection-cell/component';
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"broccoli-asset-rev": "^2.2.0",
"ember-cli": "2.3.0",
"ember-cli-app-version": "^1.0.0",
"ember-cli-csp-style": "^2.0.3",
"ember-cli-dependency-checker": "^1.2.0",
"ember-cli-deploy": "0.5.1",
"ember-cli-deploy-build": "0.1.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';

moduleForComponent('ember-collection-cell', 'Integration | Component | ember collection cell', {
integration: true
});

test('it renders with style', function(assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.on('myAction', function(val) { ... });

this.render(hbs`{{ember-collection-cell}}`);

assert.equal(this.$().text().trim(), '');

// Template block usage:
this.render(hbs`
{{#ember-collection-cell style="width:150px;"}}
template block text
{{/ember-collection-cell}}
`);

assert.equal(this.$().text().trim(), 'template block text');
assert.equal(this.$('.cell').css("width").trim(), '150px');
});