From 622871fcdee59cdb6d8294d1107a73c0add41b68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20P=C3=A9ter=20Sipos?= Date: Fri, 16 Oct 2020 14:53:58 +0200 Subject: [PATCH 1/3] #895 fix grid layout --- src/app/shared/object-grid/object-grid.component.html | 8 ++++---- src/app/shared/object-grid/object-grid.component.scss | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/app/shared/object-grid/object-grid.component.html b/src/app/shared/object-grid/object-grid.component.html index 0afd623d86..b3ad9cc27c 100644 --- a/src/app/shared/object-grid/object-grid.component.html +++ b/src/app/shared/object-grid/object-grid.component.html @@ -11,10 +11,10 @@ (sortDirectionChange)="onSortDirectionChange($event)" (sortFieldChange)="onSortFieldChange($event)" (paginationChange)="onPaginationChange($event)"> -
-
-
- +
+
+
+
diff --git a/src/app/shared/object-grid/object-grid.component.scss b/src/app/shared/object-grid/object-grid.component.scss index fb883a1f07..53d64bc60c 100644 --- a/src/app/shared/object-grid/object-grid.component.scss +++ b/src/app/shared/object-grid/object-grid.component.scss @@ -19,6 +19,7 @@ $ds-wrapper-grid-spacing: $spacer/2; .card-columns { margin-left: -$ds-wrapper-grid-spacing; margin-right: -$ds-wrapper-grid-spacing; + column-gap: 0; .card-column { padding-left: $ds-wrapper-grid-spacing; From 3d1ffa6738b8def998cf73b5d123a481f116e272 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20P=C3=A9ter=20Sipos?= Date: Fri, 16 Oct 2020 17:05:46 +0200 Subject: [PATCH 2/3] #895 fix colums sorting --- src/app/shared/object-grid/object-grid.component.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/app/shared/object-grid/object-grid.component.ts b/src/app/shared/object-grid/object-grid.component.ts index c6f8347217..c4aaebed72 100644 --- a/src/app/shared/object-grid/object-grid.component.ts +++ b/src/app/shared/object-grid/object-grid.component.ts @@ -172,13 +172,18 @@ export class ObjectGridComponent implements OnInit { const result = []; + let index = 0; page.forEach((obj: ListableObject, i: number) => { - const colNb = i % nbColumns; - let col = result[colNb]; + + if (i % nbColumns === 0 && i > 0) { + index++; + } + + let col = result[index]; if (hasNoValue(col)) { col = []; } - result[colNb] = [...col, obj]; + result[index] = [...col, obj]; }); return result; } else { From 9a324ba45621dd594a2d3a9e200d65ff2e753c98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20P=C3=A9ter=20Sipos?= Date: Fri, 16 Oct 2020 17:12:25 +0200 Subject: [PATCH 3/3] #895 revert changes fix layout --- src/app/shared/object-grid/object-grid.component.html | 8 ++++---- src/app/shared/object-grid/object-grid.component.ts | 11 +++-------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/app/shared/object-grid/object-grid.component.html b/src/app/shared/object-grid/object-grid.component.html index b3ad9cc27c..0afd623d86 100644 --- a/src/app/shared/object-grid/object-grid.component.html +++ b/src/app/shared/object-grid/object-grid.component.html @@ -11,10 +11,10 @@ (sortDirectionChange)="onSortDirectionChange($event)" (sortFieldChange)="onSortFieldChange($event)" (paginationChange)="onPaginationChange($event)"> -
-
-
- +
+
+
+
diff --git a/src/app/shared/object-grid/object-grid.component.ts b/src/app/shared/object-grid/object-grid.component.ts index c4aaebed72..c6f8347217 100644 --- a/src/app/shared/object-grid/object-grid.component.ts +++ b/src/app/shared/object-grid/object-grid.component.ts @@ -172,18 +172,13 @@ export class ObjectGridComponent implements OnInit { const result = []; - let index = 0; page.forEach((obj: ListableObject, i: number) => { - - if (i % nbColumns === 0 && i > 0) { - index++; - } - - let col = result[index]; + const colNb = i % nbColumns; + let col = result[colNb]; if (hasNoValue(col)) { col = []; } - result[index] = [...col, obj]; + result[colNb] = [...col, obj]; }); return result; } else {