Skip to content

Add column formatters for the datatable component#530

Merged
stefanoborini merged 17 commits into
masterfrom
shorten_datatable_entries
Jul 6, 2017
Merged

Add column formatters for the datatable component#530
stefanoborini merged 17 commits into
masterfrom
shorten_datatable_entries

Conversation

@martinRenou

@martinRenou martinRenou commented Jun 26, 2017

Copy link
Copy Markdown
Member

Add columFormatters prop to the datatable component. This prop is an array of functions (formatters) which takes the value of the table as input and returns a string representing some html or plain text. This html output will be used to represent the data in the datatable.

Those formatters are used to shorten ids in the containersView and to represent boolean values in the accountingView.

Closes #476

If string entries are longer than 24 characters they'll be shorten and end with "...". Furthermore, I removed the "simphonyproject/" suffix of the application names.
@martinRenou martinRenou changed the title Shorten entries in the datatable Shorten entries in the datatable [WIP] Jun 26, 2017
@martinRenou

Copy link
Copy Markdown
Member Author

Maybe we should add a tooltip to display the complete identifier/name when the mouse is over it ?

@codecov-io

codecov-io commented Jun 27, 2017

Copy link
Copy Markdown

Codecov Report

Merging #530 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #530   +/-   ##
=======================================
  Coverage   95.18%   95.18%           
=======================================
  Files          85       85           
  Lines        3905     3905           
  Branches      247      247           
=======================================
  Hits         3717     3717           
  Misses        137      137           
  Partials       51       51

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 7f76616...b6db7d2. Read the comment docs.

@stefanoborini

Copy link
Copy Markdown
Contributor

simphonyproject should stay

@martinRenou martinRenou changed the title Shorten entries in the datatable [WIP] Shorten entries in the datatable Jul 3, 2017
@martinRenou martinRenou requested a review from stefanoborini July 4, 2017 13:54
@martinRenou martinRenou changed the title Shorten entries in the datatable Add column formatters for the datatables Jul 4, 2017
@martinRenou martinRenou changed the title Add column formatters for the datatables Add column formatters for the datatable component Jul 4, 2017
@martinRenou martinRenou changed the title Add column formatters for the datatable component Add column formatters for the datatable component [WIP] Jul 5, 2017
@martinRenou

Copy link
Copy Markdown
Member Author

Need some tests

@martinRenou martinRenou changed the title Add column formatters for the datatable component [WIP] Add column formatters for the datatable component Jul 5, 2017
Comment thread frontend/toolkit/DataTable.vue Outdated
<template v-for="(value, col_index) in row">
<td v-if="isBoolean(value)"><i class="fa fa-check" v-if="value"></i></td>
<td v-else>{{value}}</td>
<td v-html="columnFormatters[col_index] !== undefined ? columnFormatters[col_index](value) : value"></td>

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

check if it's a function.

Comment thread frontend/toolkit/DataTable.vue Outdated
"headers", "rows", "globalActions", "rowActions"
],
props: {
headers: { type: Array, default: () => {return [];} },

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

must be mandatory

Comment thread frontend/toolkit/DataTable.vue Outdated
props: {
headers: { type: Array, default: () => {return [];} },
columnFormatters: { type: Array, default: () => {return [];} },
rows: { type: Array, default: () => {return [];} },

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

i would be tempted to say it must also be mandatory, at least as model object from outside.

@stefanoborini stefanoborini merged commit bacc009 into master Jul 6, 2017
@stefanoborini stefanoborini deleted the shorten_datatable_entries branch July 6, 2017 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants