mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-05 07:04:44 +00:00
DSS-6551 Adds table components for organizations and group ids: There is definitely potential to refactor this to one wrapper component that is instantiated 3 times with different props, this is however already a container component for dataset-table.
This commit is contained in:
parent
e3ccb71fb2
commit
03270406bb
@ -0,0 +1,13 @@
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
actions: {
|
||||
onFormatChange() {
|
||||
this.sendAction('onFormatChange', ...arguments);
|
||||
},
|
||||
|
||||
onPrivacyChange() {
|
||||
this.sendAction('onPrivacyChange', 'group', ...arguments);
|
||||
}
|
||||
}
|
||||
});
|
||||
13
wherehows-web/app/components/dataset-table-org-compliance.js
Normal file
13
wherehows-web/app/components/dataset-table-org-compliance.js
Normal file
@ -0,0 +1,13 @@
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
actions: {
|
||||
onFormatChange() {
|
||||
this.sendAction('onFormatChange', ...arguments);
|
||||
},
|
||||
|
||||
onPrivacyChange() {
|
||||
this.sendAction('onPrivacyChange', 'organisation', ...arguments);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -0,0 +1,52 @@
|
||||
{{#dataset-table fields=fields
|
||||
sortColumnWithName=sortColumnWithName
|
||||
filterBy=filterBy
|
||||
sortDirection=sortDirection
|
||||
searchTerm=searchTerm as |table|}}
|
||||
<caption>
|
||||
<input
|
||||
type="text"
|
||||
title="Filter fields"
|
||||
placeholder="Filter fields"
|
||||
value="{{table.searchTerm}}"
|
||||
oninput={{action table.filterDidChange value="target.value"}}>
|
||||
</caption>
|
||||
{{#table.head as |head|}}
|
||||
{{#head.column columnName="identifierField"}}Field{{/head.column}}
|
||||
{{#head.column columnName="dataType"}}Data Type{{/head.column}}
|
||||
{{#head.column}}Group Identifier?{{/head.column}}
|
||||
{{#head.column}}Field Format{{/head.column}}
|
||||
{{/table.head}}
|
||||
{{#table.body as |body|}}
|
||||
{{#each
|
||||
(slice table.beginOffset table.endOffset (sort-by table.sortBy table.data)) as |field|}}
|
||||
{{#body.row as |row|}}
|
||||
{{#row.cell}}
|
||||
{{field.identifierField}}
|
||||
{{/row.cell}}
|
||||
{{#row.cell}}
|
||||
{{field.dataType}}
|
||||
{{/row.cell}}
|
||||
{{#row.cell}}
|
||||
{{input type="checkbox" checked=field.hasPrivacyData change=(action "onPrivacyChange" field)}}
|
||||
{{/row.cell}}
|
||||
{{#row.cell}}
|
||||
{{ember-selector values=fieldFormats
|
||||
disabled=(not field.hasPrivacyData)
|
||||
selected=field.logicalType
|
||||
selectionDidChange=(action "onFormatChange" field)}}
|
||||
{{/row.cell}}
|
||||
{{/body.row}}
|
||||
{{/each}}
|
||||
{{/table.body}}
|
||||
{{#table.foot}}
|
||||
{{dataset-table-pager data=table.data
|
||||
page=table.page
|
||||
limit=table.limit
|
||||
pageLengths=table.pageLengths
|
||||
beginOffset=table.beginOffset
|
||||
endOffset=table.endOffset
|
||||
onLimitChanged=table.onLimitChanged
|
||||
onPageChanged=table.onPageChanged}}
|
||||
{{/table.foot}}
|
||||
{{/dataset-table}}
|
||||
@ -0,0 +1,52 @@
|
||||
{{#dataset-table fields=fields
|
||||
sortColumnWithName=sortColumnWithName
|
||||
filterBy=filterBy
|
||||
sortDirection=sortDirection
|
||||
searchTerm=searchTerm as |table|}}
|
||||
<caption>
|
||||
<input
|
||||
type="text"
|
||||
title="Filter fields"
|
||||
placeholder="Filter fields"
|
||||
value="{{table.searchTerm}}"
|
||||
oninput={{action table.filterDidChange value="target.value"}}>
|
||||
</caption>
|
||||
{{#table.head as |head|}}
|
||||
{{#head.column columnName="identifierField"}}Field{{/head.column}}
|
||||
{{#head.column columnName="dataType"}}Data Type{{/head.column}}
|
||||
{{#head.column}}Organization Identifier?{{/head.column}}
|
||||
{{#head.column}}Field Format{{/head.column}}
|
||||
{{/table.head}}
|
||||
{{#table.body as |body|}}
|
||||
{{#each
|
||||
(slice table.beginOffset table.endOffset (sort-by table.sortBy table.data)) as |field|}}
|
||||
{{#body.row as |row|}}
|
||||
{{#row.cell}}
|
||||
{{field.identifierField}}
|
||||
{{/row.cell}}
|
||||
{{#row.cell}}
|
||||
{{field.dataType}}
|
||||
{{/row.cell}}
|
||||
{{#row.cell}}
|
||||
{{input type="checkbox" checked=field.hasPrivacyData change=(action "onPrivacyChange" field)}}
|
||||
{{/row.cell}}
|
||||
{{#row.cell}}
|
||||
{{ember-selector values=fieldFormats
|
||||
disabled=(not field.hasPrivacyData)
|
||||
selected=field.logicalType
|
||||
selectionDidChange=(action "onFormatChange" field)}}
|
||||
{{/row.cell}}
|
||||
{{/body.row}}
|
||||
{{/each}}
|
||||
{{/table.body}}
|
||||
{{#table.foot}}
|
||||
{{dataset-table-pager data=table.data
|
||||
page=table.page
|
||||
limit=table.limit
|
||||
pageLengths=table.pageLengths
|
||||
beginOffset=table.beginOffset
|
||||
endOffset=table.endOffset
|
||||
onLimitChanged=table.onLimitChanged
|
||||
onPageChanged=table.onPageChanged}}
|
||||
{{/table.foot}}
|
||||
{{/dataset-table}}
|
||||
@ -0,0 +1,25 @@
|
||||
import { moduleForComponent, test } from 'ember-qunit';
|
||||
import hbs from 'htmlbars-inline-precompile';
|
||||
|
||||
moduleForComponent('dataset-table-group-compliance', 'Integration | Component | dataset table group compliance', {
|
||||
integration: true
|
||||
});
|
||||
|
||||
test('it renders', function(assert) {
|
||||
|
||||
// Set any properties with this.set('myProperty', 'value');
|
||||
// Handle any actions with this.on('myAction', function(val) { ... });
|
||||
|
||||
this.render(hbs`{{dataset-table-group-compliance}}`);
|
||||
|
||||
assert.equal(this.$().text().trim(), '');
|
||||
|
||||
// Template block usage:
|
||||
this.render(hbs`
|
||||
{{#dataset-table-group-compliance}}
|
||||
template block text
|
||||
{{/dataset-table-group-compliance}}
|
||||
`);
|
||||
|
||||
assert.equal(this.$().text().trim(), 'template block text');
|
||||
});
|
||||
@ -0,0 +1,25 @@
|
||||
import { moduleForComponent, test } from 'ember-qunit';
|
||||
import hbs from 'htmlbars-inline-precompile';
|
||||
|
||||
moduleForComponent('dataset-table-org-compliance', 'Integration | Component | dataset table org compliance', {
|
||||
integration: true
|
||||
});
|
||||
|
||||
test('it renders', function(assert) {
|
||||
|
||||
// Set any properties with this.set('myProperty', 'value');
|
||||
// Handle any actions with this.on('myAction', function(val) { ... });
|
||||
|
||||
this.render(hbs`{{dataset-table-org-compliance}}`);
|
||||
|
||||
assert.equal(this.$().text().trim(), '');
|
||||
|
||||
// Template block usage:
|
||||
this.render(hbs`
|
||||
{{#dataset-table-org-compliance}}
|
||||
template block text
|
||||
{{/dataset-table-org-compliance}}
|
||||
`);
|
||||
|
||||
assert.equal(this.$().text().trim(), 'template block text');
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user