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

feat(components): add data-table #167

Merged
merged 1 commit into from
Jun 16, 2018
Merged

feat(components): add data-table #167

merged 1 commit into from
Jun 16, 2018

Conversation

devCrossNet
Copy link
Member

closes #141

What is accomplished by your PR?

This PR adds a new DataTable component which includes following features:

  • define column schema (not-displaying certain columns, rename titles, rearrange appearance)
  • display JSON as table
  • sorting of rows, one column at a time
  • filtering
  • pagination
  • server-side-rendering

screen shot 2018-06-10 at 12 20 11

Is there something controversial in your PR?

nope

Link to the Issue

#141

Checklist

New Feature / Bug Fix

  • Run unit tests to ensure all existing tests are still passing
  • Add new passing unit tests to cover the code introduced by your PR

@codecov
Copy link

codecov bot commented Jun 10, 2018

Codecov Report

Merging #167 into next will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@         Coverage Diff         @@
##           next   #167   +/-   ##
===================================
  Coverage   100%   100%           
===================================
  Files        61     66    +5     
  Lines      1109   1192   +83     
  Branches    150    161   +11     
===================================
+ Hits       1109   1192   +83
Impacted Files Coverage Δ
...hared/components/VueDataTable/DataTableFixtures.ts 100% <100%> (ø)
src/app/components/Components/Components.vue 100% <100%> (ø) ⬆️
...ataTable/VueDataTableHeader/VueDataTableHeader.vue 100% <100%> (ø)
...s/VueDataTable/VueDataTableRow/VueDataTableRow.vue 100% <100%> (ø)
...ataTable/VueDataTableSearch/VueDataTableSearch.vue 100% <100%> (ø)
...pp/shared/components/VueDataTable/VueDataTable.vue 100% <100%> (ø)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bb12ac0...a03b854. Read the comment docs.

sortKey: null,
sortDirection: 'asc',
currentPage: 0,
maxPages: 1,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

computed prop, to remove the watcher and cache the result

}

const searchRegex: RegExp = new RegExp(`${this.searchTerm}`, 'gmi');
const filter = (columns: any[]) => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

object, not array

return `${100 / this.columns.length}%`;
},
rows() {
return this.displayData.map((row: any[]) => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

object, not array

data: dataTableDataFixture,
};
},
template: `<vueDataTable :header="header" :data="data" placeholder="Search" @click="action" />`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vue-data-table

data: dataTableDataFixture,
};
},
template: `<vueDataTable :header="header" :data="data" :show-search="false" :page="1" :max-rows="10" @click="action" />`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vue-data-table

@devCrossNet devCrossNet merged commit 05267b4 into next Jun 16, 2018
@devCrossNet devCrossNet deleted the feat/data-table branch June 16, 2018 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants