diff --git a/src/app/app.component.html b/src/app/app.component.html
index dd81ca9..d026c27 100644
--- a/src/app/app.component.html
+++ b/src/app/app.component.html
@@ -37,7 +37,7 @@
-
+
@@ -234,9 +236,11 @@
+
-
diff --git a/src/app/sample/sample.component.ts b/src/app/sample/sample.component.ts
index dadcfc1..18046cf 100644
--- a/src/app/sample/sample.component.ts
+++ b/src/app/sample/sample.component.ts
@@ -225,6 +225,7 @@ export class SampleComponent implements OnInit, AfterContentChecked {
}
this.loading--;
this.checkFormAfterInit = true;
+ console.log(this.baseSample.material.name);
});
});
});
@@ -355,7 +356,7 @@ export class SampleComponent implements OnInit, AfterContentChecked {
else {
this.samples.forEach((sample, i) => {
console.log(sample._id);
- this.api.put('/sample/' + sample._id, this.baseSample.sendFormat(), data => {
+ this.api.put('/sample/' + sample._id, this.baseSample.sendFormat(false), data => {
merge(this.samples[i], omit(data, ['condition']));
this.samples[i].material = this.d.arr.materials.find(e => e._id === this.samples[0].material_id);
this.view.base = false;
diff --git a/src/app/samples/samples.component.ts b/src/app/samples/samples.component.ts
index 33ce4fd..4cdf0f3 100644
--- a/src/app/samples/samples.component.ts
+++ b/src/app/samples/samples.component.ts
@@ -340,7 +340,7 @@ export class SamplesComponent implements OnInit {
updateFilterFields(field) {
const filter = this.filters.filters.find(e => e.field === field);
- filter.active = true;
+ filter.active = !(filter.values.length === 1 && filter.values[0] === '');
}
setSort(string) {
diff --git a/src/app/users/users.component.html b/src/app/users/users.component.html
index 2b7a457..16c5fb9 100644
--- a/src/app/users/users.component.html
+++ b/src/app/users/users.component.html
@@ -56,7 +56,6 @@
Device |
Models |
|
- |
@@ -71,8 +70,7 @@
{{(i > 0 ? ', ' : '') + modelIds[model]}}
- |
+ |
@@ -134,6 +132,37 @@
|
+
+ Deleted users
+
+
+
+ Name |
+ Email |
+ Level |
+ Location |
+ Device |
+ Models |
+ |
+
+
+
+ {{user.name}} |
+ {{user.email}} |
+ {{user.level}} |
+ {{user.location}} |
+ {{user.devices}} |
+
+
+ {{(i > 0 ? ', ' : '') + modelIds[model]}}
+
+ |
+ |
+
+
+
+
+
diff --git a/src/app/users/users.component.ts b/src/app/users/users.component.ts
index 27c587f..fad50dd 100644
--- a/src/app/users/users.component.ts
+++ b/src/app/users/users.component.ts
@@ -14,6 +14,7 @@ import {DataService} from '../services/data.service';
export class UsersComponent implements OnInit {
users: UserModel[] = [];
+ deletedUsers: UserModel[] = [];
newUser: UserModel | null = null;
newUserPass = '';
modelSelect: {id: string, name: string}[] = [];
@@ -28,7 +29,8 @@ export class UsersComponent implements OnInit {
ngOnInit(): void {
this.api.get('/users', data => {
- this.users = data.map(e => new UserModel().deserialize(e));
+ this.users = data.map(e => new UserModel().deserialize(e)).filter(e => e.status !== 'deleted');
+ this.deletedUsers = data.map(e => new UserModel().deserialize(e)).filter(e => e.status === 'deleted');
});
this.d.load('modelGroups', () => {
this.d.arr.modelGroups.forEach(group => {
@@ -63,6 +65,8 @@ export class UsersComponent implements OnInit {
this.api.delete('/user/' + user.name, () => {
user.status = 'deleted';
user.edit = false;
+ this.deletedUsers.push(user);
+ this.users.splice(this.users.findIndex(e => e.name === user.name), 1);
});
}
});
@@ -71,6 +75,8 @@ export class UsersComponent implements OnInit {
restoreUser(user) {
this.api.put('/user/restore/' + user.name, {}, () => {
user.status = 'new';
+ this.users.push(user);
+ this.deletedUsers.splice(this.deletedUsers.findIndex(e => e.name === user.name), 1);
});
}
}