From 3526dcb049ca96078a4e5c3aaa225090ef59701f Mon Sep 17 00:00:00 2001 From: "Hartenstein Ruben (PEA4-Fe)" Date: Thu, 3 Dec 2020 11:41:24 +0100 Subject: [PATCH 1/2] Move Sample edit-button to the left hand side --- src/app/samples/samples.component.html | 28 +++++++++++++------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/app/samples/samples.component.html b/src/app/samples/samples.component.html index 6ef8aa6..61088e3 100644 --- a/src/app/samples/samples.component.html +++ b/src/app/samples/samples.component.html @@ -161,6 +161,10 @@ + + + + all @@ -177,14 +181,19 @@ - - - - - + + + + + + + @@ -208,15 +217,6 @@ {{sample[key[1]] | exists: key[2]}} {{sample.status}} {{sample.added | date:'dd/MM/yy'}} - - - - - - From 7e82b43e069085e5975dd618ec2ebd0e4e43eb82 Mon Sep 17 00:00:00 2001 From: "Ruben Hartenstein (PEA4-Fe)" Date: Thu, 3 Dec 2020 14:39:24 +0100 Subject: [PATCH 2/2] Store current sample page --- src/app/samples/samples.component.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/app/samples/samples.component.ts b/src/app/samples/samples.component.ts index 0fff0ed..6f38f19 100644 --- a/src/app/samples/samples.component.ts +++ b/src/app/samples/samples.component.ts @@ -126,6 +126,10 @@ export class SamplesComponent implements OnInit { this.loadTemplateKeys('material', 'type', onLoad); this.loadTemplateKeys('condition', 'notes.comment', onLoad); this.loadTemplateKeys('measurement', 'status', onLoad); + + if("currentPage" in localStorage){ + this.page = Number(localStorage.getItem("currentPage")); + } } loadTemplateKeys(collection, insertBefore, f) { @@ -303,6 +307,7 @@ export class SamplesComponent implements OnInit { return; } this.page += delta; + localStorage.setItem("currentPage", this.page.toString()); this.loadSamples({toPage: delta}); } @@ -498,6 +503,4 @@ export class SamplesComponent implements OnInit { ucFirst(string) { // convert first character of string to uppercase return string[0].toUpperCase() + string.slice(1); } - - }