Skip to content
Merged
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
2 changes: 1 addition & 1 deletion addon/components/hyper-table-v2/column.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export default class HyperTableV2Column extends Component<HyperTableV2ColumnArgs

const availableHeight = tableBottom - colHeaderTop - 100;

dropdown.style.height = `${availableHeight}px`;
dropdown.style.maxHeight = `${availableHeight}px`;
Copy link
Member

Choose a reason for hiding this comment

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

❤️

dropdown.style.overflowY = 'auto';

if (!this.resizeHandler) {
Expand Down
3 changes: 1 addition & 2 deletions addon/components/hyper-table-v2/manage-columns.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { A } from '@ember/array';
import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
import { set } from '@ember/object';
import { action } from '@ember/object';
import { set, action } from '@ember/object';
import { isEmpty } from '@ember/utils';
import TableHandler from '@upfluence/hypertable/core/handler';
import { ColumnDefinition } from '@upfluence/hypertable/core/interfaces';
Expand Down
3 changes: 2 additions & 1 deletion addon/core/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ export default class TableHandler {
return this._renderingResolver;
}

return (this._renderingResolver = new BaseRenderingResolver(this._context));
this._renderingResolver = new BaseRenderingResolver(this._context)
return this._renderingResolver;
}

async fetchColumns(): Promise<void> {
Expand Down
6 changes: 3 additions & 3 deletions addon/helpers/custom-format-number.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { helper } from '@ember/component/helper';

var formats = [
const formats = [
{
value: 1e3,
sym: 'k'
Expand All @@ -16,13 +16,13 @@ var formats = [
];

export function customFormatNumber(params) {
var number = params[0];
const number = params[0];

if (number === null || number === undefined || isNaN(number)) {
return '-';
}

var format = formats
const format = formats
.filter((format) => {
return format.value < number;
})
Expand Down
21 changes: 11 additions & 10 deletions app/styles/columns.less
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
position: sticky;
right: 0;
z-index: 20;

header {
cursor: pointer;
}
}

// Animate Columns Drag & Drop
Expand Down Expand Up @@ -81,7 +85,7 @@

transition: all 0.25s ease-in-out;

& > .cell-header {
&>.cell-header {
color: var(--color-gray-600);
font-size: 16 / @rem;
font-weight: var(--font-weight-semibold);
Expand Down Expand Up @@ -153,12 +157,6 @@
}
}

.hypertable__column--sticky-right {
header {
cursor: pointer;
}
}

.hypertable__column--selection {
width: 40px;
min-width: 40px;
Expand Down Expand Up @@ -235,6 +233,7 @@
}

.hypertable__column--text .hypertable__cell {

.editing-input,
.text-value {
display: -webkit-box;
Expand All @@ -245,7 +244,7 @@
}

.hypertable__column--list .hypertable__cell {
& > div:first-child {
&>div:first-child {
width: 100%;
}

Expand All @@ -259,7 +258,7 @@
display: flex;
align-items: center;

& > div:nth-child(2) {
&>div:nth-child(2) {
margin-left: var(--spacing-px-12);

span {
Expand Down Expand Up @@ -329,15 +328,17 @@
10% {
opacity: 1;
}

99% {
opacity: 1;
max-height: 500px;
overflow: hidden;
}

100% {
opacity: 1;
max-height: 500px;
overflow: auto;
}
}
}
}
16 changes: 8 additions & 8 deletions app/styles/header.less
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,18 @@
.left-side {
display: flex;
flex-grow: 1;
}

/*
* Search
* ======
*
*/
.left-side {
input {
max-width: 250px;
min-width: 100px;
}
}

/*
* Search
* ======
*
*/
.left-side .selected-count {
background-color: var(--color-gray-400);
border-radius: var(--border-radius-sm);
Expand Down Expand Up @@ -185,6 +183,7 @@
from {
transform: scale(0);
}

to {
transform: scale(1);
}
Expand All @@ -194,6 +193,7 @@
0% {
transform: scale(1);
}

100% {
transform: scale(0);
}
Expand Down Expand Up @@ -284,4 +284,4 @@
}
}
}
}
}
4 changes: 2 additions & 2 deletions sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sonar.organization=upfluence
sonar.sources=addon/,app/
sonar.javascript.lcov.reportPaths=./coverage/lcov.info
sonar.typescript.tsconfigPaths=./tsconfig.json
sonar.coverage.exclusions=app/
sonar.cpd.exclusions=tests/,**/tests/**,*-test.js,*-test.ts,test-support/
sonar.coverage.exclusions=app/**,addon/components/hyper-table/**,addon/mixins/**,addon/types/**,addon/utils/**
sonar.cpd.exclusions=app/**,tests/**,**/tests/**,*-test.js,*-test.ts,test-support/
sonar.tests=tests/
sonar.html.file.suffixes=.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@ module('Integration | Component | hyper-table/cell-renderers/image', function (h
setupRenderingTest(hooks);

test('it renders', async function (assert) {
this.item = { imageURL: 'foo.png', name: 'FooBar' };
this.item = { imageURL: '/@upfluence/hypertable/assets/images/empty-state.png', name: 'FooBar' };
this.column = { key: 'imageURL', labels: ['name'] };

await render(hbs`<HyperTable::CellRenderers::Image @item={{this.item}} @column={{this.column}} />`);

assert.dom('.upf-avatar.upf-avatar--sm img').hasAttribute('src', 'foo.png');
assert
.dom('.upf-avatar.upf-avatar--sm img')
.hasAttribute('src', '/@upfluence/hypertable/assets/images/empty-state.png');
});

module('it has labels to show', function () {
test('it should display the labels next to the image', async function (assert) {
this.item = { imageURL: 'foo.png', name: 'FooBar' };
this.item = { imageURL: '/@upfluence/hypertable/assets/images/empty-state.png', name: 'FooBar' };
this.column = { key: 'imageURL', labels: ['name'] };

await render(hbs`<HyperTable::CellRenderers::Image @item={{this.item}} @column={{this.column}} />`);
Expand All @@ -30,7 +32,11 @@ module('Integration | Component | hyper-table/cell-renderers/image', function (h

module('there is a notification on the item', function () {
test('it should display the notification dot next to the labels', async function (assert) {
this.item = { imageURL: 'foo.png', name: 'FooBar', hasNotifications: true };
this.item = {
imageURL: '/@upfluence/hypertable/assets/images/empty-state.png',
name: 'FooBar',
hasNotifications: true
};
this.column = { key: 'imageURL', labels: ['name'] };

await render(hbs`<HyperTable::CellRenderers::Image @item={{this.item}} @column={{this.column}} />`);
Expand Down